10 #include <ecl/modules/eclWaveformCalibCollector/eclWaveformCalibCollectorModule.h>
13 #include <ecl/dataobjects/ECLDigit.h>
14 #include <ecl/dataobjects/ECLElementNumbers.h>
15 #include <ecl/dbobjects/ECLCrystalCalib.h>
18 #include <framework/gearbox/Const.h>
19 #include <framework/dataobjects/EventMetaData.h>
20 #include <framework/datastore/RelationVector.h>
39 eclWaveformCalibCollectorModule::eclWaveformCalibCollectorModule() :
Module()
42 setDescription(
"Module to export waveforms to ntuple for template calibration.");
59 m_rootFile =
new TFile(dataFileName.c_str(),
"RECREATE");
65 tree =
new TTree(
"tree",
"");
141 int cellid = aECLDigit.getCellId();
145 const int amplitude = aECLDigit.getAmp();
151 if (aECLDsp.getCellId() == cellid) {
152 m_Chi2 = aECLDsp.getTwoComponentChi2();
158 m_OfflineE = aECLDsp.getTwoComponentTotalAmp();
159 m_FitType = aECLDsp.getTwoComponentFitType();
164 const double BaselineLimit = 10.0;
165 double baselinemean = 0.0;
166 for (
int i = 0; i < BaselineLimit; i++) baselinemean += aECLDsp.getDspA()[i];
167 baselinemean /= BaselineLimit;
168 double baselineRMS = 0.0;
169 for (
int i = 0; i < BaselineLimit; i++) {
170 double temp = aECLDsp.getDspA()[i] - baselinemean;
171 baselineRMS += (temp * temp);
173 baselineRMS /= BaselineLimit;
179 m_ADC0 = aECLDsp.getDspA()[0];
180 m_ADC1 = aECLDsp.getDspA()[1];
181 m_ADC2 = aECLDsp.getDspA()[2];
182 m_ADC3 = aECLDsp.getDspA()[3];
183 m_ADC4 = aECLDsp.getDspA()[4];
184 m_ADC5 = aECLDsp.getDspA()[5];
185 m_ADC6 = aECLDsp.getDspA()[6];
186 m_ADC7 = aECLDsp.getDspA()[7];
187 m_ADC8 = aECLDsp.getDspA()[8];
188 m_ADC9 = aECLDsp.getDspA()[9];
189 m_ADC10 = aECLDsp.getDspA()[10];
190 m_ADC11 = aECLDsp.getDspA()[11];
191 m_ADC12 = aECLDsp.getDspA()[12];
192 m_ADC13 = aECLDsp.getDspA()[13];
193 m_ADC14 = aECLDsp.getDspA()[14];
194 m_ADC15 = aECLDsp.getDspA()[15];
195 m_ADC16 = aECLDsp.getDspA()[16];
196 m_ADC17 = aECLDsp.getDspA()[17];
197 m_ADC18 = aECLDsp.getDspA()[18];
198 m_ADC19 = aECLDsp.getDspA()[19];
199 m_ADC20 = aECLDsp.getDspA()[20];
200 m_ADC21 = aECLDsp.getDspA()[21];
201 m_ADC22 = aECLDsp.getDspA()[22];
202 m_ADC23 = aECLDsp.getDspA()[23];
203 m_ADC24 = aECLDsp.getDspA()[24];
204 m_ADC25 = aECLDsp.getDspA()[25];
205 m_ADC26 = aECLDsp.getDspA()[26];
206 m_ADC27 = aECLDsp.getDspA()[27];
207 m_ADC28 = aECLDsp.getDspA()[28];
208 m_ADC29 = aECLDsp.getDspA()[29];
209 m_ADC30 = aECLDsp.getDspA()[30];
Class for accessing objects in the database.
@ photonHadronBackgroundPhoton
photon + hadron template + pile-up photon fit
@ photonDiodeCrossing
photon + diode template fit
@ photonHadron
photon + hadron template fit
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.