RootUtils
FitUtils Namespace Reference

Classes

class  CrystalBallFunctionObject
 

Enumerations

enum  ResolutionType { CBFunctionMomenta , CBGaussianPart }
 

Functions

TF1 * getCrystalBallFunction (TH1 *hist, Bool_t reversed)
 Obtain a CrystalBall fitting function based on a given histogram. More...
 
TF1 * getCrystalBallFunction (TH1 *hist)
 Obtain best CrystalBall function (original or reversed) that fits the histogram. More...
 
TVector2 getCrystalBallMean (TF1 *cball)
 Calculate Crystal Ball function mean value. More...
 
TVector2 getCrystalBallDispersion (TF1 *cball)
 Calculate Crystal Ball dispersion (standard deviation) value. More...
 
TF1 * getCrystalBallGaussComponent (TF1 *cball)
 Get gaussian part of the crystal ball function. More...
 
TVector2 getCrystalBallResolution (TF1 *cball, ResolutionType rt=CBFunctionMomenta)
 Calculate Crystal Ball resolution value (standard deviation / mean). More...
 
TVector2 evalResolution (Double_t mean, Double_t meanErr, Double_t std, Double_t stdErr)
 Calculate resolution of a distribution with given standard deviation and mean. More...
 

Detailed Description

Implementation of a Crystal Ball function in ROOT. Supports regular and reversed crystal ball functions.

Enumeration Type Documentation

◆ ResolutionType

Enum defines how to calculate Crystall Ball function mean, dispersion and resolution.

Enumerator
CBFunctionMomenta 

Based on the Crystal Ball function momenta

CBGaussianPart 

Based on Gaussian part of the Crystal Ball function sigma/mean

Function Documentation

◆ evalResolution()

TVector2 FitUtils::evalResolution ( Double_t  mean,
Double_t  meanErr,
Double_t  std,
Double_t  stdErr 
)

Calculate resolution of a distribution with given standard deviation and mean.

Parameters
meandistribution mean.
meanErrdistribution mean error.
stddistribution standard deviation.
stdErrdistribution standard deviation error.
Returns
TVector2 resolution value and error.

◆ getCrystalBallDispersion()

TVector2 FitUtils::getCrystalBallDispersion ( TF1 *  cball)

Calculate Crystal Ball dispersion (standard deviation) value.

Parameters
cballCrystal ball function.
reversedtype of the crystal ball function.
Returns
TVector2 dispersion value and error.

◆ getCrystalBallFunction() [1/2]

TF1 * FitUtils::getCrystalBallFunction ( TH1 *  hist)

Obtain best CrystalBall function (original or reversed) that fits the histogram.

Function fits the histogram with both crystal ball functions and determines which one provides the best fit.

Parameters
histhistogram to be fitted.
Returns
original or reversed crystal ball function.

◆ getCrystalBallFunction() [2/2]

TF1 * FitUtils::getCrystalBallFunction ( TH1 *  hist,
Bool_t  reversed 
)

Obtain a CrystalBall fitting function based on a given histogram.

Function sets corresponding Crystal GBall function parameters based on the shape of the histogram. User can immediately do the fit.

Parameters
histhistogram to be fitted.
reversedset if Crystal Ball function is reversed or not. Default is kFALSE.
Returns
ROOT function ready for fitting.

◆ getCrystalBallGaussComponent()

TF1 * FitUtils::getCrystalBallGaussComponent ( TF1 *  cball)

Get gaussian part of the crystal ball function.

Parameters
cballCrystal ball function.
Returns
TF1* gaussian function.

◆ getCrystalBallMean()

TVector2 FitUtils::getCrystalBallMean ( TF1 *  cball)

Calculate Crystal Ball function mean value.

Parameters
cballCrystal ball function.
reversedtype of the crystal ball function.
Returns
TVector2 mean value and error.

◆ getCrystalBallResolution()

TVector2 FitUtils::getCrystalBallResolution ( TF1 *  cball,
ResolutionType  rt = CBFunctionMomenta 
)

Calculate Crystal Ball resolution value (standard deviation / mean).

Parameters
cballCrystal ball function.
Returns
TVector2 resolution value and error.