Skip to content

Commit ecafc62

Browse files
jokonigshahor02
authored andcommitted
[EMCAL-566] Add shift for low gain time calibration
- In run3, the statistics accumulated before the asynchornus reconstruction is (most likely) not sufficient to calibrate the low gain cells (> ~16GeV) - From previous run2 studies and new data from LHC22m, we know that the low gain calibration factors should be nearly the same as the high gain calib factors, however they are shifted by a few nanoseconds - Implemented that the low gain calib factors are taken from the high gain factors and added a constant shift for all cells - Shift is settable via the EMCALCalibParams
1 parent 97cd824 commit ecafc62

3 files changed

Lines changed: 12 additions & 4 deletions

File tree

Detectors/EMCAL/calibration/include/EMCALCalibration/EMCALCalibExtractor.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "EMCALCalib/BadChannelMap.h"
2525
#include "EMCALCalib/EMCALChannelScaleFactors.h"
2626
#include "EMCALCalib/TimeCalibrationParams.h"
27+
#include "EMCALCalibration/EMCALCalibParams.h"
2728
#include "CommonUtils/BoostHistogramUtils.h"
2829
#include "EMCALBase/Geometry.h"
2930
#include "EMCALCalibration/EMCALCalibParams.h"
@@ -339,10 +340,12 @@ class EMCALCalibExtractor
339340
auto fitValues = o2::utils::fitBoostHistoWithGaus<double>(boostHist1d);
340341
mean = fitValues.at(1);
341342
// add mean to time calib params
342-
TCP.addTimeCalibParam(i, mean, 0);
343+
TCP.addTimeCalibParam(i, mean, false); // highGain calib factor
344+
TCP.addTimeCalibParam(i, mean + EMCALCalibParams::Instance().lowGainOffset_tc, true); // lowGain calib factor
343345
} catch (o2::utils::FitGausError_t err) {
344346
LOG(warning) << createErrorMessageFitGaus(err) << "; for cell " << i << " (Will take the parameter of the previous cell: " << mean << "ns)";
345-
TCP.addTimeCalibParam(i, mean, 0); // take calib value of last cell; or 400 ns shift default value
347+
TCP.addTimeCalibParam(i, mean, false); // take calib value of last cell; or 400 ns shift default value
348+
TCP.addTimeCalibParam(i, mean + EMCALCalibParams::Instance().lowGainOffset_tc, true); // take calib value of last cell; or 400 ns shift default value
346349
}
347350
}
348351
return TCP;

Detectors/EMCAL/calibration/include/EMCALCalibration/EMCALCalibParams.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ struct EMCALCalibParams : public o2::conf::ConfigurableParamHelper<EMCALCalibPar
5757
int nBinsTimeAxis_tc = 1500; ///< number of bins used for the time calibration
5858
int minValueTimeAxis_tc = -500; ///< minimum value of the time axis in the time calibration
5959
int maxValueTimeAxis_tc = 1000; ///< maximum value of the time axis in the time calibration
60+
float lowGainOffset_tc = 8.8; ///< Offset between high gain and low gain in ns. This is needed since the low gain calib will not be possible due to insuficient statistics
6061
unsigned int slotLength_tc = 0; ///< Lenght of the slot before calibration is triggered. If set to 0 calibration is triggered when hasEnoughData returns true
6162
bool UpdateAtEndOfRunOnly_tc = false; ///< switsch to enable trigger of calibration only at end of run
6263

Detectors/EMCAL/calibration/include/EMCALCalibration/EMCALChannelCalibrator.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,14 @@ void EMCALChannelCalibrator<DataInput, DataOutput>::finalizeSlot(o2::calibration
168168

169169
TFile fLocalStorage((EMCALCalibParams::Instance().localRootFilePath).c_str(), ffile.good() == true ? "update" : "recreate");
170170
fLocalStorage.cd();
171-
TH1F* histTCparams = (TH1F*)tcd.getHistogramRepresentation(false);
172-
std::string nameTCHist = "TCParams_" + std::to_string(slot.getStartTimeMS());
171+
TH1F* histTCparams = (TH1F*)tcd.getHistogramRepresentation(false); // high gain calibration
172+
std::string nameTCHist = "TCParams_HG_" + std::to_string(slot.getStartTimeMS());
173173
histTCparams->Write(nameTCHist.c_str(), TObject::kOverwrite);
174174

175+
TH1F* histTCparams_LG = (TH1F*)tcd.getHistogramRepresentation(true); // low gain calibration
176+
std::string nameTCHist_LG = "TCParams_LG_" + std::to_string(slot.getStartTimeMS());
177+
histTCparams_LG->Write(nameTCHist_LG.c_str(), TObject::kOverwrite);
178+
175179
TH2F hCalibHist = o2::utils::TH2FFromBoost(c->getHisto());
176180
std::string nameTCInputHist = "TimeVsCellID_" + std::to_string(slot.getStartTimeMS());
177181
hCalibHist.Write(nameTCInputHist.c_str(), TObject::kOverwrite);

0 commit comments

Comments
 (0)