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/dataobjects/EventMetaData.h>
19#include <framework/database/DBObjPtr.h>
41 setDescription(
"Module to export waveforms to ntuple for template calibration.");
58 m_rootFile =
new TFile(dataFileName.c_str(),
"RECREATE");
64 tree =
new TTree(
"tree",
"");
140 int cellid = aECLDigit.getCellId();
144 const int amplitude = aECLDigit.getAmp();
150 if (aECLDsp.getCellId() == cellid) {
151 m_Chi2 = aECLDsp.getTwoComponentChi2();
157 m_OfflineE = aECLDsp.getTwoComponentTotalAmp();
158 m_FitType = aECLDsp.getTwoComponentFitType();
163 const double BaselineLimit = 10.0;
164 double baselinemean = 0.0;
165 for (
int i = 0; i < BaselineLimit; i++) baselinemean += aECLDsp.getDspA()[i];
166 baselinemean /= BaselineLimit;
167 double baselineRMS = 0.0;
168 for (
int i = 0; i < BaselineLimit; i++) {
169 double temp = aECLDsp.getDspA()[i] - baselinemean;
170 baselineRMS += (temp * temp);
172 baselineRMS /= BaselineLimit;
178 m_ADC0 = aECLDsp.getDspA()[0];
179 m_ADC1 = aECLDsp.getDspA()[1];
180 m_ADC2 = aECLDsp.getDspA()[2];
181 m_ADC3 = aECLDsp.getDspA()[3];
182 m_ADC4 = aECLDsp.getDspA()[4];
183 m_ADC5 = aECLDsp.getDspA()[5];
184 m_ADC6 = aECLDsp.getDspA()[6];
185 m_ADC7 = aECLDsp.getDspA()[7];
186 m_ADC8 = aECLDsp.getDspA()[8];
187 m_ADC9 = aECLDsp.getDspA()[9];
188 m_ADC10 = aECLDsp.getDspA()[10];
189 m_ADC11 = aECLDsp.getDspA()[11];
190 m_ADC12 = aECLDsp.getDspA()[12];
191 m_ADC13 = aECLDsp.getDspA()[13];
192 m_ADC14 = aECLDsp.getDspA()[14];
193 m_ADC15 = aECLDsp.getDspA()[15];
194 m_ADC16 = aECLDsp.getDspA()[16];
195 m_ADC17 = aECLDsp.getDspA()[17];
196 m_ADC18 = aECLDsp.getDspA()[18];
197 m_ADC19 = aECLDsp.getDspA()[19];
198 m_ADC20 = aECLDsp.getDspA()[20];
199 m_ADC21 = aECLDsp.getDspA()[21];
200 m_ADC22 = aECLDsp.getDspA()[22];
201 m_ADC23 = aECLDsp.getDspA()[23];
202 m_ADC24 = aECLDsp.getDspA()[24];
203 m_ADC25 = aECLDsp.getDspA()[25];
204 m_ADC26 = aECLDsp.getDspA()[26];
205 m_ADC27 = aECLDsp.getDspA()[27];
206 m_ADC28 = aECLDsp.getDspA()[28];
207 m_ADC29 = aECLDsp.getDspA()[29];
208 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.