5 #ifndef ZDCANALYSIS_ZDCDataAnalyzer_h
6 #define ZDCANALYSIS_ZDCDataAnalyzer_h
34 std::unique_ptr<ZDCJSONConfig> m_dataAnalyzerConfig{};
35 std::unique_ptr<ZDCJSONConfig> m_pulseAnalyzerConfig{};
37 bool m_repassEnabled{
false};
39 std::array<std::array<int, 4>, 2> m_delayedOrder{};
42 std::array<std::array<std::unique_ptr<ZDCPulseAnalyzer>, 4>, 2> m_moduleAnalyzers{};
49 bool m_haveECalib{
false};
50 bool m_haveT0Calib{
false};
51 std::array<std::array<std::unique_ptr<TSpline>, 4>, 2> m_LBDepEcalibSplines{};
52 std::array<std::array<std::unique_ptr<TSpline>, 4>, 2> m_T0HGOffsetSplines{};
53 std::array<std::array<std::unique_ptr<TSpline>, 4>, 2> m_T0LGOffsetSplines{};
62 std::array<std::array<bool, 4>, 2> m_dataLoaded{};
64 unsigned int m_moduleMask{0};
66 std::array<std::array<unsigned int, 4>, 2> m_moduleStatus{};
67 std::array<std::array<float, 4>, 2> m_calibAmplitude{};
68 std::array<std::array<float, 4>, 2> m_calibTime{};
70 std::array<float, 2> m_moduleSum{};
71 std::array<float, 2> m_moduleSumErrSq{};
72 std::array<float, 2> m_moduleSumPreSample{};
73 std::array<float, 2> m_moduleSumBkgdFrac{};
75 std::array<float, 2> m_calibModuleSum{};
76 std::array<float, 2> m_calibModuleSumErrSq{};
77 std::array<float, 2> m_calibModSumBkgdFrac{};
79 bool m_haveNLcalib{
false};
80 std::array< std::array< std::array<float,6>, 3>, 2> m_NLcalibFactors{};
82 std::array<float, 2> m_NLcalibModuleSum{};
83 std::array<float, 2> m_NLcalibModuleSumErrSq{};
84 std::array<float, 2> m_NLcalibModSumBkgdFrac{};
86 std::array<float, 2> m_averageTime{};
87 std::array<bool, 2> m_fail{};
89 std::array<std::array<float, 4>, 2> m_moduleAmpFractionLG{};
96 size_t preSampleIdx, std::string fitFunction,
97 const ZDCModuleIntArray& peak2ndDerivMinSamples,
98 const ZDCModuleFloatArray& peak2ndDerivMinThresholdsHG,
99 const ZDCModuleFloatArray& peak2ndDerivMinThresholdsLG,
107 if (m_pulseAnalyzerConfig.get())
return m_pulseAnalyzerConfig->getGlobalParam(
key,
value);
113 for (
size_t side : {0, 1}) {
114 for (
size_t module : {0, 1, 2, 3}) {
120 void enableDelayed(
float deltaT,
const ZDCModuleFloatArray& undelayedDelayedPedestalDiff);
121 void enableDelayed(
const ZDCModuleFloatArray& delayDeltaT,
const ZDCModuleFloatArray& undelayedDelayedPedestalDiff);
123 void enableRepass(
const ZDCModuleFloatArray& peak2ndDerivMinRepassHG,
const ZDCModuleFloatArray& peak2ndDerivMinRepassLG);
125 void enablePreExclusion(
unsigned int maxSamplesExcl,
const ZDCModuleIntArray& HGADCThresh,
const ZDCModuleIntArray& LGADCThresh);
126 void enablePreExclusion(
unsigned int maxSamplesExcl,
unsigned int HGADCThresh,
unsigned int LGADCThresh);
128 void enablePostExclusion(
unsigned int maxSamplesExcl,
const ZDCModuleIntArray& HGADCThresh,
const ZDCModuleIntArray& LGADCThresh);
129 void enablePostExclusion(
unsigned int maxSamplesExcl,
unsigned int HGADCThresh,
unsigned int LGADCThresh);
144 void DoNLcalibModuleSum();
166 bool disableModule(
size_t side,
size_t module);
168 void set2ndDerivStep(
size_t step);
170 void setMinimumSignificance(
float sigMinHG,
float sigMinLG);
172 void SetGainFactorsHGLG(
float gainFactorHG,
float gainFactorLG);
174 void SetGainFactorsHGLG(
const ZDCModuleFloatArray& gainFactorsHG,
const ZDCModuleFloatArray& gainFactorsLG);
176 void SetPeak2ndDerivMinTolerances(
size_t tolerance);
178 void SetFitTimeMax(
float tmax);
194 void SetFitMinMaxAmpValues(
float minHG,
float minLG,
float maxHG,
float maxLG);
205 void SetNonlinCorrParams(
float refADC,
float refScale,
214 void enableTimeSigCut(
bool AND,
float sigCut,
const std::string& TF1String,
218 void enableFADCCorrections(
bool correctPerSample,
222 void disableFADCCorrections();
228 m_LBDepEcalibSplines = std::move (calibSplines);
237 m_T0HGOffsetSplines = std::move (T0HGOffsetSplines);
238 m_T0LGOffsetSplines = std::move (T0LGOffsetSplines);
240 m_haveT0Calib =
true;
245 void LoadAndAnalyzeData(
size_t side,
size_t module,
const std::vector<float>& HGSamples,
const std::vector<float>& LGSamples);
247 void LoadAndAnalyzeData(
size_t side,
size_t module,
const std::vector<float>& HGSamples,
const std::vector<float>& LGSamples,
248 const std::vector<float>& HGSamplesDelayed,
const std::vector<float>& LGSamplesDelayed);