Splitted the PID cuts into three classes for ITS, TPC and TOF, and added the possibil...
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnFitResult.h
CommitLineData
0d73200d 1//
2// Class AliRsnFitResult
3//
4// It contains all results from a fit to an invariant mass spectrum
5//
6
7#ifndef ALIRSNFITRESULT
8#define ALIRSNFITRESULT
9
10#include <TMath.h>
11
12class AliRsnFitResult : public TNamed
13{
14 public:
15
16 enum
17 {
18 kSgAmp,
19 kSgCenter,
20 kSgWidth,
21 kSgIntegral,
22 kBgIntegral,
23 kSg2Bg,
24 kSignificance,
25 kTotalIntegral,
26 kSumIntegral,
27 kSumIntegralError,
28 kChi2,
29 kNDF,
30 kValues
31 };
32
33 enum ESignalType
34 {
35 kBreitWigner,
36 kGaus
37 };
38
39 enum EBackgroundType
40 {
41 kSquareRoot,
42 kLinear,
43 kPoly2
44 };
45
46 AliRsnFitResult(const char *name = "none", ESignalType sType = kGaus, EBackgroundType bType = kPoly2);
47 //AliRsnFitResult(const AliRsnFitResult& copy);
48 //AliRsnFitResult& operator=(cont AliRsnFitResult& copy);
49
50 Double_t NormSquareRoot(Double_t *x, Double_t *par);
51 Double_t NormPoly2(Double_t *x, Double_t *par);
52 Double_t NormLinear(Double_t *x, Double_t *par);
53 Double_t NormBreitWigner(Double_t *x, Double_t *par);
54 Double_t NormGaus(Double_t *x, Double_t *par);
b2b08ca2 55
0d73200d 56 Double_t Signal(Double_t *x, Double_t *par);
57 Double_t Background(Double_t *x, Double_t *par);
58 Double_t Sum(Double_t *x, Double_t *par);
59
60 Int_t GetNParBackground();
61 Bool_t InitFunctions();
62 Bool_t SingleFit(const char *fitOpts, Double_t mass, Double_t width);
63
64 void SetHistogram(TH1F *histogram);
65 void SetPeakRange(Double_t min, Double_t max) {fPeakRange[0] = TMath::Min(min, max); fPeakRange[1] = TMath::Max(min, max);}
66 void SetFullRange(Double_t min, Double_t max) {fFullRange[0] = TMath::Min(min, max); fFullRange[1] = TMath::Max(min, max);}
67
68 private:
69
70 ESignalType fSignalType; // signal function
71 EBackgroundType fBackgroundType; // background function
72
73 Double_t fFullRange[2]; // full fit range
74 Double_t fPeakRange[2]; // peak fit range
75 Double_t fFitResult[kValues]; // array of fit results
76
b2b08ca2 77 TH1D *fHistogram; // histogram to be fitted
0d73200d 78 TF1 *fSignalFcn; // function for signal
79 TF1 *fBackgroundFcn; // function for background
80 TF1 *fSumFcn; // total function
81
82 ClassDef(AliRsnFitResult, 1)
83};
84
85#endif