FileInPath
|
||
Working groups |
Blessed plots and figures |
Approving new results and publications |
Approval web pages - new results |
Approval web pages - new publications |
Mu2e Acronyn Dictionary |
Fermilab Meeting Rooms |
Fermilab Service Desk |
ReadyTalk : Home |
ReadyTalk : Help |
ReadyTalk : Toll Free Numbers |
Input and output files of event-data are not included in the above; those are still specified by giving either a full or relative path. Nor is the framework runtime configuration file ( the .py file ) included in the above.
In the following, it is presumed that the reader is familiar with the ideas of base releases and test releases.
FileInPath is driven by four environment variables defined in the table below,
FW_RELEASE_BASE |
The full path of the root of the base release. Defined in setup.sh in the root of the base release. | |
FW_DATA_PATH |
The path to disk space that files that do not belong in a release, perhaps because they are too
big or perhaps because they are not logically married to particular cvs tags.
Initially, only the magnetic field files have been stored in this location. This variable is defined in $MU2E/setupmu2e-v1.sh. | |
FW_BASE |
The full path to the root of the test release. If you are not using a test release, this may
remain undefined. Defined by bin/addlocal.sh from the base release against which the test release was built. | |
FW_SEARCH_PATH |
Colon delimited search path used by FileInPath; it contains the above elements in the order desired by
the user. Most frequently you will want the order FW_BASE, FW_RELEASE_BASE, FW_DATA_PATH.
There is an important oddity here: each element must be terminated with a / . This variable is defined in setup.sh of the base release and extended in bin/addlocal.sh . |
This next section will work through an example to illustrate the operation of FileInPath. Consider locating the geometry file, which is specified in the runtime configuration file in the stanza that configures the GeometryService,
process.GeometryService = mu2e.Service("GeometryService", inputfile=mu2e.untracked.string("Mu2eG4/test/geom_01.txt") )FileInPath will look for a file named $FW_BASE/Mu2eG4/test/geom_01.txt; if that file exists, then FileInPath has finished its work and will return that filename. If it does not exist, then FileInPath will look for a file named $FW_RELEASE_BASE/Mu2eG4/test/geom_01.txt; if that file exists, then FileInPath has finished its work and will return that filename. If it does not exist, then FileInPath will look for a file named $FW_DATA_PATH/Mu2eG4/test/geom_01.txt; if that file exists, then FileInPath has finished its work and will return that filename. If that file does not exist, FileInPath will throw. One may vary the order of FW_SEARCH_PATH to cause the search to be done in a different order to exclude any subset of the three options.
> source /grid/fermiapp/products/mu2e/setupmu2e-v1.sh > source /grid/fermiapp/mu2e/Offline/v0_3_3/setup.sh
FW_DATA_PATH | /grid/fermiapp/mu2e/DataFiles | |
FW_BASE | undefined | |
FW_RELEASE_BASE | /grid/fermiapp/mu2e/Offline/v0_3_3 | |
FW_SEARCH_PATH | /grid/fermiapp/mu2e/Offline/v0_3_3/:/grid/fermiapp/mu2e/DataFiles/ |
Note the trailing / in the elements of FW_SEARCH_PATH and the absense of the trailing / in the other environment variables.
> source /grid/fermiapp/products/mu2e/setupmu2e-v1.sh > source /grid/fermiapp/mu2e/Offline/v0_3_3/setup.sh > mkdir /grid/fermiapp/mu2e/users/kutschke/test > cd /grid/fermiapp/mu2e/users/kutschke/test > source /grid/fermiapp/mu2e/Offline/v0_3_3/bin/addlocal.sh
FW_DATA_PATH | /grid/fermiapp/mu2e/DataFiles | |
FW_BASE | /grid/fermiapp/mu2e/users/kutschke/test | |
FW_RELEASE_BASE | /grid/fermiapp/mu2e/Offline/v0_3_3 | |
FW_SEARCH_PATH | /grid/fermiapp/mu2e/users/kutschke/test/:/grid/fermiapp/mu2e/Offline/v0_3_3/:/grid/fermiapp/mu2e/DataFiles/ |
Security, Privacy, Legal |