![]() |
Project
|
Raw data fitting: standard TMinuit fit. More...
#include <CaloRawFitterStandard.h>
Inherits o2::emcal::CaloRawFitter.
Public Member Functions | |
CaloRawFitterStandard () | |
Constructor. | |
~CaloRawFitterStandard () final=default | |
Destructor. | |
CaloFitResults | evaluate (const gsl::span< const Bunch > bunchvector) final |
Evaluation Amplitude and TOF. | |
std::tuple< float, float, float > | fitRaw (int firstTimeBin, int lastTimeBin) const |
Fits the raw signal time distribution using TMinuit. | |
![]() | |
CaloRawFitter (const char *name, const char *nameshort) | |
Constructor. | |
virtual | ~CaloRawFitter ()=default |
Destructor. | |
std::tuple< int, int, float, short, short, float, int, int > | preFitEvaluateSamples (const gsl::span< const Bunch > bunchvector, int adcThreshold) |
Method to do the selection of what should possibly be fitted. | |
void | setTimeConstraint (int min, int max) |
The require time range if the maximum ADC value is between min and max (timebin) | |
void | setIsZeroSuppressed (bool iszs=true) |
void | setAmpCut (float cut) |
void | setNsamplePed (int i) |
void | setL1Phase (double phase) |
bool | getIsZeroSuppressed () const |
float | getAmpCut () const |
int | getNsamplePed () const |
double | getReversed (const int i) const |
const std::string_view | getAlgoName () const |
const std::string_view | getAlgoAbbr () const |
FitAlgorithm | getAlgo () const |
Get Type of the fit algorithm. | |
std::tuple< short, int > | getMaxAmplitudeBunch (const Bunch &bunchx) const |
Get the maximum amplitude and its index of a bunch array. | |
unsigned short | getMaxAmplitudeBunch (const gsl::span< unsigned short > data) const |
Get maximum of array. | |
bool | isMaxADCBunchEdge (const Bunch &bunch) const |
Check if the max. ADC value is at the edge of a bunch. | |
bool | isInTimeRange (int indexMaxADC, int maxtime, int mintime) const |
Check if the index of the max ADC vaue is within accepted time range. | |
std::tuple< float, std::array< double, constants::EMCAL_MAXTIMEBINS > > | reverseAndSubtractPed (const Bunch &bunch) const |
Time sample comes in reversed order, revers them back Subtract the baseline based on content of altrocfg1 and altrocfg2. | |
std::tuple< short, short, short > | selectMaximumBunch (const gsl::span< const Bunch > &bunchvector) |
We select the bunch with the highest amplitude unless any time constraints is set. | |
std::tuple< int, int > | findPeakRegion (const gsl::span< double > adcValues, short indexMaxADC, int threshold) const |
Find region constrainded by its closest minima around the main peak. | |
double | evaluatePedestal (const gsl::span< const uint16_t > data, std::optional< int > length) const |
Calculate the pedestal from the ADC values in a bunch. | |
double | calculateChi2 (double amp, double time, int first, int last, double adcErr=1, double tau=2.35) const |
Calculates the chi2 of the fit. | |
int | getMinTimeIndex () const |
int | getMaxTimeIndex () const |
Static Public Member Functions | |
static double | rawResponseFunction (double *x, double *par) |
Approximate response function of the EMCal electronics. | |
![]() | |
static std::string | createErrorMessage (RawFitterError_t fiterror) |
Create error message for a given error type. | |
static int | getErrorNumber (RawFitterError_t fiterror) |
Convert error type to numeric representation. | |
static RawFitterError_t | intToErrorType (unsigned int fiterror) |
Convert numeric representation of error type to RawFitterError_t. | |
static constexpr int | getNumberOfErrorTypes () noexcept |
Get the number of raw fit error types supported. | |
static const char * | getErrorTypeName (RawFitterError_t fiterror) |
Get the name connected to the fit error type. | |
static const char * | getErrorTypeName (unsigned int fiterror) |
Get the name connected to the fit error type. | |
static const char * | getErrorTypeTitle (RawFitterError_t fiterror) |
Get the title connected to the fit error type. | |
static const char * | getErrorTypeTitle (unsigned int fiterror) |
Get the title connected to the fit error type. | |
static const char * | getErrorTypeDescription (RawFitterError_t fiterror) |
Get the description connected to the fit error type. | |
static const char * | getErrorTypeDescription (unsigned int fiterror) |
Get the description connected to the fit error type. | |
Additional Inherited Members | |
![]() | |
enum class | RawFitterError_t { SAMPLE_UNINITIALIZED , FIT_ERROR , CHI2_ERROR , BUNCH_NOT_OK , LOW_SIGNAL } |
Error codes for failures in raw fitter procedure. More... | |
![]() | |
ClassDefNV (CaloRawFitter, 1) | |
![]() | |
std::array< double, constants::EMCAL_MAXTIMEBINS > | mReversed |
Reversed sequence of samples (pedestalsubtracted) | |
int | mMinTimeIndex |
The timebin of the max signal value must be between fMinTimeIndex and fMaxTimeIndex. | |
int | mMaxTimeIndex |
The timebin of the max signal value must be between fMinTimeIndex and fMaxTimeIndex. | |
float | mAmpCut |
Max ADC - pedestal must be higher than this befor attemting to extract the amplitude. | |
int | mNsamplePed |
Number of samples used for pedestal calculation (first in bunch) | |
bool | mIsZerosupressed |
Wether or not the data is zeros supressed, by default its assumed that the baseline is also subtracted if set to true. | |
std::string | mName |
Name of the algorithm. | |
std::string | mNameShort |
Abbrevation for the name. | |
FitAlgorithm | mAlgo |
Which algorithm to use. | |
double | mL1Phase |
Phase of the ADC sampling clock relative to the LHC clock. | |
double | mAmp |
The amplitude in entities of ADC counts. | |
Raw data fitting: standard TMinuit fit.
Extraction of amplitude and peak position from CALO raw data using least square fit for the Moment assuming identical and independent errors (equivalent with chi square)
Definition at line 43 of file CaloRawFitterStandard.h.
CaloRawFitterStandard::CaloRawFitterStandard | ( | ) |
Constructor.
Definition at line 31 of file CaloRawFitterStandard.cxx.
|
finaldefault |
Destructor.
|
finalvirtual |
Evaluation Amplitude and TOF.
bunchvector | Calo bunches for the tower and event |
RawFitterError_t | in case the fit failed (including all possible errors from upstream) |
Implements o2::emcal::CaloRawFitter.
Definition at line 53 of file CaloRawFitterStandard.cxx.
std::tuple< float, float, float > CaloRawFitterStandard::fitRaw | ( | int | firstTimeBin, |
int | lastTimeBin | ||
) | const |
Fits the raw signal time distribution using TMinuit.
firstTimeBin | First timebin of the ALTRO bunch |
lastTimeBin | Last timebin of the ALTRO bunch |
RawFitter_t::FIT_ERROR | in case the fit failed (insufficient number of samples or fit error from MINUIT) |
Definition at line 104 of file CaloRawFitterStandard.cxx.
|
static |
Approximate response function of the EMCal electronics.
x | bin |
par | function parameters |
Definition at line 36 of file CaloRawFitterStandard.cxx.