Calibrations Database

Under:
All calibration information is stored in the STAR database.  We have the following tables for BEMC calibrations:
  • For the BTOW and BPRS detectors:
    • St_emcCalib - this table contains absolute gain information for each channel
    • St_emcPed - this table contains pedestal values for each channel
    • St_emcGain - this table contains a gain correction factor vs. time for each channel (not currently used)
    • St_emcStatus - this table contains the final status for each channel
  • For the BSMDe and BSMDp detectors:
    • St_smdCalib - this table contains absolute gain information for each channel
    • St_smdPed - this table contains pedestal values for each channel
    • St_smdGain - this table contains a gain correction factor vs. time for each channel (not currently used)
    • St_smdStatus - this table contains the final status for each channel
The tables are stored in the STAR database under the directory /Calibrations/emc/y3[DETNAME] and are called bemcCalib, bemcPed, bemcGain, and bemcStatus in the case of the BTOW detector.

To get a pointer for those tables in an analysis maker do:
TDataSet *DB = GetInputDB("Calibrations/emc/y3bemc"); // for towers

St_emcCalib *table = (St_emcCalib*) DB->Find("bemcCalib");
emcCalib_st *struct = table->GetTable();

Important Information About Pedestal Tables

In order to save space and make the download faster, PEDESTALS and RMS are saved as SHORT.  So, the real pedestal value is PED/100.  Similarly, in order to save tables in the database you have to multiply the real pedestal by 100.  The same goes for the RMS.

SMD has different pedestals for different capacitors.  Only 3 pedestal values are saved:
  • Pedestal 0 is the average of 126 capacitors
  • Pedestal 1 is the pedestal value for capacitor 124
  • Pedestal 2 is the pedestal value for capacitor 125
Capacitor numbers for the BSMD can be retrieved from an StEmcRawHit by using the calibrationType() method:
unsigned char cap = (char) rawHit->calibrationType();
if(cap > 127) mCap[i][did-1]-=128;

Status Information

The St_emcStatus and St_smdStatus tables contain final status codes for each tower.  The final status is a combination of installation/run status, pedestal status and calibration status.  The final status has a bit pattern as follows:
  • 0 - not installed
  • 1 - installed / running
  • 2 - calibration problem
  • 4 - pedestal problem
  • 8 - other problem (channel removed, dead channel, etc.)
So, status==1 means the channel is installed and running OK.  Status==7 means that the channel is installed but that we have a calibration problem and a pedestal problem.

To check individual bits of the final status do
  • (status&1) == 1 means tower is installed
  • (status&2) == 2 means a calibration problem
  • (status&4) == 4 means a pedestal problem
  • (status&8) == 8 means another problem

Tables Structure

/* emcCalib.idl
*
* Table: emcCalib
*
* description: //: Table which contains all calibration information
*/
struct emcCalib {
octet Status[4800]; /* status of the tower/wire (0=problem, 1=ok) */
float AdcToE[4800][5]; /* ADC to Energy */
};
/* emcPed.idl
*
* Table: emcPed
*
* description: * //: Table which contains pedestal information for emctower ADCs
*/
struct emcPed {
octet Status[4800]; /* status of the emc tower(0=problem, 1=ok) */
short AdcPedestal[4800]; /* ADC pedestal of emc tower x 100 */
short AdcPedestalRMS[4800]; /* ADC pedestal RMS of emc tower x 100 */
float ChiSquare[4800]; /* chi square of Pedestal fit */
};
/* emcGain.idl
*
* Table: emcGain
*
* description: //: Table which contains gain correction information
*/
struct emcGain {
octet Status[4800]; /* status of the tower/wire (0=problem, 1=ok) */
float Gain[4800]; /* Gain Variation */
};
/* emcStatus.idl
*
* Table: emcStatus
*
* description: // which emc towers are up and running
*/
struct emcStatus {
octet Status[4800]; /* */
};
/* smdCalib.idl
*
* Table: smdCalib
*
* description: //: Table which contains all calibration information
*/
struct smdCalib {
octet Status[18000]; /* status of the tower/wire (0=problem, 1=ok) */
float AdcToE[18000][5]; /* ADC to Energy */
};
/* smdPed.idl
*
* Table: smdPed
*
* description: * //: Table which contains pedestal information for shower max ADCs
*/
struct smdPed {
octet Status[18000]; /* status of the smd stripe (0=problem,1=ok) */
short AdcPedestal[18000][3]; /* ADC pedestals of smd strip x 100 */
short AdcPedestalRMS[18000][3]; /* ADC pedestals RMS of smd strip x 100 */
};
/* smdGain.idl
*
* Table: smdGain
*
* description: //: Table which contains gain information
*/
struct smdGain {
octet Status[18000]; /* status of the tower/wire (0=problem, 1=ok) */
float Gain[18000]; /* Gain Variation */
};
/* smdStatus.idl
*
* Table: smdStatus
*
* description: // which smds are up and running
*/
struct smdStatus {
octet Status[18000]; /* */
};