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

Raw data fitting: Gamma-2 function. More...

#include <CaloRawFitterGamma2.h>

Inherits o2::emcal::CaloRawFitter.

Public Member Functions

 CaloRawFitterGamma2 ()
 Constructor.
 
 ~CaloRawFitterGamma2 () final=default
 Destructor.
 
void setNiterationsMax (int n)
 
int getNiterations ()
 
int getNiterationsMax ()
 
CaloFitResults evaluate (const gsl::span< const Bunch > bunchvector) final
 Evaluation Amplitude and TOF.
 
- 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
 

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...
 
- 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.
 
- 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: Gamma-2 function.

Author
Martin Poghosyan Marti.nosp@m.n.Po.nosp@m.ghosy.nosp@m.an@c.nosp@m.ern.c.nosp@m.h, ORNL.
Since
May 13th, 2020

Evaluation of amplitude and peak position using gamma-2 function. Derivatives calculated analytically. Newton's method used for solving the set of non-linear equations. Ported from class AliCaloRawAnalyzerGamma2 from AliRoot

Definition at line 41 of file CaloRawFitterGamma2.h.

Constructor & Destructor Documentation

◆ CaloRawFitterGamma2()

CaloRawFitterGamma2::CaloRawFitterGamma2 ( )

Constructor.

Definition at line 30 of file CaloRawFitterGamma2.cxx.

◆ ~CaloRawFitterGamma2()

o2::emcal::CaloRawFitterGamma2::~CaloRawFitterGamma2 ( )
finaldefault

Destructor.

Member Function Documentation

◆ evaluate()

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

Evaluation Amplitude and TOF.

Parameters
bunchvectorALTRO bunches for the current channel
altrocfg1ALTRO config register 1 from RCU trailer
altrocfg2ALTRO config register 2 from RCU trailer
Exceptions
RawFitterError_t::FIT_ERRORin case the peak fit failed
Returns
Container with the fit results (amp, time, chi2, ...)

Implements o2::emcal::CaloRawFitter.

Definition at line 35 of file CaloRawFitterGamma2.cxx.

◆ getNiterations()

int o2::emcal::CaloRawFitterGamma2::getNiterations ( )
inline

Definition at line 52 of file CaloRawFitterGamma2.h.

◆ getNiterationsMax()

int o2::emcal::CaloRawFitterGamma2::getNiterationsMax ( )
inline

Definition at line 53 of file CaloRawFitterGamma2.h.

◆ setNiterationsMax()

void o2::emcal::CaloRawFitterGamma2::setNiterationsMax ( int  n)
inline

Definition at line 51 of file CaloRawFitterGamma2.h.


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