RootUtils
FitUtils.h
1 #ifndef FitUtils_hh
2 #define FitUtils_hh 1
3 
4 #include <RtypesCore.h>
5 #include <TF1.h>
6 #include <TVector2.h>
7 
13 namespace FitUtils {
14 
20  public:
21  CrystalBallFunctionObject(Bool_t _isInverted = kFALSE);
22  Double_t operator()(double *_x, double *par);
23 
24 
25  private:
26  Bool_t isReversed;
27  };
28 
38  TF1* getCrystalBallFunction(TH1 *hist, Bool_t reversed);
39 
48  TF1* getCrystalBallFunction(TH1 *hist);
49 
57  TVector2 getCrystalBallMean(TF1* cball);
58 
66  TVector2 getCrystalBallDispersion(TF1* cball);
67 
74  TF1* getCrystalBallGaussComponent(TF1* cball);
75 
82  };
83 
91 
101  TVector2 evalResolution(Double_t mean, Double_t meanErr, Double_t std, Double_t stdErr);
102 }
103 
104 #endif
Definition: FitUtils.h:19
Definition: RootUtils.cxx:76
TVector2 getCrystalBallResolution(TF1 *cball, ResolutionType rt=CBFunctionMomenta)
Calculate Crystal Ball resolution value (standard deviation / mean).
Definition: FitUtils.cpp:238
TF1 * getCrystalBallGaussComponent(TF1 *cball)
Get gaussian part of the crystal ball function.
Definition: FitUtils.cpp:199
TF1 * getCrystalBallFunction(TH1 *hist, Bool_t reversed)
Obtain a CrystalBall fitting function based on a given histogram.
Definition: FitUtils.cpp:67
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.
Definition: FitUtils.cpp:230
TVector2 getCrystalBallDispersion(TF1 *cball)
Calculate Crystal Ball dispersion (standard deviation) value.
Definition: FitUtils.cpp:159
ResolutionType
Definition: FitUtils.h:79
@ CBGaussianPart
Definition: FitUtils.h:81
@ CBFunctionMomenta
Definition: FitUtils.h:80
TVector2 getCrystalBallMean(TF1 *cball)
Calculate Crystal Ball function mean value.
Definition: FitUtils.cpp:119