10 #include <ecl/modules/eclAutocovarianceCalibrationC1Collector/eclAutocovarianceCalibrationC1Collector.h>
13 #include <ecl/dataobjects/ECLDsp.h>
14 #include <ecl/dataobjects/ECLElementNumbers.h>
17 #include <framework/dataobjects/EventMetaData.h>
25 REG_MODULE(eclAutocovarianceCalibrationC1Collector);
31 eclAutocovarianceCalibrationC1CollectorModule::eclAutocovarianceCalibrationC1CollectorModule()
34 setDescription(
"Module to export histogram of noise level of ECL waveforms in delayed Bhabha events");
35 setPropertyFlags(c_ParallelProcessingCertified);
38 void eclAutocovarianceCalibrationC1CollectorModule::prepare()
43 PPVsCrysID =
new TH2F(
"PPVsCrysID",
"Peak to peak amplitude for each crystal;crystal ID;Peak to peak Amplitud (ADC)",
44 ECLElementNumbers::c_NCrystals, 0,
45 ECLElementNumbers::c_NCrystals, MaxPeaktoPeakValue, 0, MaxPeaktoPeakValue);
46 registerObject<TH2F>(
"PPVsCrysID", PPVsCrysID);
47 m_eclDsps.isRequired();
50 void eclAutocovarianceCalibrationC1CollectorModule::startRun()
53 B2INFO(
"eclAutocovarianceCalibrationC1Collector: Experiment = " << m_evtMetaData->getExperiment() <<
" run = " <<
54 m_evtMetaData->getRun());
57 void eclAutocovarianceCalibrationC1CollectorModule::collect()
61 const int NumDsp = m_eclDsps.getEntries();
64 if (NumDsp == ECLElementNumbers::c_NCrystals) {
66 for (
auto& aECLDsp : m_eclDsps) {
68 const int id = aECLDsp.getCellId() - 1;
71 float PeakToPeak = (float) aECLDsp.computePeaktoPeakAmp();
74 PPVsCrysID->Fill(
id, PeakToPeak);
80 void eclAutocovarianceCalibrationC1CollectorModule::closeRun()
82 for (
int i = 0; i < ECLElementNumbers::c_NCrystals; i++) {
83 for (
int j = 0; j < MaxPeaktoPeakValue; j++) {
84 getObjectPtr<TH2>(
"PPVsCrysID")->SetBinContent(i + 1, j + 1, PPVsCrysID->GetBinContent(i + 1, j + 1));
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.