This page will teach you how to use the emcDB program to write calibration data ASCII files into the PHENIX EMCAL Objectivity databases.
Disclaimer: the emcDB program is only a convenient tool to update/dump the EMCAL databases. It is not a bullet-proof program !
So far, we have 14 EMCAL calibration databases, corresponding to 7 calibration data "flavours" (there are 2 DBs per flavour : one tag-DB and one data-DB). The database names are of the form : calib.emc.XYZ.pdb, where X is the data flavour :
Y is Tag (for Tag-DB) or Cal (for data-DB), and Z is a sequence number (0000 for the moment).
In the following, databases are referred to by the flavour name (e.g. Gains).
Due to some problems with the nightly rebuild with Insure, the emcDB program is not automatically produced, but still it is in the CVS repository. We hope to solve this problem sooner or later. Meanwhile, here are instructions to install it locally.
Log into a rcas machine, e.g. phnxemc, and get an AFS token. Choose a fresh directory, e.g. ~/tmp, and do :
cd ~/tmp cvs co -d emcDB-src offline/packages/emc-calib/DataManager_plugins/emcDB.C
which should produce you a emcDB-src/emcDB.C file. Copy those 3 files : autogen.sh, configure.in and Makefile.am in the emcDB-src directory.
Create a ~/tmp/emcDB-build directory. Go into this dir, and then :
../emcDB-src/autogen.sh --prefix=where_to_install (e.g. $HOME/install) make install
You should then have the emcDB executable installed in the where_to_install/bin directory (it might be convenient to add this directory to your PATH, e.g. setenv PATH ${PATH}:where_to_install/bin).
You must set the EMCAL_DATA_COMMON environment variable to the directory where the calibration files reside, e.g. :
setenv EMCAL_DATA_COMMON /afs/rhic/phenix/phnxemc/PBSC/pbsc_082800You will note that, owing the /afs/rhic/phenix/phnxemc/ directory organization, you will not be able to update calibrations for PBGL and PBSC at the same time. You'll have to do it in 2 steps.
You must set the OO_FD_BOOT environment variable to the PHENIX Federation boot file :
setenv OO_FD_BOOT ${PHENIX_FD_BOOT}
You must have at hand a configuration file, for the sub-system you consider (PBSC or PBGL).
You can get the syntax by doing:
> where_to_install/bin/emcDB --help USAGE : emcDB [--config filename] : select the configuration filename (default=FEM.conf) [--write Gains|LCTofs|WalkTofs|Pedestals|HLRatios|all] : Collect calibration data from files and dump it into DB [--makeDBs] : create all the DBs into the FD (do nothing if DB already exist [--simulDBs] To feed DBs with fake values for simulations [--dump Gains|LCTofs|WalkTofs|Pedestals|HLRatios|TofT0s] Dump a given database on screen
You can omit the where_to_install/bin if this directory is part of your PATH.
The general syntax is :
emcDB --config configuration_file --write flavour
where flavour is Gains or LCTofs or WalkTofs or Pedestals or HLRatios or TofT0s, or "all" for all of them.
The configuration_file is used to tell emcDB which FEMs to consider.
That's it !
Usually, start-of-validity dates for the calibration data are fetch from the ASCII files themselves. If you want to override those, use the (undocumented) --forceDate option of the emcDB program. It takes a date string, in a format which is the one you can get from a call to the print() method of PHTimeStamp. E.g. :
> root -b root [0] gSystem.Load("libPdbCal.so") (int)0 root [1] PHTimeStamp t(2000,1,1,12,34,0) root [2] t.print() root [3] cout << endl ; Sat Jan 1 12:34:00 2000 root [4] .q > emcDB --config config.conf --write all --forceDate "Sat Jan 1 12:34:00 2000"