AliRoot Core  3dc7879 (3dc7879)
AliCaloFastAltroFitv0 Class Reference

Procedure of fast altro fitting. More...

#include <AliCaloFastAltroFitv0.h>

Inheritance diagram for AliCaloFastAltroFitv0:

Public Member Functions

 AliCaloFastAltroFitv0 ()
 Default constructor. More...
 
 AliCaloFastAltroFitv0 (const char *name, const char *title, const Double_t sig=1.3, const Double_t tau=2.35, const Double_t n=2.)
 Constructor. More...
 
virtual ~AliCaloFastAltroFitv0 ()
 Destructor. More...
 
virtual void FastFit (Int_t *t, Int_t *y, Int_t nPoints, Double_t sig, Double_t tau, Double_t n, Double_t ped, Double_t tMax)
 Fast fit. More...
 
void FastFit (TH1F *h, Double_t sig, Double_t tau, Double_t n, Double_t ped, Double_t tMax)
 
void Reset ()
 Reset variables. More...
 
void SetSig (const Double_t sig)
 
void SetTau (const Double_t tau)
 
void SetN (const Double_t n)
 
void SetParameters (const Double_t sig, const Double_t tau, const Double_t n)
 
Double_t GetSig () const
 
Double_t GetTau () const
 
Double_t GetN () const
 
Double_t GetPed () const
 
Double_t GetEnergy () const
 
Double_t GetAmp () const
 
Double_t GetAmpErr () const
 
Double_t GetTime () const
 
Double_t GetT0 () const
 
Double_t GetT0Err () const
 
Double_t GetChi2 () const
 
Int_t GetNDF () const
 
Int_t GetNfit () const
 
Int_t GetNoFit () const
 
void GetFitResult (Double_t &amp, Double_t &eamp, Double_t &t0, Double_t &et0, Double_t &chi2, Int_t &ndf) const
 
void GetFittedPoints (Int_t &nfit, Double_t *ar[2]) const
 
TCanvas * DrawFastFunction ()
 

Static Public Member Functions

static Double_t StdResponseFunction (const Double_t *x, const Double_t *par)
 
static void CutRightPart (Int_t *t, Int_t *y, Int_t nPoints, Double_t tMax, Int_t &ii)
 Cut right part of altro sample : static function. More...
 
static void DeductPedestal (Int_t *t, Int_t *y, Int_t nPointsIn, Double_t ped, Double_t tau, Double_t *tn, Double_t *yn, Int_t &nPointsOut)
 
static void FastFit (const Double_t *t, const Double_t *y, const Int_t nPoints, const Double_t sig, const Double_t tau, Double_t &amp, Double_t &eamp, Double_t &t0, Double_t &et0, Double_t &chi2)
 
static Bool_t QuadraticRoots (const Double_t a, const Double_t b, const Double_t c, Double_t &x1, Double_t &x2)
 Resolve quadratic equations a*x**2 + b*x + c. More...
 
static void Amplitude (const Double_t *t, const Double_t *y, const Int_t nPoints, const Double_t sig, const Double_t tau, Double_t t0, Double_t &amp, Double_t &chi2)
 
static void CalculateParsErrors (const Double_t *t, const Double_t *y, const Int_t nPoints, const Double_t sig, const Double_t tau, Double_t &amp, Double_t &t0, Double_t &eamp, Double_t &et0)
 

Protected Attributes

Double_t fSig
 Error in amplitude - used in chi2 calculation. More...
 
Double_t fTau
 First fixed parameter od fitting function (should be - filter time response. More...
 
Double_t fN
 Second fixed parameter od fitting function (should be positive) More...
 
Double_t fPed
 Pedestal. More...
 
Double_t fAmp
 Amplitude. More...
 
Double_t fAmpErr
 Amplitude error. More...
 
Double_t fT0
 Time. More...
 
Double_t fT0Err
 Time error. More...
 
Double_t fChi2
 Chi square. More...
 
Int_t fNDF
 Number degree of freedom. More...
 
Int_t fNoFit
 No solution for square equation. More...
 
Int_t fNfit
 ! Number points for fit More...
 
Double_t * fTfit
 ! Points for fit after selection - time bins More...
 
Double_t * fAmpfit
 ! Points for fit after selection - amplitudes More...
 
TF1 * fStdFun
 ! Function for drawing More...
 

Private Member Functions

 AliCaloFastAltroFitv0 (const AliCaloFastAltroFitv0 &obj)
 Copy Constructor. More...
 
AliCaloFastAltroFitv0operator= (const AliCaloFastAltroFitv0 &obj)
 Assignment operator. More...
 

Detailed Description

Procedure of fast altro fitting.

Implementation of fit procedure from ALICE-INT-2008-026: "Time and amplitude reconstruction from sampling measurements of the PHOS signal profile" M.Yu.Bogolyubsky and ..

Fit by function en*x*x*exp(-2.*x): x = (t-t0)/tau. The main goal is fast estimation of amplitude and t0.///

Author
Aleksei Pavlinov, IHEP & WSU

Definition at line 30 of file AliCaloFastAltroFitv0.h.

Constructor & Destructor Documentation

AliCaloFastAltroFitv0::AliCaloFastAltroFitv0 ( )

Default constructor.

Definition at line 36 of file AliCaloFastAltroFitv0.cxx.

AliCaloFastAltroFitv0::AliCaloFastAltroFitv0 ( const char *  name,
const char *  title,
const Double_t  sig = 1.3,
const Double_t  tau = 2.35,
const Double_t  n = 2. 
)

Constructor.

Definition at line 46 of file AliCaloFastAltroFitv0.cxx.

AliCaloFastAltroFitv0::~AliCaloFastAltroFitv0 ( )
virtual

Destructor.

Definition at line 69 of file AliCaloFastAltroFitv0.cxx.

AliCaloFastAltroFitv0::AliCaloFastAltroFitv0 ( const AliCaloFastAltroFitv0 obj)
private

Copy Constructor.

Definition at line 59 of file AliCaloFastAltroFitv0.cxx.

Member Function Documentation

void AliCaloFastAltroFitv0::Amplitude ( const Double_t *  t,
const Double_t *  y,
const Int_t  nPoints,
const Double_t  sig,
const Double_t  tau,
Double_t  t0,
Double_t &  amp,
Double_t &  chi2 
)
static

Get amplitude Calculate parameters error too. sig is independent from points

Definition at line 436 of file AliCaloFastAltroFitv0.cxx.

Referenced by FastFit(), and GetNoFit().

void AliCaloFastAltroFitv0::CalculateParsErrors ( const Double_t *  t,
const Double_t *  y,
const Int_t  nPoints,
const Double_t  sig,
const Double_t  tau,
Double_t &  amp,
Double_t &  t0,
Double_t &  eamp,
Double_t &  et0 
)
static

Evaluate errors Remember that fmax = exp(-n); fmax_nk = (n/k)**n*exp(-n) => n=k=2 => exp(-n) = exp(-2.)

Definition at line 476 of file AliCaloFastAltroFitv0.cxx.

Referenced by FastFit(), and GetNoFit().

void AliCaloFastAltroFitv0::CutRightPart ( Int_t *  t,
Int_t *  y,
Int_t  nPoints,
Double_t  tMax,
Int_t &  ii 
)
static

Cut right part of altro sample : static function.

Definition at line 220 of file AliCaloFastAltroFitv0.cxx.

Referenced by FastFit(), and GetNoFit().

void AliCaloFastAltroFitv0::DeductPedestal ( Int_t *  t,
Int_t *  y,
Int_t  nPoints,
Double_t  tau,
Double_t  ped,
Double_t *  tn,
Double_t *  yn,
Int_t &  nPointsOut 
)
static

Pedestal deduction if ped is positive : static function Discard part od samle if it is not compact.

Definition at line 241 of file AliCaloFastAltroFitv0.cxx.

Referenced by FastFit(), and GetNoFit().

TCanvas * AliCaloFastAltroFitv0::DrawFastFunction ( )

Drawing QA of fitting

Definition at line 508 of file AliCaloFastAltroFitv0.cxx.

Referenced by GetNoFit().

void AliCaloFastAltroFitv0::FastFit ( Int_t *  t,
Int_t *  y,
Int_t  nPoints,
Double_t  sig,
Double_t  tau,
Double_t  n,
Double_t  ped,
Double_t  tMax 
)
virtual

Fast fit.

Definition at line 86 of file AliCaloFastAltroFitv0.cxx.

Referenced by AliCaloRawAnalyzerFastFit::Evaluate(), FastFit(), and GetNoFit().

void AliCaloFastAltroFitv0::FastFit ( TH1F *  h,
Double_t  sig,
Double_t  tau,
Double_t  n,
Double_t  ped,
Double_t  tMax 
)

Service method for convinience only h - histogram with altro response, could have empty bin and center of bin could be different from bin number

Definition at line 137 of file AliCaloFastAltroFitv0.cxx.

void AliCaloFastAltroFitv0::FastFit ( const Double_t *  t,
const Double_t *  y,
const Int_t  nPoints,
const Double_t  sig,
const Double_t  tau,
Double_t &  amp,
Double_t &  eamp,
Double_t &  t0,
Double_t &  et0,
Double_t &  chi2 
)
static

Fast fit main algorithm. Static function

It is case of n=k=2 : fnn = x*x*exp(2 - 2*x)

Input:

Parameters
t- array of time bins
y- array of amplitudes after pedestal subtractions;
nPoints- number of points
sig- error of amplitude measurement (one value for all channels)
tau- filter time response (in timebin units) Output:
amp- amplitude at t0;
eamp- error of amplitude;
t0- time of max amplitude;
et0- error of t0;
chi2- chi2

Definition at line 321 of file AliCaloFastAltroFitv0.cxx.

Double_t AliCaloFastAltroFitv0::GetAmp ( ) const
inline

Definition at line 60 of file AliCaloFastAltroFitv0.h.

Double_t AliCaloFastAltroFitv0::GetAmpErr ( ) const
inline

Definition at line 61 of file AliCaloFastAltroFitv0.h.

Double_t AliCaloFastAltroFitv0::GetChi2 ( void  ) const
inline

Definition at line 65 of file AliCaloFastAltroFitv0.h.

Referenced by DrawFastFunction().

Double_t AliCaloFastAltroFitv0::GetEnergy ( void  ) const
inline

Definition at line 59 of file AliCaloFastAltroFitv0.h.

Referenced by DrawFastFunction(), and GetAmp().

void AliCaloFastAltroFitv0::GetFitResult ( Double_t &  amp,
Double_t &  eamp,
Double_t &  t0,
Double_t &  et0,
Double_t &  chi2,
Int_t &  ndf 
) const
Returns
results of fitting procedure

Definition at line 192 of file AliCaloFastAltroFitv0.cxx.

Referenced by GetNoFit().

void AliCaloFastAltroFitv0::GetFittedPoints ( Int_t &  nfit,
Double_t *  ar[2] 
) const
Returns
fit points

Definition at line 206 of file AliCaloFastAltroFitv0.cxx.

Referenced by GetNoFit().

Double_t AliCaloFastAltroFitv0::GetN ( ) const
inline

Definition at line 56 of file AliCaloFastAltroFitv0.h.

Referenced by DrawFastFunction().

Int_t AliCaloFastAltroFitv0::GetNDF ( void  ) const
inline

Definition at line 66 of file AliCaloFastAltroFitv0.h.

Referenced by DrawFastFunction().

Int_t AliCaloFastAltroFitv0::GetNfit ( ) const
inline

Definition at line 67 of file AliCaloFastAltroFitv0.h.

Int_t AliCaloFastAltroFitv0::GetNoFit ( ) const
inline

Definition at line 68 of file AliCaloFastAltroFitv0.h.

Double_t AliCaloFastAltroFitv0::GetPed ( ) const
inline

Definition at line 57 of file AliCaloFastAltroFitv0.h.

Double_t AliCaloFastAltroFitv0::GetSig ( ) const
inline

Definition at line 54 of file AliCaloFastAltroFitv0.h.

Double_t AliCaloFastAltroFitv0::GetT0 ( ) const
inline

Definition at line 63 of file AliCaloFastAltroFitv0.h.

Double_t AliCaloFastAltroFitv0::GetT0Err ( ) const
inline

Definition at line 64 of file AliCaloFastAltroFitv0.h.

Double_t AliCaloFastAltroFitv0::GetTau ( ) const
inline

Definition at line 55 of file AliCaloFastAltroFitv0.h.

Referenced by DrawFastFunction().

Double_t AliCaloFastAltroFitv0::GetTime ( void  ) const
inline

Definition at line 62 of file AliCaloFastAltroFitv0.h.

Referenced by DrawFastFunction(), and GetT0().

AliCaloFastAltroFitv0 & AliCaloFastAltroFitv0::operator= ( const AliCaloFastAltroFitv0 obj)
private

Assignment operator.

Definition at line 78 of file AliCaloFastAltroFitv0.cxx.

Bool_t AliCaloFastAltroFitv0::QuadraticRoots ( const Double_t  a,
const Double_t  b,
const Double_t  c,
Double_t &  x1,
Double_t &  x2 
)
static

Resolve quadratic equations a*x**2 + b*x + c.

Definition at line 392 of file AliCaloFastAltroFitv0.cxx.

Referenced by FastFit(), and GetNoFit().

void AliCaloFastAltroFitv0::Reset ( void  )

Reset variables.

Definition at line 177 of file AliCaloFastAltroFitv0.cxx.

Referenced by FastFit().

void AliCaloFastAltroFitv0::SetN ( const Double_t  n)
inline

Definition at line 50 of file AliCaloFastAltroFitv0.h.

void AliCaloFastAltroFitv0::SetParameters ( const Double_t  sig,
const Double_t  tau,
const Double_t  n 
)
inline

Definition at line 51 of file AliCaloFastAltroFitv0.h.

void AliCaloFastAltroFitv0::SetSig ( const Double_t  sig)
inline

Definition at line 48 of file AliCaloFastAltroFitv0.h.

void AliCaloFastAltroFitv0::SetTau ( const Double_t  tau)
inline

Definition at line 49 of file AliCaloFastAltroFitv0.h.

Double_t AliCaloFastAltroFitv0::StdResponseFunction ( const Double_t *  x,
const Double_t *  par 
)
static

Static Standard Response Function : look to Double_t AliEMCALRawUtils::RawResponseFunction(Double_t *x, Double_t *par) Used for drawing only.

Shape of the electronics raw reponse: It is a semi-gaussian, 2nd order Gamma function (n=2) of the general form

t' = (t - t0 + tau) / tau F = A * t**N * exp( N * ( 1 - t) ) for t >= 0 F = 0 for t < 0

parameters: A: par[0] // Amplitude = peak value t0: par[1] tau: par[2] N: par[3] ped: par[4]

Definition at line 578 of file AliCaloFastAltroFitv0.cxx.

Referenced by DrawFastFunction(), and GetNoFit().

Member Data Documentation

Double_t AliCaloFastAltroFitv0::fAmp
protected

Amplitude.

Definition at line 106 of file AliCaloFastAltroFitv0.h.

Referenced by FastFit(), GetEnergy(), GetFitResult(), and Reset().

Double_t AliCaloFastAltroFitv0::fAmpErr
protected

Amplitude error.

Definition at line 107 of file AliCaloFastAltroFitv0.h.

Referenced by FastFit(), GetAmpErr(), GetFitResult(), and Reset().

Double_t* AliCaloFastAltroFitv0::fAmpfit
protected

! Points for fit after selection - amplitudes

Definition at line 117 of file AliCaloFastAltroFitv0.h.

Referenced by DrawFastFunction(), FastFit(), GetFittedPoints(), Reset(), and ~AliCaloFastAltroFitv0().

Double_t AliCaloFastAltroFitv0::fChi2
protected

Chi square.

Definition at line 110 of file AliCaloFastAltroFitv0.h.

Referenced by FastFit(), GetChi2(), GetFitResult(), and Reset().

Double_t AliCaloFastAltroFitv0::fN
protected

Second fixed parameter od fitting function (should be positive)

Definition at line 103 of file AliCaloFastAltroFitv0.h.

Referenced by GetN(), SetN(), and SetParameters().

Int_t AliCaloFastAltroFitv0::fNDF
protected

Number degree of freedom.

Definition at line 111 of file AliCaloFastAltroFitv0.h.

Referenced by FastFit(), GetFitResult(), GetNDF(), and Reset().

Int_t AliCaloFastAltroFitv0::fNfit
protected

! Number points for fit

Definition at line 115 of file AliCaloFastAltroFitv0.h.

Referenced by DrawFastFunction(), FastFit(), GetFittedPoints(), GetNfit(), and Reset().

Int_t AliCaloFastAltroFitv0::fNoFit
protected

No solution for square equation.

Definition at line 112 of file AliCaloFastAltroFitv0.h.

Referenced by FastFit(), and GetNoFit().

Double_t AliCaloFastAltroFitv0::fPed
protected

Pedestal.

Definition at line 104 of file AliCaloFastAltroFitv0.h.

Referenced by FastFit(), and GetPed().

Double_t AliCaloFastAltroFitv0::fSig
protected

Error in amplitude - used in chi2 calculation.

Definition at line 101 of file AliCaloFastAltroFitv0.h.

Referenced by DrawFastFunction(), FastFit(), GetSig(), Reset(), SetParameters(), and SetSig().

TF1* AliCaloFastAltroFitv0::fStdFun
protected

! Function for drawing

Definition at line 119 of file AliCaloFastAltroFitv0.h.

Referenced by DrawFastFunction().

Double_t AliCaloFastAltroFitv0::fT0
protected

Time.

Definition at line 108 of file AliCaloFastAltroFitv0.h.

Referenced by FastFit(), GetFitResult(), GetTime(), and Reset().

Double_t AliCaloFastAltroFitv0::fT0Err
protected

Time error.

Definition at line 109 of file AliCaloFastAltroFitv0.h.

Referenced by FastFit(), GetFitResult(), GetT0Err(), and Reset().

Double_t AliCaloFastAltroFitv0::fTau
protected

First fixed parameter od fitting function (should be - filter time response.

Definition at line 102 of file AliCaloFastAltroFitv0.h.

Referenced by FastFit(), GetTau(), Reset(), SetParameters(), and SetTau().

Double_t* AliCaloFastAltroFitv0::fTfit
protected

! Points for fit after selection - time bins

Definition at line 116 of file AliCaloFastAltroFitv0.h.

Referenced by DrawFastFunction(), FastFit(), GetFittedPoints(), Reset(), and ~AliCaloFastAltroFitv0().


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