![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef ZDCANALYSIS_RPDDataAnalyzer_h
6 #define ZDCANALYSIS_RPDDataAnalyzer_h
92 bool doPileupExpFit(
unsigned int channel, std::vector<std::pair<unsigned int, float>>
const& pileupFitPoints);
void analyzeData()
Analyze RPD data.
std::vector< std::vector< float > > m_chPileupStretchedExpFitParamErrs
parameter errors for pileup exponential fit (if pileup was detected and fit did not fail); per channe...
const std::vector< float > & getChPileupStretchedExpFitParams(unsigned int channel) const
Get parameters for pileup stretched exponential fit (if pileup was detected and fit did not fail): ex...
@ PileupStretchedExpPulseLikeBit
std::vector< float > m_chSumAdc
sample of max of RPD data in signal range after pileup subtraction; per channel
@ InsufficientPileupFitPointsBit
float getChMaxAdc(unsigned int channel) const
Get max of RPD data in signal range after baseline and pileup subtraction.
std::vector< float > m_chMaxAdcCalib
max of RPD data in signal range after baseline and pileup subtraction; per channel
float postPulseFracThresh
float m_pileupBaselineSumThresh
The global nominal baseline; used when pileup is detected.
unsigned int m_nNegativesAllowed
Baseline standard deviations less than this number indicate there is not pileup.
std::vector< std::vector< float > > m_chPileupStretchedExpFitParams
parameters for pileup exponential fit (if pileup was detected and fit did not fail): exp( [0] + [1]*s...
void calculateMaxSampleMaxAdc(unsigned int channel)
Calculate max ADC and max sample.
unsigned int getChStatus(unsigned int channel) const
Get status word for channel.
const std::vector< float > & getChPileupStretchedExpFitParamErrs(unsigned int channel) const
Get parameter errors for pileup stretched exponential fit (if pileup was detected and fit did not fai...
std::vector< float > m_chSumAdcCalib
sum of RPD data in signal range after baseline and pileup subtraction; per channel
std::vector< float > m_chBaseline
OOT pileup sum as a fraction of non-pileup sum in entire window (0 if no OOT pileup,...
void reset()
Reset all member variables to default values.
std::bitset< 32 > m_sideStatus
status bits per channel
std::vector< float > m_outputCalibFactors
ADC values greater than or equal to this number are considered overflow.
std::vector< std::vector< float > > m_chPileupExpFitParams
baseline used in baseline subtraction; per channel
virtual ~RPDDataAnalyzer()=default
float getChMaxAdcCalib(unsigned int channel) const
Get max of RPD data in signal range after baseline and pileup subtraction, with output calibration fa...
unsigned int nNegativesAllowed
unsigned int getChMaxSample(unsigned int channel) const
Get sample of max of RPD data in signal range after pileup subtraction.
unsigned int goodPulseSampleStop
ATLAS_NO_CHECK_FILE_THREAD_SAFETY
std::vector< float > m_chPileupFrac
max of RPD data in signal range after baseline and pileup subtraction, with output calibration factor...
unsigned int countSignalRangeNegatives(std::vector< float > const &values) const
Calculate the number of negative values in signal range.
float getChSumAdc(unsigned int channel) const
Get sum of RPD data in signal range after baseline and pileup subtraction.
unsigned int nominalBaseline
RPDDataAnalyzer(ZDCMsg::MessageFunctionPtr messageFunc_p, const std::string &tag, const RPDConfig &config, std::vector< float > const &calibFactors)
float getChSumAdcCalib(unsigned int channel) const
Get sum of RPD data in signal range after baseline and pileup subtraction, with output calibration fa...
void loadChannelData(unsigned int channel, const std::vector< uint16_t > &FadcData)
Load a single channel's FADC data into member variable.
std::vector< std::vector< float > > m_chCorrectedFadcData
raw RPD data; index channel then sample
@ PileupStretchedExpGrowthBit
unsigned int m_AdcOverflow
Maximum number of negative ADC values after baseline and pileup subtraction allowed in signal range.
float getChPileupStretchedExpFitMSE(unsigned int channel) const
Get mean squared error of pileup stretched exponential fit in baseline samples (if pileup was detecte...
std::vector< float > m_chExpPileupMSE
pileup stretched exponential fit function (if pileup was detected and fit did not fail); per channel
std::vector< float > m_chMaxAdc
sum of RPD data in signal range after baseline and pileup subtraction, with output calibration factor...
void calculateSumAdc(unsigned int channel)
Calculate sum ADC and if there is pileup, calculate fractional pileup.
float calculateBaselineSamplesMSE(unsigned int channel, std::function< float(unsigned int)> const &fit) const
Calculate the mean squared error of the fit function in the baseline samples.
std::vector< float > m_ch2ndOrderStretchedExpPileupMSE
mean squared error of pileup exponential fit in baseline samples (if pileup was detected and fit did ...
const std::vector< float > & getChPileupExpFitParamErrs(unsigned int channel) const
Get parameter errors for pileup exponential fit (if pileup was detected and fit did not fail).
std::vector< bool > m_chPileupFuncType
parameter errors for pileup stretched exponential fit (if pileup was detected and fit did not fail); ...
unsigned int m_goodPulseSampleStart
If there is a good pulse and post-pulse and size of post-pulse as a fraction of good pulse is less th...
unsigned int m_goodPulseSampleStop
Pulses before this sample are considered pre-pulses.
float getChPileupExpFitMSE(unsigned int channel) const
Get mean squared error of pileup exponential fit in baseline samples (if pileup was detected and fit ...
unsigned int goodPulseSampleStart
void setSideStatusBits()
Set side status bits according to channel status bits.
float pulse2ndDerivThresh
bool doPileupStretchedExpFit(unsigned int channel, std::vector< std::pair< unsigned int, float >> const &pileupFitPoints)
Perform a stretched exponential fit in baseline-subtracted baseline samples and set relevant status b...
unsigned int m_nChannelsLoaded
bool checkOverflow(unsigned int channel)
Check for overflow and set relevant status bit.
unsigned int endSignalSample
@ PileupStretchedExpFitFailBit
unsigned int m_endSignalSample
Number of baseline samples; the sample equal to this number is the start of signal region.
const std::vector< float > & getChPileupExpFitParams(unsigned int channel) const
Get parameters for pileup exponential fit (if pileup was detected and fit did not fail): exp( [0] + [...
std::vector< std::vector< float > > m_chPileupExpFitParamErrs
parameters for pileup stretched exponential fit (if pileup was detected and fit did not fail): exp( [...
float m_postPulseFracThresh
Second differences less than or equal to this number indicate a pulse.
float pileupBaselineStdDevThresh
std::vector< std::function< float(unsigned int)> > m_ch2ndOrderStretchedExpPileupFuncs
pileup exponential fit function (if pileup was detected and fit did not fail); per channel
std::shared_ptr< MessageFunction > MessageFunctionPtr
float m_pulse2ndDerivThresh
Samples before (not including) this sample are the signal region; nSamples goes to end of window.
std::vector< std::bitset< 32 > > m_chStatus
mean squared error of pileup stretched exponential fit in baseline samples (if pileup was detected an...
unsigned int getSideStatus() const
Get status word for side.
bool doBaselinePileupSubtraction(unsigned int channel)
Determine if there is pileup, subtract baseline and pileup, and set relevant status bits.
float m_pileupBaselineStdDevThresh
Baseline sums less than this number indicate there is not pileup.
unsigned int nBaselineSamples
std::vector< float > m_chMaxSample
RPD data with baseline and pileup subtracted; index channel then sample.
unsigned int m_nominalBaseline
Pulses after this sample are considered post-pulses.
std::vector< std::vector< float > > m_chFadcData
multiplicative calibration factors to apply to output, e.g., max and sum ADC; per channel
static unsigned constexpr int s_minPileupFitPoints
status bits for side
unsigned int m_nBaselineSamples
ZDCMsg::MessageFunctionPtr m_msgFunc_p
float getChPileupFrac(unsigned int channel) const
Get OOT pileup sum as a fraction of non-pileup sum in entire window (0 if no OOT pileup,...
Define macros for attributes used to control the static checker.
bool checkPulses(unsigned int channel)
Calculate 2nd difference, identify pulses, and set relevant status bits.
float getChBaseline(unsigned int channel) const
Get baseline used in baseline subtraction.
bool doPileupExpFit(unsigned int channel, std::vector< std::pair< unsigned int, float >> const &pileupFitPoints)
Perform an exponential fit in baseline-subtracted baseline samples and set relevant status bits.
std::vector< std::function< float(unsigned int)> > m_chExpPileupFuncs
true when stretched exponential is used, false if exponential is used for pileup subtraction (if pile...
float pileupBaselineSumThresh
@ PileupBadStretchedExpSubtrBit