Writing and reading calibtration constants to/from DB



Full description of Laurent's tool allowing to dump, update and compare calibration coefficients can be found here: http://www.phenix.bnl.gov/~aphecetc/Computing/Tutorials/tutorial-emcdb.html
Here I'll give a few examples of most frequently used applications of this tool. The flavour is IniCal. So you would do:
emcDB --dump calib.emc.generic.IniCal --bankID x
where x = ( ( type << 24 ) & ( 0xFF000000 ) ) + ( number & 0xFFFFFF ) where type=1 and number is the sector number (from 0 to 7, PbGl being 6 and 7) The flavours are:
  • Gains
Time-dependent gain values
  • HLRatios
High to Low ratio values
  • Pedestals5
Pedestal values (5 ped per amu cell)
  • QAs
Quality & Assurance values
  • LCTofs
Least-Count ToF values
  • WalkTofs
Walk ToF values
  • TofT0s
ToF-T0 drift values
  • TacPeds
pedestal TAC drift values
To dump them on screen use:
emcDB --dump calib.emc.<flavour> --bankID x
where x is a FEM number. PbGl FEM numbers are 108 to 172.
emcDB --dump calib.emc.LCToFs --bankID 108 --insertedAfter "2004,01,01,0,0,0" --insertedBefore "2005,01,01,0,0,0"
emcDB --dump calib.emc.LCToFs --bankID 108 --endAfter "2004,01,01,0,0,0" --endBefore "2005,01,01,0,0,0"
emcDB --update /home/phnxpbgl/work/RawData/calib_run5/ASCII/ToF/  --forceDate "2001,08,01,12,45,00"
This directory must contain ASCII files in conventional format. Directory name and file names must have conventional format. File name format is <Sector>SM<FEM_number>.<Suffix>
--forceDate option overrides start of validity date with the pointed one.
Flavour Directory name File name example Format
Gains */Gains/ E1SM5.LED(AVY)-TOWERS-NORM_ADC.GAINS Example
Sat Jan 01 00:00:00 2005
0 1 1.89405 0
1 1 1.89601 0
...
143 1 2.51481 0

Fields meaning
<Date>
<Fem_ch_number> 1 <Gain> <Error>
<Fem_ch_number> 1 <Gain> <Error>
...
<Fem_ch_number> 1 <Gain> <Error>

HLRatios */HLRatios/ E1SM5.HLR Example
Wed Jan 19 00:00:00 2005
Sat Dec  1 00:00:00 2044
0 14.4209 1.33453 -120.375 16.2301
1 15.6258 0.720255 -48.5812 16.0317
...
143 14.6282 1.51419 -115.296 16.3644

Fields meaning
<Start validity date>
<End validity date>
<Fem_ch_number> <Average> <RMS> <Intersept> <Slope>
...
<Fem_ch_number> <Average> <RMS> <Intersept> <Slope>

Pedestals5 */pedestals/ E1SM5.HG_Post
E1SM5.HG_Pre
E1SM5.HG_Pre-Post
E1SM5.LG_Post
E1SM5.LG_Pre
E1SM5.LG_Pre-Post
E1SM5.TAC
Example
Thu Jan 20 22:04:31 2005
Mon Jan 18 22:14:07 2038
3834 3837 ... 3836
3836 3850 ... 3843 
...
3837 3832 ... 3871 

Fields meaning
<Start validity date>
<End validity date>
<Ped_ch0_AMU0> <Ped_ch0_AMU1> ... <Ped_ch0_AMU63>
<Ped_ch1_AMU0> <Ped_ch1_AMU1> ... <Ped_ch1_AMU63>
...
<Ped_ch143_AMU0> <Ped_ch143_AMU1> ... <Ped_ch143_AMU63>

QAs */QA/ E1SM5.GAINS.QA
E1SM5.HLR.QA
E1SM5.ToF.QA
Example
Wed Jan 19 00:00:00 2005
Mon Jan 18 22:14:07 2038
0 0 0
1 0 0
...
143 0 0

Fields meaning
<Start validity date>
<End validity date>
<Fem_ch_number> <Error code> <Warning code>
...
<Fem_ch_number> <Error code> <Warning code>

LCToFs */ToF/ E1SM5.TOF_LC Example
Wed Jan 19 00:00:00 2005
Mon Jan 18 22:14:07 2038
0 41.8159 1451.44 
1 42.026 1664.96 
...
143 42.5625 1422.16 

Fields meaning
<Start validity date>
<End validity date>
<Fem_ch_number> <LeastCount> <Offset> 
...
<Fem_ch_number> <LeastCount> <Offset>


Last update:
Andrey Kazantsev