How To Get the LGD Calibration
How To Get the LGD Calibration
How Things Are Stored
The LGD calibration data is stored in the map lgd3053.Map. In addition to the calibration data, pedestal information is also stored here. Due to the problems we have encountered with MPS magnet cycles, the data has been split up into "calibration groups" (calGroups), with the boundries between calGroups normally defined by magnet cycles.
The storge of the group info is:
- calGroup->nRuns : Number of runs in the group, indexed by group number.
- calGroup->firstRun : First run in the group, indexed by group number.
- calGroup->baseRun : Base run in the group, indexed by group number. This is the run that the calibration constants are based on.
- calibration->calGroup : Which group a run belongs to. Indexed by run number.
There is only one set of calibration constants stored for each group, corresponding to the base run for that group. The constants for the other runs are arrived at by multiplying the base constants by a factor derived from the monitoring system :
(wallAvBase/normAvBase)/(wallAvRun/normAvRun), where
- wallAvBase = The average monitoring signal form the wall, averaged over the run, for the base run.
- wallAvBase = The normalization tube signal, averaged over the run, for the base run.
- wallAvRun = The average monitoring signal form the wall, averaged over the run, for the run in question.
- wallAvRun = The normalization tube signal, averaged over the run, for the run in question.
The monitoring system data is stored in the following way:
- monitoring->wallAv : The wall average, indexed by run number.
- monitoring->normAv : The normalization tube average, indexed by run number.
and the calibration constants for the base run can be found in
- calibration->slope : Calibration constants for the base runs, indexed by calibration group.
The last components needed are the pedestals. These are written out by lgdmond, and are stored in the map:
- calibration->adc0 : The pedestal value, indexed by run number.
- calibration->threshold : The threshold value for a hit, indexed by run number.
How To Get the Information
The following sections describe the routines that exist to get the calibration, and how to turn clusters into photons. These routines are defined in lgdUtil.h and contained in libUtil.a
Getting Calibration Group Definitions
int getRunCalGroup(int runNo, int* calGroup, int* nRuns, int* lastRun, int* baseRun)
Fetches the information for the group that run runNo belongs to. Failure returns non-zero.
Getting Pedestals
int getLGDPed(int runNo, float* ped, int* threshold, int* actualRun)
Gets the pedestal information for run runNo. Returns non-zero on failure, and sets actualRun to the run for wich pedestals were found, if applicable. NOte that ped and threshold are arrays dimensioned to 3053 by the user.
Getting Calibration Constants
int getLGDcc(int runNo, float* cc, int* actualRun)
Gets the calibration constants for run runNo. Returns non-zero on failure. Automatically applies the monitoring system scaling. This is actually just a specific case of the call:
int getLGDccGen(int mode, int runNo, float* cc, int* actualRun, char* fileName)
Here mode can be:
- LGDCC_MODE_1 : Gets cc's for the first pass calibration (pre-nonlinearity).
- LGDCC_MODE_2 : Gets cc's for the new calibration (with nonlinearity).
and fileName is:
- "map" : Load the cc's from the appropriate location in the map.
- Some file name : Load the cc's from the given file. It assumes that these cc's are for the requested run (LGDCCC_MODE_1) or for the base run in the group (LGDCC_MODE_2), as appropriate.
Thus the call to getLGDcc(runNo,cc,&actualRun), is equivalent to getLGDccGen(LGDCC_MODE_1,runNo,cc,&actualRun,"map").
Turning Clusters Into Photons
vector4_t makePhoton(lgd_cluster_t* cluster, vector3_t vertex)
Converts the given cluster into a photon. This is actually a specific case of the more general call
vector4_t makePhoton(int mode, lgd_cluster_t* cluster, lgd_hits_t* clusterHits, vector3_t vertex)
where mode is a control word specified by the bitwise and of:
- MAKE_PHOTON_DEPTH : Use the shower depth correction.
- MAKE_PHOTON_USR_DEPTH : Use a user defined scale factor on the depth correction, instead of the default. The user's correction can be passed with the routine setupClusterToPhoton(float scale). This option does nothing without MAKE_PHOTON_DEPTH.
- MAKE_PHOTON_NONLINEAR_1 : Use the non-linearity correction to the energy described in the note of March 13. Note that you need to be using cc's based on this non-linearity.
- MAKE_PHOTON_REHIT : Rescale the hits in clusterHits after the non-linearity is applied. If this option is not used, a NULL pointer can be passed instead of the hits.
- MAKE_PHOTON_DEFAULT : Simply defined to be MAKE_PHOTON_DEPTH | MAKE_PHOTON_NONLINEAR_1
Note that in all cases, if the non-linearity is applied, cluster->energy will be rescaled. makePhoton(cluster,vertex) is actually just a call to makePhotonGen(MAKE_PHOTON_DEFUALT,cluser,NULL,vertex).
What Has Been Calibrated?
The easiest way to determine what has been calibrated is through the program calGroup-II. When run with the -rrunNo flag, it will report which calGroup the run belongs to, and it's calibration status. Run with the -gcalGroup flag, it will report on the status of the given group. When run with no flags, the status of all groups is reported.
***
3/15/95 R.L.
UPDATED 3/22/95 R.L.