10#include <ecl/calibration/eclWaveformTemplateCalibrationC3Algorithm.h>
13#include <ecl/dataobjects/ECLElementNumbers.h>
14#include <ecl/dbobjects/ECLDigitWaveformParameters.h>
32 "Perform the hadron and diode template shape calibration using photon template shapes from stage C2"
49 TTree* TempTree = (TTree*) TempFile->Get(
"HadronWaveformInfo");
50 double tHadronShapePars_A[11];
51 double tDiodeShapePars_A[11];
52 double tMaxResidualHadron_A;
53 double tMaxResidualDiode_A;
54 double tMaxValDiode_A;
55 double tMaxValHadron_A;
56 TempTree->SetBranchAddress(
"TempHadronPar11_A", &tHadronShapePars_A);
57 TempTree->SetBranchAddress(
"TempDiodePar11_A", &tDiodeShapePars_A);
58 TempTree->SetBranchAddress(
"MaxResHadron_A", &tMaxResidualHadron_A);
59 TempTree->SetBranchAddress(
"MaxResDiode_A", &tMaxResidualDiode_A);
60 TempTree->SetBranchAddress(
"MaxValDiode_A", &tMaxValDiode_A);
61 TempTree->SetBranchAddress(
"MaxValHadron_A", &tMaxValHadron_A);
64 for (
int j = 0; j <= batch; j++) {
67 B2INFO(
"tCellID=" << tCellID <<
" j=" << j);
68 TempTree->GetEntry(j);
69 float tHadronShapePars_float[11];
70 float tDiodeShapePars_float[11];
71 for (
int p = 0; p < 11; p++) {
73 if (tHadronShapePars_A[p] > 100 || tHadronShapePars_A[p] < -100) {
74 B2INFO(
"Warning large parameter for: " << tCellID <<
" " << tHadronShapePars_A[p]);
75 for (
int h = 0; h < 11; h++) B2INFO(tHadronShapePars_A[h]);
78 tHadronShapePars_float[p] = (float)tHadronShapePars_A[p];
79 tDiodeShapePars_float[p] = (float)tDiodeShapePars_A[p];
83 B2INFO(
"tCellID tHadronShapePars_float[0]" << tCellID <<
" " << tHadronShapePars_float[0]);
85 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 successfully =0 in Python.
const int c_NCrystals
Number of crystals.
Abstract base class for different kinds of events.