10 #include <ecl/calibration/eclWaveformTemplateCalibrationC3Algorithm.h>
13 #include <ecl/dataobjects/ECLElementNumbers.h>
14 #include <ecl/dbobjects/ECLDigitWaveformParameters.h>
29 eclWaveformTemplateCalibrationC3Algorithm::eclWaveformTemplateCalibrationC3Algorithm():
33 "Perform the hadron and diode template shape calibration using photon template shapes from stage C2"
50 TTree* TempTree = (TTree*) TempFile->Get(
"HadronWaveformInfo");
51 double tHadronShapePars_A[11];
52 double tDiodeShapePars_A[11];
53 double tMaxResidualHadron_A;
54 double tMaxResidualDiode_A;
55 double tMaxValDiode_A;
56 double tMaxValHadron_A;
57 TempTree->SetBranchAddress(
"TempHadronPar11_A", &tHadronShapePars_A);
58 TempTree->SetBranchAddress(
"TempDiodePar11_A", &tDiodeShapePars_A);
59 TempTree->SetBranchAddress(
"MaxResHadron_A", &tMaxResidualHadron_A);
60 TempTree->SetBranchAddress(
"MaxResDiode_A", &tMaxResidualDiode_A);
61 TempTree->SetBranchAddress(
"MaxValDiode_A", &tMaxValDiode_A);
62 TempTree->SetBranchAddress(
"MaxValHadron_A", &tMaxValHadron_A);
65 for (
int j = 0; j <= batch; j++) {
68 B2INFO(
"tCellID=" << tCellID <<
" j=" << j);
69 TempTree->GetEntry(j);
70 float tHadronShapePars_float[11];
71 float tDiodeShapePars_float[11];
72 for (
int p = 0; p < 11; p++) {
74 if (tHadronShapePars_A[p] > 100 || tHadronShapePars_A[p] < -100) {
75 B2INFO(
"Warning large parameter for: " << tCellID <<
" " << tHadronShapePars_A[p]);
76 for (
int h = 0; h < 11; h++) B2INFO(tHadronShapePars_A[h]);
79 tHadronShapePars_float[p] = (float)tHadronShapePars_A[p];
80 tDiodeShapePars_float[p] = (float)tDiodeShapePars_A[p];
84 B2INFO(
"tCellID tHadronShapePars_float[0]" << tCellID <<
" " << tHadronShapePars_float[0]);
86 HadronDiodeParameters->
setTemplateParameters(tCellID, tHadronShapePars_float, tHadronShapePars_float, tDiodeShapePars_float);
Base class for calibration algorithms.
void saveCalibration(TClonesArray *data, const std::string &name)
Store DBArray payload with given name with default IOV.
void setDescription(const std::string &description)
Set algorithm description (in constructor)
EResult
The result of calibration.
@ c_OK
Finished successfuly =0 in Python.
const int c_NCrystals
Number of crystals.
Abstract base class for different kinds of events.