op.sh : Opticks Launching Script

The op.sh script launches different Opticks executables or scripts depending on the arguments provided. It also sets environment variables picking a detector geometry and selecting volumes within the geometry.

Most usage of Opticks should use this script.

To see the options specific to particular scripts or executables use “-h” rather than the “–help” that provides this text.

Testing new geometry

opticksdata-export-ini   ## .ini file is needed, not the environment
opticksdata-dump         ## this dumps the environment

VERBOSE=1 op --resource --j1808 --dumpenv

Profile Setup

To save typing add the below bash function to your .bash_profile:

op(){ op.sh $* ; }

Commandline Help

Lists of geometry config arguments and executable selection are provided by the help

op --help

Auto-communication of geocache location to scripts with IDPATH envvar

The IDPATH is an envvar that points to the geocache directory. The envvar is internally set by op.sh using the OpticksIDPATH executable together with the geometry selecting argument parsing done by op.sh. This happens prior to running the primary executable or script. This “internal” envvar is actually only needed for python analysis scripts.

Sometimes it is convenient to run analysis scripts directly, ie not via the op.sh machinery. In this case it is necessary to manually set the IDPATH in your environment corresponding to the intended geometry.

Geometry Selection

Geometry selection is currently split between the op.sh bash script and C++ (okc-/OpticksResource), with several internal envvars used to effect the communication. See op-geometry-setup-notes for details.

This split approach is convenient for development however it does force Opticks scripts and executables to be used via op.sh. Bare use of the executables is only appropriate with the default geometry. A potential future development is to move the geo setup entirely into C++.