next up previous
Next: 5. The emcDataManager, the Up: No Title Previous: 3. The emcRawDataAccessor (RDA)

Subsections


   
4. The emcCalibrator

   
4.1 Principle

You get access to a calibrator using a calibrator factory. The idea behind this design choice is to ease the move from one calibration strategy to another one with a minimal change in the reconstruction code. The factory must be initialized first with the desired strategy and then you can use it :

emcCalibratorFactory::Initialize(``emcRawDataCalibrator'') ;
emcCalibrator* calib = emcCalibratorFactory::GetCalibrator() ;

NOTE 1: By now, only one strategy (i.e. classname) can be used with the factory and is named emcRawDataCalibrator (figure 3). In the future, if alternative strategird are defined, you will just have to change the name in the Initialize call and that's all.

NOTE 2: In case the factory is not initialized, the second line in the above example will return a null pointer.

Before using the calibrator, you can set a number of its properties :

// ADC counts below the threshold are considered to be zero
calib->SetThresholdADC(10) ; 
// Which High Post value to consider 
// as the limit between High and Low gain ?
calib->SetHighLowLimit(1024) ;
// Select the calibration data sources
emcManageable::EStorage data_source = emcManageable::kDB_Objy ;
calib->SelectSource(``Gains'',data_source) ;
calib->SelectSource(``Pedestals'',data_source) ;
calib->SelectSource(``HLRatios'',data_source) ;
// Disable collection of Tof calibration data
calib->SelectSource(``Tofs'',emcManageable::kNone) ;
// The CDO will be zero-suppressed
calib->SetZeroSuppression(true) ;
// Print calibrator info
calib->Print() ;

We will explain more on data sources in section 5.

Once the calibrator is set up, here is how you use it, assuming you already have a RDO pointer at hand (see section 3) :

emcMixedDataObject mdo ;
emcCalibratedDataObject cdo ;
PHTimeStamp when(2000,6,24,0,0,0) ;

1 calib->Calibrate(*rdo,mdo,when) ;
  calib->Calibrate(mdo,cdo,when) ;

// Can be simplified to :
// 2 calib->Calibrate(*rdo,cdo,when) ;
// if you don't need the information stored in MDO.

// Play here with your brand new calibrated data object
int i ;
for ( i = 0 ; i < cdo.GetSize() ; i++ ) {
  cout << cdo.GetSoftwareKey(i) << `` Energy='' << cdo.GetEnergy(i) 
       << `` Time='' << cdo.GetTime(i) << endl ;
}
cout << cdo.GetTotalEnergy() << endl ;
...

NOTE: The short version (line 2 above) to go from RDO to CDO has a small disadvantage over the two-step version : it will recreate a MDO object at each call, whereas the two-step version uses the very same MDO each time (I've never really timed the difference though).


  
Figure 3: emcCalibrator and related classes

   
4.2 More on the emcRawDataCalibrator strategy

In this section we will describe what the emcRawDataCalibrator (RDC) is actually doing and what it needs.

When going from the RDO to the MDO, the RDC will :

1.
choose between high and low gain, depending on the RDC GetHighLowLimit(), subtract the relevant pedestal and apply the proper high-to-low gain ratio. Schematically :
if ( hgpost < GetHighLowLimit() ) {
  adc = lgpre-lgpost ;
  adc -= pedestal_for_LG_Pre-Post(amupost) ;
  adc *= HLRatio ;
}
else {
  adc = hgpre-hgpost ;
  adc -= pedestal_for_HG_Pre-Post(amupost) ;
}
2.
subtract tac pedestal :
tac -= pedestal_for_TAC(amupost) ;

Thus the RDC needs to access Pedestals and HLRatios values (see section 5)

When going from the MDO to the CDO, the RDC will calibrate energy and time, for each channel which is above the GetThresholdADC() value. To do this, the RDC needs to access Gains (relative normalization), Tofs and time-zero (absolute normalization) calibration data.

[be more specific here...]

Fine. Unless you are really interested in more details, you can safely stop reading here, and enjoy your CDO !


next up previous
Next: 5. The emcDataManager, the Up: No Title Previous: 3. The emcRawDataAccessor (RDA)
Laurent APHECETCHE - 2000-07-28