|
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef ZDCANALYSIS_RPDDATAANALYZER_H
6 #define ZDCANALYSIS_RPDDATAANALYZER_H
101 bool doPileupExpFit(
unsigned int channel, std::vector<std::pair<unsigned int, float>>
const& pileupFitPoints);
unsigned int m_nChannelsLoaded
float postPulseFracThresh
unsigned constexpr int nChannels
unsigned int goodPulseSampleStart
unsigned int m_nBaselineSamples
std::array< std::vector< float >, s_nChannels > m_chCorrectedFadcData
raw RPD data; index channel then sample
unsigned int getChMaxSample(unsigned int channel) const
Get sample of max of RPD data in signal range after pileup subtraction.
unsigned int goodPulseSampleStop
RPDDataAnalyzer(RPDDataAnalyzer const &)=delete
std::array< std::function< float(unsigned int)>, s_nChannels > m_ch2ndOrderStretchedExpPileupFuncs
pileup exponential fit function (if pileup was detected and fit did not fail); per channel
float m_nominalBaseline
Pulses after this sample are considered post-pulses.
unsigned int m_goodPulseSampleStop
Pulses before this sample are considered pre-pulses.
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...
virtual ~RPDDataAnalyzer()=default
@ PileupBadStretchedExpSubtrBit
bool doBaselinePileupSubtraction(unsigned int channel)
Determine if there is pileup, subtract baseline and pileup, and set relevant status bits.
unsigned int nBaselineSamples
void analyzeData()
Analyze RPD data.
std::array< std::vector< float >, s_nChannels > m_chPileupExpFitParamErrs
parameters for pileup stretched exponential fit (if pileup was detected and fit did not fail): exp( [...
unsigned int endSignalSample
float pileupBaselineStdDevThresh
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...
float getChBaseline(unsigned int channel) const
Get baseline used in baseline subtraction.
std::array< float, s_nChannels > m_chMaxAdcCalib
max of RPD data in signal range after baseline and pileup subtraction; per channel
float getChPileupExpFitMSE(unsigned int channel) const
Get mean squared error of pileup exponential fit in baseline samples (if pileup was detected and fit ...
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.
bool checkPulses(unsigned int channel)
Calculate 2nd difference, identify pulses, and set relevant status bits.
unsigned int m_nNegativesAllowed
Baseline standard deviations less than this number indicate there is not pileup.
std::array< std::vector< uint16_t >, s_nChannels > m_chFADCData
multiplicative calibration factors to apply to output, e.g., max and sum ADC; per channel
ATLAS_NO_CHECK_FILE_THREAD_SAFETY
void calculateMaxSampleMaxAdc(unsigned int channel)
Calculate max ADC and max sample.
std::array< std::vector< float >, s_nChannels > m_chPileupStretchedExpFitParams
parameters for pileup exponential fit (if pileup was detected and fit did not fail): exp( [0] + [1]*s...
float getChPileupStretchedExpFitMSE(unsigned int channel) const
Get mean squared error of pileup stretched exponential fit in baseline samples (if pileup was detecte...
float getChSumAdc(unsigned int channel) const
Get sum of RPD data in signal range after baseline and pileup subtraction.
unsigned int m_AdcOverflow
Maximum number of negative ADC values after baseline and pileup subtraction allowed in signal range.
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...
RPDDataAnalyzer(ZDCMsg::MessageFunctionPtr messageFunc_p, std::string tag, RPDConfig const &config, std::vector< float > const &calibFactors)
std::array< std::vector< float >, s_nChannels > m_chPileupExpFitParams
baseline used in baseline subtraction; per channel
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
ZDCMsg::MessageFunctionPtr m_msgFunc_p
void reset()
Reset all member variables to default values.
std::bitset< N_STATUS_BITS > m_sideStatus
status bits per channel
static unsigned constexpr int s_minPileupFitPoints
status bits for side
float m_pileupBaselineSumThresh
The global nominal baseline; used when pileup is detected.
RPDDataAnalyzer(RPDDataAnalyzer &&)=delete
float pulse2ndDerivThresh
std::array< std::function< float(unsigned int)>, s_nChannels > m_chExpPileupFuncs
enum indicating type of pileup fit function; per channel
float m_postPulseFracThresh
Second differences less than or equal to this number indicate a pulse.
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::array< float, s_nChannels > m_ch2ndOrderStretchedExpPileupMSE
mean squared error of pileup exponential fit in baseline samples (if pileup was detected and fit did ...
std::array< float, s_nChannels > m_outputCalibFactors
ADC values greater than or equal to this number are considered overflow.
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,...
unsigned int getSideStatus() const
Get status word for side.
std::array< float, s_nChannels > 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.
unsigned int getChStatus(unsigned int channel) const
Get status word for channel.
void setSideStatusBits()
Set side status bits according to channel status bits.
RPDDataAnalyzer & operator=(RPDDataAnalyzer &&)=delete
std::array< float, s_nChannels > m_chSumAdcCalib
sum of RPD data in signal range after baseline and pileup subtraction; per channel
std::shared_ptr< MessageFunction > MessageFunctionPtr
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] + [...
void loadChannelData(unsigned int channel, const std::vector< uint16_t > &FadcData)
Load a single channel's FADC data into member variable.
bool checkOverflow(unsigned int channel)
Check for overflow and set relevant status bit.
static unsigned constexpr int s_nChannels
unsigned int m_endSignalSample
Number of baseline samples; the sample equal to this number is the start of signal region.
std::array< float, s_nChannels > m_chExpPileupMSE
pileup stretched exponential fit function (if pileup was detected and fit did not fail); per channel
@ InsufficientPileupFitPointsBit
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...
void calculateSumAdc(unsigned int channel)
Calculate sum ADC and if there is pileup, calculate fractional pileup.
RPDDataAnalyzer & operator=(RPDDataAnalyzer const &)=delete
std::array< PileupFitFuncType, s_nChannels > m_chPileupFuncType
parameter errors for pileup stretched exponential fit (if pileup was detected and fit did not fail); ...
float getChSumAdcCalib(unsigned int channel) const
Get sum of RPD data in signal range after baseline and pileup subtraction, with output calibration fa...
@ PileupStretchedExpFitFailBit
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::array< float, s_nChannels > m_chSumAdc
sample of max of RPD data in signal range after pileup subtraction; per channel
std::array< std::bitset< N_STATUS_BITS >, s_nChannels > m_chStatus
mean squared error of pileup stretched exponential fit in baseline samples (if pileup was detected an...
@ PileupStretchedExpPulseLikeBit
float m_pileupBaselineStdDevThresh
Baseline sums less than this number indicate there is not pileup.
@ PileupStretchedExpGrowthBit
std::array< unsigned int, s_nChannels > m_chMaxSample
RPD data with baseline and pileup subtracted; index channel then sample.
std::array< std::vector< float >, s_nChannels > m_chPileupStretchedExpFitParamErrs
parameter errors for pileup exponential fit (if pileup was detected and fit did not fail); per channe...
std::array< float, s_nChannels > m_chBaseline
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.
float pileupBaselineSumThresh
float m_pulse2ndDerivThresh
Samples before (not including) this sample are the signal region; nSamples goes to end of window.
std::array< float, s_nChannels > m_chMaxAdc
sum of RPD data in signal range after baseline and pileup subtraction, with output calibration factor...
float getChMaxAdc(unsigned int channel) const
Get max of RPD data in signal range after baseline and pileup subtraction.
@ SecondOrderStretchedExp