10#include <ecl/modules/eclAutocovarianceCalibrationC4Collector/eclAutocovarianceCalibrationC4Collector.h>
13#include <TDecompChol.h>
16#include <framework/dataobjects/EventMetaData.h>
19#include <ecl/dataobjects/ECLDsp.h>
20#include <ecl/dbobjects/ECLCrystalCalib.h>
28REG_MODULE(eclAutocovarianceCalibrationC4Collector);
36 m_ECLAutocovarianceCalibrationC1Threshold(
"ECLAutocovarianceCalibrationC1Threshold"),
37 m_ECLAutocovarianceCalibrationC3Autocovariances(
"ECLAutoCovariance")
40 setDescription(
"Module to test covariance matrix calibrations using waveforms from delayed Bhabha events");
60 B2INFO(
"eclAutocovarianceCalibrationC4Collector: Experiment = " <<
m_evtMetaData->getExperiment() <<
" run = " <<
80 if (InvertStatus == 0) {
81 B2INFO(
"Invert Failed for " <<
id);
92 const int NumDsp =
m_eclDsps.getEntries();
99 const int id = aECLDsp.getCellId() - 1;
102 float PeakToPeak = (float) aECLDsp.computePeaktoPeakAmp();
114 double aconst = 0, bconst = 0, cconst = 0;
115 for (
int i = 0; i < 31; i++) {
116 double sum = 0, sumQ = 0;
117 for (
int j = 0; j < 31; j++) {
122 bconst += sum * waveform[i];
123 cconst += sumQ * waveform[i];
126 const double Bconst = bconst / aconst;
127 const double chi2val = ((aconst * Bconst - 2 * bconst) * Bconst + cconst);
140 getObjectPtr<TH2>(
"Chi2VsCrysID")->SetBinContent(i + 1, j + 1,
Chi2VsCrysID->GetBinContent(i + 1, j + 1));
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...
std::vector< TMatrixDSym > m_NoiseMatrix
Stores noise matrix derived from the input Autocovariances.
StoreArray< ECLDsp > m_eclDsps
Required input array of ECLDSPs.
void startRun() override
Load run-dep payloads.
int m_NbinsForChi2Histogram
Number of bins For Chi2 Histogram.
DBObjPtr< ECLCrystalCalib > m_ECLAutocovarianceCalibrationC1Threshold
thresholds obtained from C1 stage
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
void closeRun() override
Transfer fom array container to ROOT histogram.
void prepare() override
Define histograms and read payloads from DB.
eclAutocovarianceCalibrationC4CollectorModule()
Constructor.
DBObjPtr< ECLAutoCovariance > m_ECLAutocovarianceCalibrationC3Autocovariances
Autocovariances obtained from C3 stage.
static constexpr int m_numberofADCPoints
length of ECLDsp waveform
TH2F * Chi2VsCrysID
Store fit chi2 vs.
int m_upperThresholdForChi2Histogram
Upper Threshold For Chi2 Histogram.
#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.