10#include <ecl/modules/eclWaveformTemplateCalibrationC2Collector/eclWaveformTemplateCalibrationC2Collector.h>
13#include <framework/dataobjects/EventMetaData.h>
16#include <ecl/dataobjects/ECLDigit.h>
17#include <ecl/dataobjects/ECLDsp.h>
18#include <ecl/dbobjects/ECLCrystalCalib.h>
26REG_MODULE(eclWaveformTemplateCalibrationC2Collector);
33 m_eclWaveformTemplateCalibrationC1MaxResLimit(
"eclWaveformTemplateCalibrationC1MaxResLimit")
36 setDescription(
"Module to export waveforms from gamma gamma events for waveform template calibrations");
58 auto tree =
new TTree(
"tree",
"");
59 tree->Branch(
"CellID", &
m_CellID,
"m_CellID/I");
60 tree->Branch(
"ADC0", &
m_ADC0,
"m_ADC0/I");
61 tree->Branch(
"ADC1", &
m_ADC1,
"m_ADC1/I");
62 tree->Branch(
"ADC2", &
m_ADC2,
"m_ADC2/I");
63 tree->Branch(
"ADC3", &
m_ADC3,
"m_ADC3/I");
64 tree->Branch(
"ADC4", &
m_ADC4,
"m_ADC4/I");
65 tree->Branch(
"ADC5", &
m_ADC5,
"m_ADC5/I");
66 tree->Branch(
"ADC6", &
m_ADC6,
"m_ADC6/I");
67 tree->Branch(
"ADC7", &
m_ADC7,
"m_ADC7/I");
68 tree->Branch(
"ADC8", &
m_ADC8,
"m_ADC8/I");
69 tree->Branch(
"ADC9", &
m_ADC9,
"m_ADC9/I");
70 tree->Branch(
"ADC10", &
m_ADC10,
"m_ADC10/I");
71 tree->Branch(
"ADC11", &
m_ADC11,
"m_ADC11/I");
72 tree->Branch(
"ADC12", &
m_ADC12,
"m_ADC12/I");
73 tree->Branch(
"ADC13", &
m_ADC13,
"m_ADC13/I");
74 tree->Branch(
"ADC14", &
m_ADC14,
"m_ADC14/I");
75 tree->Branch(
"ADC15", &
m_ADC15,
"m_ADC15/I");
76 tree->Branch(
"ADC16", &
m_ADC16,
"m_ADC16/I");
77 tree->Branch(
"ADC17", &
m_ADC17,
"m_ADC17/I");
78 tree->Branch(
"ADC18", &
m_ADC18,
"m_ADC18/I");
79 tree->Branch(
"ADC19", &
m_ADC19,
"m_ADC19/I");
80 tree->Branch(
"ADC20", &
m_ADC20,
"m_ADC20/I");
81 tree->Branch(
"ADC21", &
m_ADC21,
"m_ADC21/I");
82 tree->Branch(
"ADC22", &
m_ADC22,
"m_ADC22/I");
83 tree->Branch(
"ADC23", &
m_ADC23,
"m_ADC23/I");
84 tree->Branch(
"ADC24", &
m_ADC24,
"m_ADC24/I");
85 tree->Branch(
"ADC25", &
m_ADC25,
"m_ADC25/I");
86 tree->Branch(
"ADC26", &
m_ADC26,
"m_ADC26/I");
87 tree->Branch(
"ADC27", &
m_ADC27,
"m_ADC27/I");
88 tree->Branch(
"ADC28", &
m_ADC28,
"m_ADC28/I");
89 tree->Branch(
"ADC29", &
m_ADC29,
"m_ADC29/I");
90 tree->Branch(
"ADC30", &
m_ADC30,
"m_ADC30/I");
91 registerObject<TTree>(
"tree", tree);
98 B2INFO(
"eclWaveformTemplateCalibrationC2Collector: Experiment = " <<
m_evtMetaData->getExperiment() <<
" run = " <<
118 const int CellId = aECLDsp.getCellId();
122 const int id = CellId - 1;
127 if (aECLDigit.getCellId() - 1 ==
id) {
139 bool skipWaveform =
false;
143 if (skipWaveform)
continue;
146 float baseline = 0.0;
147 for (
int i = 0; i <
m_baselineLimit; i++) baseline += aECLDsp.getDspA()[i];
153 float temp = fabs(aECLDsp.getDspA()[i] - baseline);
154 if (temp > maxRes) maxRes = temp;
163 m_ADC0 = aECLDsp.getDspA()[0];
164 m_ADC1 = aECLDsp.getDspA()[1];
165 m_ADC2 = aECLDsp.getDspA()[2];
166 m_ADC3 = aECLDsp.getDspA()[3];
167 m_ADC4 = aECLDsp.getDspA()[4];
168 m_ADC5 = aECLDsp.getDspA()[5];
169 m_ADC6 = aECLDsp.getDspA()[6];
170 m_ADC7 = aECLDsp.getDspA()[7];
171 m_ADC8 = aECLDsp.getDspA()[8];
172 m_ADC9 = aECLDsp.getDspA()[9];
173 m_ADC10 = aECLDsp.getDspA()[10];
174 m_ADC11 = aECLDsp.getDspA()[11];
175 m_ADC12 = aECLDsp.getDspA()[12];
176 m_ADC13 = aECLDsp.getDspA()[13];
177 m_ADC14 = aECLDsp.getDspA()[14];
178 m_ADC15 = aECLDsp.getDspA()[15];
179 m_ADC16 = aECLDsp.getDspA()[16];
180 m_ADC17 = aECLDsp.getDspA()[17];
181 m_ADC18 = aECLDsp.getDspA()[18];
182 m_ADC19 = aECLDsp.getDspA()[19];
183 m_ADC20 = aECLDsp.getDspA()[20];
184 m_ADC21 = aECLDsp.getDspA()[21];
185 m_ADC22 = aECLDsp.getDspA()[22];
186 m_ADC23 = aECLDsp.getDspA()[23];
187 m_ADC24 = aECLDsp.getDspA()[24];
188 m_ADC25 = aECLDsp.getDspA()[25];
189 m_ADC26 = aECLDsp.getDspA()[26];
190 m_ADC27 = aECLDsp.getDspA()[27];
191 m_ADC28 = aECLDsp.getDspA()[28];
192 m_ADC29 = aECLDsp.getDspA()[29];
193 m_ADC30 = aECLDsp.getDspA()[30];
195 getObjectPtr<TTree>(
"tree")->Fill();
Calibration collector module base class.
void setDescription(const std::string &description)
Sets the description of the module.
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
const int c_NCrystals
Number of crystals.
Abstract base class for different kinds of events.