Project
Loading...
Searching...
No Matches
o2::emcal::CaloRawFitterStandard Class Referencefinal

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.
 
- Public Member Functions inherited from o2::emcal::CaloRawFitter
 CaloRawFitter (const char *name, const char *nameshort)
 Constructor.
 
virtual ~CaloRawFitter ()=default
 Destructor.
 
std::tuple< int, int, float, short, short, float, int, intpreFitEvaluateSamples (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, intgetMaxAmplitudeBunch (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, shortselectMaximumBunch (const gsl::span< const Bunch > &bunchvector)
 We select the bunch with the highest amplitude unless any time constraints is set.
 
std::tuple< int, intfindPeakRegion (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 Public Member Functions inherited from o2::emcal::CaloRawFitter
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 chargetErrorTypeName (RawFitterError_t fiterror)
 Get the name connected to the fit error type.
 
static const chargetErrorTypeName (unsigned int fiterror)
 Get the name connected to the fit error type.
 
static const chargetErrorTypeTitle (RawFitterError_t fiterror)
 Get the title connected to the fit error type.
 
static const chargetErrorTypeTitle (unsigned int fiterror)
 Get the title connected to the fit error type.
 
static const chargetErrorTypeDescription (RawFitterError_t fiterror)
 Get the description connected to the fit error type.
 
static const chargetErrorTypeDescription (unsigned int fiterror)
 Get the description connected to the fit error type.
 

Additional Inherited Members

- Public Types inherited from o2::emcal::CaloRawFitter
enum class  RawFitterError_t {
  SAMPLE_UNINITIALIZED , FIT_ERROR , CHI2_ERROR , BUNCH_NOT_OK ,
  LOW_SIGNAL
}
 Error codes for failures in raw fitter procedure. More...
 
- Protected Member Functions inherited from o2::emcal::CaloRawFitter
 ClassDefNV (CaloRawFitter, 1)
 
- Protected Attributes inherited from o2::emcal::CaloRawFitter
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.
 

Detailed Description

Raw data fitting: standard TMinuit fit.

Author
Hadi Hassan hadi..nosp@m.hass.nosp@m.an@ce.nosp@m.rn.c.nosp@m.h, Oak Ridge National Laboratory
Since
November 4th, 2019

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.

Constructor & Destructor Documentation

◆ CaloRawFitterStandard()

CaloRawFitterStandard::CaloRawFitterStandard ( )

Constructor.

Definition at line 31 of file CaloRawFitterStandard.cxx.

◆ ~CaloRawFitterStandard()

o2::emcal::CaloRawFitterStandard::~CaloRawFitterStandard ( )
finaldefault

Destructor.

Member Function Documentation

◆ evaluate()

CaloFitResults CaloRawFitterStandard::evaluate ( const gsl::span< const Bunch bunchvector)
finalvirtual

Evaluation Amplitude and TOF.

Parameters
bunchvectorCalo bunches for the tower and event
Returns
Container with the fit results (amp, time, chi2, ...)
Exceptions
RawFitterError_tin case the fit failed (including all possible errors from upstream)

Implements o2::emcal::CaloRawFitter.

Definition at line 53 of file CaloRawFitterStandard.cxx.

◆ fitRaw()

std::tuple< float, float, float > CaloRawFitterStandard::fitRaw ( int  firstTimeBin,
int  lastTimeBin 
) const

Fits the raw signal time distribution using TMinuit.

Parameters
firstTimeBinFirst timebin of the ALTRO bunch
lastTimeBinLast timebin of the ALTRO bunch
Returns
the fit parameters: amplitude, time, chi2
Exceptions
RawFitter_t::FIT_ERRORin case the fit failed (insufficient number of samples or fit error from MINUIT)

Definition at line 104 of file CaloRawFitterStandard.cxx.

◆ rawResponseFunction()

double CaloRawFitterStandard::rawResponseFunction ( double *  x,
double *  par 
)
static

Approximate response function of the EMCal electronics.

Parameters
xbin
parfunction parameters
Returns
double with signal for a given time bin

Definition at line 36 of file CaloRawFitterStandard.cxx.


The documentation for this class was generated from the following files: