Uploading EEMC Pedestal, Status and Gain Calibrations to the DB
This page is intended to document the process of uploading EEMC calibrations to the DB using the "eemcDb" utility script originally written by Jan Balewski. Some old notes from Jan are
here. Before we begin, a quick reminder that this is not a task many people should need to do but should be limited to one or two "experts", who will be given special DB writing priviledges by Dmitry Arkhipkin (arkhipkin@bnl.gov). The code is all in CVS though for documentation purposes.
Building the eemcDb utility:
All the uploads to the EEMC DB are handled by the eemcDb utility which Jan called the "swiss army knife" of DB uploads. The source code to build the eemcDb executible can be found in
CVS. To compile the script follow these quick instructions
mkdir yourDirectory
cd yourDirectory
cvs co StRoot/StDbLib/
cd StRoot/StDbLib/
make
cd ../../
cvs co StRoot/StEEmcUtil/database/macros/upload/src/
cd StRoot/StEEmcUtil/database/macros/upload/src/
make
Then the eemcDb executible is ready to use. It can be tested with a simple read command:
eemcDb -r -p Ver2004d/ -T
Uploading tables to the DB:
Thre are several scripts for uploading pedestal, status and gain tables to the DB located in CVS at StRoot/StEEmcUtil/database/macros/upload/. The names are fairly obvious, but just in case, here is the breakdown:
writeIdealGains.C : writes ideal gain tables in ascii files to be uploaded
writeIdealPed.C : write ideal ped tables (pedestal = 0) in ascii files to be uploaded
writeIdealStatus.C : write ideal status tables (status = 0) in ascii files to be uploaded
In the following scripts you need to specify the location of the eemcDb executible (compile instructions above) as its currently listed as "yourDirectory." Also there are various exit lines in the scripts which you'll need to comment out once you're ready to upload (they kept me from accidental uploads in the past so I kept them in place).
writeMapmtGains.sh :
- script which executes eemcDb to write MAPMT gain files to the DB
- requires user input of timestamp, table "flavor", gain file location, and comment to go in DB
writeTowerGains.sh :
- script which executes eemcDb to write tower gain files to the DB
- requires user input of timestamp, table "flavor", gain file location, and comment to go in DB
loadPed+Status.tcl :
- script which executes writePed+Status.sh (below) for many runs from the input file which specifies the fillNumber, runNumber, and unix timestamp
- requires user input of list of runs and comments to go in the DB
writePed+Status.sh :
- script which executes eemcDb to write pedestal and status files (for both towers and MAPMT) to the DB
- loadPed+Status.tcl should provide user input of timestamp, table "flavor", gain file location, and comment to go in DB
One last note that in order to upload to the DB you need write priviledges from Dmitry and to execute the following command which allows you to write to the DB. Once you're done with the upload remove this to prevent "accidental" uploads.
setenv DB_ACCESS_MODE write