|
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef ZDCANALYSIS_ZDCPulseAnalyzer_h
6 #define ZDCANALYSIS_ZDCPulseAnalyzer_h
10 #include "TGraphErrors.h"
354 void Reset(
bool reanalyze =
false);
363 const std::vector<float>& samples,
364 const std::vector<bool>& useSamples,
365 float peak2ndDerivMinThresh,
367 const std::vector<float>& toCorrParams,
368 float maxChisqDivAmp,
369 float minT0Corr,
float maxT0Corr
379 void prepareLGRefit(
const std::vector<float>& samplesLG,
const std::vector<float>& samplesSig,
380 const std::vector<bool>& useSamples);
388 for (
size_t isample = 0; isample <
m_NSamplesAna; isample++) {
394 for (
size_t isample = 0; isample <
m_NSamplesAna; isample++) {
404 for (
size_t isample = 0; isample <
m_Nsample; isample++) {
415 for (
size_t isample = 0; isample <
m_Nsample; isample++) {
426 void DoFit(
bool refitLG =
false);
440 const std::string& fitFunction,
int peak2ndDerivMinSample,
float peak2DerivMinThreshHG,
float peak2DerivMinThreshLG);
449 void enableDelayed(
float deltaT,
float pedestalShift,
bool fixedBaseline =
false);
451 void enableRepass(
float peak2ndDerivMinRepassHG,
float peak2ndDerivMinRepassLG);
454 const std::vector<double>& parsHG,
455 const std::vector<double>& parsLG);
457 void enablePreExclusion(
unsigned int maxSamplesExcl,
unsigned int HGADCThresh,
unsigned int LGADCThresh)
483 void SetCutValues(
float chisqDivAmpCutHG,
float chisqDivAmpCutLG,
484 float deltaT0MinHG,
float deltaT0MaxHG,
485 float deltaT0MinLG,
float deltaT0MaxLG) ;
495 void SetFitMinMaxAmp(
float minAmpHG,
float minAmpLG,
float maxAmpHG,
float maxAmpLG);
497 void SetTauT0Values(
bool fixTau1,
bool fixTau2,
float tau1,
float tau2,
float t0HG,
float t0LG);
502 const std::vector<float>& HGT0CorrParams,
const std::vector<float>& LGT0CorrParams)
516 void SetNonlinCorrParams(
float refADC,
float refScale,
const std::vector<float>& paramsHG,
const std::vector<float>& paramsLG)
518 std::string HGParamsStr =
"HG coefficients = ", LGParamsStr =
"LG coefficients = ";
523 (*m_msgFunc_p)(
ZDCMsg::Info, (
"Setting non-linear parameters for module: " +
m_tag +
", reference ADC = " +
539 void enableFADCCorrections(
bool correctPerSample, std::unique_ptr<const TH1>& correHistHG, std::unique_ptr<const TH1>& correHistLG);
542 bool LoadAndAnalyzeData(
const std::vector<float>& ADCSamplesHG,
const std::vector<float>& ADCSamplesLG);
544 bool LoadAndAnalyzeData(
const std::vector<float>& ADCSamplesHG,
const std::vector<float>& ADCSamplesLG,
545 const std::vector<float>& ADCSamplesHGDelayed,
const std::vector<float>& ADCSamplesLGDelayed);
696 std::shared_ptr<TGraphErrors>
GetGraph(
bool forceLG =
false)
const;
698 std::vector<float>
GetFitPulls(
bool forceLG =
false)
const;
702 void dumpTF1(
const TF1*)
const;
std::unique_ptr< ZDCFitWrapper > m_defaultFitWrapper
float GetFitPreAmp() const
const ShapeFitter * fitter
std::unique_ptr< ZDCPrePulseFitWrapper > m_prePulseFitWrapper
std::vector< bool > m_useSampleHG
void SetGainFactorsHGLG(float gainFactorHG, float gainFactorLG)
std::vector< float > m_ADCSamplesLG
std::vector< float > m_samplesSub
float GetFitPostAmp() const
void enableRepass(float peak2ndDerivMinRepassHG, float peak2ndDerivMinRepassLG)
unsigned int m_NSamplesAna
float getRefitLGAmp() const
ZDCMsg::MessageFunctionPtr m_msgFunc_p
std::vector< float > m_LGT0CorrParams
constexpr double tolerance
bool ArmSumInclude() const
bool m_haveFADCCorrections
std::unique_ptr< const TH1 > m_FADCCorrHG
float GetMinDelta() const
float m_peak2ndDerivMinThreshLG
float GetDelayedBaselineShiftFit() const
float m_nonLinCorrRefScale
unsigned int m_timeCutMode
static std::unique_ptr< TFitter > MakeCombinedFitter(TF1 *func)
float getMaxADCLG() const
void SetNonlinCorrParams(float refADC, float refScale, const std::vector< float > ¶msHG, const std::vector< float > ¶msLG)
void SetPeak2ndDerivMinTolerance(size_t tolerance)
int getMinADCSampleHG() const
float m_delayedPedestalDiff
void enableTimeSigCut(bool AND, float sigCut, const std::string &TF1String, const std::vector< double > &parsHG, const std::vector< double > &parsLG)
float GetFitPreT0() const
void DoFitCombined(bool refitLG=false)
float GetAmpError() const
void UpdateFitterTimeLimits(TFitter *fitter, ZDCFitWrapper *wrapper, bool prePulse)
unsigned int GetStatusMask() const
std::unique_ptr< TFitter > m_defaultCombinedFitter
float getRefitLGTime() const
std::unique_ptr< TH1 > m_delayedHist
void SetCutValues(float chisqDivAmpCutHG, float chisqDivAmpCutLG, float deltaT0MinHG, float deltaT0MaxHG, float deltaT0MinLG, float deltaT0MaxLG)
float GetAmpNoNonLin() const
std::unique_ptr< TH1 > m_fitHistLGRefit
int getMinADCSampleLG() const
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)
bool ExcludeLateLG() const
float GetAmplitude() const
float m_delayedBaselineShift
float getRefitLGTimeSub() const
static TH1 * s_delayedFitHist
std::vector< float > m_samplesDeriv2nd
static void SetQuietFits(bool quiet)
static bool s_saveFitFunc
static TF1 * s_combinedFitFunc
static float s_combinedFitTMin
bool PSHGOverUnderflow() const
float GetFitPostT0() const
std::vector< bool > m_useSampleLG
std::string m_fitFunction
bool LoadAndAnalyzeData(const std::vector< float > &ADCSamplesHG, const std::vector< float > &ADCSamplesLG)
unsigned int m_preExclHGADCThresh
std::vector< float >::const_iterator SampleCIter
std::vector< float > m_fitPulls
float getMinADCHG() const
float GetMaxDelta() const
float getMinADCSub() const
void setLGMode(unsigned int mode)
float getPresample() const
def save(self, fileName="./columbo.out")
unsigned int m_postExclHGADCThresh
float getMaxADCHG() const
float m_peak2ndDerivMinRepassHG
float m_initialPrePulseAmp
float m_peak2ndDerivMinRepassLG
float getRefitLGFitAmp() const
float GetPreExpAmp() const
static void CombinedPulsesFCN(int &numParam, double *, double &f, double *par, int flag)
int getMaxADCSampleHG() const
std::vector< float > m_nonLinCorrParamsLG
unsigned int m_minSampleEvt
unsigned int m_maxSampleEvt
std::vector< float > m_ADCSamplesHG
static void SetSaveFitFunc(bool save)
float getMaxADCSub() const
const TH1 * GetHistogramPtr(bool refitLG=false) const
unsigned int getLGMode() const
void disableFADCCorrections()
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)
void SetADCOverUnderflowValues(int HGOverflowADC, int HGUnderflowADC, int LGOverflowADC)
unsigned int m_preExclLGADCThresh
static float obtainDelayedBaselineCorr(const std::vector< float > &samples)
std::vector< float > m_ADCSamplesHGSub
void SetTauT0Values(bool fixTau1, bool fixTau2, float tau1, float tau2, float t0HG, float t0LG)
void SetFitMinMaxAmp(float minAmpHG, float minAmpLG, float maxAmpHG, float maxAmpLG)
void set2ndDerivStep(size_t step)
const std::vector< float > & GetSamplesDeriv2nd() const
std::vector< float > m_ADCSSampSigLG
static std::vector< float > Calculate2ndDerivative(const std::vector< float > &inputData, unsigned int step)
unsigned int m_preSampleIdx
float GetMinDeriv2ndIndex() const
std::string to_string(const DetectorType &type)
bool ExcludeEarlyLG() const
std::unique_ptr< const TF1 > m_timeResFuncLG_p
std::unique_ptr< ZDCPreExpFitWrapper > m_preExpFitWrapper
std::shared_ptr< MessageFunction > MessageFunctionPtr
float getADCPeakHG() const
size_t m_peak2ndDerivMinSample
void enablePreExclusion(unsigned int maxSamplesExcl, unsigned int HGADCThresh, unsigned int LGADCThresh)
void SetFitTimeMax(float tmax)
std::unique_ptr< TH1 > m_delayedHistLGRefit
float GetFitAmplitude() const
float getRefitLGChisq() const
float getMinADCLG() const
int m_lastHGOverFlowSample
std::vector< float > m_samplesLGRefit
float GetMinDeriv2nd() const
size_t m_peak2ndDerivMinTolerance
int getMaxADCSampleLG() const
void DoFit(bool refitLG=false)
std::shared_ptr< TGraphErrors > GetCombinedGraph(bool forceLG=false) const
float GetBkgdMaxFraction() const
void prepareLGRefit(const std::vector< float > &samplesLG, const std::vector< float > &samplesSig, const std::vector< bool > &useSamples)
void FillHistogram(bool refitLG) const
std::vector< float > m_ADCSSampSigHG
bool DoAnalysis(bool repass)
void Reset(bool reanalyze=false)
std::vector< float > m_samplesSigLGRefit
float m_peak2ndDerivMinThreshHG
void SetTimingCorrParams(TimingCorrMode mode, float refADC, float refScale, const std::vector< float > &HGT0CorrParams, const std::vector< float > &LGT0CorrParams)
ATLAS_NO_CHECK_FILE_THREAD_SAFETY
float getRefitLGAmpCorr() const
unsigned int m_maxSamplesPostExcl
void dumpTF1(const TF1 *) const
float getADCPeakLG() const
std::vector< float > m_ADCSamplesLGSub
int m_firstHGOverFlowSample
std::vector< float > GetFitPulls(bool forceLG=false) const
static TH1 * s_undelayedFitHist
void enablePostExclusion(unsigned int maxSamplesExcl, unsigned int HGADCThresh, unsigned int LGADCThresh)
bool fitMinimumAmplitude() const
unsigned int m_timingCorrMode
unsigned int m_maxSamplesPreExcl
void enableFADCCorrections(bool correctPerSample, std::unique_ptr< const TH1 > &correHistHG, std::unique_ptr< const TH1 > &correHistLG)
std::unique_ptr< const TH1 > m_FADCCorrLG
void SetNoiseSigmas(float noiseSigHG, float noiseSigLG)
float m_initialPostPulseT0
void enableDelayed(float deltaT, float pedestalShift, bool fixedBaseline=false)
std::unique_ptr< TFitter > m_prePulseCombinedFitter
std::unique_ptr< TH1 > m_fitHist
std::unique_ptr< const TF1 > m_timeResFuncHG_p
std::vector< float > m_nonLinCorrParamsHG
double getAmplitudeCorrection(bool highGain)
Define macros for attributes used to control the static checker.
static float s_combinedFitTMax
unsigned int m_postExclLGADCThresh
std::shared_ptr< TGraphErrors > GetGraph(bool forceLG=false) const
std::vector< float > m_samplesSig
float m_initialPrePulseT0
std::vector< float > m_HGT0CorrParams
static std::vector< float > s_pullValues
float GetDelayedBaselineCorr() const
const std::vector< float > & GetSamplesSub() const
void SetFitOPtions(const std::string &fitOptions)
float GetFitExpAmp() const
float GetPreSampleAmp() const
static std::vector< float > CalculateDerivative(const std::vector< float > &inputData, unsigned int step)