10 #include <ecl/modules/eclAutocovarianceCalibrationC2Collector/eclAutocovarianceCalibrationC2Collector.h>
13 #include <framework/dataobjects/EventMetaData.h>
16 #include <ecl/dataobjects/ECLDsp.h>
17 #include <ecl/dbobjects/ECLCrystalCalib.h>
25 REG_MODULE(eclAutocovarianceCalibrationC2Collector);
32 m_ECLAutocovarianceCalibrationC1Threshold(
"ECLAutocovarianceCalibrationC1Threshold")
35 setDescription(
"Module to export histogram corresponding to sum of waveforms from random trigger events. Used to compute baseline");
45 m_BaselineVsCrysID =
new TH1D(
"m_BaselineVsCrysID",
"Baseline for each crystal;crystal ID;Baseline (ADC)",
48 m_CounterVsCrysID =
new TH1D(
"m_CounterVsCrysID",
"Baseline for each crystal;crystal ID;Baseline (ADC)",
58 B2INFO(
"eclAutocovarianceCalibrationC2Collector: Experiment = " <<
m_evtMetaData->getExperiment() <<
" run = " <<
66 const int NumDsp =
m_eclDsps.getEntries();
73 const int id = aECLDsp.getCellId() - 1;
78 float PeakToPeak = (float) aECLDsp.computePeaktoPeakAmp();
80 if (PeakToPeak < peakToPeakThreshold) {
94 B2INFO(i <<
" " << getObjectPtr<TH1>(
"m_BaselineVsCrysID")->GetBinContent(i + 1));
95 getObjectPtr<TH1D>(
"m_BaselineVsCrysID")->SetBinContent(i + 1,
m_sumOfSamples[i]);
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...
StoreArray< ECLDsp > m_eclDsps
Required input array of ECLDSPs.
double m_sumOfSamples[ECLElementNumbers::c_NCrystals]
sum of 31 samples for selected waveforms
void startRun() override
Load run-dep payloads.
int m_nSelectedWaveforms[ECLElementNumbers::c_NCrystals]
number of selected waveforms for each crystal
DBObjPtr< ECLCrystalCalib > m_ECLAutocovarianceCalibrationC1Threshold
peak to peak noise threshold computed from step C1
void collect() override
Select events and crystals and accumulate histograms.
StoreObjPtr< EventMetaData > m_evtMetaData
dataStore EventMetaData
std::vector< float > m_PeakToPeakThresholds
vector of thresholds obtained from DB object
TH1D * m_CounterVsCrysID
final histogram returned by collector contains counter
void closeRun() override
save histograms
const int m_numberofADCPoints
length of ECLDsp waveform
void prepare() override
Define histograms and read payloads from DB.
TH1D * m_BaselineVsCrysID
final histogram returned by collector contains baseline
#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.