ATLAS Offline Software
Public Types | Public Member Functions | Private Attributes | List of all members
ZDCDataAnalyzer Class Reference

#include <ZDCDataAnalyzer.h>

Collaboration diagram for ZDCDataAnalyzer:

Public Types

typedef std::array< std::array< float, 4 >, 2 > ZDCModuleFloatArray
 
typedef std::array< std::array< bool, 4 >, 2 > ZDCModuleBoolArray
 
typedef std::array< std::array< int, 4 >, 2 > ZDCModuleIntArray
 

Public Member Functions

 ZDCDataAnalyzer (ZDCMsg::MessageFunctionPtr messageFunc_p, int nSample, float deltaTSample, size_t preSampleIdx, std::string fitFunction, const ZDCModuleIntArray &peak2ndDerivMinSamples, const ZDCModuleFloatArray &peak2ndDerivMinThresholdsHG, const ZDCModuleFloatArray &peak2ndDerivMinThresholdsLG, unsigned int LGMode=ZDCPulseAnalyzer::LGModeNormal)
 
 ~ZDCDataAnalyzer ()
 
void enableDelayed (float deltaT, const ZDCModuleFloatArray &undelayedDelayedPedestalDiff)
 
void enableDelayed (const ZDCModuleFloatArray &delayDeltaT, const ZDCModuleFloatArray &undelayedDelayedPedestalDiff)
 
void enableRepass (const ZDCModuleFloatArray &peak2ndDerivMinRepassHG, const ZDCModuleFloatArray &peak2ndDerivMinRepassLG)
 
void enablePreExclusion (unsigned int maxSamplesExcl, const ZDCModuleIntArray &HGADCThresh, const ZDCModuleIntArray &LGADCThresh)
 
void enablePreExclusion (unsigned int maxSamplesExcl, unsigned int HGADCThresh, unsigned int LGADCThresh)
 
void enablePostExclusion (unsigned int maxSamplesExcl, const ZDCModuleIntArray &HGADCThresh, const ZDCModuleIntArray &LGADCThresh)
 
void enablePostExclusion (unsigned int maxSamplesExcl, unsigned int HGADCThresh, unsigned int LGADCThresh)
 
bool ModuleDisabled (unsigned int side, unsigned int module) const
 
unsigned int GetModuleMask () const
 
float GetModuleSum (size_t side) const
 
float GetModuleSumErr (size_t side) const
 
float GetSideBkgdFrac (size_t side) const
 
float GetCalibModuleSum (size_t side) const
 
float GetCalibModuleSumErr (size_t side) const
 
float GetSideCalibBkgdFrac (size_t side) const
 
void DoNLcalibModuleSum ()
 
float GetNLcalibModuleSum (size_t side) const
 
float GetNLcalibModuleSumErr (size_t side) const
 
float GetModuleSumPreSample (size_t side) const
 
float GetAverageTime (size_t side) const
 
bool SideFailed (size_t side) const
 
float GetModuleAmplitude (size_t side, size_t module) const
 
float GetModuleTime (size_t side, size_t module) const
 
float GetModuleChisq (size_t side, size_t module) const
 
float GetModuleCalibAmplitude (size_t side, size_t module) const
 
float GetModuleCalibTime (size_t side, size_t module) const
 
float GetModuleStatus (size_t side, size_t module) const
 
float GetdelayedBS (size_t side, size_t module) const
 
const ZDCPulseAnalyzerGetPulseAnalyzer (size_t side, size_t module) const
 
bool disableModule (size_t side, size_t module)
 
void set2ndDerivStep (size_t step)
 
void SetGainFactorsHGLG (float gainFactorHG, float gainFactorLG)
 
void SetGainFactorsHGLG (const ZDCModuleFloatArray &gainFactorsHG, const ZDCModuleFloatArray &gainFactorsLG)
 
void SetPeak2ndDerivMinTolerances (size_t tolerance)
 
void SetFitTimeMax (float tmax)
 
void SetSaveFitFunc (bool save)
 
void SetADCOverUnderflowValues (const ZDCModuleFloatArray &HGOverflowADC, const ZDCModuleFloatArray &HGUnderflowADC, const ZDCModuleFloatArray &LGOverflowADC)
 
void SetNoiseSigmas (const ZDCModuleFloatArray &noiseSigmasHG, const ZDCModuleFloatArray &noiseSigmasLG)
 
void SetTauT0Values (const ZDCModuleBoolArray &fxiTau1, const ZDCModuleBoolArray &fxiTau2, const ZDCModuleFloatArray &tau1, const ZDCModuleFloatArray &tau2, const ZDCModuleFloatArray &t0HG, const ZDCModuleFloatArray &t0LG)
 
void SetFitMinMaxAmpValues (const ZDCModuleFloatArray &minAmpHG, const ZDCModuleFloatArray &minAmpLG, const ZDCModuleFloatArray &maxAmpHG, const ZDCModuleFloatArray &maxAmpLG)
 
void SetFitMinMaxAmpValues (float minHG, float minLG, float maxHG, float maxLG)
 
void SetCutValues (const ZDCModuleFloatArray &chisqDivAmpCutHG, const ZDCModuleFloatArray &chisqDivAmpCutLG, const ZDCModuleFloatArray &deltaT0MinHG, const ZDCModuleFloatArray &deltaT0MaxHG, const ZDCModuleFloatArray &deltaT0MinLG, const ZDCModuleFloatArray &deltaT0MaxLG)
 
void SetTimingCorrParams (ZDCPulseAnalyzer::TimingCorrMode mode, float refADC, float refScale, const std::array< std::array< std::vector< float >, 4 >, 2 > &HGParamArr, const std::array< std::array< std::vector< float >, 4 >, 2 > &LGParamArr)
 
void SetNonlinCorrParams (float refADC, float refScale, const std::array< std::array< std::vector< float >, 4 >, 2 > &HGNonlinCorrParams, const std::array< std::array< std::vector< float >, 4 >, 2 > &LHGNonlinCorrParams)
 
void SetNLcalibParams (std::array< std::array< std::array< float, 6 >, 3 >, 2 > &nlcalibParams)
 
void SetModuleAmpFractionLG (const ZDCDataAnalyzer::ZDCModuleFloatArray &moduleAmpFractionLG)
 
void enableTimeSigCut (bool AND, float sigCut, const std::string &TF1String, const std::array< std::array< std::vector< double >, 4 >, 2 > &parsHGArr, const std::array< std::array< std::vector< double >, 4 >, 2 > &parsLGArr)
 
void enableFADCCorrections (bool correctPerSample, std::array< std::array< std::unique_ptr< const TH1 >, 4 >, 2 > &correHistHG, std::array< std::array< std::unique_ptr< const TH1 >, 4 >, 2 > &correHistLG)
 
void disableFADCCorrections ()
 
void LoadEnergyCalibrations (std::array< std::array< std::unique_ptr< TSpline >, 4 >, 2 > &calibSplines)
 
void LoadT0Calibrations (std::array< std::array< std::unique_ptr< TSpline >, 4 >, 2 > &T0HGOffsetSplines, std::array< std::array< std::unique_ptr< TSpline >, 4 >, 2 > &T0LGOffsetSplines)
 
void StartEvent (int lumiBlock)
 
void LoadAndAnalyzeData (size_t side, size_t module, const std::vector< float > &HGSamples, const std::vector< float > &LGSamples)
 
void LoadAndAnalyzeData (size_t side, size_t module, const std::vector< float > &HGSamples, const std::vector< float > &LGSamples, const std::vector< float > &HGSamplesDelayed, const std::vector< float > &LGSamplesDelayed)
 
bool FinishEvent ()
 

Private Attributes

ZDCMsg::MessageFunctionPtr m_msgFunc_p
 
size_t m_nSample {}
 
float m_deltaTSample {}
 
size_t m_preSampleIdx {}
 
std::string m_fitFunction
 
unsigned int m_LGMode {}
 
bool m_repassEnabled {}
 
std::array< std::array< int, 4 >, 2 > m_delayedOrder {}
 
ZDCModuleBoolArray m_moduleDisabled {}
 
std::array< std::array< std::unique_ptr< ZDCPulseAnalyzer >, 4 >, 2 > m_moduleAnalyzers {}
 
int m_eventCount {}
 
ZDCModuleFloatArray m_HGGains {}
 
ZDCModuleFloatArray m_pedestals {}
 
bool m_haveECalib {}
 
std::array< std::array< std::unique_ptr< TSpline >, 4 >, 2 > m_LBDepEcalibSplines {}
 
bool m_haveT0Calib {}
 
std::array< std::array< std::unique_ptr< TSpline >, 4 >, 2 > m_T0HGOffsetSplines {}
 
std::array< std::array< std::unique_ptr< TSpline >, 4 >, 2 > m_T0LGOffsetSplines {}
 
int m_currentLB {}
 
ZDCModuleFloatArray m_currentECalibCoeff {}
 
ZDCModuleFloatArray m_currentT0OffsetsHG {}
 
ZDCModuleFloatArray m_currentT0OffsetsLG {}
 
std::array< std::array< bool, 4 >, 2 > m_dataLoaded {}
 
unsigned int m_moduleMask
 
std::array< std::array< unsigned int, 4 >, 2 > m_moduleStatus {}
 
std::array< std::array< float, 4 >, 2 > m_calibAmplitude {}
 
std::array< std::array< float, 4 >, 2 > m_calibTime {}
 
std::array< float, 2 > m_moduleSum {}
 
std::array< float, 2 > m_moduleSumErrSq {}
 
std::array< float, 2 > m_moduleSumPreSample {}
 
std::array< float, 2 > m_moduleSumBkgdFrac {}
 
std::array< float, 2 > m_calibModuleSum {}
 
std::array< float, 2 > m_calibModuleSumErrSq {}
 
std::array< float, 2 > m_calibModSumBkgdFrac {}
 
bool m_haveNLcalib {}
 
std::array< std::array< std::array< float, 6 >, 3 >, 2 > m_NLcalibFactors {}
 
std::array< float, 2 > m_NLcalibModuleSum {}
 
std::array< float, 2 > m_NLcalibModuleSumErrSq {}
 
std::array< float, 2 > m_NLcalibModSumBkgdFrac {}
 
std::array< float, 2 > m_averageTime {}
 
std::array< bool, 2 > m_fail {}
 
std::array< std::array< float, 4 >, 2 > m_moduleAmpFractionLG {}
 

Detailed Description

Definition at line 19 of file ZDCDataAnalyzer.h.

Member Typedef Documentation

◆ ZDCModuleBoolArray

typedef std::array<std::array<bool, 4>, 2> ZDCDataAnalyzer::ZDCModuleBoolArray

Definition at line 23 of file ZDCDataAnalyzer.h.

◆ ZDCModuleFloatArray

typedef std::array<std::array<float, 4>, 2> ZDCDataAnalyzer::ZDCModuleFloatArray

Definition at line 22 of file ZDCDataAnalyzer.h.

◆ ZDCModuleIntArray

typedef std::array<std::array<int, 4>, 2> ZDCDataAnalyzer::ZDCModuleIntArray

Definition at line 24 of file ZDCDataAnalyzer.h.

Constructor & Destructor Documentation

◆ ZDCDataAnalyzer()

ZDCDataAnalyzer::ZDCDataAnalyzer ( ZDCMsg::MessageFunctionPtr  messageFunc_p,
int  nSample,
float  deltaTSample,
size_t  preSampleIdx,
std::string  fitFunction,
const ZDCModuleIntArray peak2ndDerivMinSamples,
const ZDCModuleFloatArray peak2ndDerivMinThresholdsHG,
const ZDCModuleFloatArray peak2ndDerivMinThresholdsLG,
unsigned int  LGMode = ZDCPulseAnalyzer::LGModeNormal 
)

Definition at line 14 of file ZDCDataAnalyzer.cxx.

18  :
19  m_msgFunc_p(msgFunc_p),
20  m_nSample(nSample), m_deltaTSample(deltaTSample), m_preSampleIdx(preSampleIdx),
21  m_fitFunction(std::move(fitFunction)),
22  m_LGMode(LGMode),
23  m_repassEnabled(false),
24  m_eventCount(0),
25  m_haveECalib(false),
26  m_haveT0Calib(false),
27  m_currentLB(-1),
28 
29  // Default "calibrations"
30  m_currentECalibCoeff ({{{{1, 1, 1, 1}}, {{1, 1, 1, 1}}}}),
31  m_currentT0OffsetsHG ({{{{0, 0, 0, 0}}, {{0, 0, 0, 0}}}}),
32  m_currentT0OffsetsLG ({{{{0, 0, 0, 0}}, {{0, 0, 0, 0}}}}),
33 
34  m_moduleMask(0),
35  m_moduleSum({{0, 0}}),
36  m_moduleSumErrSq({{0, 0}}),
37  m_moduleSumPreSample({{0, 0}}),
38  m_calibModuleSum({{0, 0}}),
39  m_calibModuleSumErrSq({{0, 0}}),
40  m_haveNLcalib(false),
42  {{ {{0,0,0,0,0,0}},{{0,0,0,0,0,0}},{{0,0,0,0,0,0}} }},
43  {{ {{0,0,0,0,0,0}},{{0,0,0,0,0,0}},{{0,0,0,0,0,0}} }} }}),
44  m_NLcalibModuleSum({{0, 0}}),
45  m_NLcalibModuleSumErrSq({{0, 0}}),
46  m_averageTime({{0, 0}}),
47  m_fail({{false, false}})
48 {
49  m_moduleDisabled[0] = {{false, false, false, false}};
50  m_moduleDisabled[1] = {{false, false, false, false}};
51 
52  m_moduleAnalyzers[0] = {{0, 0, 0, 0}};
53  m_moduleAnalyzers[1] = {{0, 0, 0, 0}};
54 
55  m_calibAmplitude[0] = {{0, 0, 0, 0}};
56  m_calibAmplitude[1] = {{0, 0, 0, 0}};
57 
58  m_calibTime[0] = {{0, 0, 0, 0}};
59  m_calibTime[1] = {{0, 0, 0, 0}};
60 
61  m_dataLoaded[0] = {{false, false, false, false}};
62  m_dataLoaded[1] = {{false, false, false, false}};
63 
64  m_delayedOrder[0] = {0, 0, 0, 0};
65  m_delayedOrder[1] = {0, 0, 0, 0};
66 
67  // For now we are using hard-coded gain factors and pedestals
68  //
69  m_HGGains[0] = {{10, 10, 10, 10}};
70  m_HGGains[1] = {{10, 10, 10, 10}};
71 
72  m_pedestals[0] = {{100, 100, 100, 100}};
73  m_pedestals[1] = {{100, 100, 100, 100}};
74 
75  // Construct the per-module pulse analyzers
76  //
77  for (size_t side : {0, 1}) {
78  for (size_t module : {0, 1, 2, 3}) {
79  std::ostringstream moduleTag;
80  moduleTag << "_s" << side << "_m" << module;
81 
84  peak2ndDerivMinSamples[side][module],
85  peak2ndDerivMinThresholdsHG[side][module],
86  peak2ndDerivMinThresholdsLG[side][module]));
87  m_moduleAnalyzers[side][module]->setLGMode(m_LGMode);
88  }
89  }
90 }

◆ ~ZDCDataAnalyzer()

ZDCDataAnalyzer::~ZDCDataAnalyzer ( )

Definition at line 92 of file ZDCDataAnalyzer.cxx.

93 {
94 }

Member Function Documentation

◆ disableFADCCorrections()

void ZDCDataAnalyzer::disableFADCCorrections ( )

Definition at line 361 of file ZDCDataAnalyzer.cxx.

362 {
363  for (size_t side : {0, 1}) {
364  for (size_t module : {0, 1, 2, 3}) {
365  m_moduleAnalyzers[side][module]->disableFADCCorrections();
366  }
367  }
368 }

◆ disableModule()

bool ZDCDataAnalyzer::disableModule ( size_t  side,
size_t  module 
)

Definition at line 96 of file ZDCDataAnalyzer.cxx.

97 {
98  if (side < 2 && module < 4) {
99  //
100  // Can't disable in the middle of analysis
101  //
102  if (m_dataLoaded[side][module]) return false;
103  else {
104  m_moduleDisabled[side][module] = true;
105  return true;
106  }
107  }
108  else {
109  return false;
110  }
111 }

◆ DoNLcalibModuleSum()

void ZDCDataAnalyzer::DoNLcalibModuleSum ( )

Definition at line 641 of file ZDCDataAnalyzer.cxx.

642 {
643  if (!m_haveNLcalib) return;
644 
645  for (int iside:{0,1})
646  {
647  if (m_calibModuleSum[iside]>0.)
648  {
649  float fEM = m_calibAmplitude[iside][0] / m_calibModuleSum[iside];
650  float fHad1 = m_calibAmplitude[iside][1] / m_calibModuleSum[iside];
651  float fHad2 = m_calibAmplitude[iside][2] / m_calibModuleSum[iside];
652 
653  float EMCorrFact = 0;
654 
655  for (size_t i=0;i<m_NLcalibFactors[iside][0].size()-1;i++)
656  {
657  EMCorrFact += std::pow(fEM - m_NLcalibFactors[iside][0][0],i)*m_NLcalibFactors[iside][0][i+1];
658  }
659 
660  float Had1CorrFact = 0;
661  for (size_t i=0;i<m_NLcalibFactors[iside][1].size()-1;i++)
662  {
663  Had1CorrFact += std::pow(fHad1 - m_NLcalibFactors[iside][1][0],i)*m_NLcalibFactors[iside][1][i+1];
664  }
665 
666  float Had2CorrFact = 0;
667  for (size_t i=0;i<m_NLcalibFactors[iside][2].size()-1;i++)
668  {
669  Had2CorrFact += std::pow(fHad2 - m_NLcalibFactors[iside][2][0],i)*m_NLcalibFactors[iside][2][i+1];
670  }
671 
672  float ECorrEM = m_calibModuleSum[iside]/EMCorrFact;
673  float ECorrEMHad1 = ECorrEM/Had1CorrFact;
674  float ECorrEMHad1Had2 = ECorrEMHad1/Had2CorrFact;
675 
676 
677  m_NLcalibModuleSum[iside] = ECorrEMHad1Had2;
678  m_NLcalibModuleSumErrSq[iside] = 0.; // no error for now
679  }
680  else
681  {
682  m_NLcalibModuleSum[iside] = 0.;
683  m_NLcalibModuleSumErrSq[iside] = 0.; // no error for now
684  }
685  }
686 
687 }

◆ enableDelayed() [1/2]

void ZDCDataAnalyzer::enableDelayed ( const ZDCModuleFloatArray delayDeltaT,
const ZDCModuleFloatArray undelayedDelayedPedestalDiff 
)

Definition at line 124 of file ZDCDataAnalyzer.cxx.

125 {
126  for (size_t side : {0, 1}) {
127  for (size_t module : {0, 1, 2, 3}) {
128  if (delayDeltaTArray[side][module] < 0) m_delayedOrder[side][module] = -1;
129  else m_delayedOrder[side][module] = 1;
130 
131  (*m_msgFunc_p)(ZDCMsg::Verbose, "Enabling use of delayed samples on side, module = " + std::to_string(side) + ", " +
132  std::to_string(module) + ", delta t = " + std::to_string(delayDeltaTArray[side][module]));
133 
134  m_moduleAnalyzers[side][module]->enableDelayed(std::abs(delayDeltaTArray[side][module]), undelayedDelayedPedestalDiff[side][module]);
135  }
136  }
137 }

◆ enableDelayed() [2/2]

void ZDCDataAnalyzer::enableDelayed ( float  deltaT,
const ZDCModuleFloatArray undelayedDelayedPedestalDiff 
)

Definition at line 113 of file ZDCDataAnalyzer.cxx.

114 {
115  int delayedOrder = deltaT < 0 ? -1 : 1;
116  for (size_t side : {0, 1}) {
117  for (size_t module : {0, 1, 2, 3}) {
118  m_delayedOrder[side][module] = delayedOrder;
119  m_moduleAnalyzers[side][module]->enableDelayed(std::abs(deltaT), undelayedDelayedPedestalDiff[side][module]);
120  }
121  }
122 }

◆ enableFADCCorrections()

void ZDCDataAnalyzer::enableFADCCorrections ( bool  correctPerSample,
std::array< std::array< std::unique_ptr< const TH1 >, 4 >, 2 > &  correHistHG,
std::array< std::array< std::unique_ptr< const TH1 >, 4 >, 2 > &  correHistLG 
)

Definition at line 350 of file ZDCDataAnalyzer.cxx.

353 {
354  for (size_t side : {0, 1}) {
355  for (size_t module : {0, 1, 2, 3}) {
356  m_moduleAnalyzers[side][module]->enableFADCCorrections(correctPerSample, corrHistHG[side][module], corrHistLG[side][module]);
357  }
358  }
359 }

◆ enablePostExclusion() [1/2]

void ZDCDataAnalyzer::enablePostExclusion ( unsigned int  maxSamplesExcl,
const ZDCModuleIntArray HGADCThresh,
const ZDCModuleIntArray LGADCThresh 
)

Definition at line 157 of file ZDCDataAnalyzer.cxx.

158 {
159  for (size_t side : {0, 1}) {
160  for (size_t module : {0, 1, 2, 3}) {
161  m_moduleAnalyzers[side][module]->enablePostExclusion(maxSamplesExcl, HGADCThresh[side][module], LGADCThresh[side][module]);
162  }
163  }
164 }

◆ enablePostExclusion() [2/2]

void ZDCDataAnalyzer::enablePostExclusion ( unsigned int  maxSamplesExcl,
unsigned int  HGADCThresh,
unsigned int  LGADCThresh 
)

Definition at line 166 of file ZDCDataAnalyzer.cxx.

167 {
168  for (size_t side : {0, 1}) {
169  for (size_t module : {0, 1, 2, 3}) {
170  m_moduleAnalyzers[side][module]->enablePostExclusion(maxSamplesExcl, HGADCThresh, LGADCThresh);
171  }
172  }
173 }

◆ enablePreExclusion() [1/2]

void ZDCDataAnalyzer::enablePreExclusion ( unsigned int  maxSamplesExcl,
const ZDCModuleIntArray HGADCThresh,
const ZDCModuleIntArray LGADCThresh 
)

Definition at line 139 of file ZDCDataAnalyzer.cxx.

140 {
141  for (size_t side : {0, 1}) {
142  for (size_t module : {0, 1, 2, 3}) {
143  m_moduleAnalyzers[side][module]->enablePreExclusion(maxSamplesExcl, HGADCThresh[side][module], LGADCThresh[side][module]);
144  }
145  }
146 }

◆ enablePreExclusion() [2/2]

void ZDCDataAnalyzer::enablePreExclusion ( unsigned int  maxSamplesExcl,
unsigned int  HGADCThresh,
unsigned int  LGADCThresh 
)

Definition at line 148 of file ZDCDataAnalyzer.cxx.

149 {
150  for (size_t side : {0, 1}) {
151  for (size_t module : {0, 1, 2, 3}) {
152  m_moduleAnalyzers[side][module]->enablePreExclusion(maxSamplesExcl, HGADCThresh, LGADCThresh);
153  }
154  }
155 }

◆ enableRepass()

void ZDCDataAnalyzer::enableRepass ( const ZDCModuleFloatArray peak2ndDerivMinRepassHG,
const ZDCModuleFloatArray peak2ndDerivMinRepassLG 
)

Definition at line 176 of file ZDCDataAnalyzer.cxx.

177 {
178  m_repassEnabled = true;
179  for (size_t side : {0, 1}) {
180  for (size_t module : {0, 1, 2, 3}) {
181  m_moduleAnalyzers[side][module]->enableRepass(peak2ndDerivMinRepassHG[side][module], peak2ndDerivMinRepassLG[side][module]);
182  }
183  }
184 }

◆ enableTimeSigCut()

void ZDCDataAnalyzer::enableTimeSigCut ( bool  AND,
float  sigCut,
const std::string &  TF1String,
const std::array< std::array< std::vector< double >, 4 >, 2 > &  parsHGArr,
const std::array< std::array< std::vector< double >, 4 >, 2 > &  parsLGArr 
)

Definition at line 370 of file ZDCDataAnalyzer.cxx.

373 {
374  for (size_t side : {0, 1}) {
375  for (size_t module : {0, 1, 2, 3}) {
376  m_moduleAnalyzers[side][module]->enableTimeSigCut(AND, sigCut, TF1String, parsHGArr[side][module], parsLGArr[side][module]);
377  }
378  }
379 }

◆ FinishEvent()

bool ZDCDataAnalyzer::FinishEvent ( )

Definition at line 536 of file ZDCDataAnalyzer.cxx.

537 {
538  // First make sure that all data is loaded. while we're at it, count how many modules on each side have a pulse
539  //
540  unsigned int sideNPulsesMod[2] = {0, 0};
541 
542  for (size_t side : {0, 1}) {
543  for (size_t module : {0, 1, 2, 3}) {
544  if (!m_dataLoaded[side][module] && !m_moduleDisabled[side][module]) {return false;}
545  if (m_moduleAnalyzers[side][module]->ArmSumInclude()) {sideNPulsesMod[side]++;}
546  }
547  }
548 
549  // Are we doing a repass? If so, reanalyze modules for which no pulse was found the first time
550  // as long as we have one module with a pulse on the given side
551  //
552  if (m_repassEnabled) {
553  for (size_t side : {0, 1}) {
554  if (sideNPulsesMod[side] == 0) continue;
555 
556  for (size_t module : {0, 1, 2, 3}) {
557  if (m_moduleDisabled[side][module]) continue;
558 
559  ZDCPulseAnalyzer* pulseAna_p = m_moduleAnalyzers[side][module].get();
560 
561  // If this module had no pulse the first time, reanalyze it (with a lower 2nd derivative threshold)
562  //
563  if (!pulseAna_p->HavePulse()) {
564  (*m_msgFunc_p)(ZDCMsg::Debug, ("ZDCPulseAnalyzer:: performing a repass on data for side, module = " + std::to_string(side) + ", " + std::to_string(module)));
565  pulseAna_p->ReanalyzeData();
566  m_moduleStatus[side][module] = pulseAna_p->GetStatusMask();
567  }
568  }
569  }
570  }
571 
572  // Now sum up amplitudes etc
573  //
574  for (size_t side : {0, 1}) {
575  float tempFraction = 1.0;
576  double sumAmpTimesBkgdFrac = 0.0;
577  double sumCalibAmpTimesBkgdFrac = 0.0;
578 
579  for (size_t module : {0, 1, 2, 3}) {
580  ZDCPulseAnalyzer* pulseAna_p = m_moduleAnalyzers[side][module].get();
581 
582  if (pulseAna_p->ArmSumInclude()) {
583  int moduleMaskBit = 4 * side + module;
584  m_moduleMask |= 1 << moduleMaskBit;
585 
586  float amplitude = pulseAna_p->GetAmplitude();
587  float ampError = pulseAna_p->GetAmpError();
588  float bkgdFraction = pulseAna_p->GetBkgdMaxFraction();
589 
591 
592  float calibAmpError = ampError * m_currentECalibCoeff[side][module];
593 
594  float timeCalib = pulseAna_p->GetT0Corr();
595  if (pulseAna_p->UseLowGain()) {timeCalib -= m_currentT0OffsetsLG[side][module];}
596  else {timeCalib -= m_currentT0OffsetsHG[side][module];}
597 
598  m_calibTime[side][module] = timeCalib;
599 
600  m_moduleSum[side] += amplitude;
601  m_moduleSumErrSq[side] += ampError * ampError;
602  sumAmpTimesBkgdFrac += amplitude*bkgdFraction;
603 
604  m_moduleSumPreSample[side] += pulseAna_p->GetPreSampleAmp();
605 
607  m_calibModuleSumErrSq[side] += calibAmpError * calibAmpError;
608 
610  sumCalibAmpTimesBkgdFrac += amplitude*bkgdFraction;
611  }
612 
613  // subtract the fraction of LGOverflow events if we have fraction available (<0 means unavailable)
614  if (pulseAna_p->LGOverflow() && m_moduleAmpFractionLG[side][module] > 0) {tempFraction -= m_moduleAmpFractionLG[side][module];}
615  }
616 
617  {
619  if (m_moduleSum[side] > 0) m_moduleSumBkgdFrac[side] = sumAmpTimesBkgdFrac/m_moduleSum[side];
620  else m_moduleSumBkgdFrac[side] = 0;
621  }
622 
623  if (m_calibModuleSum[side] > 1e-6) {
625  m_calibModSumBkgdFrac[side] = sumCalibAmpTimesBkgdFrac/m_calibModuleSum[side];
626  }
627  else {
628  m_averageTime[side] = 0;
630  }
631 
632  if (tempFraction < 1.0) {m_moduleSum[side] /= tempFraction;}
633  }
634 
636 
637  m_eventCount++;
638  return true;
639 }

◆ GetAverageTime()

float ZDCDataAnalyzer::GetAverageTime ( size_t  side) const
inline

Definition at line 130 of file ZDCDataAnalyzer.h.

130 {return m_averageTime.at(side);}

◆ GetCalibModuleSum()

float ZDCDataAnalyzer::GetCalibModuleSum ( size_t  side) const
inline

Definition at line 120 of file ZDCDataAnalyzer.h.

120 {return m_calibModuleSum.at(side);}

◆ GetCalibModuleSumErr()

float ZDCDataAnalyzer::GetCalibModuleSumErr ( size_t  side) const
inline

Definition at line 121 of file ZDCDataAnalyzer.h.

121 {return std::sqrt(m_calibModuleSumErrSq.at(side));}

◆ GetdelayedBS()

float ZDCDataAnalyzer::GetdelayedBS ( size_t  side,
size_t  module 
) const
inline

Definition at line 141 of file ZDCDataAnalyzer.h.

141 {return m_moduleAnalyzers.at(side).at(module)->GetdelayBS();}

◆ GetModuleAmplitude()

float ZDCDataAnalyzer::GetModuleAmplitude ( size_t  side,
size_t  module 
) const
inline

Definition at line 133 of file ZDCDataAnalyzer.h.

133 {return m_moduleAnalyzers.at(side).at(module)->GetAmplitude();}

◆ GetModuleCalibAmplitude()

float ZDCDataAnalyzer::GetModuleCalibAmplitude ( size_t  side,
size_t  module 
) const
inline

Definition at line 137 of file ZDCDataAnalyzer.h.

137 {return m_calibAmplitude.at(side).at(module);}

◆ GetModuleCalibTime()

float ZDCDataAnalyzer::GetModuleCalibTime ( size_t  side,
size_t  module 
) const
inline

Definition at line 138 of file ZDCDataAnalyzer.h.

138 {return m_calibTime.at(side).at(module);}

◆ GetModuleChisq()

float ZDCDataAnalyzer::GetModuleChisq ( size_t  side,
size_t  module 
) const
inline

Definition at line 135 of file ZDCDataAnalyzer.h.

135 {return m_moduleAnalyzers.at(side).at(module)->GetChisq();}

◆ GetModuleMask()

unsigned int ZDCDataAnalyzer::GetModuleMask ( ) const
inline

Definition at line 114 of file ZDCDataAnalyzer.h.

114 {return m_moduleMask;}

◆ GetModuleStatus()

float ZDCDataAnalyzer::GetModuleStatus ( size_t  side,
size_t  module 
) const
inline

Definition at line 139 of file ZDCDataAnalyzer.h.

139 {return m_moduleStatus.at(side).at(module);}

◆ GetModuleSum()

float ZDCDataAnalyzer::GetModuleSum ( size_t  side) const
inline

Definition at line 116 of file ZDCDataAnalyzer.h.

116 {return m_moduleSum.at(side);}

◆ GetModuleSumErr()

float ZDCDataAnalyzer::GetModuleSumErr ( size_t  side) const
inline

Definition at line 117 of file ZDCDataAnalyzer.h.

117 {return std::sqrt(m_moduleSumErrSq.at(side));}

◆ GetModuleSumPreSample()

float ZDCDataAnalyzer::GetModuleSumPreSample ( size_t  side) const
inline

Definition at line 128 of file ZDCDataAnalyzer.h.

128 {return m_moduleSumPreSample.at(side);}

◆ GetModuleTime()

float ZDCDataAnalyzer::GetModuleTime ( size_t  side,
size_t  module 
) const
inline

Definition at line 134 of file ZDCDataAnalyzer.h.

134 {return m_moduleAnalyzers.at(side).at(module)->GetT0Corr();}

◆ GetNLcalibModuleSum()

float ZDCDataAnalyzer::GetNLcalibModuleSum ( size_t  side) const
inline

Definition at line 125 of file ZDCDataAnalyzer.h.

125 {return m_NLcalibModuleSum.at(side);}

◆ GetNLcalibModuleSumErr()

float ZDCDataAnalyzer::GetNLcalibModuleSumErr ( size_t  side) const
inline

Definition at line 126 of file ZDCDataAnalyzer.h.

126 {return std::sqrt(m_NLcalibModuleSumErrSq.at(side));}

◆ GetPulseAnalyzer()

const ZDCPulseAnalyzer* ZDCDataAnalyzer::GetPulseAnalyzer ( size_t  side,
size_t  module 
) const
inline

Definition at line 143 of file ZDCDataAnalyzer.h.

143 {return m_moduleAnalyzers.at(side).at(module).get();}

◆ GetSideBkgdFrac()

float ZDCDataAnalyzer::GetSideBkgdFrac ( size_t  side) const
inline

Definition at line 118 of file ZDCDataAnalyzer.h.

118 {return m_moduleSumBkgdFrac.at(side);}

◆ GetSideCalibBkgdFrac()

float ZDCDataAnalyzer::GetSideCalibBkgdFrac ( size_t  side) const
inline

Definition at line 122 of file ZDCDataAnalyzer.h.

122 {return m_calibModSumBkgdFrac.at(side);}

◆ LoadAndAnalyzeData() [1/2]

void ZDCDataAnalyzer::LoadAndAnalyzeData ( size_t  side,
size_t  module,
const std::vector< float > &  HGSamples,
const std::vector< float > &  LGSamples 
)

Definition at line 474 of file ZDCDataAnalyzer.cxx.

475 {
476 
477  // We immediately return if this module is disabled
478  //
479  if (m_moduleDisabled[side][module]) {
480  (*m_msgFunc_p)(ZDCMsg::Verbose, ("Skipping analysis of disabled module for event index " + std::to_string(m_eventCount) + ", side, module = " + std::to_string(side) + ", " + std::to_string(module)));
481 
482  return;
483  }
484 
485  (*m_msgFunc_p)(ZDCMsg::Verbose, ("/n Loading data for event index " + std::to_string(m_eventCount) + ", side, module = " + std::to_string(side) + ", " + std::to_string(module)));
486 
487  ZDCPulseAnalyzer* pulseAna_p = m_moduleAnalyzers[side][module].get();
488  pulseAna_p->LoadAndAnalyzeData(HGSamples, LGSamples);
489  m_dataLoaded[side][module] = true;
490 
491  if (pulseAna_p->Failed()) {
492  (*m_msgFunc_p)(ZDCMsg::Debug, ("ZDCPulseAnalyzer::LoadData() returned fail for event " + std::to_string(m_eventCount) + ", side, module = " + std::to_string(side) + ", " + std::to_string(module)));
493 
494  m_fail[side] = true;
495  }
496 
497  m_moduleStatus[side][module] = pulseAna_p->GetStatusMask();
498 }

◆ LoadAndAnalyzeData() [2/2]

void ZDCDataAnalyzer::LoadAndAnalyzeData ( size_t  side,
size_t  module,
const std::vector< float > &  HGSamples,
const std::vector< float > &  LGSamples,
const std::vector< float > &  HGSamplesDelayed,
const std::vector< float > &  LGSamplesDelayed 
)

Definition at line 500 of file ZDCDataAnalyzer.cxx.

502 {
503  // We immediately return if this module is disabled
504  //
505  if (m_moduleDisabled[side][module]) {
506  (*m_msgFunc_p)(ZDCMsg::Debug, ("Skipping analysis of disabled mofule for event index " + std::to_string(m_eventCount) + ", side, module = " + std::to_string(side) + ", " + std::to_string(module)));
507 
508  return;
509  }
510 
511  if (m_delayedOrder[side][module] == 0) {
512  (*m_msgFunc_p)(ZDCMsg::Error, ("Handling of delayed pulses not enabled, on side, module = " + std::to_string(side) + ", " + std::to_string(module) + ", skipping processing for event index " + std::to_string(m_eventCount)));
513  return;
514  }
515 
516  (*m_msgFunc_p)(ZDCMsg::Verbose, ("Loading undelayed and delayed data for event index " + std::to_string(m_eventCount) + ", side, module = " + std::to_string(side) + ", " + std::to_string(module)));
517 
518  ZDCPulseAnalyzer* pulseAna_p = m_moduleAnalyzers[side][module].get();
519  if (m_delayedOrder[side][module] > 0) {
520  pulseAna_p->LoadAndAnalyzeData(HGSamples, LGSamples, HGSamplesDelayed, LGSamplesDelayed);
521  }
522  else {
523  pulseAna_p->LoadAndAnalyzeData(HGSamplesDelayed, LGSamplesDelayed, HGSamples, LGSamples);
524  }
525  m_dataLoaded[side][module] = true;
526 
527  if (pulseAna_p->Failed()) {
528  (*m_msgFunc_p)(ZDCMsg::Debug, ("ZDCPulseAnalyzer::LoadData() returned fail for event " + std::to_string(m_eventCount) + ", side, module = " + std::to_string(side) + ", " + std::to_string(module)));
529 
530  m_fail[side] = true;
531  }
532 
533  m_moduleStatus[side][module] = pulseAna_p->GetStatusMask();
534 }

◆ LoadEnergyCalibrations()

void ZDCDataAnalyzer::LoadEnergyCalibrations ( std::array< std::array< std::unique_ptr< TSpline >, 4 >, 2 > &  calibSplines)
inline

Definition at line 201 of file ZDCDataAnalyzer.h.

202  {
203  (*m_msgFunc_p)(ZDCMsg::Verbose, "Loading energy calibrations");
204 
205  m_LBDepEcalibSplines = std::move (calibSplines);
206  m_haveECalib = true;
207  }

◆ LoadT0Calibrations()

void ZDCDataAnalyzer::LoadT0Calibrations ( std::array< std::array< std::unique_ptr< TSpline >, 4 >, 2 > &  T0HGOffsetSplines,
std::array< std::array< std::unique_ptr< TSpline >, 4 >, 2 > &  T0LGOffsetSplines 
)
inline

Definition at line 209 of file ZDCDataAnalyzer.h.

211  {
212  (*m_msgFunc_p)(ZDCMsg::Verbose, "Loading timing calibrations");
213 
214  m_T0HGOffsetSplines = std::move (T0HGOffsetSplines);
215  m_T0LGOffsetSplines = std::move (T0LGOffsetSplines);
216 
217  m_haveT0Calib = true;
218  }

◆ ModuleDisabled()

bool ZDCDataAnalyzer::ModuleDisabled ( unsigned int  side,
unsigned int  module 
) const
inline

Definition at line 112 of file ZDCDataAnalyzer.h.

112 {return m_moduleDisabled[side][module];}

◆ set2ndDerivStep()

void ZDCDataAnalyzer::set2ndDerivStep ( size_t  step)

Definition at line 186 of file ZDCDataAnalyzer.cxx.

187 {
188  for (size_t side : {0, 1}) {
189  for (size_t module : {0, 1, 2, 3}) {
190  m_moduleAnalyzers[side][module]->set2ndDerivStep(step);
191  }
192  }
193 }

◆ SetADCOverUnderflowValues()

void ZDCDataAnalyzer::SetADCOverUnderflowValues ( const ZDCModuleFloatArray HGOverflowADC,
const ZDCModuleFloatArray HGUnderflowADC,
const ZDCModuleFloatArray LGOverflowADC 
)

Definition at line 286 of file ZDCDataAnalyzer.cxx.

288 {
289  for (size_t side : {0, 1}) {
290  for (size_t module : {0, 1, 2, 3}) {
291  m_moduleAnalyzers[side][module]->SetADCOverUnderflowValues(HGOverflowADC[side][module], HGUnderflowADC[side][module], LGOverflowADC[side][module]);
292  }
293  }
294 }

◆ SetCutValues()

void ZDCDataAnalyzer::SetCutValues ( const ZDCModuleFloatArray chisqDivAmpCutHG,
const ZDCModuleFloatArray chisqDivAmpCutLG,
const ZDCModuleFloatArray deltaT0MinHG,
const ZDCModuleFloatArray deltaT0MaxHG,
const ZDCModuleFloatArray deltaT0MinLG,
const ZDCModuleFloatArray deltaT0MaxLG 
)

Definition at line 296 of file ZDCDataAnalyzer.cxx.

299 {
300  for (size_t side : {0, 1}) {
301  for (size_t module : {0, 1, 2, 3}) {
302  m_moduleAnalyzers[side][module]->SetCutValues(chisqDivAmpCutHG[side][module], chisqDivAmpCutLG[side][module],
303  deltaT0MinHG[side][module], deltaT0MaxHG[side][module],
304  deltaT0MinLG[side][module], deltaT0MaxLG[side][module]);
305  }
306  }
307 }

◆ SetFitMinMaxAmpValues() [1/2]

void ZDCDataAnalyzer::SetFitMinMaxAmpValues ( const ZDCModuleFloatArray minAmpHG,
const ZDCModuleFloatArray minAmpLG,
const ZDCModuleFloatArray maxAmpHG,
const ZDCModuleFloatArray maxAmpLG 
)

Definition at line 265 of file ZDCDataAnalyzer.cxx.

267 {
268  for (size_t side : {0, 1}) {
269  for (size_t module : {0, 1, 2, 3}) {
270  m_moduleAnalyzers[side][module]->SetFitMinMaxAmp(minAmpHG[side][module], minAmpLG[side][module],
271  maxAmpHG[side][module], maxAmpLG[side][module]);
272 
273  }
274  }
275 }

◆ SetFitMinMaxAmpValues() [2/2]

void ZDCDataAnalyzer::SetFitMinMaxAmpValues ( float  minHG,
float  minLG,
float  maxHG,
float  maxLG 
)

Definition at line 277 of file ZDCDataAnalyzer.cxx.

278 {
279  for (size_t side : {0, 1}) {
280  for (size_t module : {0, 1, 2, 3}) {
281  m_moduleAnalyzers[side][module]->SetFitMinMaxAmp(minHG, minLG, maxHG, maxLG);
282  }
283  }
284 }

◆ SetFitTimeMax()

void ZDCDataAnalyzer::SetFitTimeMax ( float  tmax)

Definition at line 222 of file ZDCDataAnalyzer.cxx.

222  {
223  for (size_t side : {0, 1}) {
224  for (size_t module : {0, 1, 2, 3}) {
225  m_moduleAnalyzers[side][module]->SetFitTimeMax(tmax);
226  }
227  }
228 }

◆ SetGainFactorsHGLG() [1/2]

void ZDCDataAnalyzer::SetGainFactorsHGLG ( const ZDCModuleFloatArray gainFactorsHG,
const ZDCModuleFloatArray gainFactorsLG 
)

Definition at line 204 of file ZDCDataAnalyzer.cxx.

205 {
206  for (size_t side : {0, 1}) {
207  for (size_t module : {0, 1, 2, 3}) {
208  m_moduleAnalyzers[side][module]->SetGainFactorsHGLG(gainFactorsHG[side][module], gainFactorsLG[side][module]);
209  }
210  }
211 }

◆ SetGainFactorsHGLG() [2/2]

void ZDCDataAnalyzer::SetGainFactorsHGLG ( float  gainFactorHG,
float  gainFactorLG 
)

Definition at line 195 of file ZDCDataAnalyzer.cxx.

196 {
197  for (size_t side : {0, 1}) {
198  for (size_t module : {0, 1, 2, 3}) {
199  m_moduleAnalyzers[side][module]->SetGainFactorsHGLG(gainFactorHG, gainFactorLG);
200  }
201  }
202 }

◆ SetModuleAmpFractionLG()

void ZDCDataAnalyzer::SetModuleAmpFractionLG ( const ZDCDataAnalyzer::ZDCModuleFloatArray moduleAmpFractionLG)

Definition at line 257 of file ZDCDataAnalyzer.cxx.

257  {
258  for (size_t side : {0, 1}) {
259  for (size_t module : {0, 1, 2, 3}) {
260  m_moduleAmpFractionLG[side][module] = moduleAmpFractionLG[side][module];
261  }
262  }
263 }

◆ SetNLcalibParams()

void ZDCDataAnalyzer::SetNLcalibParams ( std::array< std::array< std::array< float, 6 >, 3 >, 2 > &  nlcalibParams)

Definition at line 335 of file ZDCDataAnalyzer.cxx.

336 {
337  for (size_t side: {0,1})
338  {
339  for (size_t module: {0,1,2})
340  {
341  for (size_t val: {0,1,2,3,4,5})
342  {
343  m_NLcalibFactors[side][module][val] = nlcalibParams[side][module][val];
344  }
345  }
346  }
347  m_haveNLcalib = true;
348 }

◆ SetNoiseSigmas()

void ZDCDataAnalyzer::SetNoiseSigmas ( const ZDCModuleFloatArray noiseSigmasHG,
const ZDCModuleFloatArray noiseSigmasLG 
)

Definition at line 248 of file ZDCDataAnalyzer.cxx.

249 {
250  for (size_t side : {0, 1}) {
251  for (size_t module : {0, 1, 2, 3}) {
252  m_moduleAnalyzers[side][module]->SetNoiseSigmas(noiseSigmasHG[side][module], noiseSigmasLG[side][module]);
253  }
254  }
255 }

◆ SetNonlinCorrParams()

void ZDCDataAnalyzer::SetNonlinCorrParams ( float  refADC,
float  refScale,
const std::array< std::array< std::vector< float >, 4 >, 2 > &  HGNonlinCorrParams,
const std::array< std::array< std::vector< float >, 4 >, 2 > &  LHGNonlinCorrParams 
)

Definition at line 322 of file ZDCDataAnalyzer.cxx.

325 {
326  for (size_t side : {0, 1}) {
327  for (size_t module : {0, 1, 2, 3}) {
328  m_moduleAnalyzers[side][module]->SetNonlinCorrParams(refADC, refScale,
329  HGNonlinCorrParams[side][module],
330  LGNonlinCorrParams[side][module]);
331  }
332  }
333 }

◆ SetPeak2ndDerivMinTolerances()

void ZDCDataAnalyzer::SetPeak2ndDerivMinTolerances ( size_t  tolerance)

Definition at line 213 of file ZDCDataAnalyzer.cxx.

213  {
214  for (size_t side : {0, 1}) {
215  for (size_t module : {0, 1, 2, 3}) {
216  m_moduleAnalyzers[side][module]->SetPeak2ndDerivMinTolerance(tolerance);
217  }
218  }
219 }

◆ SetSaveFitFunc()

void ZDCDataAnalyzer::SetSaveFitFunc ( bool  save)

Definition at line 231 of file ZDCDataAnalyzer.cxx.

231  {
233 }

◆ SetTauT0Values()

void ZDCDataAnalyzer::SetTauT0Values ( const ZDCModuleBoolArray fxiTau1,
const ZDCModuleBoolArray fxiTau2,
const ZDCModuleFloatArray tau1,
const ZDCModuleFloatArray tau2,
const ZDCModuleFloatArray t0HG,
const ZDCModuleFloatArray t0LG 
)

Definition at line 236 of file ZDCDataAnalyzer.cxx.

239 {
240  for (size_t side : {0, 1}) {
241  for (size_t module : {0, 1, 2, 3}) {
242  m_moduleAnalyzers[side][module]->SetTauT0Values(fixTau1[side][module], fixTau2[side][module],
243  tau1[side][module], tau2[side][module], t0HG[side][module], t0LG[side][module]);
244  }
245  }
246 }

◆ SetTimingCorrParams()

void ZDCDataAnalyzer::SetTimingCorrParams ( ZDCPulseAnalyzer::TimingCorrMode  mode,
float  refADC,
float  refScale,
const std::array< std::array< std::vector< float >, 4 >, 2 > &  HGParamArr,
const std::array< std::array< std::vector< float >, 4 >, 2 > &  LGParamArr 
)

Definition at line 309 of file ZDCDataAnalyzer.cxx.

312 {
313  for (size_t side : {0, 1}) {
314  for (size_t module : {0, 1, 2, 3}) {
315  m_moduleAnalyzers[side][module]->SetTimingCorrParams(mode, refADC, refScale,
316  HGParamArr.at(side).at(module), LGParamArr.at(side).at(module));
317  }
318  }
319 
320 }

◆ SideFailed()

bool ZDCDataAnalyzer::SideFailed ( size_t  side) const
inline

Definition at line 131 of file ZDCDataAnalyzer.h.

131 {return m_fail.at(side);}

◆ StartEvent()

void ZDCDataAnalyzer::StartEvent ( int  lumiBlock)

Definition at line 381 of file ZDCDataAnalyzer.cxx.

382 {
383  (*m_msgFunc_p)(ZDCMsg::Verbose, ("Starting new event, event index = " + std::to_string(m_eventCount)));
384 
385  // By default we perform quiet pulse fits
386  //
388  else {ZDCPulseAnalyzer::SetQuietFits(true);}
389 
390  // See if we have to load up new calibrations
391  //
392  if (lumiBlock != m_currentLB) {
393  (*m_msgFunc_p)(ZDCMsg::Verbose, ("Starting new luminosity block " + std::to_string(lumiBlock)));
394 
395  if (m_haveECalib) {
396  (*m_msgFunc_p)(ZDCMsg::Verbose, ("Loading energy calibrations for event " + std::to_string(m_eventCount) + ", lumi block " +
398 
399  for (size_t side : {0, 1}) {
400  for (size_t module : {0, 1, 2, 3}) {
401  float splineLBMin = m_LBDepEcalibSplines[side][module]->GetXmin();
402  float splineLBMax = m_LBDepEcalibSplines[side][module]->GetXmax();
403 
404  if (lumiBlock >= splineLBMin && lumiBlock <= splineLBMax) {
406  }
407  else if (lumiBlock < splineLBMin) {
409  }
410  else {
412  }
413  }
414  }
415  } // end of if (_haveEcalib) {
416 
417  if (m_haveT0Calib) {
418  (*m_msgFunc_p)(ZDCMsg::Verbose, ("Loading timing calibrations for event " + std::to_string(m_eventCount) + ", lumi block " + std::to_string(lumiBlock)));
419 
420  for (size_t side : {0, 1}) {
421  for (size_t module : {0, 1, 2, 3}) {
422  float splineLBMin = m_T0HGOffsetSplines[side][module]->GetXmin();
423  float splineLBMax = m_T0HGOffsetSplines[side][module]->GetXmax();
424 
425  if (lumiBlock >= splineLBMin && lumiBlock <= splineLBMax) {
428  }
429  else if (lumiBlock < splineLBMin) {
432  }
433  else {
436  }
437  }
438  }
439  } // end of if (m_haveT0Calib)
440  }
441 
442  // Initialize transient results
443  //
444  for (size_t side : {0, 1}) {
445  for (size_t module : {0, 1, 2, 3}) {
446  m_dataLoaded[side][module] = false;
447  m_moduleStatus[side][module] = 0;
449  m_calibTime[side][module] = 0;
450  // _moduleFail[side][module] = false;
451  }
452 
453  m_moduleSum[side] = 0;
454  m_moduleSumErrSq[side] = 0;
457 
458  m_calibModuleSum[side] = 0;
461 
465 
466  m_averageTime[side] = 0;
467  m_fail[side] = false;
468  }
469 
470  m_moduleMask = 0;
472 }

Member Data Documentation

◆ m_averageTime

std::array<float, 2> ZDCDataAnalyzer::m_averageTime {}
private

Definition at line 85 of file ZDCDataAnalyzer.h.

◆ m_calibAmplitude

std::array<std::array<float, 4>, 2> ZDCDataAnalyzer::m_calibAmplitude {}
private

Definition at line 66 of file ZDCDataAnalyzer.h.

◆ m_calibModSumBkgdFrac

std::array<float, 2> ZDCDataAnalyzer::m_calibModSumBkgdFrac {}
private

Definition at line 76 of file ZDCDataAnalyzer.h.

◆ m_calibModuleSum

std::array<float, 2> ZDCDataAnalyzer::m_calibModuleSum {}
private

Definition at line 74 of file ZDCDataAnalyzer.h.

◆ m_calibModuleSumErrSq

std::array<float, 2> ZDCDataAnalyzer::m_calibModuleSumErrSq {}
private

Definition at line 75 of file ZDCDataAnalyzer.h.

◆ m_calibTime

std::array<std::array<float, 4>, 2> ZDCDataAnalyzer::m_calibTime {}
private

Definition at line 67 of file ZDCDataAnalyzer.h.

◆ m_currentECalibCoeff

ZDCModuleFloatArray ZDCDataAnalyzer::m_currentECalibCoeff {}
private

Definition at line 56 of file ZDCDataAnalyzer.h.

◆ m_currentLB

int ZDCDataAnalyzer::m_currentLB {}
private

Definition at line 55 of file ZDCDataAnalyzer.h.

◆ m_currentT0OffsetsHG

ZDCModuleFloatArray ZDCDataAnalyzer::m_currentT0OffsetsHG {}
private

Definition at line 57 of file ZDCDataAnalyzer.h.

◆ m_currentT0OffsetsLG

ZDCModuleFloatArray ZDCDataAnalyzer::m_currentT0OffsetsLG {}
private

Definition at line 58 of file ZDCDataAnalyzer.h.

◆ m_dataLoaded

std::array<std::array<bool, 4>, 2> ZDCDataAnalyzer::m_dataLoaded {}
private

Definition at line 60 of file ZDCDataAnalyzer.h.

◆ m_delayedOrder

std::array<std::array<int, 4>, 2> ZDCDataAnalyzer::m_delayedOrder {}
private

Definition at line 36 of file ZDCDataAnalyzer.h.

◆ m_deltaTSample

float ZDCDataAnalyzer::m_deltaTSample {}
private

Definition at line 29 of file ZDCDataAnalyzer.h.

◆ m_eventCount

int ZDCDataAnalyzer::m_eventCount {}
private

Definition at line 41 of file ZDCDataAnalyzer.h.

◆ m_fail

std::array<bool, 2> ZDCDataAnalyzer::m_fail {}
private

Definition at line 86 of file ZDCDataAnalyzer.h.

◆ m_fitFunction

std::string ZDCDataAnalyzer::m_fitFunction
private

Definition at line 31 of file ZDCDataAnalyzer.h.

◆ m_haveECalib

bool ZDCDataAnalyzer::m_haveECalib {}
private

Definition at line 46 of file ZDCDataAnalyzer.h.

◆ m_haveNLcalib

bool ZDCDataAnalyzer::m_haveNLcalib {}
private

Definition at line 78 of file ZDCDataAnalyzer.h.

◆ m_haveT0Calib

bool ZDCDataAnalyzer::m_haveT0Calib {}
private

Definition at line 49 of file ZDCDataAnalyzer.h.

◆ m_HGGains

ZDCModuleFloatArray ZDCDataAnalyzer::m_HGGains {}
private

Definition at line 43 of file ZDCDataAnalyzer.h.

◆ m_LBDepEcalibSplines

std::array<std::array<std::unique_ptr<TSpline>, 4>, 2> ZDCDataAnalyzer::m_LBDepEcalibSplines {}
private

Definition at line 47 of file ZDCDataAnalyzer.h.

◆ m_LGMode

unsigned int ZDCDataAnalyzer::m_LGMode {}
private

Definition at line 32 of file ZDCDataAnalyzer.h.

◆ m_moduleAmpFractionLG

std::array<std::array<float, 4>, 2> ZDCDataAnalyzer::m_moduleAmpFractionLG {}
private

Definition at line 88 of file ZDCDataAnalyzer.h.

◆ m_moduleAnalyzers

std::array<std::array<std::unique_ptr<ZDCPulseAnalyzer>, 4>, 2> ZDCDataAnalyzer::m_moduleAnalyzers {}
private

Definition at line 39 of file ZDCDataAnalyzer.h.

◆ m_moduleDisabled

ZDCModuleBoolArray ZDCDataAnalyzer::m_moduleDisabled {}
private

Definition at line 38 of file ZDCDataAnalyzer.h.

◆ m_moduleMask

unsigned int ZDCDataAnalyzer::m_moduleMask
private

Definition at line 63 of file ZDCDataAnalyzer.h.

◆ m_moduleStatus

std::array<std::array<unsigned int, 4>, 2> ZDCDataAnalyzer::m_moduleStatus {}
private

Definition at line 65 of file ZDCDataAnalyzer.h.

◆ m_moduleSum

std::array<float, 2> ZDCDataAnalyzer::m_moduleSum {}
private

Definition at line 69 of file ZDCDataAnalyzer.h.

◆ m_moduleSumBkgdFrac

std::array<float, 2> ZDCDataAnalyzer::m_moduleSumBkgdFrac {}
private

Definition at line 72 of file ZDCDataAnalyzer.h.

◆ m_moduleSumErrSq

std::array<float, 2> ZDCDataAnalyzer::m_moduleSumErrSq {}
private

Definition at line 70 of file ZDCDataAnalyzer.h.

◆ m_moduleSumPreSample

std::array<float, 2> ZDCDataAnalyzer::m_moduleSumPreSample {}
private

Definition at line 71 of file ZDCDataAnalyzer.h.

◆ m_msgFunc_p

ZDCMsg::MessageFunctionPtr ZDCDataAnalyzer::m_msgFunc_p
private

Definition at line 27 of file ZDCDataAnalyzer.h.

◆ m_NLcalibFactors

std::array< std::array< std::array<float,6>, 3>, 2> ZDCDataAnalyzer::m_NLcalibFactors {}
private

Definition at line 79 of file ZDCDataAnalyzer.h.

◆ m_NLcalibModSumBkgdFrac

std::array<float, 2> ZDCDataAnalyzer::m_NLcalibModSumBkgdFrac {}
private

Definition at line 83 of file ZDCDataAnalyzer.h.

◆ m_NLcalibModuleSum

std::array<float, 2> ZDCDataAnalyzer::m_NLcalibModuleSum {}
private

Definition at line 81 of file ZDCDataAnalyzer.h.

◆ m_NLcalibModuleSumErrSq

std::array<float, 2> ZDCDataAnalyzer::m_NLcalibModuleSumErrSq {}
private

Definition at line 82 of file ZDCDataAnalyzer.h.

◆ m_nSample

size_t ZDCDataAnalyzer::m_nSample {}
private

Definition at line 28 of file ZDCDataAnalyzer.h.

◆ m_pedestals

ZDCModuleFloatArray ZDCDataAnalyzer::m_pedestals {}
private

Definition at line 44 of file ZDCDataAnalyzer.h.

◆ m_preSampleIdx

size_t ZDCDataAnalyzer::m_preSampleIdx {}
private

Definition at line 30 of file ZDCDataAnalyzer.h.

◆ m_repassEnabled

bool ZDCDataAnalyzer::m_repassEnabled {}
private

Definition at line 34 of file ZDCDataAnalyzer.h.

◆ m_T0HGOffsetSplines

std::array<std::array<std::unique_ptr<TSpline>, 4>, 2> ZDCDataAnalyzer::m_T0HGOffsetSplines {}
private

Definition at line 50 of file ZDCDataAnalyzer.h.

◆ m_T0LGOffsetSplines

std::array<std::array<std::unique_ptr<TSpline>, 4>, 2> ZDCDataAnalyzer::m_T0LGOffsetSplines {}
private

Definition at line 51 of file ZDCDataAnalyzer.h.


The documentation for this class was generated from the following files:
ZDCDataAnalyzer::m_T0LGOffsetSplines
std::array< std::array< std::unique_ptr< TSpline >, 4 >, 2 > m_T0LGOffsetSplines
Definition: ZDCDataAnalyzer.h:51
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
ZDCDataAnalyzer::m_calibAmplitude
std::array< std::array< float, 4 >, 2 > m_calibAmplitude
Definition: ZDCDataAnalyzer.h:66
ZDCDataAnalyzer::m_dataLoaded
std::array< std::array< bool, 4 >, 2 > m_dataLoaded
Definition: ZDCDataAnalyzer.h:60
CXXUTILS_TRAPPING_FP
#define CXXUTILS_TRAPPING_FP
Definition: trapping_fp.h:24
ZDCPulseAnalyzer::UseLowGain
bool UseLowGain() const
Definition: ZDCPulseAnalyzer.h:553
ZDCDataAnalyzer::m_moduleMask
unsigned int m_moduleMask
Definition: ZDCDataAnalyzer.h:63
ZDCPulseAnalyzer::ArmSumInclude
bool ArmSumInclude() const
Definition: ZDCPulseAnalyzer.h:573
ZDCPulseAnalyzer::ReanalyzeData
bool ReanalyzeData()
Definition: ZDCPulseAnalyzer.cxx:730
ZDCPulseAnalyzer::Failed
bool Failed() const
Definition: ZDCPulseAnalyzer.h:554
ZDCDataAnalyzer::m_moduleAnalyzers
std::array< std::array< std::unique_ptr< ZDCPulseAnalyzer >, 4 >, 2 > m_moduleAnalyzers
Definition: ZDCDataAnalyzer.h:39
ZDCPulseAnalyzer::GetAmpError
float GetAmpError() const
Definition: ZDCPulseAnalyzer.h:598
ZDCPulseAnalyzer::LGOverflow
bool LGOverflow() const
Definition: ZDCPulseAnalyzer.h:559
ZDCPulseAnalyzer::GetStatusMask
unsigned int GetStatusMask() const
Definition: ZDCPulseAnalyzer.cxx:2017
ZDCDataAnalyzer::m_repassEnabled
bool m_repassEnabled
Definition: ZDCDataAnalyzer.h:34
ZDCPulseAnalyzer::HavePulse
bool HavePulse() const
Definition: ZDCPulseAnalyzer.h:552
ZDCDataAnalyzer::m_moduleSum
std::array< float, 2 > m_moduleSum
Definition: ZDCDataAnalyzer.h:69
ZDCDataAnalyzer::m_T0HGOffsetSplines
std::array< std::array< std::unique_ptr< TSpline >, 4 >, 2 > m_T0HGOffsetSplines
Definition: ZDCDataAnalyzer.h:50
Root::AND
@ AND
Definition: TGRLCollection.h:32
ZDCPulseAnalyzer
Definition: ZDCPulseAnalyzer.h:22
ZDCPulseAnalyzer::GetAmplitude
float GetAmplitude() const
Definition: ZDCPulseAnalyzer.h:597
ZDCDataAnalyzer::m_NLcalibModuleSum
std::array< float, 2 > m_NLcalibModuleSum
Definition: ZDCDataAnalyzer.h:81
ZDCDataAnalyzer::m_haveNLcalib
bool m_haveNLcalib
Definition: ZDCDataAnalyzer.h:78
ZDCDataAnalyzer::m_msgFunc_p
ZDCMsg::MessageFunctionPtr m_msgFunc_p
Definition: ZDCDataAnalyzer.h:27
ZDCPulseAnalyzer::SetQuietFits
static void SetQuietFits(bool quiet)
Definition: ZDCPulseAnalyzer.h:443
ZDCPulseAnalyzer::GetT0Corr
float GetT0Corr() const
Definition: ZDCPulseAnalyzer.h:584
TRT::Hit::side
@ side
Definition: HitInfo.h:83
ZDCPulseAnalyzer::LoadAndAnalyzeData
bool LoadAndAnalyzeData(const std::vector< float > &ADCSamplesHG, const std::vector< float > &ADCSamplesLG)
Definition: ZDCPulseAnalyzer.cxx:653
ZDCDataAnalyzer::m_calibTime
std::array< std::array< float, 4 >, 2 > m_calibTime
Definition: ZDCDataAnalyzer.h:67
python.PyAthena.module
module
Definition: PyAthena.py:131
ZDCDataAnalyzer::m_haveECalib
bool m_haveECalib
Definition: ZDCDataAnalyzer.h:46
ZDCMsg::Verbose
@ Verbose
Definition: ZDCMsg.h:18
ZDCDataAnalyzer::m_eventCount
int m_eventCount
Definition: ZDCDataAnalyzer.h:41
checkTP.save
def save(self, fileName="./columbo.out")
Definition: checkTP.py:176
ZDCDataAnalyzer::m_moduleSumBkgdFrac
std::array< float, 2 > m_moduleSumBkgdFrac
Definition: ZDCDataAnalyzer.h:72
ZDCDataAnalyzer::m_haveT0Calib
bool m_haveT0Calib
Definition: ZDCDataAnalyzer.h:49
ZDCDataAnalyzer::m_fail
std::array< bool, 2 > m_fail
Definition: ZDCDataAnalyzer.h:86
ZDCDataAnalyzer::m_calibModuleSumErrSq
std::array< float, 2 > m_calibModuleSumErrSq
Definition: ZDCDataAnalyzer.h:75
ZDCDataAnalyzer::m_averageTime
std::array< float, 2 > m_averageTime
Definition: ZDCDataAnalyzer.h:85
lumiFormat.i
int i
Definition: lumiFormat.py:85
ZDCDataAnalyzer::m_pedestals
ZDCModuleFloatArray m_pedestals
Definition: ZDCDataAnalyzer.h:44
ZDCDataAnalyzer::m_nSample
size_t m_nSample
Definition: ZDCDataAnalyzer.h:28
ZDCDataAnalyzer::m_fitFunction
std::string m_fitFunction
Definition: ZDCDataAnalyzer.h:31
ZDCDataAnalyzer::m_currentLB
int m_currentLB
Definition: ZDCDataAnalyzer.h:55
ZDCDataAnalyzer::m_moduleSumPreSample
std::array< float, 2 > m_moduleSumPreSample
Definition: ZDCDataAnalyzer.h:71
ZDCPulseAnalyzer::SetSaveFitFunc
static void SetSaveFitFunc(bool save)
Definition: ZDCPulseAnalyzer.h:444
Preparation.mode
mode
Definition: Preparation.py:107
ZDCDataAnalyzer::m_LGMode
unsigned int m_LGMode
Definition: ZDCDataAnalyzer.h:32
ZDCDataAnalyzer::m_calibModuleSum
std::array< float, 2 > m_calibModuleSum
Definition: ZDCDataAnalyzer.h:74
ZDCDataAnalyzer::m_NLcalibFactors
std::array< std::array< std::array< float, 6 >, 3 >, 2 > m_NLcalibFactors
Definition: ZDCDataAnalyzer.h:79
ZDCDataAnalyzer::m_calibModSumBkgdFrac
std::array< float, 2 > m_calibModSumBkgdFrac
Definition: ZDCDataAnalyzer.h:76
ZDCMsg::Error
@ Error
Definition: ZDCMsg.h:22
tolerance
Definition: suep_shower.h:17
ZDCDataAnalyzer::m_NLcalibModSumBkgdFrac
std::array< float, 2 > m_NLcalibModSumBkgdFrac
Definition: ZDCDataAnalyzer.h:83
ZDCDataAnalyzer::m_preSampleIdx
size_t m_preSampleIdx
Definition: ZDCDataAnalyzer.h:30
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
ZDCDataAnalyzer::m_moduleSumErrSq
std::array< float, 2 > m_moduleSumErrSq
Definition: ZDCDataAnalyzer.h:70
ZDCDataAnalyzer::m_currentT0OffsetsHG
ZDCModuleFloatArray m_currentT0OffsetsHG
Definition: ZDCDataAnalyzer.h:57
ZDCDataAnalyzer::m_moduleStatus
std::array< std::array< unsigned int, 4 >, 2 > m_moduleStatus
Definition: ZDCDataAnalyzer.h:65
ZDCDataAnalyzer::DoNLcalibModuleSum
void DoNLcalibModuleSum()
Definition: ZDCDataAnalyzer.cxx:641
ZDCPulseAnalyzer::GetBkgdMaxFraction
float GetBkgdMaxFraction() const
Definition: ZDCPulseAnalyzer.h:676
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
ZDCDataAnalyzer::m_currentECalibCoeff
ZDCModuleFloatArray m_currentECalibCoeff
Definition: ZDCDataAnalyzer.h:56
ZDCDataAnalyzer::m_NLcalibModuleSumErrSq
std::array< float, 2 > m_NLcalibModuleSumErrSq
Definition: ZDCDataAnalyzer.h:82
ZDCDataAnalyzer::m_currentT0OffsetsLG
ZDCModuleFloatArray m_currentT0OffsetsLG
Definition: ZDCDataAnalyzer.h:58
ZDCDataAnalyzer::m_LBDepEcalibSplines
std::array< std::array< std::unique_ptr< TSpline >, 4 >, 2 > m_LBDepEcalibSplines
Definition: ZDCDataAnalyzer.h:47
LArCellBinning.step
step
Definition: LArCellBinning.py:158
ZDCMsg::Debug
@ Debug
Definition: ZDCMsg.h:19
ZDCDataAnalyzer::m_moduleDisabled
ZDCModuleBoolArray m_moduleDisabled
Definition: ZDCDataAnalyzer.h:38
ZDCDataAnalyzer::m_HGGains
ZDCModuleFloatArray m_HGGains
Definition: ZDCDataAnalyzer.h:43
xAOD::lumiBlock
setTeId lumiBlock
Definition: L2StandAloneMuon_v1.cxx:328
pow
constexpr int pow(int base, int exp) noexcept
Definition: ap_fixedTest.cxx:15
ZDCDataAnalyzer::m_moduleAmpFractionLG
std::array< std::array< float, 4 >, 2 > m_moduleAmpFractionLG
Definition: ZDCDataAnalyzer.h:88
ZDCDataAnalyzer::m_delayedOrder
std::array< std::array< int, 4 >, 2 > m_delayedOrder
Definition: ZDCDataAnalyzer.h:36
ZDCPulseAnalyzer::GetPreSampleAmp
float GetPreSampleAmp() const
Definition: ZDCPulseAnalyzer.h:675
ZDCDataAnalyzer::m_deltaTSample
float m_deltaTSample
Definition: ZDCDataAnalyzer.h:29