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

#include <ZDCPulseAnalyzer.h>

Collaboration diagram for ZDCPulseAnalyzer:

Public Types

enum  {
  PulseBit = 0, LowGainBit = 1, FailBit = 2, HGOverflowBit = 3,
  HGUnderflowBit = 4, PSHGOverUnderflowBit = 5, LGOverflowBit = 6, LGUnderflowBit = 7,
  PrePulseBit = 8, PostPulseBit = 9, FitFailedBit = 10, BadChisqBit = 11,
  BadT0Bit = 12, ExcludeEarlyLGBit = 13, ExcludeLateLGBit = 14, preExpTailBit = 15,
  FitMinAmpBit = 16, RepassPulseBit = 17, ArmSumIncludeBit = 18
}
 
enum  TimingCorrMode { NoTimingCorr = 0, TimingCorrLin, TimingCorrLog }
 

Public Member Functions

 ZDCPulseAnalyzer (ZDCMsg::MessageFunctionPtr msgFunc_p, const std::string &tag, int Nsample, float deltaTSample, size_t preSampleIdx, int pedestal, float gainHG, const std::string &fitFunction, int peak2ndDerivMinSample, float peak2DerivMinThreshHG, float peak2DerivMinThreshLG)
 
 ~ZDCPulseAnalyzer ()
 
void enableDelayed (float deltaT, float pedestalShift, bool fixedBaseline=false)
 
void enableRepass (float peak2ndDerivMinRepassHG, float peak2ndDerivMinRepassLG)
 
void enableTimeSigCut (bool AND, float sigCut, std::string TF1String, const std::vector< double > &parsHG, const std::vector< double > &parsLG)
 
void enablePreExclusion (unsigned int maxSamplesExcl, unsigned int HGADCThresh, unsigned int LGADCThresh)
 
void enablePostExclusion (unsigned int maxSamplesExcl, unsigned int HGADCThresh, unsigned int LGADCThresh)
 
void SetPeak2ndDerivMinTolerance (size_t tolerance)
 
void SetForceLG (bool forceLG)
 
bool ForceLG () const
 
void set2ndDerivStep (size_t step)
 
void SetCutValues (float chisqDivAmpCutHG, float chisqDivAmpCutLG, float deltaT0MinHG, float deltaT0MaxHG, float deltaT0MinLG, float deltaT0MaxLG)
 
void SetNoiseSigmas (float noiseSigHG, float noiseSigLG)
 
void SetGainFactorsHGLG (float gainFactorHG, float gainFactorLG)
 
void SetFitMinMaxAmp (float minAmpHG, float minAmpLG, float maxAmpHG, float maxAmpLG)
 
void SetTauT0Values (bool fixTau1, bool fixTau2, float tau1, float tau2, float t0HG, float t0LG)
 
void SetADCOverUnderflowValues (int HGOverflowADC, int HGUnderflowADC, int LGOverflowADC)
 
void SetTimingCorrParams (TimingCorrMode mode, float refADC, float refScale, const std::vector< float > &HGT0CorrParams, const std::vector< float > &LGT0CorrParams)
 
void SetFitTimeMax (float tmax)
 
void SetNonlinCorrParams (float refADC, float refScale, const std::vector< float > &paramsHG, const std::vector< float > &paramsLG)
 
bool LoadAndAnalyzeData (const std::vector< float > &ADCSamplesHG, const std::vector< float > &ADCSamplesLG)
 
bool LoadAndAnalyzeData (const std::vector< float > &ADCSamplesHG, const std::vector< float > &ADCSamplesLG, const std::vector< float > &ADCSamplesHGDelayed, const std::vector< float > &ADCSamplesLGDelayed)
 
bool ReanalyzeData ()
 
bool HaveData () const
 
bool HavePulse () const
 
bool UseLowGain () const
 
bool Failed () const
 
bool HGOverflow () const
 
bool HGUnderflow () const
 
bool PSHGOverUnderflow () const
 
bool LGOverflow () const
 
bool LGUnderflow () const
 
bool PrePulse () const
 
bool PostPulse () const
 
bool FitFailed () const
 
bool BadChisq () const
 
bool BadT0 () const
 
bool ExcludeEarlyLG () const
 
bool ExcludeLateLG () const
 
bool preExpTail () const
 
bool fitMinimumAmplitude () const
 
bool repassPulse () const
 
bool ArmSumInclude () const
 
float GetFitAmplitude () const
 
float GetFitT0 () const
 
float GetT0Sub () const
 
float GetT0Corr () const
 
float getTimeSig () const
 
float GetChisq () const
 
float GetFitTau1 () const
 
float GetFitTau2 () const
 
float GetFitPreT0 () const
 
float GetFitPreAmp () const
 
float GetFitPostT0 () const
 
float GetFitPostAmp () const
 
float GetFitExpAmp () const
 
float GetAmpNoNonLin () const
 
float GetAmplitude () const
 
float GetAmpError () const
 
float GetPreExpAmp () const
 
float GetPresample () const
 
float GetMaxADC () const
 
float GetMinADC () const
 
int GetMaxADCSample () const
 
int GetMinADCSample () const
 
float GetMaxDelta () const
 
float GetMinDelta () const
 
float GetFitTMax () const
 
float GetFitTMin () const
 
float GetdelayBS () const
 
float GetMinDeriv2nd () const
 
float GetMinDeriv2ndIndex () const
 
unsigned int GetStatusMask () const
 
float GetPreSampleAmp () const
 
float GetBkgdMaxFraction () const
 
float GetDelayedBaselineShiftFit () const
 
float GetDelayedBaselineCorr () const
 
const TH1GetHistogramPtr () const
 
std::shared_ptr< TGraphErrors > GetCombinedGraph () const
 
std::shared_ptr< TGraphErrors > GetGraph () const
 
std::vector< float > GetFitPulls () const
 
std::shared_ptr< TGraphErrors > GetUndelayedGraph () const
 
std::shared_ptr< TGraphErrors > GetDelayedGraph () const
 
void dump () const
 
void dumpSetting () const
 
void dumpTF1 (const TF1 *) const
 
const std::vector< float > & GetSamplesSub () const
 
const std::vector< float > & GetSamplesDeriv2nd () const
 

Static Public Member Functions

static void SetFitOPtions (const std::string &fitOptions)
 
static void SetQuietFits (bool quiet)
 
static void SetSaveFitFunc (bool save)
 
static bool QuietFits ()
 

Private Types

typedef std::vector< float >::const_iterator SampleCIter
 

Private Member Functions

void Reset (bool reanalyze=false)
 
void SetDefaults ()
 
void SetupFitFunctions ()
 
bool DoAnalysis (bool repass)
 
bool ScanAndSubtractSamples ()
 
bool AnalyzeData (size_t nSamples, size_t preSample, const std::vector< float > &samples, const std::vector< bool > &useSamples, float peak2ndDerivMinThresh, float noiseSig, const std::vector< float > &toCorrParams, float maxChisqDivAmp, float minT0Corr, float maxT0Corr)
 
void FillHistogram (const std::vector< float > &samples, float noiseSig) const
 
void DoFit ()
 
void DoFitCombined ()
 
void UpdateFitterTimeLimits (TFitter *fitter, ZDCFitWrapper *wrapper, bool prePulse)
 

Static Private Member Functions

static std::vector< float > Calculate2ndDerivative (const std::vector< float > &inputData, unsigned int step)
 
static std::vector< float > CalculateDerivative (const std::vector< float > &inputData, unsigned int step)
 
static float obtainDelayedBaselineCorr (const std::vector< float > &samples)
 
static std::unique_ptr< TFitter > MakeCombinedFitter (TF1 *func)
 
static void CombinedPulsesFCN (int &numParam, double *, double &f, double *par, int flag)
 

Private Attributes

ZDCMsg::MessageFunctionPtr m_msgFunc_p {}
 
std::string m_tag
 
unsigned int m_Nsample {}
 
unsigned int m_preSampleIdx {}
 
float m_deltaTSample {}
 
int m_pedestal {}
 
float m_gainHG {}
 
bool m_forceLG {false}
 
float m_tmin {}
 
float m_tmax {}
 
std::string m_fitFunction
 
size_t m_2ndDerivStep {1}
 
size_t m_peak2ndDerivMinSample {}
 
size_t m_peak2ndDerivMinTolerance {1}
 
float m_peak2ndDerivMinThreshLG {}
 
float m_peak2ndDerivMinThreshHG {}
 
bool m_useDelayed {false}
 
bool m_enableRepass {false}
 
float m_peak2ndDerivMinRepassLG {}
 
float m_peak2ndDerivMinRepassHG {}
 
float m_gainFactorHG {}
 
float m_gainFactorLG {}
 
float m_noiseSigHG {}
 
float m_noiseSigLG {}
 
int m_HGOverflowADC {}
 
int m_HGUnderflowADC {}
 
int m_LGOverflowADC {}
 
float m_nominalT0HG {}
 
float m_nominalT0LG {}
 
float m_nominalTau1 {}
 
float m_nominalTau2 {}
 
bool m_fixTau1 {}
 
bool m_fixTau2 {}
 
float m_defaultFitTMax {}
 
float m_defaultFitTMin {}
 
float m_chisqDivAmpCutLG {}
 
float m_chisqDivAmpCutHG {}
 
float m_T0CutLowLG {}
 
float m_T0CutHighLG {}
 
float m_T0CutLowHG {}
 
float m_T0CutHighHG {}
 
std::unique_ptr< const TF1 > m_timeResFuncHG_p {}
 
std::unique_ptr< const TF1 > m_timeResFuncLG_p {}
 
float m_t0CutSig {}
 
unsigned int m_timeCutMode {0}
 
float m_defaultT0Max {}
 
float m_defaultT0Min {}
 
float m_fitAmpMinHG {}
 
float m_fitAmpMinLG {}
 
float m_fitAmpMaxHG {}
 
float m_fitAmpMaxLG {}
 
bool m_enablePreExcl {false}
 
unsigned int m_maxSamplesPreExcl {0}
 
unsigned int m_preExclHGADCThresh {0}
 
unsigned int m_preExclLGADCThresh {0}
 
bool m_enablePostExcl {false}
 
unsigned int m_postExclHGADCThresh {0}
 
unsigned int m_postExclLGADCThresh {0}
 
unsigned int m_maxSamplesPostExcl {0}
 
unsigned int m_timingCorrMode {NoTimingCorr}
 
float m_timingCorrRefADC {500}
 
float m_timingCorrScale {100}
 
std::vector< float > m_LGT0CorrParams
 
std::vector< float > m_HGT0CorrParams
 
bool m_haveNonlinCorr {false}
 
float m_nonLinCorrRefADC {500}
 
float m_nonLinCorrRefScale {100}
 
std::vector< float > m_nonLinCorrParamsHG
 
std::vector< float > m_nonLinCorrParamsLG
 
std::unique_ptr< TH1m_fitHist
 
bool m_initializedFits {false}
 
std::unique_ptr< ZDCFitWrapperm_defaultFitWrapper
 
std::unique_ptr< ZDCPrePulseFitWrapperm_prePulseFitWrapper
 
std::unique_ptr< ZDCPreExpFitWrapperm_preExpFitWrapper
 
unsigned int m_NSampleAna {0}
 
bool m_adjTimeRangeEvent {}
 
unsigned int m_minSampleEvt {}
 
unsigned int m_maxSampleEvt {}
 
bool m_useFixedBaseline {}
 
float m_delayedDeltaT {}
 
float m_delayedPedestalDiff {}
 
std::unique_ptr< TH1m_delayedHist
 
std::unique_ptr< TFitter > m_prePulseCombinedFitter
 
std::unique_ptr< TFitter > m_defaultCombinedFitter
 
bool m_haveData {}
 
bool m_havePulse {}
 
bool m_useLowGain {}
 
bool m_fail {}
 
bool m_HGOverflow {}
 
bool m_HGUnderflow {}
 
bool m_PSHGOverUnderflow {}
 
bool m_LGOverflow {}
 
bool m_LGUnderflow {}
 
bool m_prePulse {}
 
bool m_postPulse {}
 
bool m_fitFailed {}
 
bool m_badChisq {}
 
bool m_badT0 {}
 
bool m_ExcludeEarly {}
 
bool m_ExcludeLate {}
 
bool m_preExpTail {}
 
bool m_fixPrePulse {}
 
bool m_fitMinAmp {}
 
bool m_repassPulse {}
 
bool m_backToHG_pre {}
 
float m_baselineCorr {}
 
int m_usedPresampIdx {}
 
float m_preSample {}
 
float m_maxADCValue {}
 
float m_minADCValue {}
 
float m_maxDelta {}
 
float m_minDelta {}
 
int m_maxSampl {}
 
int m_minSampl {}
 
float m_initialExpAmp {}
 
float m_minDeriv2nd {}
 
int m_minDeriv2ndIndex {}
 
float m_fitTMax {}
 
float m_fitTMin {}
 
float m_fitPostT0lo {}
 
float m_minDeriv2ndSig
 
float m_preExpSig
 
float m_prePulseSig
 
float m_initialPrePulseT0 {}
 
float m_initialPrePulseAmp {}
 
float m_initialPostPulseT0 {}
 
float m_fitAmplitude {}
 
float m_fitAmpError {}
 
float m_fitTime {}
 
float m_fitTimeSub {}
 
float m_fitTimeCorr {}
 
float m_timeSig {}
 
float m_fitTCorr2nd {}
 
float m_fitTau1 {}
 
float m_fitTau2 {}
 
float m_fitChisq {}
 
float m_fitNDoF {}
 
float m_fitPreT0 {}
 
float m_fitPreAmp {}
 
float m_fitPostT0 {}
 
float m_fitPostAmp {}
 
float m_fitExpAmp {}
 
float m_amplitude {}
 
float m_ampNoNonLin {}
 
float m_ampError {}
 
float m_preSampleAmp {}
 
float m_preAmplitude {}
 
float m_postAmplitude {}
 
float m_expAmplitude {}
 
float m_bkgdMaxFraction {}
 
float m_delayedBaselineShift {}
 
int m_lastHGOverFlowSample {}
 
int m_firstHGOverFlowSample {}
 
unsigned int m_NSamplesAna {}
 
std::vector< float > m_ADCSamplesHG
 
std::vector< float > m_ADCSamplesLG
 
std::vector< float > m_ADCSamplesHGSub
 
std::vector< float > m_ADCSamplesLGSub
 
std::vector< bool > m_useSampleLG
 
std::vector< bool > m_useSampleHG
 
std::vector< float > m_ADCSSampSigHG
 
std::vector< float > m_ADCSSampSigLG
 
std::vector< float > m_samplesSub
 
std::vector< float > m_samplesDeriv2nd
 
std::vector< float > m_fitPulls
 

Static Private Attributes

static std::string s_fitOptions = ""
 
static bool s_quietFits = true
 
static bool s_saveFitFunc = false
 
static TH1s_undelayedFitHist = nullptr
 
static TH1s_delayedFitHist = nullptr
 
static TF1 * s_combinedFitFunc = nullptr
 
static float s_combinedFitTMax = 1000
 
static float s_combinedFitTMin = -0.5
 
static std::vector< float > s_pullValues
 

Detailed Description

Definition at line 23 of file ZDCPulseAnalyzer.h.

Member Typedef Documentation

◆ SampleCIter

typedef std::vector<float>::const_iterator ZDCPulseAnalyzer::SampleCIter
private

Definition at line 54 of file ZDCPulseAnalyzer.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
PulseBit 
LowGainBit 
FailBit 
HGOverflowBit 
HGUnderflowBit 
PSHGOverUnderflowBit 
LGOverflowBit 
LGUnderflowBit 
PrePulseBit 
PostPulseBit 
FitFailedBit 
BadChisqBit 
BadT0Bit 
ExcludeEarlyLGBit 
ExcludeLateLGBit 
preExpTailBit 
FitMinAmpBit 
RepassPulseBit 
ArmSumIncludeBit 

Definition at line 26 of file ZDCPulseAnalyzer.h.

26  {PulseBit = 0, // &1
27  LowGainBit = 1, // &2
28  FailBit = 2, // &4
29  HGOverflowBit = 3, // &8
30  // -------------------------
31  HGUnderflowBit = 4, // &16
32  PSHGOverUnderflowBit = 5, // &32
33  LGOverflowBit = 6, // &64
34  LGUnderflowBit = 7, // &128
35  // -------------------------
36  PrePulseBit = 8, // &256
37  PostPulseBit = 9, // &512
38  FitFailedBit = 10, // &1024
39  BadChisqBit = 11, // &2048
40  // -------------------------
41  BadT0Bit = 12, // &4096
42  ExcludeEarlyLGBit = 13, // &8192
43  ExcludeLateLGBit = 14, // &16384
44  preExpTailBit = 15, // &32768
45  //
46  FitMinAmpBit = 16, // 0x10000
47  RepassPulseBit = 17, // 0x20000
48  ArmSumIncludeBit = 18,
49  };

◆ TimingCorrMode

Enumerator
NoTimingCorr 
TimingCorrLin 
TimingCorrLog 

Definition at line 51 of file ZDCPulseAnalyzer.h.

Constructor & Destructor Documentation

◆ ZDCPulseAnalyzer()

ZDCPulseAnalyzer::ZDCPulseAnalyzer ( ZDCMsg::MessageFunctionPtr  msgFunc_p,
const std::string &  tag,
int  Nsample,
float  deltaTSample,
size_t  preSampleIdx,
int  pedestal,
float  gainHG,
const std::string &  fitFunction,
int  peak2ndDerivMinSample,
float  peak2DerivMinThreshHG,
float  peak2DerivMinThreshLG 
)

Definition at line 88 of file ZDCPulseAnalyzer.cxx.

90  :
91  m_msgFunc_p(std::move(msgFunc_p)),
92  m_tag(tag), m_Nsample(Nsample),
93  m_preSampleIdx(preSampleIdx),
94  m_deltaTSample(deltaTSample),
95  m_pedestal(pedestal), m_gainHG(gainHG), m_forceLG(false), m_fitFunction(fitFunction),
96  m_peak2ndDerivMinSample(peak2ndDerivMinSample),
97  m_peak2ndDerivMinThreshLG(peak2ndDerivMinThreshLG),
98  m_peak2ndDerivMinThreshHG(peak2ndDerivMinThreshHG),
99  m_ADCSamplesHGSub(Nsample, 0), m_ADCSamplesLGSub(Nsample, 0),
100  m_ADCSSampSigHG(Nsample, 0), m_ADCSSampSigLG(Nsample, 0),
101  m_samplesSub(Nsample, 0)
102 {
103  // Create the histogram used for fitting
104  //
105  m_tmin = -deltaTSample / 2;
106  m_tmax = m_tmin + ((float) Nsample) * deltaTSample;
107 
108  std::string histName = "ZDCFitHist" + tag;
109 
110  m_fitHist = std::make_unique<TH1F>(histName.c_str(), "", m_Nsample, m_tmin, m_tmax);
111  m_fitHist->SetDirectory(0);
112 
113  SetDefaults();
114  Reset();
115 }

◆ ~ZDCPulseAnalyzer()

ZDCPulseAnalyzer::~ZDCPulseAnalyzer ( )
inline

Definition at line 383 of file ZDCPulseAnalyzer.h.

383 {}

Member Function Documentation

◆ AnalyzeData()

bool ZDCPulseAnalyzer::AnalyzeData ( size_t  nSamples,
size_t  preSample,
const std::vector< float > &  samples,
const std::vector< bool > &  useSamples,
float  peak2ndDerivMinThresh,
float  noiseSig,
const std::vector< float > &  toCorrParams,
float  maxChisqDivAmp,
float  minT0Corr,
float  maxT0Corr 
)
private

Definition at line 912 of file ZDCPulseAnalyzer.cxx.

921 {
922 
923  // We keep track of which sample we used to do the subtraction sepaate from m_minSampleEvt
924  // because the corresponding time is the reference time we provide to the fit function when
925  // we have pre-pulses and in case we change the m_minSampleEvt after doing the subtraction
926  //
927  // e.g. our refit when the chisquare cuts fails
928  //
929 
930  // Find the first used sample in the event
931  //
932  bool haveFirst = false;
933  unsigned int lastUsed = 0;
934 
935  for (unsigned int sample = preSampleIdx; sample < nSamples; sample++) {
936  if (useSample[sample]) {
937  //
938  // We're going to use this sample in the analysis, update bookeeping
939  //
940  if (!haveFirst) {
942  haveFirst = true;
943  }
944  else {
945  lastUsed = sample;
946  }
947  }
948  }
949 
950  if (lastUsed < m_maxSampleEvt) m_maxSampleEvt = lastUsed;
951 
952  // Check to see whether we've changed the range of samples used in the analysis
953  //
954  // Should be obseleted with reworking of the fitting using Root::Fit package
955  //
956  if (m_minSampleEvt > preSampleIdx) {
957  m_ExcludeEarly = true;
958  m_adjTimeRangeEvent = true;
959  }
960 
961  if (m_maxSampleEvt < nSamples - 1) {
962  m_adjTimeRangeEvent = true;
963  m_ExcludeLate = true;
964  }
965 
966  // Prepare for subtraction
967  //
970 
971  std::ostringstream pedMessage;
972  pedMessage << "Pedestal index = " << m_usedPresampIdx << ", value = " << m_preSample;
973  (*m_msgFunc_p)(ZDCMsg::Verbose, pedMessage.str().c_str());
974 
976 
977  //
978  // When we are combinig delayed and undelayed samples we have to deal with the fact that
979  // the two readouts can have different noise and thus different baselines. Which is a huge
980  // headache.
981  //
982  if (m_useDelayed) {
983  if (m_useFixedBaseline) {
985  }
986  else {
987  //
988  // Use much-improved method to match delayed and undelayed baselines
989  //
991  std::ostringstream baselineMsg;
992  baselineMsg << "Delayed samples baseline correction = " << m_baselineCorr << std::endl;
993  (*m_msgFunc_p)(ZDCMsg::Debug, baselineMsg.str().c_str());
994  }
995 
996  // Now apply the baseline correction to align ADC values for delayed and undelayed samples
997  //
998  for (size_t isample = 0; isample < nSamples; isample++) {
999  if (isample % 2) m_samplesSub[isample] -= m_baselineCorr;
1000  }
1001 
1002  // If we use one of the delayed samples for presample, we have to adjust the presample value as well
1003  //
1005  }
1006 
1007  // Do the presample subtraction
1008  //
1009  std::for_each(m_samplesSub.begin(), m_samplesSub.end(), [ = ] (float & adcUnsub) {return adcUnsub -= m_preSample;} );
1010 
1011  // Find maximum and minimum values, not necessarily those of the actual pulse
1012  //
1013  std::pair<SampleCIter, SampleCIter> minMaxIters = std::minmax_element(m_samplesSub.cbegin() + m_minSampleEvt, m_samplesSub.cbegin() + m_maxSampleEvt);
1014  SampleCIter minIter = minMaxIters.first;
1015  SampleCIter maxIter = minMaxIters.second;
1016 
1017  m_maxADCValue = *maxIter;
1018  m_minADCValue = *minIter;
1019 
1020  m_maxSampl = std::distance(m_samplesSub.cbegin(), maxIter);
1021  m_minSampl = std::distance(m_samplesSub.cbegin(), minIter);
1022 
1023  // Calculate the second derivatives using step size m_2ndDerivStep
1024  //
1026 
1027  // Find the sample which has the lowest 2nd derivative. We loop over the range defined by the
1028  // tolerance on the position of the minimum second derivative. Note: the +1 in the upper iterator is because
1029  // that's where the loop terminates, not the last element.
1030  //
1031  SampleCIter minDeriv2ndIter;
1032 
1034 
1035  minDeriv2ndIter = std::min_element(m_samplesDeriv2nd.begin() + m_peak2ndDerivMinSample - m_peak2ndDerivMinTolerance, m_samplesDeriv2nd.begin() + upperDelta);
1036 
1037  m_minDeriv2nd = *minDeriv2ndIter;
1038  m_minDeriv2ndSig = -m_minDeriv2nd/(std::sqrt(6.0)*noiseSig);
1039 
1040  m_minDeriv2ndIndex = std::distance(m_samplesDeriv2nd.cbegin(), minDeriv2ndIter);
1041 
1042  // BAC 02-04-23 This check turned out to be problematic. Todo: figure out how to replace
1043  //
1044  // // Also check the ADC value for the "peak" sample to make sure it is significant (at least 3 sigma)
1045  // // The factor of sqrt(2) on the noise is because we have done a pre-sample subtraction
1046  // //
1047  if (m_minDeriv2nd <= peak2ndDerivMinThresh) {
1048  m_havePulse = true;
1049  (*m_msgFunc_p)(ZDCMsg::Verbose, "ZDCPulseAnalyzer:: " + m_tag + " has pulse ");
1050  }
1051  else {
1052  (*m_msgFunc_p)(ZDCMsg::Verbose, "ZDCPulseAnalyzer:: " + m_tag + " does not have pulse ");
1053  m_havePulse = false;
1054  }
1055 
1056 
1057 
1058  // Now decide whether we have a preceeding pulse or not. There are two possible kinds of preceeding pulses:
1059  // 1) exponential tail from a preceeding pulse
1060  // 2) peaked pulse before the main pulse
1061  //
1062  // we can, of course, have both
1063  //
1064 
1065  // To check for exponential tail, test the slope determined by the minimum ADC value (and pre-sample)
1066  // **beware** this can cause trouble in 2015 data where the pulses had overshoot due to the transformers
1067  //
1068 
1069  // Implement a much simpler test for presence of an exponential tail from an OOT pulse
1070  // namely if the slope evaluated at the presample is significantly negative, then
1071  // we have a preceeding pulse.
1072  //
1073  // Note that we don't have to subtract the FADC value corresponding to the presample because
1074  // that subtraction has already been done.
1075  //
1076  if (m_havePulse) {
1077  // If we've alreday excluded early samples, we have almost by construction have negative exponential tail
1078  //
1079  if (m_ExcludeEarly) m_preExpTail = true;
1080 
1081  //
1082  // The subtracted ADC value at m_usedPresampIdx is, by construction, zero
1083  // The next sample has had the pre-sample subtracted, so it represents the initial derivative
1084  //
1085  float derivPresampleSig = m_samplesSub[m_usedPresampIdx+1]/(std::sqrt(2.0)*noiseSig);
1086  if (derivPresampleSig < -5) {
1087  m_preExpTail = true;
1088  m_preExpSig = derivPresampleSig;
1089  }
1090 
1091  for (unsigned int isample = m_usedPresampIdx; isample < m_samplesSub.size(); isample++) {
1092  if (!useSample[isample]) continue;
1093 
1094  float sampleSig = -m_samplesSub[isample]/(std::sqrt(2.0)*noiseSig);
1095  float sigRatio = sampleSig/m_minDeriv2ndSig;
1096 
1097  if ((sampleSig > 5 && sigRatio > 0.02) || sigRatio > 0.5) {
1098  m_preExpTail = true;
1099  if (sampleSig > m_preExpSig) m_preExpSig = sampleSig;
1100  }
1101  }
1102 
1103  int loopLimit = (m_havePulse ? m_minDeriv2ndIndex - 2 : m_peak2ndDerivMinSample - 2);
1104  int loopStart = m_minSampleEvt == 0 ? 1 : m_minSampleEvt;
1105 
1106  for (int isample = loopStart; isample <= loopLimit; isample++) {
1107  if (!useSample[isample]) continue;
1108 
1109  //
1110  // If any of the second derivatives prior to the peak are significantly negative, we have a an extra pulse
1111  // prior to the main one -- as opposed to just an expnential tail
1112  //
1113  m_prePulseSig = -m_samplesDeriv2nd[isample]/(std::sqrt(6.0)*noiseSig);
1114 
1115  if ((m_prePulseSig > 6 && m_samplesDeriv2nd[isample] < 0.05 * m_minDeriv2nd) ||
1116  m_samplesDeriv2nd[isample] < 0.5*m_minDeriv2nd)
1117  {
1118  if (m_preExpTail) {
1119  //
1120  // We have a prepulse. If we already indicated an negative exponential,
1121  // if the prepulse has greater significance, we override the negative exponential
1122  //
1123  if (m_prePulseSig > m_preExpSig) {
1124  m_prePulse = true;
1125  m_preExpTail = false;
1126  }
1127  }
1128  else {
1129  m_prePulse = true;
1130  }
1131 
1132  if (m_prePulse && m_samplesSub[isample] > m_initialPrePulseAmp) {
1134  m_initialPrePulseT0 = m_deltaTSample * (isample);
1135  }
1136  }
1137  }
1138 
1139  // if (m_preExpTail) m_prePulse = true;
1140 
1141  // -----------------------------------------------------
1142  // Post pulse detection
1143  //
1144  unsigned int postStartIdx = std::max(static_cast<unsigned int>(m_minDeriv2ndIndex + 2),
1145  static_cast<unsigned int>(m_peak2ndDerivMinSample + m_peak2ndDerivMinTolerance + 1));
1146 
1147 
1148  for (int isample = postStartIdx; isample < (int) m_samplesDeriv2nd.size() - 1; isample++) {
1149  if (!useSample[isample]) continue;
1150 
1151  // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1152  // BAC 12-01-2024
1153  //
1154  // The following code is commented out as a temporary measure to deal with apparent reflections
1155  // associated with large out-of-time pulses that introduce a "kink" that triggers the derivative
1156  // test. A work-around that doesn't introduce specific code for the 2023 Pb+Pb run but allows
1157  // adaption for this specific issue is going to take some work. For now we leave the 2nd derivative
1158  // test, but will also need to introduce some configurability of the cut -- which we need anyway
1159  //
1160  // Calculate the forward derivative. the pulse should never increase on the tail. If it
1161  // does, we almost certainly have a post-pulse
1162  //
1163  // float deriv = m_samplesSub[isample + 1] - m_samplesSub[isample];
1164  // if (deriv/(std::sqrt(2)*noiseSig) > 6) {
1165  // m_postPulse = true;
1166  // m_maxSampleEvt = isample;
1167  // m_adjTimeRangeEvent = true;
1168  // break;
1169  // }
1170  // else {
1171  //----------------------------------------------------------------------------------------------
1172  //
1173  // Now we check the second derivative which might also indicate a post pulse
1174  // even if the derivative is not sufficiently large
1175  //
1176  // add small 1e-3 in division to avoid floating overflow
1177  //
1178 
1179  float deriv = m_samplesSub[isample + 1] - m_samplesSub[isample];
1180  float derivSig = deriv/(std::sqrt(2)*noiseSig);
1181  float deriv2ndSig = -m_samplesDeriv2nd[isample] / (std::sqrt(6)*noiseSig);
1182 
1183  float deriv2ndTest = m_samplesDeriv2nd[isample] / (-m_minDeriv2nd + 1.0e-3);
1184 
1185  if (derivSig > 5) {
1186  //
1187  // Check the 2nd derivative -- we should be at a minimum(?)
1188  //
1189  if (std::abs(deriv2ndTest) > 0.15) {
1190  m_postPulse = true;
1191  m_maxSampleEvt = std::min<int>(isample - (m_2ndDerivStep - 1), m_maxSampleEvt);
1192 
1193  m_adjTimeRangeEvent = true;
1194  break;
1195  }
1196  }
1197 
1198  // The place to apply the cut on samples depends on whether we have found a "minimum" or a "maximum"
1199  // The -m_2ndDerivStep for the minimum accounts for the shift between 2nd derivative and the samples
1200  // if we find a maximum we cut one sample lower
1201  //
1202  if (deriv2ndSig > 5 && deriv2ndTest < -0.1) {
1203  m_postPulse = true;
1204  m_maxSampleEvt = std::min<int>(isample - m_2ndDerivStep, m_maxSampleEvt);
1205 
1206  m_adjTimeRangeEvent = true;
1207  break;
1208  }
1209  }
1210  }
1211 
1212  if (m_postPulse) {
1213  std::ostringstream ostrm;
1214  ostrm << "Post pulse found, m_maxSampleEvt = " << m_maxSampleEvt;
1215  (*m_msgFunc_p)(ZDCMsg::Debug, ostrm.str());
1216  }
1217 
1218 
1219  // -----------------------------------------------------
1220 
1221  FillHistogram(m_samplesSub, noiseSig);
1222 
1223  // Stop now if we have no pulse or we've detected a failure
1224  //
1225  if (m_fail || !m_havePulse) return false;
1226 
1227  if (!m_useDelayed) DoFit();
1228  else DoFitCombined();
1229 
1230  if (FitFailed()) {
1231  m_fail = true;
1232  }
1233  else {
1234  std::ostringstream ostrm;
1235  ostrm << "Pulse fit successful with chisquare = " << m_fitChisq;
1236  (*m_msgFunc_p)(ZDCMsg::Debug, ostrm.str());
1237 
1239 
1240  if (m_timingCorrMode != NoTimingCorr) {
1241  //
1242  // We correct relative to the m_timingCorrRefADC using m_timingCorrScale to scale
1243  //
1244  double t0CorrFact = (m_fitAmplitude - m_timingCorrRefADC) / m_timingCorrScale;
1245  if (m_timingCorrMode == TimingCorrLog) t0CorrFact = std::log(t0CorrFact);
1246 
1247  // Calculate the correction using a polynomial of power determined by the size of the vector.
1248  // For historical reasons we include here a constant term, though it is degenerate with
1249  // the nominal t0 and/or timing calibrations.
1250  //
1251  float correction = 0;
1252 
1253  for (unsigned int ipow = 0; ipow < t0CorrParams.size(); ipow++) {
1254  correction += t0CorrParams[ipow]*std::pow(t0CorrFact, double(ipow));
1255  }
1256 
1257  // The correction represents the offset of the timing value from zero so we subtract the result
1258  //
1260  }
1261 
1262  bool failFixedCut = m_fitTimeCorr < minT0Corr || m_fitTimeCorr > maxT0Corr;
1263 
1264  // Calculate the timing significance. Note this implementation breaks the model for
1265  // how DoAnalysis is currently used by explicitly testing m_useLowGain, but that model
1266  // needs adjustment anyway ... (one step at a time)
1267  //
1268  // Note that to avoid coupling non-linear corrections to the amplitude and the
1269  // timing significance we evaluate the time resolution using the fit amplitude
1270  //
1271  if (m_timeCutMode != 0) {
1272  double timeResolution = 0;
1273  if (m_useLowGain) timeResolution = m_timeResFuncLG_p->Eval(m_fitAmplitude);
1274  else timeResolution = m_timeResFuncHG_p->Eval(m_fitAmplitude);
1275 
1276  m_timeSig = m_fitTimeCorr/timeResolution;
1277  if (std::abs(m_timeSig) > m_t0CutSig) {
1278  //
1279  // We've failed the significance cut. In OR mode (1) we mark the time
1280  // as bad if we've lso failed the fixed cut. In AND mode, we mark it
1281  // as bad regardless of the fixed cut.
1282  //
1283  if (m_timeCutMode == 1) {
1284  if (failFixedCut) m_badT0 = true;
1285  }
1286  else m_badT0 = true;
1287  }
1288  else if (m_timeCutMode == 2 && failFixedCut) m_badT0 = failFixedCut;
1289  }
1290  else {
1291  m_timeSig = -1;
1292  m_badT0 = failFixedCut;
1293  }
1294 
1295  // Now check for valid chisq and valid time
1296  //
1297  if (m_fitChisq/m_fitNDoF > 2 && m_fitChisq / (m_fitAmplitude + 1.0e-6) > maxChisqDivAmp) m_badChisq = true;
1298  }
1299 
1300  return !m_fitFailed;
1301 }

◆ ArmSumInclude()

bool ZDCPulseAnalyzer::ArmSumInclude ( ) const
inline

Definition at line 510 of file ZDCPulseAnalyzer.h.

510 {return HavePulse() && !(FitFailed() || BadChisq() || BadT0() || fitMinimumAmplitude() || LGOverflow());}

◆ BadChisq()

bool ZDCPulseAnalyzer::BadChisq ( ) const
inline

Definition at line 502 of file ZDCPulseAnalyzer.h.

502 {return m_badChisq;}

◆ BadT0()

bool ZDCPulseAnalyzer::BadT0 ( ) const
inline

Definition at line 504 of file ZDCPulseAnalyzer.h.

504 {return m_badT0;}

◆ Calculate2ndDerivative()

std::vector< float > ZDCPulseAnalyzer::Calculate2ndDerivative ( const std::vector< float > &  inputData,
unsigned int  step 
)
staticprivate

Definition at line 1945 of file ZDCPulseAnalyzer.cxx.

1946 {
1947  unsigned int nSamples = inputData.size();
1948 
1949  // We start with two zero entries for which we can't calculate the double-step derivative
1950  // and woud pad with two zero entries at the end. Start by initializing
1951  //
1952  unsigned int vecSize = 2*step + nSamples - step - 1;
1953  std::vector<float> results(vecSize, 0);
1954 
1955  unsigned int fillIndex = step;
1956  for (unsigned int sample = step; sample < nSamples - step; sample++) {
1957  int deriv2nd = inputData[sample + step] + inputData[sample - step] - 2*inputData[sample];
1958  results.at(fillIndex++) = deriv2nd;
1959  }
1960 
1961  return results;
1962 }

◆ CalculateDerivative()

std::vector< float > ZDCPulseAnalyzer::CalculateDerivative ( const std::vector< float > &  inputData,
unsigned int  step 
)
staticprivate

Definition at line 1924 of file ZDCPulseAnalyzer.cxx.

1925 {
1926  unsigned int nSamples = inputData.size();
1927 
1928  // So we pad at the beginning and end based on step (i.e. with step - 1 zeros). Fill out the fill vector with zeros initially
1929  //
1930  unsigned int vecSize = 2*(step - 1) + nSamples - step - 1;
1931  std::vector<float> results(vecSize, 0);
1932 
1933  // Now fill out the values
1934  //
1935  unsigned int fillIdx = step - 1;
1936 
1937  for (unsigned int sample = 0; sample < nSamples - step; sample++) {
1938  int deriv = inputData[sample + step] - inputData[sample];
1939  results.at(fillIdx++) = deriv;
1940  }
1941 
1942  return results;
1943 }

◆ CombinedPulsesFCN()

void ZDCPulseAnalyzer::CombinedPulsesFCN ( int &  numParam,
double *  ,
double &  f,
double *  par,
int  flag 
)
staticprivate

Definition at line 34 of file ZDCPulseAnalyzer.cxx.

35 {
36  // The first parameter is a correction factor to account for decrease in beam intensity between x
37  // and y scan. It is applied here and not passed to the actual fit function
38  //
39  int nSamples = s_undelayedFitHist->GetNbinsX();
40 
41  if (flag == 3) {
42  s_pullValues.assign(nSamples * 2, 0);
43  }
44 
45  double chiSquare = 0;
46 
47  float delayBaselineAdjust = par[0];
48 
49  // undelayed
50  //
51  for (int isample = 0; isample < nSamples; isample++) {
52  double histValue = s_undelayedFitHist->GetBinContent(isample + 1);
53  double histError = std::max(s_undelayedFitHist->GetBinError(isample + 1), 1.0);
54  double t = s_undelayedFitHist->GetBinCenter(isample + 1);
55 
56  if (t > s_combinedFitTMax) break;
57  if (t < s_combinedFitTMin) continue;
58 
59  double funcVal = s_combinedFitFunc->EvalPar(&t, &par[1]);
60 
61  double pull = (histValue - funcVal) / histError;
62 
63  if (flag == 3) s_pullValues[2 * isample] = pull;
64  chiSquare += pull * pull;
65  }
66 
67  // delayed
68  //
69  for (int isample = 0; isample < nSamples; isample++) {
70  double histValue = s_delayedFitHist->GetBinContent(isample + 1);
71  double histError = std::max(s_delayedFitHist->GetBinError(isample + 1), 1.0);
72  double t = s_delayedFitHist->GetBinCenter(isample + 1);
73 
74  if (t > s_combinedFitTMax) break;
75  if (t < s_combinedFitTMin) continue;
76 
77  double funcVal = s_combinedFitFunc->EvalPar(&t, &par[1]) + delayBaselineAdjust;
78  double pull = (histValue - funcVal) / histError;
79 
80  if (flag == 3) s_pullValues[2 * isample + 1] = pull;
81  chiSquare += pull * pull;
82  }
83 
84  f = chiSquare;
85 }

◆ DoAnalysis()

bool ZDCPulseAnalyzer::DoAnalysis ( bool  repass)
private

Definition at line 796 of file ZDCPulseAnalyzer.cxx.

797 {
798  float deriv2ndThreshHG = 0;
799  float deriv2ndThreshLG = 0;
800 
801  if (!repass) {
803 
804  deriv2ndThreshHG = m_peak2ndDerivMinThreshHG;
805  deriv2ndThreshLG = m_peak2ndDerivMinThreshLG;
806  }
807  else {
808  deriv2ndThreshHG = m_peak2ndDerivMinRepassHG;
809  deriv2ndThreshLG = m_peak2ndDerivMinRepassLG;
810  }
811 
813  if (m_useLowGain) {
814  (*m_msgFunc_p)(ZDCMsg::Verbose, "ZDCPulseAnalyzer:: " + m_tag + " using low gain data ");
815 
817  deriv2ndThreshLG, m_noiseSigLG, m_LGT0CorrParams,
819  if (result) {
820  //
821  // +++BAC
822  //
823  // I have removed some code that attempted a refit in case of failure of the chi-square cut
824  // Instead, we should implement an analysis of the failure with possible re-fit afterwards
825  // with possible change of the pre- or post-pulse condition
826  //
827  // --BAC
828  //
829 
830  // If we have a non-linear correction, apply it here
831  // We apply it as an inverse correction - i.e. we divide by a correction
832  // term tha is a sum of coefficients times the ADC minus a reference
833  // to a power. The lowest power is 1, the highest is deteremined by
834  // the number of provided coefficients
835 
836  double invNLCorr = 1.0;
837  if (m_haveNonlinCorr) {
838  float ampCorrFact = (m_fitAmplitude - m_nonLinCorrRefADC) / m_nonLinCorrRefScale;
839 
840  for (size_t power = 1; power <= m_nonLinCorrParamsLG.size(); power++) {
841  invNLCorr += m_nonLinCorrParamsLG[power - 1]*pow(ampCorrFact, power);
842  }
843  }
844 
845  //
846  // Multiply amplitude by gain factor
847  //
849  m_amplitude = m_fitAmplitude / invNLCorr * m_gainFactorLG;
850  m_ampError = m_fitAmpError / invNLCorr * m_gainFactorLG;
855 
856  // BAC: also scale up the 2nd derivative so low and high gain can be treated on the same footing
857  //
859  }
860 
861  return result;
862  }
863  else {
864  (*m_msgFunc_p)(ZDCMsg::Verbose, "ZDCPulseAnalyzer:: " + m_tag + " using high gain data ");
865 
867  deriv2ndThreshHG, m_noiseSigHG, m_HGT0CorrParams,
869  if (result) {
870  // +++BAC
871  //
872  // I have removed some code that attempted a refit in case of failure of the chi-square cut
873  // Instead, we should implement an analysis of the failure with possible re-fit afterwards
874  // with possible change of the pre- or post-pulse condition
875  //
876  // --BAC
877 
885 
887 
888  // If we have a non-linear correction, apply it here
889  //
890  // We apply it as an inverse correction - i.e. we divide by a correction
891  // term tha is a sum of coefficients times the ADC minus a reference
892  // to a power. The lowest power is 1, the highest is deteremined by
893  // the number of provided coefficients
894  //
895  if (m_haveNonlinCorr) {
896  float ampCorrFact = (m_amplitude - m_nonLinCorrRefADC) / m_nonLinCorrRefScale;
897 
898  float invNLCorr = 1.0;
899  for (size_t power = 1; power <= m_nonLinCorrParamsHG.size(); power++) {
900  invNLCorr += m_nonLinCorrParamsHG[power - 1]*pow(ampCorrFact, power);
901  }
902 
903  m_amplitude /= invNLCorr;
904  m_ampError /= invNLCorr;
905  }
906  }
907 
908  return result;
909  }
910 }

◆ DoFit()

void ZDCPulseAnalyzer::DoFit ( )
private

Definition at line 1303 of file ZDCPulseAnalyzer.cxx.

1304 {
1305  float fitAmpMin = (m_useLowGain ? m_fitAmpMinLG : m_fitAmpMinHG);
1306  float fitAmpMax = (m_useLowGain ? m_fitAmpMaxLG : m_fitAmpMaxHG);
1307 
1308  // Set the initial values
1309  //
1310  float ampInitial = m_maxADCValue - m_minADCValue; // ??? sometime it is smaller than 5???? why
1311  float t0Initial = (m_useLowGain ? m_nominalT0LG : m_nominalT0HG);
1312 
1313  if (ampInitial < fitAmpMin) ampInitial = fitAmpMin * 1.5;
1314 
1315  ZDCFitWrapper* fitWrapper = m_defaultFitWrapper.get();
1316  if (preExpTail()) {
1317  fitWrapper = m_preExpFitWrapper.get();
1318  (static_cast<ZDCPreExpFitWrapper*>(m_preExpFitWrapper.get()))->SetInitialExpPulse(m_initialExpAmp);
1319  }
1320  else if (PrePulse()) {
1321  fitWrapper = m_prePulseFitWrapper.get();
1322  (static_cast<ZDCPrePulseFitWrapper*>(fitWrapper))->SetInitialPrePulse(m_initialPrePulseAmp, m_initialPrePulseT0,0,25);
1323  }
1324 
1325  if (m_adjTimeRangeEvent) {
1328 
1329  float fitTReference = m_deltaTSample * m_usedPresampIdx;
1330 
1331  fitWrapper->Initialize(ampInitial, t0Initial, fitAmpMin, fitAmpMax, m_fitTMin, m_fitTMax, fitTReference);
1332  }
1333  else {
1334  fitWrapper->Initialize(ampInitial, t0Initial, fitAmpMin, fitAmpMax);
1335  }
1336 
1337  // Now perform the fit
1338  //
1339  std::string options = s_fitOptions + "N";
1340  if (QuietFits()) {
1341  options += "Q";
1342  }
1343 
1344  m_fitFailed = false;
1345 
1346  dumpTF1(fitWrapper->GetWrapperTF1RawPtr());
1347 
1348  //
1349  // Fit the data with the function provided by the fit wrapper
1350  //
1351  TFitResultPtr result_ptr = m_fitHist->Fit(fitWrapper->GetWrapperTF1RawPtr(), options.c_str(), "", m_fitTMin, m_fitTMax);
1352  int fitStatus = result_ptr;
1353 
1354  //
1355  // If the first fit failed, also check the EDM. If sufficiently small, the failure is almost surely due
1356  // to parameter limits and we just accept the result
1357  //
1358  if (fitStatus != 0 && result_ptr->Edm() > 0.001)
1359  {
1360  //
1361  // We contstrain the fit and try again
1362  //
1363  fitWrapper->ConstrainFit();
1364 
1365  TFitResultPtr constrFitResult_ptr = m_fitHist->Fit(fitWrapper->GetWrapperTF1RawPtr(), options.c_str(), "", m_fitTMin, m_fitTMax);
1366  fitWrapper->UnconstrainFit();
1367 
1368  if ((int) constrFitResult_ptr != 0) {
1369  //
1370  // Even the constrained fit failed, so we quit.
1371  //
1372  m_fitFailed = true;
1373  }
1374  else {
1375  // Now we try the fit again with the constraint removed
1376  //
1377  TFitResultPtr unconstrFitResult_ptr = m_fitHist->Fit(fitWrapper->GetWrapperTF1RawPtr(), options.c_str(), "", m_fitTMin, m_fitTMax);
1378  if ((int) unconstrFitResult_ptr != 0) {
1379  //
1380  // The unconstrained fit failed again, so we redo the constrained fit
1381  //
1382  fitWrapper->ConstrainFit();
1383 
1384  TFitResultPtr constrFit2Result_ptr = m_fitHist->Fit(fitWrapper->GetWrapperTF1RawPtr(), options.c_str(), "", m_fitTMin, m_fitTMax);
1385  if ((int) constrFit2Result_ptr != 0) {
1386  //
1387  // Even the constrained fit failed the second time, so we quit.
1388  //
1389  m_fitFailed = true;
1390  }
1391 
1392  result_ptr = constrFit2Result_ptr;
1393  fitWrapper->UnconstrainFit();
1394  }
1395  else {
1396  result_ptr = unconstrFitResult_ptr;
1397  }
1398  }
1399  }
1400 
1401  if (!m_fitFailed && s_saveFitFunc) {
1402  m_fitHist->GetListOfFunctions()->Clear();
1403  m_fitHist->GetListOfFunctions()->Add(fitWrapper->GetWrapperTF1RawPtr());
1404  }
1405 
1406  m_bkgdMaxFraction = fitWrapper->GetBkgdMaxFraction();
1407  m_fitAmplitude = fitWrapper->GetAmplitude();
1408  m_fitAmpError = fitWrapper->GetAmpError();
1409 
1410  if (preExpTail()) {
1411  m_fitExpAmp = (static_cast<ZDCPreExpFitWrapper*>(m_preExpFitWrapper.get()))->GetExpAmp();
1412  }
1413  else {
1414  m_fitExpAmp = 0;
1415  }
1416 
1417  m_fitTime = fitWrapper->GetTime();
1418 
1419  m_fitTimeSub = m_fitTime - t0Initial;
1420 
1421  m_fitChisq = result_ptr->Chi2();
1422  m_fitNDoF = result_ptr->Ndf();
1423 
1424  m_fitTau1 = fitWrapper->GetTau1();
1425  m_fitTau2 = fitWrapper->GetTau2();
1426 
1427  // Here we need to check if the fit amplitude is small (close) enough to fitAmpMin.
1428  // with "< 1+epsilon" where epsilon ~ 1%
1429  if (m_fitAmplitude < fitAmpMin * 1.01) {
1430  m_fitMinAmp = true;
1431  }
1432 
1433 }

◆ DoFitCombined()

void ZDCPulseAnalyzer::DoFitCombined ( )
private

Definition at line 1435 of file ZDCPulseAnalyzer.cxx.

1436 {
1437  float fitAmpMin = (m_useLowGain ? m_fitAmpMinLG : m_fitAmpMinHG);
1438  float fitAmpMax = (m_useLowGain ? m_fitAmpMaxLG : m_fitAmpMaxHG);
1439 
1440  // Set the initial values
1441  //
1442  float ampInitial = m_maxADCValue - m_minADCValue;
1443  float t0Initial = (m_useLowGain ? m_nominalT0LG : m_nominalT0HG);
1444 
1445  if (ampInitial < fitAmpMin) ampInitial = fitAmpMin * 1.5;
1446 
1447  ZDCFitWrapper* fitWrapper = m_defaultFitWrapper.get();
1448  //if (PrePulse()) fitWrapper = fitWrapper = m_preExpFitWrapper.get();
1449 
1450  if (preExpTail()) {
1451  fitWrapper = m_preExpFitWrapper.get();
1452  (static_cast<ZDCPreExpFitWrapper*>(m_preExpFitWrapper.get()))->SetInitialExpPulse(m_initialExpAmp);
1453  }
1454  else if (PrePulse()) {
1455  fitWrapper = m_prePulseFitWrapper.get();
1456  (static_cast<ZDCPrePulseFitWrapper*>(fitWrapper))->SetInitialPrePulse(m_initialPrePulseAmp, m_initialPrePulseT0,0,25);
1457  }
1458 
1459  // Initialize the fit wrapper for this event, specifying a
1460  // per-event fit range if necessary
1461  //
1462  if (m_adjTimeRangeEvent) {
1465 
1466  float fitTReference = m_deltaTSample * m_usedPresampIdx;
1467 
1468  fitWrapper->Initialize(ampInitial, t0Initial, fitAmpMin, fitAmpMax, m_fitTMin, m_fitTMax, fitTReference);
1469  }
1470  else {
1471  fitWrapper->Initialize(ampInitial, t0Initial, fitAmpMin, fitAmpMax);
1472  }
1473 
1474  // Set up the virtual fitter
1475  //
1476  TFitter* theFitter = nullptr;
1477 
1478  if (PrePulse()) {
1480 
1481  theFitter = m_prePulseCombinedFitter.get();
1482  }
1483  else {
1485 
1486  theFitter = m_defaultCombinedFitter.get();
1487  }
1488 
1489  dumpTF1(fitWrapper->GetWrapperTF1RawPtr());
1490 
1491  // Set the static pointers to histograms and function for use in FCN
1492  //
1493  s_undelayedFitHist = m_fitHist.get();
1495  s_combinedFitFunc = fitWrapper->GetWrapperTF1RawPtr();
1498 
1499 
1500  size_t numFitPar = theFitter->GetNumberTotalParameters();
1501 
1502  theFitter->GetMinuit()->fISW[4] = -1;
1503 
1504  // Now perform the fit
1505  //
1506  if (s_quietFits) {
1507  theFitter->GetMinuit()->fISW[4] = -1;
1508 
1509  int ierr= 0;
1510  theFitter->GetMinuit()->mnexcm("SET NOWarnings",nullptr,0,ierr);
1511  }
1512  else theFitter->GetMinuit()->fISW[4] = 0;
1513 
1514  // Only include baseline shift in fit for pre-pulses. Otherwise baseline matching should work
1515  //
1516  if (PrePulse()) {
1517  theFitter->SetParameter(0, "delayBaselineAdjust", 0, 0.01, -100, 100);
1518  theFitter->ReleaseParameter(0);
1519  }
1520  else {
1521  theFitter->SetParameter(0, "delayBaselineAdjust", 0, 0.01, -100, 100);
1522  theFitter->FixParameter(0);
1523  }
1524 
1525 
1526  double arglist[100];
1527  arglist[0] = 5000; // number of function calls
1528  arglist[1] = 0.01; // tolerance
1529  int status = theFitter->ExecuteCommand("MIGRAD", arglist, 2);
1530 
1531  double fitAmp = theFitter->GetParameter(1);
1532 
1533  // Capture the chi-square etc.
1534  //
1535  double chi2, edm, errdef;
1536  int nvpar, nparx;
1537 
1538  theFitter->GetStats(chi2, edm, errdef, nvpar, nparx);
1539 
1540  // Here we need to check if fitAmp is small (close) enough to fitAmpMin.
1541  // with "< 1+epsilon" where epsilon ~ 1%
1542  //
1543  if (status || fitAmp < fitAmpMin * 1.01 || edm > 0.01){
1544 
1545  //
1546  // We first retry the fit with no baseline adjust
1547  //
1548  theFitter->SetParameter(0, "delayBaselineAdjust", 0, 0.01, -100, 100);
1549  theFitter->FixParameter(0);
1550 
1551  // Here we need to check if fitAmp is small (close) enough to fitAmpMin.
1552  // with "< 1+epsilon" where epsilon ~ 1%
1553  if (fitAmp < fitAmpMin * 1.01) {
1554  if (m_adjTimeRangeEvent) {
1555  float fitTReference = m_deltaTSample * m_usedPresampIdx;
1556  fitWrapper->Initialize(ampInitial, t0Initial, fitAmpMin, fitAmpMax, m_fitTMin, m_fitTMax, fitTReference);
1557  }
1558  else {
1559  fitWrapper->Initialize(ampInitial, t0Initial, fitAmpMin, fitAmpMax);
1560  }
1561  }
1562 
1563  status = theFitter->ExecuteCommand("MIGRAD", arglist, 2);
1564  if (status != 0) {
1565  //
1566  // Fit failed event with no baseline adust, so be it
1567  //
1568  theFitter->ReleaseParameter(0);
1569  m_fitFailed = true;
1570  }
1571  else {
1572  //
1573  // The fit succeeded with no baseline adjust, re-fit allowing for baseline adjust using
1574  // the parameters from previous fit as the starting point
1575  //
1576  theFitter->ReleaseParameter(0);
1577  status = theFitter->ExecuteCommand("MIGRAD", arglist, 2);
1578 
1579  if (status) {
1580  // Since we know the fit can succeed without the baseline adjust, go back to it
1581  //
1582  theFitter->SetParameter(0, "delayBaselineAdjust", 0, 0.01, -100, 100);
1583  theFitter->FixParameter(0);
1584  status = theFitter->ExecuteCommand("MIGRAD", arglist, 2);
1585  }
1586  }
1587  }
1588  else m_fitFailed = false;
1589 
1590  // Check to see if the fit forced the amplitude to the minimum, if so set the corresponding status bit
1591  //
1592  fitAmp = theFitter->GetParameter(1);
1593 
1594  // Here we need to check if fitAmp is small (close) enough to fitAmpMin.
1595  // with "< 1+epsilon" where epsilon ~ 1%
1596  if (fitAmp < fitAmpMin * 1.01) {
1597  m_fitMinAmp = true;
1598  }
1599 
1600  if (!s_quietFits) theFitter->GetMinuit()->fISW[4] = -1;
1601 
1602  std::vector<double> funcParams(numFitPar - 1);
1603  std::vector<double> funcParamErrs(numFitPar - 1);
1604 
1605  // Save the baseline shift between delayed and undelayed samples
1606  //
1607  m_delayedBaselineShift = theFitter->GetParameter(0);
1608 
1609  // Capture and store the fit function parameteds and errors
1610  //
1611  for (size_t ipar = 1; ipar < numFitPar; ipar++) {
1612  funcParams[ipar - 1] = theFitter->GetParameter(ipar);
1613  funcParamErrs[ipar - 1] = theFitter->GetParError(ipar);
1614  }
1615 
1616  s_combinedFitFunc->SetParameters(&funcParams[0]);
1617  s_combinedFitFunc->SetParErrors(&funcParamErrs[0]);
1618 
1619  // Capture the chi-square etc.
1620  //
1621  theFitter->GetStats(chi2, edm, errdef, nvpar, nparx);
1622 
1623  int ndf = 2 * m_Nsample - nvpar;
1624 
1625  s_combinedFitFunc->SetChisquare(chi2);
1626  s_combinedFitFunc->SetNDF(ndf);
1627 
1628  // add to list of functions
1629  if (s_saveFitFunc) {
1630  s_undelayedFitHist->GetListOfFunctions()->Clear();
1631  s_undelayedFitHist->GetListOfFunctions()->Add(s_combinedFitFunc);
1632 
1633  s_delayedFitHist->GetListOfFunctions()->Clear();
1634  s_delayedFitHist->GetListOfFunctions()->Add(s_combinedFitFunc);
1635  }
1636 
1637  // Save the pull values from the last call to FCN
1638  //
1639  arglist[0] = 3; // number of function calls
1640  theFitter->ExecuteCommand("Cal1fcn", arglist, 1);
1642 
1643  m_fitAmplitude = fitWrapper->GetAmplitude();
1644  m_fitTime = fitWrapper->GetTime();
1645  if (PrePulse()) {
1646  m_fitPreT0 = (static_cast<ZDCPrePulseFitWrapper*>(m_prePulseFitWrapper.get()))->GetPreT0();
1647  m_fitPreAmp = (static_cast<ZDCPrePulseFitWrapper*>(m_prePulseFitWrapper.get()))->GetPreAmp();
1648  m_fitPostT0 = (static_cast<ZDCPrePulseFitWrapper*>(m_prePulseFitWrapper.get()))->GetPostT0();
1649  m_fitPostAmp = (static_cast<ZDCPrePulseFitWrapper*>(m_prePulseFitWrapper.get()))->GetPostAmp();
1650  }
1651 
1652  if (preExpTail()) {
1653  m_fitExpAmp = (static_cast<ZDCPreExpFitWrapper*>(m_preExpFitWrapper.get()))->GetExpAmp();
1654  }
1655  else {
1656  m_fitExpAmp = 0;
1657  }
1658 
1659  m_fitTimeSub = m_fitTime - t0Initial;
1660  m_fitChisq = chi2;
1661  m_fitNDoF = ndf;
1662 
1663  m_fitTau1 = fitWrapper->GetTau1();
1664  m_fitTau2 = fitWrapper->GetTau2();
1665 
1666  m_fitAmpError = fitWrapper->GetAmpError();
1667  m_bkgdMaxFraction = fitWrapper->GetBkgdMaxFraction();
1668 }

◆ dump()

void ZDCPulseAnalyzer::dump ( ) const

Definition at line 1726 of file ZDCPulseAnalyzer.cxx.

1727 {
1728  (*m_msgFunc_p)(ZDCMsg::Info, ("ZDCPulseAnalyzer dump for tag = " + m_tag));
1729 
1730  (*m_msgFunc_p)(ZDCMsg::Info, ("Presample index, value = " + std::to_string(m_preSampleIdx) + ", " + std::to_string(m_preSample)));
1731 
1732  if (m_useDelayed) {
1733  (*m_msgFunc_p)(ZDCMsg::Info, ("using delayed samples with delta T = " + std::to_string(m_delayedDeltaT) + ", and pedestalDiff == " +
1735  }
1736 
1737  std::ostringstream message1;
1738  message1 << "samplesSub ";
1739  for (size_t sample = 0; sample < m_samplesSub.size(); sample++) {
1740  message1 << ", [" << sample << "] = " << m_samplesSub[sample];
1741  }
1742  (*m_msgFunc_p)(ZDCMsg::Info, message1.str());
1743 
1744  std::ostringstream message3;
1745  message3 << "samplesDeriv2nd ";
1746  for (size_t sample = 0; sample < m_samplesDeriv2nd.size(); sample++) {
1747  message3 << ", [" << sample << "] = " << m_samplesDeriv2nd[sample];
1748  }
1749  (*m_msgFunc_p)(ZDCMsg::Info, message3.str());
1750 
1751  (*m_msgFunc_p)(ZDCMsg::Info, ("minimum 2nd deriv sample, value = " + std::to_string(m_minDeriv2ndIndex) + ", " + std::to_string(m_minDeriv2nd)));
1752 }

◆ dumpSetting()

void ZDCPulseAnalyzer::dumpSetting ( ) const

Definition at line 1772 of file ZDCPulseAnalyzer.cxx.

1773 {
1774  if (m_useDelayed) {
1775  (*m_msgFunc_p)(ZDCMsg::Info, ("using delayed samples with delta T = " + std::to_string(m_delayedDeltaT) + ", and pedestalDiff == " + std::to_string(m_delayedPedestalDiff)));
1776  }
1777 
1778  (*m_msgFunc_p)(ZDCMsg::Info, ("m_fixTau1 = " + std::to_string(m_fixTau1) + " m_fixTau2=" + std::to_string(m_fixTau2) + " m_nominalTau1=" + std::to_string(m_nominalTau1) + " m_nominalTau2=" + std::to_string(m_nominalTau2) + " m_nominalT0HG=" + std::to_string(m_nominalT0HG) + " m_nominalT0LG=" + std::to_string(m_nominalT0LG)));
1779 
1780  (*m_msgFunc_p)(ZDCMsg::Info, ("m_defaultFitTMax = " + std::to_string(m_defaultFitTMax)));
1781 
1782  (*m_msgFunc_p)(ZDCMsg::Info, ("m_HGOverflowADC = " + std::to_string(m_HGOverflowADC) + " m_HGUnderflowADC=" + std::to_string(m_HGUnderflowADC) + " m_LGOverflowADC=" + std::to_string(m_LGOverflowADC)));
1783 
1784  (*m_msgFunc_p)(ZDCMsg::Info, ("m_chisqDivAmpCutLG = " + std::to_string(m_chisqDivAmpCutLG) + " m_chisqDivAmpCutHG=" + std::to_string(m_chisqDivAmpCutHG)));
1785 
1786  (*m_msgFunc_p)(ZDCMsg::Info, ("m_T0CutLowLG = " + std::to_string(m_T0CutLowLG) + " m_T0CutHighLG=" + std::to_string(m_T0CutHighLG) + " m_T0CutLowHG=" + std::to_string(m_T0CutLowHG) + " m_T0CutHighHG=" + std::to_string(m_T0CutHighHG)));
1787 }

◆ dumpTF1()

void ZDCPulseAnalyzer::dumpTF1 ( const TF1 *  func) const

Definition at line 1754 of file ZDCPulseAnalyzer.cxx.

1755 {
1756  std::string message = "Dump of TF1: " + std::string(func->GetName());
1757  (*m_msgFunc_p)(ZDCMsg::Verbose, std::move(message));
1758 
1759  unsigned int npar = func->GetNpar();
1760  for (unsigned int ipar = 0; ipar < npar; ipar++) {
1761  std::ostringstream msgstr;
1762 
1763  double parMin = 0, parMax = 0;
1764  func->GetParLimits(ipar, parMin, parMax);
1765 
1766  msgstr << "Parameter " << ipar << ", value = " << func->GetParameter(ipar) << ", error = "
1767  << func->GetParError(ipar) << ", min = " << parMin << ", max = " << parMax;
1768  (*m_msgFunc_p)(ZDCMsg::Verbose, msgstr.str());
1769  }
1770 }

◆ enableDelayed()

void ZDCPulseAnalyzer::enableDelayed ( float  deltaT,
float  pedestalShift,
bool  fixedBaseline = false 
)

Definition at line 118 of file ZDCPulseAnalyzer.cxx.

119 {
120  m_useDelayed = true;
121  m_useFixedBaseline = fixedBaseline;
122 
123  m_delayedDeltaT = deltaT;
124  m_delayedPedestalDiff = pedestalShift;
125 
126  m_deltaTSample /= 2.;
127 
128  m_delayedHist = std::make_unique<TH1F>((std::string(m_fitHist->GetName()) + "delayed").c_str(), "", m_Nsample, m_tmin + m_delayedDeltaT, m_tmax + m_delayedDeltaT);
129  m_delayedHist->SetDirectory(0);
130 
131  m_ADCSamplesHGSub.assign(2 * m_Nsample, 0);
132 }

◆ enablePostExclusion()

void ZDCPulseAnalyzer::enablePostExclusion ( unsigned int  maxSamplesExcl,
unsigned int  HGADCThresh,
unsigned int  LGADCThresh 
)
inline

Definition at line 406 of file ZDCPulseAnalyzer.h.

407  {
408  m_enablePostExcl = true;
409  m_maxSamplesPostExcl = maxSamplesExcl;
410  m_postExclHGADCThresh = HGADCThresh;
411  m_postExclLGADCThresh = LGADCThresh;
412  }

◆ enablePreExclusion()

void ZDCPulseAnalyzer::enablePreExclusion ( unsigned int  maxSamplesExcl,
unsigned int  HGADCThresh,
unsigned int  LGADCThresh 
)
inline

Definition at line 398 of file ZDCPulseAnalyzer.h.

399  {
400  m_enablePreExcl = true;
401  m_maxSamplesPreExcl = maxSamplesExcl;
402  m_preExclHGADCThresh = HGADCThresh;
403  m_preExclLGADCThresh = LGADCThresh;
404  }

◆ enableRepass()

void ZDCPulseAnalyzer::enableRepass ( float  peak2ndDerivMinRepassHG,
float  peak2ndDerivMinRepassLG 
)

Definition at line 134 of file ZDCPulseAnalyzer.cxx.

135 {
136  m_enableRepass = true;
137  m_peak2ndDerivMinRepassHG = peak2ndDerivMinRepassHG;
138  m_peak2ndDerivMinRepassLG = peak2ndDerivMinRepassLG;
139 }

◆ enableTimeSigCut()

void ZDCPulseAnalyzer::enableTimeSigCut ( bool  AND,
float  sigCut,
std::string  TF1String,
const std::vector< double > &  parsHG,
const std::vector< double > &  parsLG 
)

Definition at line 388 of file ZDCPulseAnalyzer.cxx.

391 {
392  m_timeCutMode = AND ? 2 : 1;
393  m_t0CutSig = sigCut;
394 
395  // Make the TF1's that provide the resolution
396  //
397  std::string timeResHGName = "TimeResFuncHG_" + m_tag;
398  std::string timeResLGName = "TimeResFuncLG_" + m_tag;
399 
400  TF1* funcHG_p = new TF1(timeResHGName.c_str(), TF1String.c_str(), 0, m_HGOverflowADC);
401  TF1* funcLG_p = new TF1(timeResLGName.c_str(), TF1String.c_str(), 0, m_LGOverflowADC);
402 
403  if (parsHG.size() != static_cast<unsigned int>(funcHG_p->GetNpar()) ||
404  parsLG.size() != static_cast<unsigned int>(funcLG_p->GetNpar())) {
405  //
406  // generate an error message
407  }
408 
409  funcHG_p->SetParameters(&parsHG[0]);
410  funcLG_p->SetParameters(&parsLG[0]);
411 
412  m_timeResFuncHG_p.reset(funcHG_p);
413  m_timeResFuncLG_p.reset(funcLG_p);
414 
415 }

◆ ExcludeEarlyLG()

bool ZDCPulseAnalyzer::ExcludeEarlyLG ( ) const
inline

Definition at line 505 of file ZDCPulseAnalyzer.h.

505 {return m_ExcludeEarly;}

◆ ExcludeLateLG()

bool ZDCPulseAnalyzer::ExcludeLateLG ( ) const
inline

Definition at line 506 of file ZDCPulseAnalyzer.h.

506 {return m_ExcludeLate;}

◆ Failed()

bool ZDCPulseAnalyzer::Failed ( ) const
inline

Definition at line 491 of file ZDCPulseAnalyzer.h.

491 {return m_fail;}

◆ FillHistogram()

void ZDCPulseAnalyzer::FillHistogram ( const std::vector< float > &  samples,
float  noiseSig 
) const
inlineprivate

Definition at line 343 of file ZDCPulseAnalyzer.h.

344  {
345  if (!m_useDelayed) {
346  // Set the data and errors in the histogram object
347  //
348  for (size_t isample = 0; isample < m_Nsample; isample++) {
349  m_fitHist->SetBinContent(isample + 1, samples[isample]);
350  m_fitHist->SetBinError(isample + 1, noiseSig);
351  }
352  }
353  else {
354  // Set the data and errors in the histogram object
355  //
356  for (size_t isample = 0; isample < m_Nsample; isample++) {
357  m_fitHist->SetBinContent(isample + 1, samples[isample * 2]);
358  m_delayedHist->SetBinContent(isample + 1, samples[isample * 2 + 1]);
359 
360  m_fitHist->SetBinError(isample + 1, noiseSig);
361  m_delayedHist->SetBinError(isample + 1, noiseSig);
362  }
363 
364  }
365  }

◆ FitFailed()

bool ZDCPulseAnalyzer::FitFailed ( ) const
inline

Definition at line 501 of file ZDCPulseAnalyzer.h.

501 {return m_fitFailed;}

◆ fitMinimumAmplitude()

bool ZDCPulseAnalyzer::fitMinimumAmplitude ( ) const
inline

Definition at line 508 of file ZDCPulseAnalyzer.h.

508 {return m_fitMinAmp;}

◆ ForceLG()

bool ZDCPulseAnalyzer::ForceLG ( ) const
inline

Definition at line 420 of file ZDCPulseAnalyzer.h.

420 {return m_forceLG;}

◆ GetAmpError()

float ZDCPulseAnalyzer::GetAmpError ( ) const
inline

Definition at line 535 of file ZDCPulseAnalyzer.h.

535 {return m_ampError;}

◆ GetAmplitude()

float ZDCPulseAnalyzer::GetAmplitude ( ) const
inline

Definition at line 534 of file ZDCPulseAnalyzer.h.

534 {return m_amplitude;}

◆ GetAmpNoNonLin()

float ZDCPulseAnalyzer::GetAmpNoNonLin ( ) const
inline

Definition at line 533 of file ZDCPulseAnalyzer.h.

533 {return m_ampNoNonLin;}

◆ GetBkgdMaxFraction()

float ZDCPulseAnalyzer::GetBkgdMaxFraction ( ) const
inline

Definition at line 561 of file ZDCPulseAnalyzer.h.

561 {return m_bkgdMaxFraction;}

◆ GetChisq()

float ZDCPulseAnalyzer::GetChisq ( ) const
inline

Definition at line 523 of file ZDCPulseAnalyzer.h.

523 {return m_fitChisq;}

◆ GetCombinedGraph()

std::shared_ptr< TGraphErrors > ZDCPulseAnalyzer::GetCombinedGraph ( ) const

Definition at line 1818 of file ZDCPulseAnalyzer.cxx.

1818  {
1819  //
1820  // We defer filling the histogram if we don't have a pulse until the histogram is requested
1821  //
1822  GetHistogramPtr();
1823 
1824  std::shared_ptr<TGraphErrors> theGraph = std::make_shared<TGraphErrors>(TGraphErrors(2 * m_Nsample));
1825  size_t npts = 0;
1826 
1827  for (int ipt = 0; ipt < m_fitHist->GetNbinsX(); ipt++) {
1828  theGraph->SetPoint(npts, m_fitHist->GetBinCenter(ipt + 1), m_fitHist->GetBinContent(ipt + 1));
1829  theGraph->SetPointError(npts++, 0, m_fitHist->GetBinError(ipt + 1));
1830  }
1831 
1832  for (int iDelayPt = 0; iDelayPt < m_delayedHist->GetNbinsX(); iDelayPt++) {
1833  theGraph->SetPoint(npts, m_delayedHist->GetBinCenter(iDelayPt + 1), m_delayedHist->GetBinContent(iDelayPt + 1) - m_delayedBaselineShift);
1834  theGraph->SetPointError(npts++, 0, m_delayedHist->GetBinError(iDelayPt + 1));
1835  }
1836  if (m_havePulse) {
1837  TF1* func_p = (TF1*) m_fitHist->GetListOfFunctions()->Last();
1838  if (func_p) {
1839  theGraph->GetListOfFunctions()->Add(new TF1(*func_p));
1840  m_fitHist->GetListOfFunctions()->SetOwner (false);
1841  }
1842  }
1843  theGraph->SetName(( std::string(m_fitHist->GetName()) + "combinaed").c_str());
1844 
1845  theGraph->SetMarkerStyle(20);
1846  theGraph->SetMarkerColor(1);
1847 
1848  return theGraph;
1849 }

◆ GetdelayBS()

float ZDCPulseAnalyzer::GetdelayBS ( ) const
inline

Definition at line 553 of file ZDCPulseAnalyzer.h.

553 {return m_delayedBaselineShift;}

◆ GetDelayedBaselineCorr()

float ZDCPulseAnalyzer::GetDelayedBaselineCorr ( ) const
inline

Definition at line 564 of file ZDCPulseAnalyzer.h.

564 {return m_baselineCorr;}

◆ GetDelayedBaselineShiftFit()

float ZDCPulseAnalyzer::GetDelayedBaselineShiftFit ( ) const
inline

Definition at line 563 of file ZDCPulseAnalyzer.h.

563 {return m_delayedBaselineShift;}

◆ GetDelayedGraph()

std::shared_ptr< TGraphErrors > ZDCPulseAnalyzer::GetDelayedGraph ( ) const

Definition at line 1900 of file ZDCPulseAnalyzer.cxx.

1900  {
1901  //
1902  // We defer filling the histogram if we don't have a pulse until the histogram is requested
1903  //
1904  GetHistogramPtr();
1905 
1906  std::shared_ptr<TGraphErrors> theGraph = std::make_shared<TGraphErrors>(TGraphErrors(m_Nsample));
1907  size_t npts = 0;
1908 
1909  for (int iDelayPt = 0; iDelayPt < m_delayedHist->GetNbinsX(); iDelayPt++) {
1910  theGraph->SetPoint(npts, m_delayedHist->GetBinCenter(iDelayPt + 1), m_delayedHist->GetBinContent(iDelayPt + 1) - m_delayedBaselineShift);
1911  theGraph->SetPointError(npts++, 0, m_delayedHist->GetBinError(iDelayPt + 1));
1912  }
1913 
1914  TF1* func_p = (TF1*) m_fitHist->GetListOfFunctions()->Last();
1915  theGraph->GetListOfFunctions()->Add(func_p);
1916  theGraph->SetName(( std::string(m_fitHist->GetName()) + "delayed").c_str());
1917 
1918  theGraph->SetMarkerStyle(20);
1919  theGraph->SetMarkerColor(kBlue);
1920 
1921  return theGraph;
1922 }

◆ GetFitAmplitude()

float ZDCPulseAnalyzer::GetFitAmplitude ( ) const
inline

Definition at line 518 of file ZDCPulseAnalyzer.h.

518 {return m_fitAmplitude;}

◆ GetFitExpAmp()

float ZDCPulseAnalyzer::GetFitExpAmp ( ) const
inline

Definition at line 530 of file ZDCPulseAnalyzer.h.

530 {return m_fitExpAmp;}

◆ GetFitPostAmp()

float ZDCPulseAnalyzer::GetFitPostAmp ( ) const
inline

Definition at line 529 of file ZDCPulseAnalyzer.h.

529 {return m_postAmplitude;}

◆ GetFitPostT0()

float ZDCPulseAnalyzer::GetFitPostT0 ( ) const
inline

Definition at line 528 of file ZDCPulseAnalyzer.h.

528 {return m_fitPostT0;}

◆ GetFitPreAmp()

float ZDCPulseAnalyzer::GetFitPreAmp ( ) const
inline

Definition at line 527 of file ZDCPulseAnalyzer.h.

527 {return m_preAmplitude;}

◆ GetFitPreT0()

float ZDCPulseAnalyzer::GetFitPreT0 ( ) const
inline

Definition at line 526 of file ZDCPulseAnalyzer.h.

526 {return m_fitPreT0;}

◆ GetFitPulls()

std::vector< float > ZDCPulseAnalyzer::GetFitPulls ( ) const

Definition at line 418 of file ZDCPulseAnalyzer.cxx.

419 {
420  //
421  // If there was no pulse for this event, return an empty vector (see reset() method)
422  //
423  if (!m_havePulse) {
424  return m_fitPulls;
425  }
426 
427  //
428  // The combined (delayed+undelayed) pulse fitting fills out m_fitPulls directly
429  //
430  if (m_useDelayed) {
431  return m_fitPulls;
432  }
433  else {
434  //
435  // When not using combined fitting, We don't have the pre-calculated pulls. Calculate them on the fly.
436  //
437  std::vector<float> pulls(m_Nsample, -100);
438 
439  const TH1* dataHist_p = m_fitHist.get();
440  const TF1* fit_p = (const TF1*) dataHist_p->GetListOfFunctions()->Last();
441 
442  for (size_t ibin = 0; ibin < m_Nsample ; ibin++) {
443  float t = dataHist_p->GetBinCenter(ibin + 1);
444  float fitVal = fit_p->Eval(t);
445  float histVal = dataHist_p->GetBinContent(ibin + 1);
446  float histErr = dataHist_p->GetBinError(ibin + 1);
447  float pull = (histVal - fitVal)/histErr;
448  pulls[ibin] = pull;
449  }
450 
451  return pulls;
452  }
453 }

◆ GetFitT0()

float ZDCPulseAnalyzer::GetFitT0 ( ) const
inline

Definition at line 519 of file ZDCPulseAnalyzer.h.

519 {return m_fitTime;}

◆ GetFitTau1()

float ZDCPulseAnalyzer::GetFitTau1 ( ) const
inline

Definition at line 524 of file ZDCPulseAnalyzer.h.

524 {return m_fitTau1;}

◆ GetFitTau2()

float ZDCPulseAnalyzer::GetFitTau2 ( ) const
inline

Definition at line 525 of file ZDCPulseAnalyzer.h.

525 {return m_fitTau2;}

◆ GetFitTMax()

float ZDCPulseAnalyzer::GetFitTMax ( ) const
inline

Definition at line 550 of file ZDCPulseAnalyzer.h.

550 {return m_fitTMax;}

◆ GetFitTMin()

float ZDCPulseAnalyzer::GetFitTMin ( ) const
inline

Definition at line 551 of file ZDCPulseAnalyzer.h.

551 {return m_fitTMin;}

◆ GetGraph()

std::shared_ptr< TGraphErrors > ZDCPulseAnalyzer::GetGraph ( ) const

Definition at line 1852 of file ZDCPulseAnalyzer.cxx.

1852  {
1853  //
1854  // We defer filling the histogram if we don't have a pulse until the histogram is requested
1855  //
1856  GetHistogramPtr();
1857 
1858  std::shared_ptr<TGraphErrors> theGraph = std::make_shared<TGraphErrors>(TGraphErrors(m_Nsample));
1859  size_t npts = 0;
1860 
1861  for (int ipt = 0; ipt < m_fitHist->GetNbinsX(); ipt++) {
1862  theGraph->SetPoint(npts, m_fitHist->GetBinCenter(ipt + 1), m_fitHist->GetBinContent(ipt + 1));
1863  theGraph->SetPointError(npts++, 0, m_fitHist->GetBinError(ipt + 1));
1864  }
1865 
1866  TF1* func_p = (TF1*) m_fitHist->GetListOfFunctions()->Last();
1867  theGraph->GetListOfFunctions()->Add(func_p);
1868  theGraph->SetName(( std::string(m_fitHist->GetName()) + "not_combinaed").c_str());
1869 
1870  theGraph->SetMarkerStyle(20);
1871  theGraph->SetMarkerColor(1);
1872 
1873  return theGraph;
1874 }

◆ GetHistogramPtr()

const TH1* ZDCPulseAnalyzer::GetHistogramPtr ( ) const
inline

Definition at line 566 of file ZDCPulseAnalyzer.h.

566  {
567  //
568  // We defer filling the histogram if we don't have a pulse until the histogram is requested
569  //
570  if (!m_havePulse) {
573  }
574 
575  return m_fitHist.get();
576  }

◆ GetMaxADC()

float ZDCPulseAnalyzer::GetMaxADC ( ) const
inline

Definition at line 541 of file ZDCPulseAnalyzer.h.

541 {return m_maxADCValue;}

◆ GetMaxADCSample()

int ZDCPulseAnalyzer::GetMaxADCSample ( ) const
inline

Definition at line 544 of file ZDCPulseAnalyzer.h.

544 {return m_maxSampl;}

◆ GetMaxDelta()

float ZDCPulseAnalyzer::GetMaxDelta ( ) const
inline

Definition at line 547 of file ZDCPulseAnalyzer.h.

547 {return m_maxDelta;}

◆ GetMinADC()

float ZDCPulseAnalyzer::GetMinADC ( ) const
inline

Definition at line 542 of file ZDCPulseAnalyzer.h.

542 {return m_minADCValue;}

◆ GetMinADCSample()

int ZDCPulseAnalyzer::GetMinADCSample ( ) const
inline

Definition at line 545 of file ZDCPulseAnalyzer.h.

545 {return m_minSampl;}

◆ GetMinDelta()

float ZDCPulseAnalyzer::GetMinDelta ( ) const
inline

Definition at line 548 of file ZDCPulseAnalyzer.h.

548 {return m_minDelta;}

◆ GetMinDeriv2nd()

float ZDCPulseAnalyzer::GetMinDeriv2nd ( ) const
inline

Definition at line 555 of file ZDCPulseAnalyzer.h.

555 {return m_minDeriv2nd;}

◆ GetMinDeriv2ndIndex()

float ZDCPulseAnalyzer::GetMinDeriv2ndIndex ( ) const
inline

Definition at line 556 of file ZDCPulseAnalyzer.h.

556 {return m_minDeriv2ndIndex;}

◆ GetPreExpAmp()

float ZDCPulseAnalyzer::GetPreExpAmp ( ) const
inline

Definition at line 537 of file ZDCPulseAnalyzer.h.

537 {return m_expAmplitude;}

◆ GetPresample()

float ZDCPulseAnalyzer::GetPresample ( ) const
inline

Definition at line 539 of file ZDCPulseAnalyzer.h.

539 {return m_preSample;}

◆ GetPreSampleAmp()

float ZDCPulseAnalyzer::GetPreSampleAmp ( ) const
inline

Definition at line 560 of file ZDCPulseAnalyzer.h.

560 {return m_preSampleAmp;}

◆ GetSamplesDeriv2nd()

const std::vector<float>& ZDCPulseAnalyzer::GetSamplesDeriv2nd ( ) const
inline

Definition at line 591 of file ZDCPulseAnalyzer.h.

591 {return m_samplesDeriv2nd;}

◆ GetSamplesSub()

const std::vector<float>& ZDCPulseAnalyzer::GetSamplesSub ( ) const
inline

Definition at line 590 of file ZDCPulseAnalyzer.h.

590 {return m_samplesSub;}

◆ GetStatusMask()

unsigned int ZDCPulseAnalyzer::GetStatusMask ( ) const

Definition at line 1789 of file ZDCPulseAnalyzer.cxx.

1790 {
1791  unsigned int statusMask = 0;
1792 
1793  if (HavePulse()) statusMask |= 1 << PulseBit;
1794  if (UseLowGain()) statusMask |= 1 << LowGainBit;
1795  if (Failed()) statusMask |= 1 << FailBit;
1796  if (HGOverflow()) statusMask |= 1 << HGOverflowBit;
1797 
1798  if (HGUnderflow()) statusMask |= 1 << HGUnderflowBit;
1799  if (PSHGOverUnderflow()) statusMask |= 1 << PSHGOverUnderflowBit;
1800  if (LGOverflow()) statusMask |= 1 << LGOverflowBit;
1801  if (LGUnderflow()) statusMask |= 1 << LGUnderflowBit;
1802 
1803  if (PrePulse()) statusMask |= 1 << PrePulseBit;
1804  if (PostPulse()) statusMask |= 1 << PostPulseBit;
1805  if (FitFailed()) statusMask |= 1 << FitFailedBit;
1806  if (BadChisq()) statusMask |= 1 << BadChisqBit;
1807 
1808  if (BadT0()) statusMask |= 1 << BadT0Bit;
1809  if (ExcludeEarlyLG()) statusMask |= 1 << ExcludeEarlyLGBit;
1810  if (ExcludeLateLG()) statusMask |= 1 << ExcludeLateLGBit;
1811  if (preExpTail()) statusMask |= 1 << preExpTailBit;
1812  if (fitMinimumAmplitude()) statusMask |= 1 << FitMinAmpBit;
1813  if (repassPulse()) statusMask |= 1 << RepassPulseBit;
1814 
1815  return statusMask;
1816 }

◆ GetT0Corr()

float ZDCPulseAnalyzer::GetT0Corr ( ) const
inline

Definition at line 521 of file ZDCPulseAnalyzer.h.

521 {return m_fitTimeCorr;}

◆ GetT0Sub()

float ZDCPulseAnalyzer::GetT0Sub ( ) const
inline

Definition at line 520 of file ZDCPulseAnalyzer.h.

520 {return m_fitTimeSub;}

◆ getTimeSig()

float ZDCPulseAnalyzer::getTimeSig ( ) const
inline

Definition at line 522 of file ZDCPulseAnalyzer.h.

522 {return m_timeSig;}

◆ GetUndelayedGraph()

std::shared_ptr< TGraphErrors > ZDCPulseAnalyzer::GetUndelayedGraph ( ) const

Definition at line 1876 of file ZDCPulseAnalyzer.cxx.

1876  {
1877  //
1878  // We defer filling the histogram if we don't have a pulse until the histogram is requested
1879  //
1880  GetHistogramPtr();
1881 
1882  std::shared_ptr<TGraphErrors> theGraph = std::make_shared<TGraphErrors>(TGraphErrors(m_Nsample));
1883  size_t npts = 0;
1884 
1885  for (int ipt = 0; ipt < m_fitHist->GetNbinsX(); ipt++) {
1886  theGraph->SetPoint(npts, m_fitHist->GetBinCenter(ipt + 1), m_fitHist->GetBinContent(ipt + 1));
1887  theGraph->SetPointError(npts++, 0, m_fitHist->GetBinError(ipt + 1));
1888  }
1889 
1890  TF1* func_p = (TF1*) m_fitHist->GetListOfFunctions()->Last();
1891  theGraph->GetListOfFunctions()->Add(func_p);
1892  theGraph->SetName(( std::string(m_fitHist->GetName()) + "undelayed").c_str());
1893 
1894  theGraph->SetMarkerStyle(20);
1895  theGraph->SetMarkerColor(1);
1896 
1897  return theGraph;
1898 }

◆ HaveData()

bool ZDCPulseAnalyzer::HaveData ( ) const
inline

Definition at line 484 of file ZDCPulseAnalyzer.h.

484 {return m_haveData;}

◆ HavePulse()

bool ZDCPulseAnalyzer::HavePulse ( ) const
inline

Definition at line 489 of file ZDCPulseAnalyzer.h.

489 {return m_havePulse;}

◆ HGOverflow()

bool ZDCPulseAnalyzer::HGOverflow ( ) const
inline

Definition at line 492 of file ZDCPulseAnalyzer.h.

492 {return m_HGOverflow;}

◆ HGUnderflow()

bool ZDCPulseAnalyzer::HGUnderflow ( ) const
inline

Definition at line 494 of file ZDCPulseAnalyzer.h.

494 {return m_HGUnderflow;}

◆ LGOverflow()

bool ZDCPulseAnalyzer::LGOverflow ( ) const
inline

Definition at line 496 of file ZDCPulseAnalyzer.h.

496 {return m_LGOverflow;}

◆ LGUnderflow()

bool ZDCPulseAnalyzer::LGUnderflow ( ) const
inline

Definition at line 497 of file ZDCPulseAnalyzer.h.

497 {return m_LGUnderflow;}

◆ LoadAndAnalyzeData() [1/2]

bool ZDCPulseAnalyzer::LoadAndAnalyzeData ( const std::vector< float > &  ADCSamplesHG,
const std::vector< float > &  ADCSamplesLG 
)

Definition at line 548 of file ZDCPulseAnalyzer.cxx.

549 {
550  if (m_useDelayed) {
551  (*m_msgFunc_p)(ZDCMsg::Fatal, "ZDCPulseAnalyzer::LoadAndAnalyzeData:: Wrong LoadAndAnalyzeData called -- expecting both delayed and undelayed samples");
552  }
553 
555 
556  // Clear any transient data
557  //
558  Reset(false);
559 
560  // Make sure we have the right number of samples. Should never fail. necessry?
561  //
562  if (ADCSamplesHG.size() != m_Nsample || ADCSamplesLG.size() != m_Nsample) {
563  m_fail = true;
564  return false;
565  }
566 
567  m_ADCSamplesHG = ADCSamplesHG;
568  m_ADCSamplesLG = ADCSamplesLG;
569 
570  return DoAnalysis(false);
571 }

◆ LoadAndAnalyzeData() [2/2]

bool ZDCPulseAnalyzer::LoadAndAnalyzeData ( const std::vector< float > &  ADCSamplesHG,
const std::vector< float > &  ADCSamplesLG,
const std::vector< float > &  ADCSamplesHGDelayed,
const std::vector< float > &  ADCSamplesLGDelayed 
)

Definition at line 573 of file ZDCPulseAnalyzer.cxx.

575 {
576  if (!m_useDelayed) {
577  (*m_msgFunc_p)(ZDCMsg::Fatal, "ZDCPulseAnalyzer::LoadAndAnalyzeData:: Wrong LoadAndAnalyzeData called -- expecting only undelayed samples");
578  }
579 
581 
582  // Clear any transient data
583  //
584  Reset();
585 
586  // Make sure we have the right number of samples. Should never fail. necessry?
587  //
588  if (ADCSamplesHG.size() != m_Nsample || ADCSamplesLG.size() != m_Nsample ||
589  ADCSamplesHGDelayed.size() != m_Nsample || ADCSamplesLGDelayed.size() != m_Nsample) {
590  m_fail = true;
591  return false;
592  }
593 
594  m_ADCSamplesHG.reserve(m_Nsample*2);
595  m_ADCSamplesLG.reserve(m_Nsample*2);
596 
597  // Now do pedestal subtraction and check for overflows
598  //
599  for (size_t isample = 0; isample < m_Nsample; isample++) {
600  float ADCHG = ADCSamplesHG[isample];
601  float ADCLG = ADCSamplesLG[isample];
602 
603  float ADCHGDelay = ADCSamplesHGDelayed[isample] - m_delayedPedestalDiff;
604  float ADCLGDelay = ADCSamplesLGDelayed[isample] - m_delayedPedestalDiff;
605 
606  if (m_delayedDeltaT > 0) {
607  m_ADCSamplesHG.push_back(ADCHG);
608  m_ADCSamplesHG.push_back(ADCHGDelay);
609 
610  m_ADCSamplesLG.push_back(ADCLG);
611  m_ADCSamplesLG.push_back(ADCLGDelay);
612  }
613  else {
614  m_ADCSamplesHG.push_back(ADCHGDelay);
615  m_ADCSamplesHG.push_back(ADCHG);
616 
617  m_ADCSamplesLG.push_back(ADCLGDelay);
618  m_ADCSamplesLG.push_back(ADCLG);
619  }
620  }
621 
622  return DoAnalysis(false);
623 }

◆ MakeCombinedFitter()

std::unique_ptr< TFitter > ZDCPulseAnalyzer::MakeCombinedFitter ( TF1 *  func)
staticprivate

Definition at line 1671 of file ZDCPulseAnalyzer.cxx.

1672 {
1673  TVirtualFitter::SetDefaultFitter("Minuit");
1674 
1675  size_t nFitParams = func->GetNpar() + 1;
1676  std::unique_ptr<TFitter> fitter = std::make_unique<TFitter>(nFitParams);
1677 
1678  fitter->GetMinuit()->fISW[4] = -1;
1679  fitter->SetParameter(0, "delayBaselineAdjust", 0, 0.01, -100, 100);
1680 
1681  for (size_t ipar = 0; ipar < nFitParams - 1; ipar++) {
1682  double parLimitLow, parLimitHigh;
1683 
1684  func->GetParLimits(ipar, parLimitLow, parLimitHigh);
1685  if (std::abs(parLimitHigh / parLimitLow - 1) < 1e-6) {
1686  double value = func->GetParameter(ipar);
1687  double lowLim = std::min(value * 0.99, value * 1.01);
1688  double highLim = std::max(value * 0.99, value * 1.01);
1689 
1690  fitter->SetParameter(ipar + 1, func->GetParName(ipar), func->GetParameter(ipar), 0.01, lowLim, highLim);
1691  fitter->FixParameter(ipar + 1);
1692  }
1693  else {
1694  double value = func->GetParameter(ipar);
1695  if (value >= parLimitHigh) value = parLimitHigh * 0.99;
1696  else if (value <= parLimitLow) value = parLimitLow * 1.01;
1697 
1698  double step = std::min((parLimitHigh - parLimitLow)/100., (value - parLimitLow)/100.);
1699 
1700  fitter->SetParameter(ipar + 1, func->GetParName(ipar), value, step, parLimitLow, parLimitHigh);
1701  }
1702  }
1703 
1705 
1706  return fitter;
1707 }

◆ obtainDelayedBaselineCorr()

float ZDCPulseAnalyzer::obtainDelayedBaselineCorr ( const std::vector< float > &  samples)
staticprivate

Definition at line 1977 of file ZDCPulseAnalyzer.cxx.

1978 {
1979  const unsigned int nsamples = samples.size();
1980 
1981  std::vector<float> derivVec = CalculateDerivative(samples, 2);
1982  std::vector<float> deriv2ndVec = Calculate2ndDerivative(samples, 2);
1983 
1984  // Now step through and check even and odd samples values for 2nd derivative and derivative
1985  // we start with index 2 since the 2nd derivative calculation has 2 initial zeros with nstep = 2
1986  //
1987  float minScore = 1.0e9;
1988  unsigned int minIndex = 0;
1989 
1990  for (unsigned int idx = 2; idx < nsamples - 1; idx++) {
1991  float deriv = derivVec[idx];
1992  float prevDeriv = derivVec[idx - 1];
1993 
1994  float derivDiff = deriv - prevDeriv;
1995 
1996  float deriv2nd = deriv2ndVec[idx];
1997  if (idx > nsamples - 2) deriv2nd = deriv2ndVec[idx - 1];
1998 
1999  // Calculate a score based on the actual derivatives (squared) and 2nd derivatives (squared)
2000  // and the slope differences (squared). The relative weights are not adjustable for now
2001  //
2002  float score = (deriv*deriv + 2*derivDiff*derivDiff +
2003  0.5*deriv2nd*deriv2nd);
2004 
2005  if (score < minScore) {
2006  minScore = score;
2007  minIndex = idx;
2008  }
2009  }
2010 
2011  // We use four samples, two each of "even" and "odd".
2012  // Because of the way the above analysis is done, we can always
2013  // Go back one even and one odd sample and forward one odd sample.
2014  //
2015  //if minIndex is < 2 or >samples.size() the result is undefined; prevent this:
2016  if (minIndex<2 or (minIndex+1) >=nsamples){
2017  throw std::out_of_range("minIndex out of range in ZDCPulseAnalyzer::obtainDelayedBaselineCorr");
2018  }
2019  float sample0 = samples[minIndex - 2];
2020  float sample1 = samples[minIndex - 1];
2021  float sample2 = samples[minIndex];
2022  float sample3 = samples[minIndex + 1];
2023 
2024  // Possibility -- implement logarithmic interpolation for large 2nd derivative?
2025  //
2026  float baselineCorr = (0.5 * (sample1 - sample0 + sample3 - sample2) -
2027  0.25 * (sample3 - sample1 + sample2 - sample0));
2028 
2029  if (minIndex % 2 != 0) baselineCorr =-baselineCorr;
2030 
2031  return baselineCorr;
2032 }

◆ PostPulse()

bool ZDCPulseAnalyzer::PostPulse ( ) const
inline

Definition at line 500 of file ZDCPulseAnalyzer.h.

500 {return m_postPulse;}

◆ preExpTail()

bool ZDCPulseAnalyzer::preExpTail ( ) const
inline

Definition at line 507 of file ZDCPulseAnalyzer.h.

507 {return m_preExpTail;}

◆ PrePulse()

bool ZDCPulseAnalyzer::PrePulse ( ) const
inline

Definition at line 499 of file ZDCPulseAnalyzer.h.

499 {return m_prePulse;}

◆ PSHGOverUnderflow()

bool ZDCPulseAnalyzer::PSHGOverUnderflow ( ) const
inline

Definition at line 495 of file ZDCPulseAnalyzer.h.

495 {return m_PSHGOverUnderflow;}

◆ QuietFits()

static bool ZDCPulseAnalyzer::QuietFits ( )
inlinestatic

Definition at line 388 of file ZDCPulseAnalyzer.h.

388 {return s_quietFits;}

◆ ReanalyzeData()

bool ZDCPulseAnalyzer::ReanalyzeData ( )

Definition at line 625 of file ZDCPulseAnalyzer.cxx.

626 {
627  Reset(true);
628 
629  bool result = DoAnalysis(true);
630  if (result && HavePulse()) {
631  m_repassPulse = true;
632  }
633 
634  return result;
635 }

◆ repassPulse()

bool ZDCPulseAnalyzer::repassPulse ( ) const
inline

Definition at line 509 of file ZDCPulseAnalyzer.h.

509 {return m_repassPulse;}

◆ Reset()

void ZDCPulseAnalyzer::Reset ( bool  reanalyze = false)
private

Definition at line 205 of file ZDCPulseAnalyzer.cxx.

206 {
207  if (!repass) {
208  m_haveData = false;
209 
210  m_useLowGain = false;
211  m_fail = false;
212  m_HGOverflow = false;
213 
214  m_HGUnderflow = false;
215  m_PSHGOverUnderflow = false;
216  m_LGOverflow = false;
217  m_LGUnderflow = false;
218 
219  m_ExcludeEarly = false;
220  m_ExcludeLate = false;
221 
222  m_adjTimeRangeEvent = false;
223  m_backToHG_pre = false;
224  m_fixPrePulse = false;
225 
226  int sampleVecSize = m_Nsample;
227  if (m_useDelayed) sampleVecSize *= 2;
228 
229  m_ADCSamplesHG.clear();
230  m_ADCSamplesLG.clear();
231 
232  m_ADCSamplesHGSub.clear();
233  m_ADCSamplesLGSub.clear();
234 
235  m_ADCSSampSigHG.assign(sampleVecSize, m_noiseSigHG);
236  m_ADCSSampSigLG.assign(sampleVecSize, m_noiseSigLG);
237 
238  m_minSampleEvt = 0;
239  m_maxSampleEvt = (m_useDelayed ? 2 * m_Nsample - 1 : m_Nsample - 1);
240 
241  m_usedPresampIdx = 0;
242 
245 
246  m_lastHGOverFlowSample = -999;
248  }
249 
252 
253  if (m_initializedFits) {
257  }
258 
259  // -----------------------
260  // Statuses
261  //
262  m_havePulse = false;
263 
264  m_prePulse = false;
265  m_postPulse = false;
266  m_fitFailed = false;
267  m_badChisq = false;
268 
269  m_badT0 = false;
270  m_preExpTail = false;
271  m_repassPulse = false;
272 
273  m_fitMinAmp = false;
274 
275  // -----------------------
276 
278 
279  m_fitAmplitude = 0;
280  m_fitTime = -100;
281  m_fitTimeSub = -100;
282  m_fitTimeCorr = -100;
283  m_fitTCorr2nd = -100;
284 
285  m_fitPreT0 = -100;
286  m_fitPreAmp = -100;
287  m_fitPostT0 = -100;
288  m_fitPostAmp = -100;
289  m_fitExpAmp = -100;
290 
291  m_minDeriv2ndSig = -10;
292  m_preExpSig = -10;
293  m_prePulseSig = -10;
294 
295  m_fitChisq = 0;
296 
297  m_amplitude = 0;
298  m_ampError = 0;
299  m_preSampleAmp = 0;
300  m_preAmplitude = 0;
301  m_postAmplitude = 0;
302  m_expAmplitude = 0;
303  m_bkgdMaxFraction = 0;
304 
305 
306  m_initialPrePulseT0 = -10;
308 
309  m_initialPostPulseT0 = 100;
310 
311  m_initialExpAmp = 0;
312  m_fitPostT0lo = 0;
313 
314  m_fitPulls.clear();
315 
316  m_samplesSub.clear();
317  m_samplesDeriv2nd.clear();
318 }

◆ ScanAndSubtractSamples()

bool ZDCPulseAnalyzer::ScanAndSubtractSamples ( )
private

Definition at line 637 of file ZDCPulseAnalyzer.cxx.

638 {
639  //
640  // Dump samples to verbose output
641  //
642  (*m_msgFunc_p)(ZDCMsg::Verbose, "Dumping all samples before subtraction: ");
643 
644  std::ostringstream dumpStringHG;
645  dumpStringHG << "HG: ";
646  for (auto val : m_ADCSamplesHG) {
647  dumpStringHG << std::setw(4) << val << " ";
648  }
649 
650  (*m_msgFunc_p)(ZDCMsg::Verbose, dumpStringHG.str().c_str());
651 
652 
653  // Now low gain
654  //
655  std::ostringstream dumpStringLG;
656  dumpStringLG << "LG: " << std::setw(4) << std::setfill(' ');
657  for (auto val : m_ADCSamplesLG) {
658  dumpStringLG << std::setw(4) << val << " ";
659  }
660 
661  (*m_msgFunc_p)(ZDCMsg::Verbose, dumpStringLG.str().c_str());
662 
663  m_NSamplesAna = m_ADCSamplesHG.size();
664 
665  m_ADCSamplesHGSub.assign(m_NSamplesAna, 0);
666  m_ADCSamplesLGSub.assign(m_NSamplesAna, 0);
667 
668  m_useSampleHG.assign(m_NSamplesAna, true);
669  m_useSampleLG.assign(m_NSamplesAna, true);
670 
671  // Now do pedestal subtraction and check for overflows
672  //
673  for (size_t isample = 0; isample < m_NSamplesAna; isample++) {
674  float ADCHG = m_ADCSamplesHG[isample];
675  float ADCLG = m_ADCSamplesLG[isample];
676 
677  //
678  // We always pedestal subtract even if the sample isn't going to be used in analysis
679  // basically for diagnostics
680  //
681  m_ADCSamplesHGSub[isample] = ADCHG - m_pedestal;
682  m_ADCSamplesLGSub[isample] = ADCLG - m_pedestal;
683 
684  if (m_useSampleHG[isample]) {
685  if (m_enablePreExcl) {
686  if (ADCHG > m_preExclHGADCThresh && isample < m_maxSamplesPreExcl) {
687  m_useSampleHG[isample] = false;
688  continue;
689  }
690  }
691 
692  if (m_enablePostExcl) {
693  if (ADCHG > m_postExclHGADCThresh && isample >= m_NSamplesAna - m_maxSamplesPostExcl) {
694  m_useSampleHG[isample] = false;
695  continue;
696  }
697  }
698 
699  // If we get here, we've passed the above filters on the sample
700  //
701  if (ADCHG > m_HGOverflowADC) {
702  m_HGOverflow = true;
703 
704  if (isample == m_preSampleIdx) m_PSHGOverUnderflow = true;
705 
706  // Note: the implementation of the explicit pre- and post- sample exclusion should make this
707  // code obselete but before removing it we first need to validate the pre- and post-exclusion
708  //
709  if ((int) isample > m_lastHGOverFlowSample) m_lastHGOverFlowSample = isample;
710  if ((int) isample < m_firstHGOverFlowSample) m_firstHGOverFlowSample = isample;
711  }
712  else if (ADCHG < m_HGUnderflowADC) {
713  m_HGUnderflow = true;
714 
715  if (isample == m_preSampleIdx) m_PSHGOverUnderflow = true;
716  }
717  }
718 
719  // Now the low gain sample
720  //
721  if (m_useSampleLG[isample]) {
722  if (m_enablePreExcl) {
723  if (ADCLG > m_preExclLGADCThresh && isample <= m_maxSamplesPreExcl) {
724  m_useSampleLG[isample] = false;
725  continue;
726  }
727  }
728 
729  if (m_enablePostExcl) {
730  if (ADCLG > m_postExclLGADCThresh && isample >= m_NSamplesAna - m_maxSamplesPostExcl) {
731  m_useSampleLG[isample] = false;
732  m_ExcludeLate = true;
733  continue;
734  }
735  }
736 
737  if (ADCLG > m_LGOverflowADC) {
738  m_LGOverflow = true;
739  m_fail = true;
740  m_amplitude = m_LGOverflowADC * m_gainFactorLG; // Give a vale here even though we know it's wrong because
741  // the user may not check the return value and we know that
742  // amplitude is bigger than this
743  }
744 
745  if (ADCLG == 0) {
746  m_LGUnderflow = true;
747  m_fail = true;
748  }
749  }
750  }
751 
752  (*m_msgFunc_p)(ZDCMsg::Verbose, "Dump of useSamples: ");
753 
754  std::ostringstream dumpStringUseHG;
755  dumpStringUseHG << "HG: ";
756  for (auto val : m_useSampleHG) {
757  dumpStringUseHG << val << " ";
758  }
759  (*m_msgFunc_p)(ZDCMsg::Verbose, dumpStringUseHG.str().c_str());
760 
761  std::ostringstream dumpStringUseLG;
762  dumpStringUseLG << "LG: ";
763  for (auto val : m_useSampleLG) {
764  dumpStringUseLG << val << " ";
765  }
766  (*m_msgFunc_p)(ZDCMsg::Verbose, dumpStringUseLG.str().c_str());
767 
768 
769  // This ugly code should be obseleted by the introduction of the better, pre- and post-sample exclusion but
770  // that code still has to be fully validated.
771  //
772  // See if we can still use high gain even in the case of HG overflow if the overflow results from
773  // the first few samples or the last few samples
774  //
775  if (m_HGOverflow && !m_HGUnderflow) {
776  if (m_lastHGOverFlowSample < 2 && m_lastHGOverFlowSample > -1) {
777  m_HGOverflow = false;
779  m_adjTimeRangeEvent = true;
780  m_backToHG_pre = true;
781  m_ExcludeEarly = true;
782  }
783  else if (m_firstHGOverFlowSample < static_cast<int>(m_NSampleAna) && m_firstHGOverFlowSample >= static_cast<int>(m_NSampleAna - 2) ) {
785  m_HGOverflow = false;
786  m_adjTimeRangeEvent = true;
787  m_ExcludeLate = true;
788  }
789  }
790 
791  (*m_msgFunc_p)(ZDCMsg::Verbose, "ZDCPulseAnalyzer:: " + m_tag + ": ScanAndSubtractSamples done");
792 
793  return true;
794 }

◆ set2ndDerivStep()

void ZDCPulseAnalyzer::set2ndDerivStep ( size_t  step)
inline

Definition at line 422 of file ZDCPulseAnalyzer.h.

422 {m_2ndDerivStep = step;}

◆ SetADCOverUnderflowValues()

void ZDCPulseAnalyzer::SetADCOverUnderflowValues ( int  HGOverflowADC,
int  HGUnderflowADC,
int  LGOverflowADC 
)

Definition at line 367 of file ZDCPulseAnalyzer.cxx.

368 {
369  m_HGOverflowADC = HGOverflowADC;
370  m_LGOverflowADC = LGOverflowADC;
371  m_HGUnderflowADC = HGUnderflowADC;
372 }

◆ SetCutValues()

void ZDCPulseAnalyzer::SetCutValues ( float  chisqDivAmpCutHG,
float  chisqDivAmpCutLG,
float  deltaT0MinHG,
float  deltaT0MaxHG,
float  deltaT0MinLG,
float  deltaT0MaxLG 
)

Definition at line 374 of file ZDCPulseAnalyzer.cxx.

377 {
378  m_chisqDivAmpCutHG = chisqDivAmpCutHG;
379  m_chisqDivAmpCutLG = chisqDivAmpCutLG;
380 
381  m_T0CutLowHG = deltaT0MinHG;
382  m_T0CutLowLG = deltaT0MinLG;
383 
384  m_T0CutHighHG = deltaT0MaxHG;
385  m_T0CutHighLG = deltaT0MaxLG;
386 }

◆ SetDefaults()

void ZDCPulseAnalyzer::SetDefaults ( )
private

Definition at line 141 of file ZDCPulseAnalyzer.cxx.

142 {
143  m_nominalTau1 = 4;
144  m_nominalTau2 = 21;
145 
146  m_fixTau1 = false;
147  m_fixTau2 = false;
148 
149  m_HGOverflowADC = 900;
150  m_HGUnderflowADC = 20;
151  m_LGOverflowADC = 1000;
152 
153  // Default values for the gain factors uswed to match low and high gain
154  //
156  m_gainFactorHG = 1;
157 
158  m_2ndDerivStep = 1;
159 
160  m_noiseSigHG = 1;
161  m_noiseSigLG = 1;
162 
163  m_timeCutMode = 0;
164  m_chisqDivAmpCutLG = 100;
165  m_chisqDivAmpCutHG = 100;
166 
169 
172 
173  m_LGT0CorrParams.assign(4, 0);
174  m_HGT0CorrParams.assign(4, 0);
175 
178 
179  m_fitAmpMinHG = 1;
180  m_fitAmpMinLG = 1;
181 
182  m_fitAmpMaxHG = 1500;
183  m_fitAmpMaxLG = 1500;
184 
185  m_postPulse = false;
186  m_prePulse = false;
187 
188  m_initialPrePulseT0 = -10;
190 
191  m_initialPostPulseT0 = 100;
192 
193  m_initialExpAmp = 0;
194  m_fitPostT0lo = 0;
195 
196  m_enablePreExcl = false;
197  m_enablePostExcl = false;
198 
200  m_haveNonlinCorr = false;
201 
202  s_fitOptions = "s";
203 }

◆ SetFitMinMaxAmp()

void ZDCPulseAnalyzer::SetFitMinMaxAmp ( float  minAmpHG,
float  minAmpLG,
float  maxAmpHG,
float  maxAmpLG 
)

Definition at line 326 of file ZDCPulseAnalyzer.cxx.

327 {
328  m_fitAmpMinHG = minAmpHG;
329  m_fitAmpMinLG = minAmpLG;
330 
331  m_fitAmpMaxHG = maxAmpHG;
332  m_fitAmpMaxLG = maxAmpLG;
333 }

◆ SetFitOPtions()

static void ZDCPulseAnalyzer::SetFitOPtions ( const std::string &  fitOptions)
inlinestatic

Definition at line 385 of file ZDCPulseAnalyzer.h.

385 { s_fitOptions = fitOptions;}

◆ SetFitTimeMax()

void ZDCPulseAnalyzer::SetFitTimeMax ( float  tmax)

Definition at line 353 of file ZDCPulseAnalyzer.cxx.

354 {
355  if (tmax < m_tmin) {
356  (*m_msgFunc_p)(ZDCMsg::Error, ("ZDCPulseAnalyzer::SetFitTimeMax:: invalid FitTimeMax: " + std::to_string(tmax)));
357  return;
358  }
359 
361 
362  (*m_msgFunc_p)(ZDCMsg::Verbose, ("Setting FitTMax to " + std::to_string(m_defaultFitTMax)));
363 
365 }

◆ SetForceLG()

void ZDCPulseAnalyzer::SetForceLG ( bool  forceLG)
inline

Definition at line 419 of file ZDCPulseAnalyzer.h.

419 {m_forceLG = forceLG;}

◆ SetGainFactorsHGLG()

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

Definition at line 320 of file ZDCPulseAnalyzer.cxx.

321 {
322  m_gainFactorHG = gainFactorHG;
323  m_gainFactorLG = gainFactorLG;
324 }

◆ SetNoiseSigmas()

void ZDCPulseAnalyzer::SetNoiseSigmas ( float  noiseSigHG,
float  noiseSigLG 
)
inline

Definition at line 428 of file ZDCPulseAnalyzer.h.

429  {
430  m_noiseSigHG = noiseSigHG;
431  m_noiseSigLG = noiseSigLG;
432  }

◆ SetNonlinCorrParams()

void ZDCPulseAnalyzer::SetNonlinCorrParams ( float  refADC,
float  refScale,
const std::vector< float > &  paramsHG,
const std::vector< float > &  paramsLG 
)
inline

Definition at line 457 of file ZDCPulseAnalyzer.h.

458  {
459  std::string HGParamsStr = "HG coefficients = ", LGParamsStr = "LG coefficients = ";
460 
461  for (auto val : paramsHG) {HGParamsStr += std::to_string(val) + " ";}
462  for (auto val : paramsLG) {LGParamsStr += std::to_string(val) + " ";}
463 
464  (*m_msgFunc_p)(ZDCMsg::Info, ("Setting non-linear parameters for module: " + m_tag + ", reference ADC = " +
465  std::to_string(refADC) + ", reference scale = " + std::to_string(refScale)));
466 
467  (*m_msgFunc_p)(ZDCMsg::Info, HGParamsStr);
468  (*m_msgFunc_p)(ZDCMsg::Info, LGParamsStr);
469 
470  m_nonLinCorrRefADC = refADC;
471  m_nonLinCorrRefScale = refScale;
472  m_nonLinCorrParamsHG = paramsHG;
473  m_nonLinCorrParamsLG = paramsLG;
474  m_haveNonlinCorr = true;
475  }

◆ SetPeak2ndDerivMinTolerance()

void ZDCPulseAnalyzer::SetPeak2ndDerivMinTolerance ( size_t  tolerance)
inline

Definition at line 414 of file ZDCPulseAnalyzer.h.

414  {
416  m_initializedFits = false;
417  }

◆ SetQuietFits()

static void ZDCPulseAnalyzer::SetQuietFits ( bool  quiet)
inlinestatic

Definition at line 386 of file ZDCPulseAnalyzer.h.

386 {s_quietFits = quiet;}

◆ SetSaveFitFunc()

static void ZDCPulseAnalyzer::SetSaveFitFunc ( bool  save)
inlinestatic

Definition at line 387 of file ZDCPulseAnalyzer.h.

387 {s_saveFitFunc = save;}

◆ SetTauT0Values()

void ZDCPulseAnalyzer::SetTauT0Values ( bool  fixTau1,
bool  fixTau2,
float  tau1,
float  tau2,
float  t0HG,
float  t0LG 
)

Definition at line 335 of file ZDCPulseAnalyzer.cxx.

336 {
337  m_fixTau1 = fixTau1;
338  m_fixTau2 = fixTau2;
339  m_nominalTau1 = tau1;
340  m_nominalTau2 = tau2;
341 
342  m_nominalT0HG = t0HG;
343  m_nominalT0LG = t0LG;
344 
345  std::ostringstream ostrm;
346  ostrm << "ZDCPulseAnalyzer::SetTauT0Values:: m_fixTau1=" << m_fixTau1 << " m_fixTau2=" << m_fixTau2 << " m_nominalTau1=" << m_nominalTau1 << " m_nominalTau2=" << m_nominalTau2 << " m_nominalT0HG=" << m_nominalT0HG << " m_nominalT0LG=" << m_nominalT0LG;
347 
348  (*m_msgFunc_p)(ZDCMsg::Info, ostrm.str());
349 
350  m_initializedFits = false;
351 }

◆ SetTimingCorrParams()

void ZDCPulseAnalyzer::SetTimingCorrParams ( TimingCorrMode  mode,
float  refADC,
float  refScale,
const std::vector< float > &  HGT0CorrParams,
const std::vector< float > &  LGT0CorrParams 
)
inline

Definition at line 442 of file ZDCPulseAnalyzer.h.

444  {
446  if (mode != NoTimingCorr) {
447  m_timingCorrRefADC = refADC;
448  m_timingCorrScale = refScale;
449 
450  m_HGT0CorrParams = HGT0CorrParams;
451  m_LGT0CorrParams = LGT0CorrParams;
452  }
453  }

◆ SetupFitFunctions()

void ZDCPulseAnalyzer::SetupFitFunctions ( )
private

Definition at line 455 of file ZDCPulseAnalyzer.cxx.

456 {
457  float prePulseTMin = 0;
458  float prePulseTMax = prePulseTMin + m_deltaTSample * (m_peak2ndDerivMinSample - m_peak2ndDerivMinTolerance);
459 
460  if (m_fitFunction == "FermiExp") {
461  if (!m_fixTau1 || !m_fixTau2) {
462  //
463  // Use the variable tau version of the expFermiFit
464  //
466  }
467  else {
468  m_defaultFitWrapper = std::unique_ptr<ZDCFitWrapper>(new ZDCFitExpFermiFixedTaus(m_tag, m_tmin, m_tmax, m_nominalTau1, m_nominalTau2));
469  }
470 
471  m_preExpFitWrapper = std::unique_ptr<ZDCFitExpFermiPreExp>(new ZDCFitExpFermiPreExp(m_tag, m_tmin, m_tmax, m_nominalTau1, m_nominalTau2, m_nominalTau2, false));
472  m_prePulseFitWrapper = std::unique_ptr<ZDCPrePulseFitWrapper>(new ZDCFitExpFermiPrePulse(m_tag, m_tmin, m_tmax, m_nominalTau1, m_nominalTau2));
473  }
474  else if (m_fitFunction == "FermiExpRun3") {
475  if (!m_fixTau1 || !m_fixTau2) {
476  //
477  // Use the variable tau version of the expFermiFit
478  //
480  }
481  else {
482  m_defaultFitWrapper = std::unique_ptr<ZDCFitWrapper>(new ZDCFitExpFermiFixedTaus(m_tag, m_tmin, m_tmax, m_nominalTau1, m_nominalTau2));
483  }
484 
485  m_preExpFitWrapper = std::unique_ptr<ZDCFitExpFermiPreExp>(new ZDCFitExpFermiPreExp(m_tag, m_tmin, m_tmax, m_nominalTau1, m_nominalTau2, 6, false));
486  m_prePulseFitWrapper = std::unique_ptr<ZDCPrePulseFitWrapper>(new ZDCFitExpFermiPrePulse(m_tag, m_tmin, m_tmax, m_nominalTau1, m_nominalTau2));
487  }
488  else if (m_fitFunction == "FermiExpLHCf") {
489  //
490  // Use the variable tau version of the expFermiFit
491  //
494 
495  m_preExpFitWrapper = std::unique_ptr<ZDCFitExpFermiLHCfPreExp>(new ZDCFitExpFermiLHCfPreExp(m_tag, m_tmin, m_tmax, m_nominalTau1, m_nominalTau2, 6, false));
496 
497  m_prePulseFitWrapper = std::unique_ptr<ZDCPrePulseFitWrapper>(new ZDCFitExpFermiPrePulse(m_tag, m_tmin, m_tmax, m_nominalTau1, m_nominalTau2));
498  }
499  else if (m_fitFunction == "FermiExpLinear") {
500  if (!m_fixTau1 || !m_fixTau2) {
501  //
502  // Use the variable tau version of the expFermiFit
503  //
505  }
506  else {
508  }
509 
510  m_preExpFitWrapper = std::unique_ptr<ZDCFitExpFermiPreExp>(new ZDCFitExpFermiPreExp(m_tag, m_tmin, m_tmax, m_nominalTau1, m_nominalTau2, 6, false));
511  m_prePulseFitWrapper = std::unique_ptr<ZDCPrePulseFitWrapper>(new ZDCFitExpFermiLinearPrePulse(m_tag, m_tmin, m_tmax, m_nominalTau1, m_nominalTau2));
512  }
513  else if (m_fitFunction == "ComplexPrePulse") {
514  if (!m_fixTau1 || !m_fixTau2) {
515  //
516  // Use the variable tau version of the expFermiFit
517  //
519  }
520  else {
522  }
523 
524  m_prePulseFitWrapper = std::unique_ptr<ZDCPrePulseFitWrapper>(new ZDCFitComplexPrePulse(m_tag, m_tmin, m_tmax, m_nominalTau1, m_nominalTau2));
525  }
526  else if (m_fitFunction == "GeneralPulse") {
527  if (!m_fixTau1 || !m_fixTau2) {
528  //
529  // Use the variable tau version of the expFermiFit
530  //
532  }
533  else {
535  }
536 
537  m_prePulseFitWrapper = std::unique_ptr<ZDCPrePulseFitWrapper>(new ZDCFitGeneralPulse(m_tag, m_tmin, m_tmax, m_nominalTau1, m_nominalTau2));
538  }
539  else {
540  (*m_msgFunc_p)(ZDCMsg::Fatal, "Wrong fit function type: " + m_fitFunction);
541  }
542 
543  m_prePulseFitWrapper->SetPrePulseT0Range(prePulseTMin, prePulseTMax);
544 
545  m_initializedFits = true;
546 }

◆ UpdateFitterTimeLimits()

void ZDCPulseAnalyzer::UpdateFitterTimeLimits ( TFitter *  fitter,
ZDCFitWrapper wrapper,
bool  prePulse 
)
private

Definition at line 1709 of file ZDCPulseAnalyzer.cxx.

1710 {
1711  double parLimitLow, parLimitHigh;
1712 
1713  auto func_p = wrapper->GetWrapperTF1();
1714  func_p->GetParLimits(1, parLimitLow, parLimitHigh);
1715 
1716  fitter->SetParameter(2, func_p->GetParName(1), func_p->GetParameter(1), 0.01, parLimitLow, parLimitHigh);
1717 
1718  if (prePulse) {
1719  unsigned int parIndex = static_cast<ZDCPrePulseFitWrapper*>(wrapper)->GetPreT0ParIndex();
1720 
1721  func_p->GetParLimits(parIndex, parLimitLow, parLimitHigh);
1722  fitter->SetParameter(parIndex + 1, func_p->GetParName(parIndex), func_p->GetParameter(parIndex), 0.01, parLimitLow, parLimitHigh);
1723  }
1724 }

◆ UseLowGain()

bool ZDCPulseAnalyzer::UseLowGain ( ) const
inline

Definition at line 490 of file ZDCPulseAnalyzer.h.

490 {return m_useLowGain;}

Member Data Documentation

◆ m_2ndDerivStep

size_t ZDCPulseAnalyzer::m_2ndDerivStep {1}
private

Definition at line 82 of file ZDCPulseAnalyzer.h.

◆ m_ADCSamplesHG

std::vector<float> ZDCPulseAnalyzer::m_ADCSamplesHG
private

Definition at line 296 of file ZDCPulseAnalyzer.h.

◆ m_ADCSamplesHGSub

std::vector<float> ZDCPulseAnalyzer::m_ADCSamplesHGSub
private

Definition at line 298 of file ZDCPulseAnalyzer.h.

◆ m_ADCSamplesLG

std::vector<float> ZDCPulseAnalyzer::m_ADCSamplesLG
private

Definition at line 297 of file ZDCPulseAnalyzer.h.

◆ m_ADCSamplesLGSub

std::vector<float> ZDCPulseAnalyzer::m_ADCSamplesLGSub
private

Definition at line 299 of file ZDCPulseAnalyzer.h.

◆ m_ADCSSampSigHG

std::vector<float> ZDCPulseAnalyzer::m_ADCSSampSigHG
private

Definition at line 304 of file ZDCPulseAnalyzer.h.

◆ m_ADCSSampSigLG

std::vector<float> ZDCPulseAnalyzer::m_ADCSSampSigLG
private

Definition at line 305 of file ZDCPulseAnalyzer.h.

◆ m_adjTimeRangeEvent

bool ZDCPulseAnalyzer::m_adjTimeRangeEvent {}
private

Definition at line 182 of file ZDCPulseAnalyzer.h.

◆ m_ampError

float ZDCPulseAnalyzer::m_ampError {}
private

Definition at line 284 of file ZDCPulseAnalyzer.h.

◆ m_amplitude

float ZDCPulseAnalyzer::m_amplitude {}
private

Definition at line 282 of file ZDCPulseAnalyzer.h.

◆ m_ampNoNonLin

float ZDCPulseAnalyzer::m_ampNoNonLin {}
private

Definition at line 283 of file ZDCPulseAnalyzer.h.

◆ m_backToHG_pre

bool ZDCPulseAnalyzer::m_backToHG_pre {}
private

Definition at line 231 of file ZDCPulseAnalyzer.h.

◆ m_badChisq

bool ZDCPulseAnalyzer::m_badChisq {}
private

Definition at line 218 of file ZDCPulseAnalyzer.h.

◆ m_badT0

bool ZDCPulseAnalyzer::m_badT0 {}
private

Definition at line 220 of file ZDCPulseAnalyzer.h.

◆ m_baselineCorr

float ZDCPulseAnalyzer::m_baselineCorr {}
private

Definition at line 232 of file ZDCPulseAnalyzer.h.

◆ m_bkgdMaxFraction

float ZDCPulseAnalyzer::m_bkgdMaxFraction {}
private

Definition at line 289 of file ZDCPulseAnalyzer.h.

◆ m_chisqDivAmpCutHG

float ZDCPulseAnalyzer::m_chisqDivAmpCutHG {}
private

Definition at line 123 of file ZDCPulseAnalyzer.h.

◆ m_chisqDivAmpCutLG

float ZDCPulseAnalyzer::m_chisqDivAmpCutLG {}
private

Definition at line 122 of file ZDCPulseAnalyzer.h.

◆ m_defaultCombinedFitter

std::unique_ptr<TFitter> ZDCPulseAnalyzer::m_defaultCombinedFitter
private

Definition at line 195 of file ZDCPulseAnalyzer.h.

◆ m_defaultFitTMax

float ZDCPulseAnalyzer::m_defaultFitTMax {}
private

Definition at line 119 of file ZDCPulseAnalyzer.h.

◆ m_defaultFitTMin

float ZDCPulseAnalyzer::m_defaultFitTMin {}
private

Definition at line 120 of file ZDCPulseAnalyzer.h.

◆ m_defaultFitWrapper

std::unique_ptr<ZDCFitWrapper> ZDCPulseAnalyzer::m_defaultFitWrapper
private

Definition at line 175 of file ZDCPulseAnalyzer.h.

◆ m_defaultT0Max

float ZDCPulseAnalyzer::m_defaultT0Max {}
private

Definition at line 136 of file ZDCPulseAnalyzer.h.

◆ m_defaultT0Min

float ZDCPulseAnalyzer::m_defaultT0Min {}
private

Definition at line 137 of file ZDCPulseAnalyzer.h.

◆ m_delayedBaselineShift

float ZDCPulseAnalyzer::m_delayedBaselineShift {}
private

Definition at line 290 of file ZDCPulseAnalyzer.h.

◆ m_delayedDeltaT

float ZDCPulseAnalyzer::m_delayedDeltaT {}
private

Definition at line 190 of file ZDCPulseAnalyzer.h.

◆ m_delayedHist

std::unique_ptr<TH1> ZDCPulseAnalyzer::m_delayedHist
mutableprivate

Definition at line 192 of file ZDCPulseAnalyzer.h.

◆ m_delayedPedestalDiff

float ZDCPulseAnalyzer::m_delayedPedestalDiff {}
private

Definition at line 191 of file ZDCPulseAnalyzer.h.

◆ m_deltaTSample

float ZDCPulseAnalyzer::m_deltaTSample {}
private

Definition at line 74 of file ZDCPulseAnalyzer.h.

◆ m_enablePostExcl

bool ZDCPulseAnalyzer::m_enablePostExcl {false}
private

Definition at line 152 of file ZDCPulseAnalyzer.h.

◆ m_enablePreExcl

bool ZDCPulseAnalyzer::m_enablePreExcl {false}
private

Definition at line 147 of file ZDCPulseAnalyzer.h.

◆ m_enableRepass

bool ZDCPulseAnalyzer::m_enableRepass {false}
private

Definition at line 90 of file ZDCPulseAnalyzer.h.

◆ m_ExcludeEarly

bool ZDCPulseAnalyzer::m_ExcludeEarly {}
private

Definition at line 221 of file ZDCPulseAnalyzer.h.

◆ m_ExcludeLate

bool ZDCPulseAnalyzer::m_ExcludeLate {}
private

Definition at line 222 of file ZDCPulseAnalyzer.h.

◆ m_expAmplitude

float ZDCPulseAnalyzer::m_expAmplitude {}
private

Definition at line 288 of file ZDCPulseAnalyzer.h.

◆ m_fail

bool ZDCPulseAnalyzer::m_fail {}
private

Definition at line 207 of file ZDCPulseAnalyzer.h.

◆ m_firstHGOverFlowSample

int ZDCPulseAnalyzer::m_firstHGOverFlowSample {}
private

Definition at line 293 of file ZDCPulseAnalyzer.h.

◆ m_fitAmpError

float ZDCPulseAnalyzer::m_fitAmpError {}
private

Definition at line 267 of file ZDCPulseAnalyzer.h.

◆ m_fitAmplitude

float ZDCPulseAnalyzer::m_fitAmplitude {}
private

Definition at line 266 of file ZDCPulseAnalyzer.h.

◆ m_fitAmpMaxHG

float ZDCPulseAnalyzer::m_fitAmpMaxHG {}
private

Definition at line 142 of file ZDCPulseAnalyzer.h.

◆ m_fitAmpMaxLG

float ZDCPulseAnalyzer::m_fitAmpMaxLG {}
private

Definition at line 143 of file ZDCPulseAnalyzer.h.

◆ m_fitAmpMinHG

float ZDCPulseAnalyzer::m_fitAmpMinHG {}
private

Definition at line 139 of file ZDCPulseAnalyzer.h.

◆ m_fitAmpMinLG

float ZDCPulseAnalyzer::m_fitAmpMinLG {}
private

Definition at line 140 of file ZDCPulseAnalyzer.h.

◆ m_fitChisq

float ZDCPulseAnalyzer::m_fitChisq {}
private

Definition at line 275 of file ZDCPulseAnalyzer.h.

◆ m_fitExpAmp

float ZDCPulseAnalyzer::m_fitExpAmp {}
private

Definition at line 281 of file ZDCPulseAnalyzer.h.

◆ m_fitFailed

bool ZDCPulseAnalyzer::m_fitFailed {}
private

Definition at line 217 of file ZDCPulseAnalyzer.h.

◆ m_fitFunction

std::string ZDCPulseAnalyzer::m_fitFunction
private

Definition at line 81 of file ZDCPulseAnalyzer.h.

◆ m_fitHist

std::unique_ptr<TH1> ZDCPulseAnalyzer::m_fitHist
mutableprivate

Definition at line 172 of file ZDCPulseAnalyzer.h.

◆ m_fitMinAmp

bool ZDCPulseAnalyzer::m_fitMinAmp {}
private

Definition at line 226 of file ZDCPulseAnalyzer.h.

◆ m_fitNDoF

float ZDCPulseAnalyzer::m_fitNDoF {}
private

Definition at line 276 of file ZDCPulseAnalyzer.h.

◆ m_fitPostAmp

float ZDCPulseAnalyzer::m_fitPostAmp {}
private

Definition at line 280 of file ZDCPulseAnalyzer.h.

◆ m_fitPostT0

float ZDCPulseAnalyzer::m_fitPostT0 {}
private

Definition at line 279 of file ZDCPulseAnalyzer.h.

◆ m_fitPostT0lo

float ZDCPulseAnalyzer::m_fitPostT0lo {}
private

Definition at line 255 of file ZDCPulseAnalyzer.h.

◆ m_fitPreAmp

float ZDCPulseAnalyzer::m_fitPreAmp {}
private

Definition at line 278 of file ZDCPulseAnalyzer.h.

◆ m_fitPreT0

float ZDCPulseAnalyzer::m_fitPreT0 {}
private

Definition at line 277 of file ZDCPulseAnalyzer.h.

◆ m_fitPulls

std::vector<float> ZDCPulseAnalyzer::m_fitPulls
private

Definition at line 316 of file ZDCPulseAnalyzer.h.

◆ m_fitTau1

float ZDCPulseAnalyzer::m_fitTau1 {}
private

Definition at line 273 of file ZDCPulseAnalyzer.h.

◆ m_fitTau2

float ZDCPulseAnalyzer::m_fitTau2 {}
private

Definition at line 274 of file ZDCPulseAnalyzer.h.

◆ m_fitTCorr2nd

float ZDCPulseAnalyzer::m_fitTCorr2nd {}
private

Definition at line 272 of file ZDCPulseAnalyzer.h.

◆ m_fitTime

float ZDCPulseAnalyzer::m_fitTime {}
private

Definition at line 268 of file ZDCPulseAnalyzer.h.

◆ m_fitTimeCorr

float ZDCPulseAnalyzer::m_fitTimeCorr {}
private

Definition at line 270 of file ZDCPulseAnalyzer.h.

◆ m_fitTimeSub

float ZDCPulseAnalyzer::m_fitTimeSub {}
private

Definition at line 269 of file ZDCPulseAnalyzer.h.

◆ m_fitTMax

float ZDCPulseAnalyzer::m_fitTMax {}
private

Definition at line 252 of file ZDCPulseAnalyzer.h.

◆ m_fitTMin

float ZDCPulseAnalyzer::m_fitTMin {}
private

Definition at line 253 of file ZDCPulseAnalyzer.h.

◆ m_fixPrePulse

bool ZDCPulseAnalyzer::m_fixPrePulse {}
private

Definition at line 225 of file ZDCPulseAnalyzer.h.

◆ m_fixTau1

bool ZDCPulseAnalyzer::m_fixTau1 {}
private

Definition at line 116 of file ZDCPulseAnalyzer.h.

◆ m_fixTau2

bool ZDCPulseAnalyzer::m_fixTau2 {}
private

Definition at line 117 of file ZDCPulseAnalyzer.h.

◆ m_forceLG

bool ZDCPulseAnalyzer::m_forceLG {false}
private

Definition at line 77 of file ZDCPulseAnalyzer.h.

◆ m_gainFactorHG

float ZDCPulseAnalyzer::m_gainFactorHG {}
private

Definition at line 96 of file ZDCPulseAnalyzer.h.

◆ m_gainFactorLG

float ZDCPulseAnalyzer::m_gainFactorLG {}
private

Definition at line 97 of file ZDCPulseAnalyzer.h.

◆ m_gainHG

float ZDCPulseAnalyzer::m_gainHG {}
private

Definition at line 76 of file ZDCPulseAnalyzer.h.

◆ m_haveData

bool ZDCPulseAnalyzer::m_haveData {}
private

Definition at line 203 of file ZDCPulseAnalyzer.h.

◆ m_haveNonlinCorr

bool ZDCPulseAnalyzer::m_haveNonlinCorr {false}
private

Definition at line 164 of file ZDCPulseAnalyzer.h.

◆ m_havePulse

bool ZDCPulseAnalyzer::m_havePulse {}
private

Definition at line 205 of file ZDCPulseAnalyzer.h.

◆ m_HGOverflow

bool ZDCPulseAnalyzer::m_HGOverflow {}
private

Definition at line 208 of file ZDCPulseAnalyzer.h.

◆ m_HGOverflowADC

int ZDCPulseAnalyzer::m_HGOverflowADC {}
private

Definition at line 106 of file ZDCPulseAnalyzer.h.

◆ m_HGT0CorrParams

std::vector<float> ZDCPulseAnalyzer::m_HGT0CorrParams
private

Definition at line 162 of file ZDCPulseAnalyzer.h.

◆ m_HGUnderflow

bool ZDCPulseAnalyzer::m_HGUnderflow {}
private

Definition at line 210 of file ZDCPulseAnalyzer.h.

◆ m_HGUnderflowADC

int ZDCPulseAnalyzer::m_HGUnderflowADC {}
private

Definition at line 107 of file ZDCPulseAnalyzer.h.

◆ m_initialExpAmp

float ZDCPulseAnalyzer::m_initialExpAmp {}
private

Definition at line 248 of file ZDCPulseAnalyzer.h.

◆ m_initializedFits

bool ZDCPulseAnalyzer::m_initializedFits {false}
private

Definition at line 174 of file ZDCPulseAnalyzer.h.

◆ m_initialPostPulseT0

float ZDCPulseAnalyzer::m_initialPostPulseT0 {}
private

Definition at line 264 of file ZDCPulseAnalyzer.h.

◆ m_initialPrePulseAmp

float ZDCPulseAnalyzer::m_initialPrePulseAmp {}
private

Definition at line 262 of file ZDCPulseAnalyzer.h.

◆ m_initialPrePulseT0

float ZDCPulseAnalyzer::m_initialPrePulseT0 {}
private

Definition at line 261 of file ZDCPulseAnalyzer.h.

◆ m_lastHGOverFlowSample

int ZDCPulseAnalyzer::m_lastHGOverFlowSample {}
private

Definition at line 292 of file ZDCPulseAnalyzer.h.

◆ m_LGOverflow

bool ZDCPulseAnalyzer::m_LGOverflow {}
private

Definition at line 212 of file ZDCPulseAnalyzer.h.

◆ m_LGOverflowADC

int ZDCPulseAnalyzer::m_LGOverflowADC {}
private

Definition at line 108 of file ZDCPulseAnalyzer.h.

◆ m_LGT0CorrParams

std::vector<float> ZDCPulseAnalyzer::m_LGT0CorrParams
private

Definition at line 161 of file ZDCPulseAnalyzer.h.

◆ m_LGUnderflow

bool ZDCPulseAnalyzer::m_LGUnderflow {}
private

Definition at line 213 of file ZDCPulseAnalyzer.h.

◆ m_maxADCValue

float ZDCPulseAnalyzer::m_maxADCValue {}
private

Definition at line 239 of file ZDCPulseAnalyzer.h.

◆ m_maxDelta

float ZDCPulseAnalyzer::m_maxDelta {}
private

Definition at line 242 of file ZDCPulseAnalyzer.h.

◆ m_maxSampl

int ZDCPulseAnalyzer::m_maxSampl {}
private

Definition at line 245 of file ZDCPulseAnalyzer.h.

◆ m_maxSampleEvt

unsigned int ZDCPulseAnalyzer::m_maxSampleEvt {}
private

Definition at line 185 of file ZDCPulseAnalyzer.h.

◆ m_maxSamplesPostExcl

unsigned int ZDCPulseAnalyzer::m_maxSamplesPostExcl {0}
private

Definition at line 155 of file ZDCPulseAnalyzer.h.

◆ m_maxSamplesPreExcl

unsigned int ZDCPulseAnalyzer::m_maxSamplesPreExcl {0}
private

Definition at line 148 of file ZDCPulseAnalyzer.h.

◆ m_minADCValue

float ZDCPulseAnalyzer::m_minADCValue {}
private

Definition at line 240 of file ZDCPulseAnalyzer.h.

◆ m_minDelta

float ZDCPulseAnalyzer::m_minDelta {}
private

Definition at line 243 of file ZDCPulseAnalyzer.h.

◆ m_minDeriv2nd

float ZDCPulseAnalyzer::m_minDeriv2nd {}
private

Definition at line 249 of file ZDCPulseAnalyzer.h.

◆ m_minDeriv2ndIndex

int ZDCPulseAnalyzer::m_minDeriv2ndIndex {}
private

Definition at line 250 of file ZDCPulseAnalyzer.h.

◆ m_minDeriv2ndSig

float ZDCPulseAnalyzer::m_minDeriv2ndSig
private

Definition at line 257 of file ZDCPulseAnalyzer.h.

◆ m_minSampl

int ZDCPulseAnalyzer::m_minSampl {}
private

Definition at line 246 of file ZDCPulseAnalyzer.h.

◆ m_minSampleEvt

unsigned int ZDCPulseAnalyzer::m_minSampleEvt {}
private

Definition at line 184 of file ZDCPulseAnalyzer.h.

◆ m_msgFunc_p

ZDCMsg::MessageFunctionPtr ZDCPulseAnalyzer::m_msgFunc_p {}
private

Definition at line 70 of file ZDCPulseAnalyzer.h.

◆ m_noiseSigHG

float ZDCPulseAnalyzer::m_noiseSigHG {}
private

Definition at line 101 of file ZDCPulseAnalyzer.h.

◆ m_noiseSigLG

float ZDCPulseAnalyzer::m_noiseSigLG {}
private

Definition at line 102 of file ZDCPulseAnalyzer.h.

◆ m_nominalT0HG

float ZDCPulseAnalyzer::m_nominalT0HG {}
private

Definition at line 110 of file ZDCPulseAnalyzer.h.

◆ m_nominalT0LG

float ZDCPulseAnalyzer::m_nominalT0LG {}
private

Definition at line 111 of file ZDCPulseAnalyzer.h.

◆ m_nominalTau1

float ZDCPulseAnalyzer::m_nominalTau1 {}
private

Definition at line 113 of file ZDCPulseAnalyzer.h.

◆ m_nominalTau2

float ZDCPulseAnalyzer::m_nominalTau2 {}
private

Definition at line 114 of file ZDCPulseAnalyzer.h.

◆ m_nonLinCorrParamsHG

std::vector<float> ZDCPulseAnalyzer::m_nonLinCorrParamsHG
private

Definition at line 167 of file ZDCPulseAnalyzer.h.

◆ m_nonLinCorrParamsLG

std::vector<float> ZDCPulseAnalyzer::m_nonLinCorrParamsLG
private

Definition at line 168 of file ZDCPulseAnalyzer.h.

◆ m_nonLinCorrRefADC

float ZDCPulseAnalyzer::m_nonLinCorrRefADC {500}
private

Definition at line 165 of file ZDCPulseAnalyzer.h.

◆ m_nonLinCorrRefScale

float ZDCPulseAnalyzer::m_nonLinCorrRefScale {100}
private

Definition at line 166 of file ZDCPulseAnalyzer.h.

◆ m_Nsample

unsigned int ZDCPulseAnalyzer::m_Nsample {}
private

Definition at line 72 of file ZDCPulseAnalyzer.h.

◆ m_NSampleAna

unsigned int ZDCPulseAnalyzer::m_NSampleAna {0}
private

Definition at line 181 of file ZDCPulseAnalyzer.h.

◆ m_NSamplesAna

unsigned int ZDCPulseAnalyzer::m_NSamplesAna {}
private

Definition at line 295 of file ZDCPulseAnalyzer.h.

◆ m_peak2ndDerivMinRepassHG

float ZDCPulseAnalyzer::m_peak2ndDerivMinRepassHG {}
private

Definition at line 92 of file ZDCPulseAnalyzer.h.

◆ m_peak2ndDerivMinRepassLG

float ZDCPulseAnalyzer::m_peak2ndDerivMinRepassLG {}
private

Definition at line 91 of file ZDCPulseAnalyzer.h.

◆ m_peak2ndDerivMinSample

size_t ZDCPulseAnalyzer::m_peak2ndDerivMinSample {}
private

Definition at line 83 of file ZDCPulseAnalyzer.h.

◆ m_peak2ndDerivMinThreshHG

float ZDCPulseAnalyzer::m_peak2ndDerivMinThreshHG {}
private

Definition at line 86 of file ZDCPulseAnalyzer.h.

◆ m_peak2ndDerivMinThreshLG

float ZDCPulseAnalyzer::m_peak2ndDerivMinThreshLG {}
private

Definition at line 85 of file ZDCPulseAnalyzer.h.

◆ m_peak2ndDerivMinTolerance

size_t ZDCPulseAnalyzer::m_peak2ndDerivMinTolerance {1}
private

Definition at line 84 of file ZDCPulseAnalyzer.h.

◆ m_pedestal

int ZDCPulseAnalyzer::m_pedestal {}
private

Definition at line 75 of file ZDCPulseAnalyzer.h.

◆ m_postAmplitude

float ZDCPulseAnalyzer::m_postAmplitude {}
private

Definition at line 287 of file ZDCPulseAnalyzer.h.

◆ m_postExclHGADCThresh

unsigned int ZDCPulseAnalyzer::m_postExclHGADCThresh {0}
private

Definition at line 153 of file ZDCPulseAnalyzer.h.

◆ m_postExclLGADCThresh

unsigned int ZDCPulseAnalyzer::m_postExclLGADCThresh {0}
private

Definition at line 154 of file ZDCPulseAnalyzer.h.

◆ m_postPulse

bool ZDCPulseAnalyzer::m_postPulse {}
private

Definition at line 216 of file ZDCPulseAnalyzer.h.

◆ m_preAmplitude

float ZDCPulseAnalyzer::m_preAmplitude {}
private

Definition at line 286 of file ZDCPulseAnalyzer.h.

◆ m_preExclHGADCThresh

unsigned int ZDCPulseAnalyzer::m_preExclHGADCThresh {0}
private

Definition at line 149 of file ZDCPulseAnalyzer.h.

◆ m_preExclLGADCThresh

unsigned int ZDCPulseAnalyzer::m_preExclLGADCThresh {0}
private

Definition at line 150 of file ZDCPulseAnalyzer.h.

◆ m_preExpFitWrapper

std::unique_ptr<ZDCPreExpFitWrapper> ZDCPulseAnalyzer::m_preExpFitWrapper
private

Definition at line 177 of file ZDCPulseAnalyzer.h.

◆ m_preExpSig

float ZDCPulseAnalyzer::m_preExpSig
private

Definition at line 258 of file ZDCPulseAnalyzer.h.

◆ m_preExpTail

bool ZDCPulseAnalyzer::m_preExpTail {}
private

Definition at line 223 of file ZDCPulseAnalyzer.h.

◆ m_prePulse

bool ZDCPulseAnalyzer::m_prePulse {}
private

Definition at line 215 of file ZDCPulseAnalyzer.h.

◆ m_prePulseCombinedFitter

std::unique_ptr<TFitter> ZDCPulseAnalyzer::m_prePulseCombinedFitter
private

Definition at line 194 of file ZDCPulseAnalyzer.h.

◆ m_prePulseFitWrapper

std::unique_ptr<ZDCPrePulseFitWrapper> ZDCPulseAnalyzer::m_prePulseFitWrapper
private

Definition at line 176 of file ZDCPulseAnalyzer.h.

◆ m_prePulseSig

float ZDCPulseAnalyzer::m_prePulseSig
private

Definition at line 259 of file ZDCPulseAnalyzer.h.

◆ m_preSample

float ZDCPulseAnalyzer::m_preSample {}
private

Definition at line 237 of file ZDCPulseAnalyzer.h.

◆ m_preSampleAmp

float ZDCPulseAnalyzer::m_preSampleAmp {}
private

Definition at line 285 of file ZDCPulseAnalyzer.h.

◆ m_preSampleIdx

unsigned int ZDCPulseAnalyzer::m_preSampleIdx {}
private

Definition at line 73 of file ZDCPulseAnalyzer.h.

◆ m_PSHGOverUnderflow

bool ZDCPulseAnalyzer::m_PSHGOverUnderflow {}
private

Definition at line 211 of file ZDCPulseAnalyzer.h.

◆ m_repassPulse

bool ZDCPulseAnalyzer::m_repassPulse {}
private

Definition at line 227 of file ZDCPulseAnalyzer.h.

◆ m_samplesDeriv2nd

std::vector<float> ZDCPulseAnalyzer::m_samplesDeriv2nd
private

Definition at line 309 of file ZDCPulseAnalyzer.h.

◆ m_samplesSub

std::vector<float> ZDCPulseAnalyzer::m_samplesSub
private

Definition at line 307 of file ZDCPulseAnalyzer.h.

◆ m_T0CutHighHG

float ZDCPulseAnalyzer::m_T0CutHighHG {}
private

Definition at line 129 of file ZDCPulseAnalyzer.h.

◆ m_T0CutHighLG

float ZDCPulseAnalyzer::m_T0CutHighLG {}
private

Definition at line 126 of file ZDCPulseAnalyzer.h.

◆ m_T0CutLowHG

float ZDCPulseAnalyzer::m_T0CutLowHG {}
private

Definition at line 128 of file ZDCPulseAnalyzer.h.

◆ m_T0CutLowLG

float ZDCPulseAnalyzer::m_T0CutLowLG {}
private

Definition at line 125 of file ZDCPulseAnalyzer.h.

◆ m_t0CutSig

float ZDCPulseAnalyzer::m_t0CutSig {}
private

Definition at line 133 of file ZDCPulseAnalyzer.h.

◆ m_tag

std::string ZDCPulseAnalyzer::m_tag
private

Definition at line 71 of file ZDCPulseAnalyzer.h.

◆ m_timeCutMode

unsigned int ZDCPulseAnalyzer::m_timeCutMode {0}
private

Definition at line 134 of file ZDCPulseAnalyzer.h.

◆ m_timeResFuncHG_p

std::unique_ptr<const TF1> ZDCPulseAnalyzer::m_timeResFuncHG_p {}
private

Definition at line 131 of file ZDCPulseAnalyzer.h.

◆ m_timeResFuncLG_p

std::unique_ptr<const TF1> ZDCPulseAnalyzer::m_timeResFuncLG_p {}
private

Definition at line 132 of file ZDCPulseAnalyzer.h.

◆ m_timeSig

float ZDCPulseAnalyzer::m_timeSig {}
private

Definition at line 271 of file ZDCPulseAnalyzer.h.

◆ m_timingCorrMode

unsigned int ZDCPulseAnalyzer::m_timingCorrMode {NoTimingCorr}
private

Definition at line 158 of file ZDCPulseAnalyzer.h.

◆ m_timingCorrRefADC

float ZDCPulseAnalyzer::m_timingCorrRefADC {500}
private

Definition at line 159 of file ZDCPulseAnalyzer.h.

◆ m_timingCorrScale

float ZDCPulseAnalyzer::m_timingCorrScale {100}
private

Definition at line 160 of file ZDCPulseAnalyzer.h.

◆ m_tmax

float ZDCPulseAnalyzer::m_tmax {}
private

Definition at line 79 of file ZDCPulseAnalyzer.h.

◆ m_tmin

float ZDCPulseAnalyzer::m_tmin {}
private

Definition at line 78 of file ZDCPulseAnalyzer.h.

◆ m_useDelayed

bool ZDCPulseAnalyzer::m_useDelayed {false}
private

Definition at line 88 of file ZDCPulseAnalyzer.h.

◆ m_usedPresampIdx

int ZDCPulseAnalyzer::m_usedPresampIdx {}
private

Definition at line 236 of file ZDCPulseAnalyzer.h.

◆ m_useFixedBaseline

bool ZDCPulseAnalyzer::m_useFixedBaseline {}
private

Definition at line 189 of file ZDCPulseAnalyzer.h.

◆ m_useLowGain

bool ZDCPulseAnalyzer::m_useLowGain {}
private

Definition at line 206 of file ZDCPulseAnalyzer.h.

◆ m_useSampleHG

std::vector<bool> ZDCPulseAnalyzer::m_useSampleHG
private

Definition at line 302 of file ZDCPulseAnalyzer.h.

◆ m_useSampleLG

std::vector<bool> ZDCPulseAnalyzer::m_useSampleLG
private

Definition at line 301 of file ZDCPulseAnalyzer.h.

◆ s_combinedFitFunc

TF1 * ZDCPulseAnalyzer::s_combinedFitFunc = nullptr
staticprivate

Definition at line 63 of file ZDCPulseAnalyzer.h.

◆ s_combinedFitTMax

float ZDCPulseAnalyzer::s_combinedFitTMax = 1000
staticprivate

Definition at line 64 of file ZDCPulseAnalyzer.h.

◆ s_combinedFitTMin

float ZDCPulseAnalyzer::s_combinedFitTMin = -0.5
staticprivate

Definition at line 65 of file ZDCPulseAnalyzer.h.

◆ s_delayedFitHist

TH1 * ZDCPulseAnalyzer::s_delayedFitHist = nullptr
staticprivate

Definition at line 62 of file ZDCPulseAnalyzer.h.

◆ s_fitOptions

std::string ZDCPulseAnalyzer::s_fitOptions = ""
staticprivate

Definition at line 58 of file ZDCPulseAnalyzer.h.

◆ s_pullValues

std::vector< float > ZDCPulseAnalyzer::s_pullValues
staticprivate

Definition at line 66 of file ZDCPulseAnalyzer.h.

◆ s_quietFits

bool ZDCPulseAnalyzer::s_quietFits = true
staticprivate

Definition at line 59 of file ZDCPulseAnalyzer.h.

◆ s_saveFitFunc

bool ZDCPulseAnalyzer::s_saveFitFunc = false
staticprivate

Definition at line 60 of file ZDCPulseAnalyzer.h.

◆ s_undelayedFitHist

TH1 * ZDCPulseAnalyzer::s_undelayedFitHist = nullptr
staticprivate

Definition at line 61 of file ZDCPulseAnalyzer.h.


The documentation for this class was generated from the following files:
ZDCFitWrapper::GetAmplitude
virtual float GetAmplitude() const =0
ZDCPulseAnalyzer::SetupFitFunctions
void SetupFitFunctions()
Definition: ZDCPulseAnalyzer.cxx:455
ZDCPulseAnalyzer::m_LGOverflow
bool m_LGOverflow
Definition: ZDCPulseAnalyzer.h:212
ZDCPulseAnalyzer::m_fitTau2
float m_fitTau2
Definition: ZDCPulseAnalyzer.h:274
ZDCPulseAnalyzer::m_fitPostT0
float m_fitPostT0
Definition: ZDCPulseAnalyzer.h:279
ZDCPulseAnalyzer::m_defaultFitWrapper
std::unique_ptr< ZDCFitWrapper > m_defaultFitWrapper
Definition: ZDCPulseAnalyzer.h:175
ZDCPulseAnalyzer::m_maxADCValue
float m_maxADCValue
Definition: ZDCPulseAnalyzer.h:239
covarianceTool.ndf
ndf
Definition: covarianceTool.py:678
ZDCPulseAnalyzer::PrePulseBit
@ PrePulseBit
Definition: ZDCPulseAnalyzer.h:36
ZDCPulseAnalyzer::m_NSampleAna
unsigned int m_NSampleAna
Definition: ZDCPulseAnalyzer.h:181
ZDCPulseAnalyzer::m_defaultT0Max
float m_defaultT0Max
Definition: ZDCPulseAnalyzer.h:136
ZDCPulseAnalyzer::m_expAmplitude
float m_expAmplitude
Definition: ZDCPulseAnalyzer.h:288
LArSamples::FitterData::fitter
const ShapeFitter * fitter
Definition: ShapeFitter.cxx:23
ZDCPulseAnalyzer::preExpTail
bool preExpTail() const
Definition: ZDCPulseAnalyzer.h:507
ZDCPulseAnalyzer::m_prePulseFitWrapper
std::unique_ptr< ZDCPrePulseFitWrapper > m_prePulseFitWrapper
Definition: ZDCPulseAnalyzer.h:176
ZDCPulseAnalyzer::m_useSampleHG
std::vector< bool > m_useSampleHG
Definition: ZDCPulseAnalyzer.h:302
ZDCPulseAnalyzer::m_maxSampl
int m_maxSampl
Definition: ZDCPulseAnalyzer.h:245
ZDCPulseAnalyzer::m_enableRepass
bool m_enableRepass
Definition: ZDCPulseAnalyzer.h:90
ZDCPulseAnalyzer::m_ADCSamplesLG
std::vector< float > m_ADCSamplesLG
Definition: ZDCPulseAnalyzer.h:297
ZDCPulseAnalyzer::m_samplesSub
std::vector< float > m_samplesSub
Definition: ZDCPulseAnalyzer.h:307
ZDCPulseAnalyzer::m_fitPostAmp
float m_fitPostAmp
Definition: ZDCPulseAnalyzer.h:280
ZDCPulseAnalyzer::m_chisqDivAmpCutLG
float m_chisqDivAmpCutLG
Definition: ZDCPulseAnalyzer.h:122
ZDCPulseAnalyzer::m_NSamplesAna
unsigned int m_NSamplesAna
Definition: ZDCPulseAnalyzer.h:295
ZDCFitExpFermiVariableTausLHCf
Definition: ZDCFitWrapper.h:231
python.CaloRecoConfig.f
f
Definition: CaloRecoConfig.py:127
ZDCPulseAnalyzer::m_HGOverflowADC
int m_HGOverflowADC
Definition: ZDCPulseAnalyzer.h:106
ZDCPulseAnalyzer::m_enablePreExcl
bool m_enablePreExcl
Definition: ZDCPulseAnalyzer.h:147
ZDCPulseAnalyzer::UseLowGain
bool UseLowGain() const
Definition: ZDCPulseAnalyzer.h:490
ZDCPulseAnalyzer::m_msgFunc_p
ZDCMsg::MessageFunctionPtr m_msgFunc_p
Definition: ZDCPulseAnalyzer.h:70
ZDCPulseAnalyzer::m_LGT0CorrParams
std::vector< float > m_LGT0CorrParams
Definition: ZDCPulseAnalyzer.h:161
tolerance
constexpr double tolerance
Definition: runMdtGeoComparison.cxx:105
get_generator_info.result
result
Definition: get_generator_info.py:21
max
#define max(a, b)
Definition: cfImp.cxx:41
ZDCPulseAnalyzer::m_minSampl
int m_minSampl
Definition: ZDCPulseAnalyzer.h:246
ZDCPulseAnalyzer::m_fitAmplitude
float m_fitAmplitude
Definition: ZDCPulseAnalyzer.h:266
ZDCPulseAnalyzer::m_HGOverflow
bool m_HGOverflow
Definition: ZDCPulseAnalyzer.h:208
AddEmptyComponent.histName
string histName
Definition: AddEmptyComponent.py:64
ZDCPulseAnalyzer::m_fitTau1
float m_fitTau1
Definition: ZDCPulseAnalyzer.h:273
ZDCPulseAnalyzer::m_useFixedBaseline
bool m_useFixedBaseline
Definition: ZDCPulseAnalyzer.h:189
ZDCPulseAnalyzer::m_postAmplitude
float m_postAmplitude
Definition: ZDCPulseAnalyzer.h:287
ZDCPulseAnalyzer::DoFit
void DoFit()
Definition: ZDCPulseAnalyzer.cxx:1303
ZDCPulseAnalyzer::m_adjTimeRangeEvent
bool m_adjTimeRangeEvent
Definition: ZDCPulseAnalyzer.h:182
ZDCPulseAnalyzer::m_minDeriv2nd
float m_minDeriv2nd
Definition: ZDCPulseAnalyzer.h:249
ZDCPrePulseFitWrapper
Definition: ZDCFitWrapper.h:116
ZDCFitExpFermiFixedTaus
Definition: ZDCFitWrapper.h:298
ZDCPulseAnalyzer::m_peak2ndDerivMinThreshLG
float m_peak2ndDerivMinThreshLG
Definition: ZDCPulseAnalyzer.h:85
ZDCPulseAnalyzer::m_2ndDerivStep
size_t m_2ndDerivStep
Definition: ZDCPulseAnalyzer.h:82
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
ZDCPulseAnalyzer::m_nonLinCorrRefScale
float m_nonLinCorrRefScale
Definition: ZDCPulseAnalyzer.h:166
ZDCPulseAnalyzer::m_timeCutMode
unsigned int m_timeCutMode
Definition: ZDCPulseAnalyzer.h:134
ZDCPulseAnalyzer::MakeCombinedFitter
static std::unique_ptr< TFitter > MakeCombinedFitter(TF1 *func)
Definition: ZDCPulseAnalyzer.cxx:1671
ZDCPulseAnalyzer::m_fitAmpMaxHG
float m_fitAmpMaxHG
Definition: ZDCPulseAnalyzer.h:142
ZDCPulseAnalyzer::m_backToHG_pre
bool m_backToHG_pre
Definition: ZDCPulseAnalyzer.h:231
ZDCPulseAnalyzer::Failed
bool Failed() const
Definition: ZDCPulseAnalyzer.h:491
ZDCFitWrapper
Definition: ZDCFitWrapper.h:19
TRT::Track::chiSquare
@ chiSquare
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:67
ZDCPulseAnalyzer::BadT0Bit
@ BadT0Bit
Definition: ZDCPulseAnalyzer.h:41
ZDCPulseAnalyzer::m_fitTimeSub
float m_fitTimeSub
Definition: ZDCPulseAnalyzer.h:269
quiet
bool quiet
Definition: TrigGlobEffCorrValidation.cxx:190
ZDCPulseAnalyzer::m_delayedPedestalDiff
float m_delayedPedestalDiff
Definition: ZDCPulseAnalyzer.h:191
ZDCFitWrapper::ConstrainFit
virtual void ConstrainFit()=0
ZDCPulseAnalyzer::LGOverflow
bool LGOverflow() const
Definition: ZDCPulseAnalyzer.h:496
ZDCFitWrapper::GetTime
virtual float GetTime() const =0
ZDCPulseAnalyzer::m_timingCorrRefADC
float m_timingCorrRefADC
Definition: ZDCPulseAnalyzer.h:159
ZDCPulseAnalyzer::m_postPulse
bool m_postPulse
Definition: ZDCPulseAnalyzer.h:216
ZDCPulseAnalyzer::m_defaultCombinedFitter
std::unique_ptr< TFitter > m_defaultCombinedFitter
Definition: ZDCPulseAnalyzer.h:195
ZDCPulseAnalyzer::m_nominalT0HG
float m_nominalT0HG
Definition: ZDCPulseAnalyzer.h:110
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
ZDCPulseAnalyzer::m_delayedHist
std::unique_ptr< TH1 > m_delayedHist
Definition: ZDCPulseAnalyzer.h:192
ZDCPulseAnalyzer::m_haveNonlinCorr
bool m_haveNonlinCorr
Definition: ZDCPulseAnalyzer.h:164
ZDCPulseAnalyzer::PostPulse
bool PostPulse() const
Definition: ZDCPulseAnalyzer.h:500
ZDCPulseAnalyzer::m_preExpTail
bool m_preExpTail
Definition: ZDCPulseAnalyzer.h:223
ZDCPulseAnalyzer::QuietFits
static bool QuietFits()
Definition: ZDCPulseAnalyzer.h:388
ZDCPulseAnalyzer::m_bkgdMaxFraction
float m_bkgdMaxFraction
Definition: ZDCPulseAnalyzer.h:289
ZDCPulseAnalyzer::HavePulse
bool HavePulse() const
Definition: ZDCPulseAnalyzer.h:489
ZDCPulseAnalyzer::m_tag
std::string m_tag
Definition: ZDCPulseAnalyzer.h:71
ZDCPulseAnalyzer::ScanAndSubtractSamples
bool ScanAndSubtractSamples()
Definition: ZDCPulseAnalyzer.cxx:637
ZDCFitExpFermiLinearPrePulse
Definition: ZDCFitWrapper.h:821
Root::AND
@ AND
Definition: TGRLCollection.h:32
ZDCPulseAnalyzer::AnalyzeData
bool AnalyzeData(size_t nSamples, size_t preSample, const std::vector< float > &samples, const std::vector< bool > &useSamples, float peak2ndDerivMinThresh, float noiseSig, const std::vector< float > &toCorrParams, float maxChisqDivAmp, float minT0Corr, float maxT0Corr)
Definition: ZDCPulseAnalyzer.cxx:912
athena.value
value
Definition: athena.py:122
ZDCPreExpFitWrapper
Definition: ZDCFitWrapper.h:144
ZDCPulseAnalyzer::LGOverflowBit
@ LGOverflowBit
Definition: ZDCPulseAnalyzer.h:33
ZDCPulseAnalyzer::m_prePulseSig
float m_prePulseSig
Definition: ZDCPulseAnalyzer.h:259
ZDCPulseAnalyzer::m_HGUnderflow
bool m_HGUnderflow
Definition: ZDCPulseAnalyzer.h:210
ZDCPulseAnalyzer::SetDefaults
void SetDefaults()
Definition: ZDCPulseAnalyzer.cxx:141
ZDCPulseAnalyzer::ExcludeLateLG
bool ExcludeLateLG() const
Definition: ZDCPulseAnalyzer.h:506
ZDCFitWrapper::GetWrapperTF1
virtual std::shared_ptr< TF1 > GetWrapperTF1()
Definition: ZDCFitWrapper.h:110
ZDCPulseAnalyzer::m_fixTau2
bool m_fixTau2
Definition: ZDCPulseAnalyzer.h:117
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ZDCPulseAnalyzer::m_defaultFitTMax
float m_defaultFitTMax
Definition: ZDCPulseAnalyzer.h:119
ZDCPulseAnalyzer::m_delayedBaselineShift
float m_delayedBaselineShift
Definition: ZDCPulseAnalyzer.h:290
ZDCPulseAnalyzer::m_badT0
bool m_badT0
Definition: ZDCPulseAnalyzer.h:220
ZDCPulseAnalyzer::m_fitMinAmp
bool m_fitMinAmp
Definition: ZDCPulseAnalyzer.h:226
ZDCMsg::Info
@ Info
Definition: ZDCMsg.h:20
ZDCPulseAnalyzer::s_quietFits
static bool s_quietFits
Definition: ZDCPulseAnalyzer.h:59
ZDCPulseAnalyzer::s_delayedFitHist
static TH1 * s_delayedFitHist
Definition: ZDCPulseAnalyzer.h:62
ReweightUtils.message
message
Definition: ReweightUtils.py:15
ZDCPulseAnalyzer::BadT0
bool BadT0() const
Definition: ZDCPulseAnalyzer.h:504
ZDCPulseAnalyzer::m_samplesDeriv2nd
std::vector< float > m_samplesDeriv2nd
Definition: ZDCPulseAnalyzer.h:309
ZDCFitExpFermiLHCfPreExp
Definition: ZDCFitWrapper.h:653
ZDCPulseAnalyzer::repassPulse
bool repassPulse() const
Definition: ZDCPulseAnalyzer.h:509
ZDCFitWrapper::GetTau2
virtual float GetTau2() const =0
ZDCPulseAnalyzer::m_haveData
bool m_haveData
Definition: ZDCPulseAnalyzer.h:203
ZDCPulseAnalyzer::s_saveFitFunc
static bool s_saveFitFunc
Definition: ZDCPulseAnalyzer.h:60
ZDCPulseAnalyzer::HGOverflow
bool HGOverflow() const
Definition: ZDCPulseAnalyzer.h:492
ZDCPulseAnalyzer::s_combinedFitFunc
static TF1 * s_combinedFitFunc
Definition: ZDCPulseAnalyzer.h:63
ZDCPulseAnalyzer::ArmSumIncludeBit
@ ArmSumIncludeBit
Definition: ZDCPulseAnalyzer.h:48
ZDCPulseAnalyzer::m_nominalTau2
float m_nominalTau2
Definition: ZDCPulseAnalyzer.h:114
ZDCPulseAnalyzer::HGUnderflowBit
@ HGUnderflowBit
Definition: ZDCPulseAnalyzer.h:31
ZDCPulseAnalyzer::m_prePulse
bool m_prePulse
Definition: ZDCPulseAnalyzer.h:215
ZDCPulseAnalyzer::s_combinedFitTMin
static float s_combinedFitTMin
Definition: ZDCPulseAnalyzer.h:65
ZDCPulseAnalyzer::PSHGOverUnderflow
bool PSHGOverUnderflow() const
Definition: ZDCPulseAnalyzer.h:495
ZDCPulseAnalyzer::RepassPulseBit
@ RepassPulseBit
Definition: ZDCPulseAnalyzer.h:47
ZDCPulseAnalyzer::m_useSampleLG
std::vector< bool > m_useSampleLG
Definition: ZDCPulseAnalyzer.h:301
ZDCPulseAnalyzer::m_ampNoNonLin
float m_ampNoNonLin
Definition: ZDCPulseAnalyzer.h:283
ZDCPulseAnalyzer::m_fitFunction
std::string m_fitFunction
Definition: ZDCPulseAnalyzer.h:81
ZDCPulseAnalyzer::m_preExclHGADCThresh
unsigned int m_preExclHGADCThresh
Definition: ZDCPulseAnalyzer.h:149
ZDCPulseAnalyzer::BadChisqBit
@ BadChisqBit
Definition: ZDCPulseAnalyzer.h:39
ZDCPulseAnalyzer::m_pedestal
int m_pedestal
Definition: ZDCPulseAnalyzer.h:75
ZDCPulseAnalyzer::SampleCIter
std::vector< float >::const_iterator SampleCIter
Definition: ZDCPulseAnalyzer.h:54
ZDCPulseAnalyzer::m_fixPrePulse
bool m_fixPrePulse
Definition: ZDCPulseAnalyzer.h:225
ZDCPulseAnalyzer::m_fitPulls
std::vector< float > m_fitPulls
Definition: ZDCPulseAnalyzer.h:316
tools.zlumi_mc_cf.correction
def correction(mu, runmode, campaign, run=None)
Definition: zlumi_mc_cf.py:4
ZDCPulseAnalyzer::m_preSample
float m_preSample
Definition: ZDCPulseAnalyzer.h:237
ZDCPulseAnalyzer::TimingCorrLog
@ TimingCorrLog
Definition: ZDCPulseAnalyzer.h:51
ZDCMsg::Verbose
@ Verbose
Definition: ZDCMsg.h:18
ZDCFitWrapper::UnconstrainFit
virtual void UnconstrainFit()=0
ZDCPulseAnalyzer::FailBit
@ FailBit
Definition: ZDCPulseAnalyzer.h:28
checkTP.save
def save(self, fileName="./columbo.out")
Definition: checkTP.py:178
ZDCPulseAnalyzer::m_postExclHGADCThresh
unsigned int m_postExclHGADCThresh
Definition: ZDCPulseAnalyzer.h:153
ZDCPulseAnalyzer::m_nominalT0LG
float m_nominalT0LG
Definition: ZDCPulseAnalyzer.h:111
ZDCPulseAnalyzer::m_fitAmpMinLG
float m_fitAmpMinLG
Definition: ZDCPulseAnalyzer.h:140
ZDCPulseAnalyzer::m_badChisq
bool m_badChisq
Definition: ZDCPulseAnalyzer.h:218
ZDCPulseAnalyzer::m_t0CutSig
float m_t0CutSig
Definition: ZDCPulseAnalyzer.h:133
ZDCFitWrapper::GetAmpError
virtual float GetAmpError() const =0
ZDCPulseAnalyzer::m_peak2ndDerivMinRepassHG
float m_peak2ndDerivMinRepassHG
Definition: ZDCPulseAnalyzer.h:92
ZDCPulseAnalyzer::m_initialPrePulseAmp
float m_initialPrePulseAmp
Definition: ZDCPulseAnalyzer.h:262
ZDCPulseAnalyzer::m_peak2ndDerivMinRepassLG
float m_peak2ndDerivMinRepassLG
Definition: ZDCPulseAnalyzer.h:91
ZDCPulseAnalyzer::FitMinAmpBit
@ FitMinAmpBit
Definition: ZDCPulseAnalyzer.h:46
ZDCPulseAnalyzer::m_fitPostT0lo
float m_fitPostT0lo
Definition: ZDCPulseAnalyzer.h:255
FullCPAlgorithmsTest_eljob.sample
sample
Definition: FullCPAlgorithmsTest_eljob.py:100
ZDCPulseAnalyzer::m_fixTau1
bool m_fixTau1
Definition: ZDCPulseAnalyzer.h:116
ZDCFitWrapper::GetWrapperTF1RawPtr
virtual TF1 * GetWrapperTF1RawPtr() const
Definition: ZDCFitWrapper.h:112
ZDCPulseAnalyzer::m_gainHG
float m_gainHG
Definition: ZDCPulseAnalyzer.h:76
ZDCPulseAnalyzer::PSHGOverUnderflowBit
@ PSHGOverUnderflowBit
Definition: ZDCPulseAnalyzer.h:32
ZDCPulseAnalyzer::m_fitTMax
float m_fitTMax
Definition: ZDCPulseAnalyzer.h:252
ZDCPulseAnalyzer::m_fitChisq
float m_fitChisq
Definition: ZDCPulseAnalyzer.h:275
ZDCPulseAnalyzer::CombinedPulsesFCN
static void CombinedPulsesFCN(int &numParam, double *, double &f, double *par, int flag)
Definition: ZDCPulseAnalyzer.cxx:34
ZDCPulseAnalyzer::m_noiseSigHG
float m_noiseSigHG
Definition: ZDCPulseAnalyzer.h:101
01SubmitToGrid.samples
samples
Definition: 01SubmitToGrid.py:58
ZDCPulseAnalyzer::m_fail
bool m_fail
Definition: ZDCPulseAnalyzer.h:207
ZDCPulseAnalyzer::PulseBit
@ PulseBit
Definition: ZDCPulseAnalyzer.h:26
ZDCPulseAnalyzer::m_fitPreAmp
float m_fitPreAmp
Definition: ZDCPulseAnalyzer.h:278
ZDCPulseAnalyzer::LGUnderflow
bool LGUnderflow() const
Definition: ZDCPulseAnalyzer.h:497
master.flag
bool flag
Definition: master.py:29
ZDCPulseAnalyzer::m_deltaTSample
float m_deltaTSample
Definition: ZDCPulseAnalyzer.h:74
ZDCPulseAnalyzer::m_nonLinCorrParamsLG
std::vector< float > m_nonLinCorrParamsLG
Definition: ZDCPulseAnalyzer.h:168
ZDCPulseAnalyzer::m_gainFactorLG
float m_gainFactorLG
Definition: ZDCPulseAnalyzer.h:97
ZDCPulseAnalyzer::m_minSampleEvt
unsigned int m_minSampleEvt
Definition: ZDCPulseAnalyzer.h:184
ZDCPulseAnalyzer::m_noiseSigLG
float m_noiseSigLG
Definition: ZDCPulseAnalyzer.h:102
chi2
double chi2(TH1 *h0, TH1 *h1)
Definition: comparitor.cxx:522
ZDCPulseAnalyzer::m_gainFactorHG
float m_gainFactorHG
Definition: ZDCPulseAnalyzer.h:96
ZDCPulseAnalyzer::m_fitFailed
bool m_fitFailed
Definition: ZDCPulseAnalyzer.h:217
ZDCPulseAnalyzer::m_maxSampleEvt
unsigned int m_maxSampleEvt
Definition: ZDCPulseAnalyzer.h:185
ZDCPulseAnalyzer::FitFailedBit
@ FitFailedBit
Definition: ZDCPulseAnalyzer.h:38
ZDCPulseAnalyzer::m_timingCorrScale
float m_timingCorrScale
Definition: ZDCPulseAnalyzer.h:160
ZDCPulseAnalyzer::m_initialExpAmp
float m_initialExpAmp
Definition: ZDCPulseAnalyzer.h:248
ZDCPulseAnalyzer::m_ADCSamplesHG
std::vector< float > m_ADCSamplesHG
Definition: ZDCPulseAnalyzer.h:296
ZDCPulseAnalyzer::ExcludeEarlyLGBit
@ ExcludeEarlyLGBit
Definition: ZDCPulseAnalyzer.h:42
python.StandardJetMods.pull
pull
Definition: StandardJetMods.py:264
ZDCPulseAnalyzer::m_T0CutLowHG
float m_T0CutLowHG
Definition: ZDCPulseAnalyzer.h:128
ZDCPulseAnalyzer::PostPulseBit
@ PostPulseBit
Definition: ZDCPulseAnalyzer.h:37
ZDCPulseAnalyzer::m_fitNDoF
float m_fitNDoF
Definition: ZDCPulseAnalyzer.h:276
Preparation.mode
mode
Definition: Preparation.py:95
ZDCFitWrapper::GetBkgdMaxFraction
virtual float GetBkgdMaxFraction() const =0
ZDCPulseAnalyzer::DoFitCombined
void DoFitCombined()
Definition: ZDCPulseAnalyzer.cxx:1435
ZDCPulseAnalyzer::m_havePulse
bool m_havePulse
Definition: ZDCPulseAnalyzer.h:205
ZDCPulseAnalyzer::m_maxDelta
float m_maxDelta
Definition: ZDCPulseAnalyzer.h:242
python.AtlRunQueryLib.options
options
Definition: AtlRunQueryLib.py:379
ZDCPulseAnalyzer::TimingCorrLin
@ TimingCorrLin
Definition: ZDCPulseAnalyzer.h:51
ZDCPulseAnalyzer::m_nonLinCorrRefADC
float m_nonLinCorrRefADC
Definition: ZDCPulseAnalyzer.h:165
ZDCPulseAnalyzer::m_T0CutHighLG
float m_T0CutHighLG
Definition: ZDCPulseAnalyzer.h:126
ZDCFitExpFermiPrePulse
Definition: ZDCFitWrapper.h:361
ZDCPulseAnalyzer::m_ampError
float m_ampError
Definition: ZDCPulseAnalyzer.h:284
ZDCFitExpFermiVariableTaus
Definition: ZDCFitWrapper.h:164
ZDCPulseAnalyzer::GetHistogramPtr
const TH1 * GetHistogramPtr() const
Definition: ZDCPulseAnalyzer.h:566
ZDCPulseAnalyzer::m_ExcludeLate
bool m_ExcludeLate
Definition: ZDCPulseAnalyzer.h:222
ZDCPulseAnalyzer::m_preExclLGADCThresh
unsigned int m_preExclLGADCThresh
Definition: ZDCPulseAnalyzer.h:150
ZDCPulseAnalyzer::m_enablePostExcl
bool m_enablePostExcl
Definition: ZDCPulseAnalyzer.h:152
ZDCPulseAnalyzer::ExcludeLateLGBit
@ ExcludeLateLGBit
Definition: ZDCPulseAnalyzer.h:43
min
#define min(a, b)
Definition: cfImp.cxx:40
ZDCPulseAnalyzer::obtainDelayedBaselineCorr
static float obtainDelayedBaselineCorr(const std::vector< float > &samples)
Definition: ZDCPulseAnalyzer.cxx:1977
ZDCPulseAnalyzer::m_ADCSamplesHGSub
std::vector< float > m_ADCSamplesHGSub
Definition: ZDCPulseAnalyzer.h:298
ZDCPulseAnalyzer::m_fitPreT0
float m_fitPreT0
Definition: ZDCPulseAnalyzer.h:277
ZDCPulseAnalyzer::m_useDelayed
bool m_useDelayed
Definition: ZDCPulseAnalyzer.h:88
ZDCMsg::Error
@ Error
Definition: ZDCMsg.h:22
ZDCPulseAnalyzer::HGUnderflow
bool HGUnderflow() const
Definition: ZDCPulseAnalyzer.h:494
ZDCPulseAnalyzer::m_HGUnderflowADC
int m_HGUnderflowADC
Definition: ZDCPulseAnalyzer.h:107
ZDCPulseAnalyzer::m_useLowGain
bool m_useLowGain
Definition: ZDCPulseAnalyzer.h:206
ZDCPulseAnalyzer::m_ADCSSampSigLG
std::vector< float > m_ADCSSampSigLG
Definition: ZDCPulseAnalyzer.h:305
ZDCPulseAnalyzer::Calculate2ndDerivative
static std::vector< float > Calculate2ndDerivative(const std::vector< float > &inputData, unsigned int step)
Definition: ZDCPulseAnalyzer.cxx:1945
ZDCPulseAnalyzer::m_repassPulse
bool m_repassPulse
Definition: ZDCPulseAnalyzer.h:227
createCoolChannelIdFile.par
par
Definition: createCoolChannelIdFile.py:29
ZDCPulseAnalyzer::m_ExcludeEarly
bool m_ExcludeEarly
Definition: ZDCPulseAnalyzer.h:221
ZDCPulseAnalyzer::m_preSampleIdx
unsigned int m_preSampleIdx
Definition: ZDCPulseAnalyzer.h:73
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
ZDCPulseAnalyzer::m_delayedDeltaT
float m_delayedDeltaT
Definition: ZDCPulseAnalyzer.h:190
ZDCPulseAnalyzer::ExcludeEarlyLG
bool ExcludeEarlyLG() const
Definition: ZDCPulseAnalyzer.h:505
ZDCFitWrapper::Initialize
void Initialize(float initialAmp, float initialT0, float ampMin, float ampMax)
Definition: ZDCFitWrapper.cxx:9
ZDCPulseAnalyzer::m_preExpSig
float m_preExpSig
Definition: ZDCPulseAnalyzer.h:258
ZDCPulseAnalyzer::s_fitOptions
static std::string s_fitOptions
Definition: ZDCPulseAnalyzer.h:58
ZDCFitWrapper::GetTau1
virtual float GetTau1() const =0
ZDCPulseAnalyzer::m_timeResFuncLG_p
std::unique_ptr< const TF1 > m_timeResFuncLG_p
Definition: ZDCPulseAnalyzer.h:132
ZDCPulseAnalyzer::preExpTailBit
@ preExpTailBit
Definition: ZDCPulseAnalyzer.h:44
ZDCPulseAnalyzer::m_minDeriv2ndSig
float m_minDeriv2ndSig
Definition: ZDCPulseAnalyzer.h:257
ZDCPulseAnalyzer::m_fitTime
float m_fitTime
Definition: ZDCPulseAnalyzer.h:268
ZDCPulseAnalyzer::m_preExpFitWrapper
std::unique_ptr< ZDCPreExpFitWrapper > m_preExpFitWrapper
Definition: ZDCPulseAnalyzer.h:177
python.ami.results
def results
Definition: ami.py:386
TH1::GetBinContent
double GetBinContent(int) const
Definition: rootspy.cxx:298
ZDCPulseAnalyzer::LowGainBit
@ LowGainBit
Definition: ZDCPulseAnalyzer.h:27
ZDCPulseAnalyzer::PrePulse
bool PrePulse() const
Definition: ZDCPulseAnalyzer.h:499
ZDCPulseAnalyzer::m_forceLG
bool m_forceLG
Definition: ZDCPulseAnalyzer.h:77
ZDCPulseAnalyzer::m_peak2ndDerivMinSample
size_t m_peak2ndDerivMinSample
Definition: ZDCPulseAnalyzer.h:83
ZDCFitComplexPrePulse
Definition: ZDCFitWrapper.h:934
ZDCPulseAnalyzer::m_usedPresampIdx
int m_usedPresampIdx
Definition: ZDCPulseAnalyzer.h:236
ZDCPulseAnalyzer::NoTimingCorr
@ NoTimingCorr
Definition: ZDCPulseAnalyzer.h:51
ZDCPulseAnalyzer::HGOverflowBit
@ HGOverflowBit
Definition: ZDCPulseAnalyzer.h:29
ZDCPulseAnalyzer::m_lastHGOverFlowSample
int m_lastHGOverFlowSample
Definition: ZDCPulseAnalyzer.h:292
xAOD::score
@ score
Definition: TrackingPrimitives.h:513
ReadOfcFromCool.nsamples
nsamples
Definition: ReadOfcFromCool.py:115
ZDCPulseAnalyzer::m_chisqDivAmpCutHG
float m_chisqDivAmpCutHG
Definition: ZDCPulseAnalyzer.h:123
ZDCPulseAnalyzer::m_peak2ndDerivMinTolerance
size_t m_peak2ndDerivMinTolerance
Definition: ZDCPulseAnalyzer.h:84
ZDCPulseAnalyzer::m_baselineCorr
float m_baselineCorr
Definition: ZDCPulseAnalyzer.h:232
ZDCPulseAnalyzer::m_PSHGOverUnderflow
bool m_PSHGOverUnderflow
Definition: ZDCPulseAnalyzer.h:211
ZDCFitExpFermiVariableTausRun3
Definition: ZDCFitWrapper.h:292
ZDCPulseAnalyzer::m_preAmplitude
float m_preAmplitude
Definition: ZDCPulseAnalyzer.h:286
ZDCPulseAnalyzer::m_tmin
float m_tmin
Definition: ZDCPulseAnalyzer.h:78
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
ZDCPulseAnalyzer::m_ADCSSampSigHG
std::vector< float > m_ADCSSampSigHG
Definition: ZDCPulseAnalyzer.h:304
ZDCPulseAnalyzer::m_fitAmpMaxLG
float m_fitAmpMaxLG
Definition: ZDCPulseAnalyzer.h:143
ZDCPulseAnalyzer::DoAnalysis
bool DoAnalysis(bool repass)
Definition: ZDCPulseAnalyzer.cxx:796
ZDCPulseAnalyzer::FillHistogram
void FillHistogram(const std::vector< float > &samples, float noiseSig) const
Definition: ZDCPulseAnalyzer.h:343
ZDCPulseAnalyzer::Reset
void Reset(bool reanalyze=false)
Definition: ZDCPulseAnalyzer.cxx:205
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
ZDCPulseAnalyzer::m_fitAmpError
float m_fitAmpError
Definition: ZDCPulseAnalyzer.h:267
ZDCPulseAnalyzer::m_fitTimeCorr
float m_fitTimeCorr
Definition: ZDCPulseAnalyzer.h:270
TH1
Definition: rootspy.cxx:268
ZDCPulseAnalyzer::m_peak2ndDerivMinThreshHG
float m_peak2ndDerivMinThreshHG
Definition: ZDCPulseAnalyzer.h:86
ZDCPulseAnalyzer::m_timeSig
float m_timeSig
Definition: ZDCPulseAnalyzer.h:271
ZDCPulseAnalyzer::m_T0CutLowLG
float m_T0CutLowLG
Definition: ZDCPulseAnalyzer.h:125
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
ZDCPulseAnalyzer::m_defaultT0Min
float m_defaultT0Min
Definition: ZDCPulseAnalyzer.h:137
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
ZDCPulseAnalyzer::m_maxSamplesPostExcl
unsigned int m_maxSamplesPostExcl
Definition: ZDCPulseAnalyzer.h:155
ZDCPulseAnalyzer::m_amplitude
float m_amplitude
Definition: ZDCPulseAnalyzer.h:282
ZDCPulseAnalyzer::BadChisq
bool BadChisq() const
Definition: ZDCPulseAnalyzer.h:502
ZDCPulseAnalyzer::m_initializedFits
bool m_initializedFits
Definition: ZDCPulseAnalyzer.h:174
ZDCPulseAnalyzer::m_defaultFitTMin
float m_defaultFitTMin
Definition: ZDCPulseAnalyzer.h:120
ZDCPulseAnalyzer::m_fitTMin
float m_fitTMin
Definition: ZDCPulseAnalyzer.h:253
ZDCPulseAnalyzer::dumpTF1
void dumpTF1(const TF1 *) const
Definition: ZDCPulseAnalyzer.cxx:1754
ZDCPulseAnalyzer::m_minDeriv2ndIndex
int m_minDeriv2ndIndex
Definition: ZDCPulseAnalyzer.h:250
ZDCPulseAnalyzer::m_LGUnderflow
bool m_LGUnderflow
Definition: ZDCPulseAnalyzer.h:213
ZDCPulseAnalyzer::m_LGOverflowADC
int m_LGOverflowADC
Definition: ZDCPulseAnalyzer.h:108
LArCellBinning.step
step
Definition: LArCellBinning.py:158
ZDCPulseAnalyzer::m_ADCSamplesLGSub
std::vector< float > m_ADCSamplesLGSub
Definition: ZDCPulseAnalyzer.h:299
ZDCPulseAnalyzer::m_T0CutHighHG
float m_T0CutHighHG
Definition: ZDCPulseAnalyzer.h:129
ZDCPulseAnalyzer::m_firstHGOverFlowSample
int m_firstHGOverFlowSample
Definition: ZDCPulseAnalyzer.h:293
ZDCPulseAnalyzer::s_undelayedFitHist
static TH1 * s_undelayedFitHist
Definition: ZDCPulseAnalyzer.h:61
ZDCMsg::Debug
@ Debug
Definition: ZDCMsg.h:19
ZDCPulseAnalyzer::m_fitAmpMinHG
float m_fitAmpMinHG
Definition: ZDCPulseAnalyzer.h:139
ZDCMsg::Fatal
@ Fatal
Definition: ZDCMsg.h:23
ZDCPulseAnalyzer::fitMinimumAmplitude
bool fitMinimumAmplitude() const
Definition: ZDCPulseAnalyzer.h:508
ZDCPulseAnalyzer::m_timingCorrMode
unsigned int m_timingCorrMode
Definition: ZDCPulseAnalyzer.h:158
ZDCPulseAnalyzer::m_maxSamplesPreExcl
unsigned int m_maxSamplesPreExcl
Definition: ZDCPulseAnalyzer.h:148
LArDigits2NtupleDumper.nSamples
nSamples
Definition: LArDigits2NtupleDumper.py:70
merge.status
status
Definition: merge.py:17
ZDCPulseAnalyzer::LGUnderflowBit
@ LGUnderflowBit
Definition: ZDCPulseAnalyzer.h:34
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
ZDCPulseAnalyzer::m_initialPostPulseT0
float m_initialPostPulseT0
Definition: ZDCPulseAnalyzer.h:264
ZDCPulseAnalyzer::m_fitExpAmp
float m_fitExpAmp
Definition: ZDCPulseAnalyzer.h:281
ZDCPulseAnalyzer::m_prePulseCombinedFitter
std::unique_ptr< TFitter > m_prePulseCombinedFitter
Definition: ZDCPulseAnalyzer.h:194
ZDCPulseAnalyzer::m_fitHist
std::unique_ptr< TH1 > m_fitHist
Definition: ZDCPulseAnalyzer.h:172
ZDCPulseAnalyzer::m_timeResFuncHG_p
std::unique_ptr< const TF1 > m_timeResFuncHG_p
Definition: ZDCPulseAnalyzer.h:131
ZDCPulseAnalyzer::m_preSampleAmp
float m_preSampleAmp
Definition: ZDCPulseAnalyzer.h:285
ZDCPulseAnalyzer::m_nonLinCorrParamsHG
std::vector< float > m_nonLinCorrParamsHG
Definition: ZDCPulseAnalyzer.h:167
ZDCPulseAnalyzer::m_nominalTau1
float m_nominalTau1
Definition: ZDCPulseAnalyzer.h:113
ZDCPulseAnalyzer::m_minDelta
float m_minDelta
Definition: ZDCPulseAnalyzer.h:243
ZDCPulseAnalyzer::m_fitTCorr2nd
float m_fitTCorr2nd
Definition: ZDCPulseAnalyzer.h:272
ZDCPulseAnalyzer::s_combinedFitTMax
static float s_combinedFitTMax
Definition: ZDCPulseAnalyzer.h:64
ZDCPulseAnalyzer::m_postExclLGADCThresh
unsigned int m_postExclLGADCThresh
Definition: ZDCPulseAnalyzer.h:154
Amg::distance
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Definition: GeoPrimitivesHelpers.h:54
ZDCPulseAnalyzer::m_initialPrePulseT0
float m_initialPrePulseT0
Definition: ZDCPulseAnalyzer.h:261
ZDCPulseAnalyzer::FitFailed
bool FitFailed() const
Definition: ZDCPulseAnalyzer.h:501
readCCLHist.float
float
Definition: readCCLHist.py:83
ZDCPulseAnalyzer::m_HGT0CorrParams
std::vector< float > m_HGT0CorrParams
Definition: ZDCPulseAnalyzer.h:162
ZDCPulseAnalyzer::s_pullValues
static std::vector< float > s_pullValues
Definition: ZDCPulseAnalyzer.h:66
ZDCFitExpFermiPreExp
Definition: ZDCFitWrapper.h:563
ZDCPulseAnalyzer::m_minADCValue
float m_minADCValue
Definition: ZDCPulseAnalyzer.h:240
ZDCFitExpFermiLinearFixedTaus
Definition: ZDCFitWrapper.h:756
ZDCPulseAnalyzer::m_tmax
float m_tmax
Definition: ZDCPulseAnalyzer.h:79
ZDCFitGeneralPulse
Definition: ZDCFitWrapper.h:1049
ZDCPulseAnalyzer::m_Nsample
unsigned int m_Nsample
Definition: ZDCPulseAnalyzer.h:72
ZDCPulseAnalyzer::CalculateDerivative
static std::vector< float > CalculateDerivative(const std::vector< float > &inputData, unsigned int step)
Definition: ZDCPulseAnalyzer.cxx:1924