]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/RESONANCES/AliRsnFitResult.h
bugfix
[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);
55 Double_t Signal(Double_t *x, Double_t *par);
56 Double_t Background(Double_t *x, Double_t *par);
57 Double_t Sum(Double_t *x, Double_t *par);
58
59 Int_t GetNParBackground();
60 Bool_t InitFunctions();
61 Bool_t SingleFit(const char *fitOpts, Double_t mass, Double_t width);
62
63 void SetHistogram(TH1F *histogram);
64 void SetPeakRange(Double_t min, Double_t max) {fPeakRange[0] = TMath::Min(min, max); fPeakRange[1] = TMath::Max(min, max);}
65 void SetFullRange(Double_t min, Double_t max) {fFullRange[0] = TMath::Min(min, max); fFullRange[1] = TMath::Max(min, max);}
66
67 private:
68
69 ESignalType fSignalType; // signal function
70 EBackgroundType fBackgroundType; // background function
71
72 Double_t fFullRange[2]; // full fit range
73 Double_t fPeakRange[2]; // peak fit range
74 Double_t fFitResult[kValues]; // array of fit results
75
76 TH1F *fHistogram; // histogram to be fitted
77 TF1 *fSignalFcn; // function for signal
78 TF1 *fBackgroundFcn; // function for background
79 TF1 *fSumFcn; // total function
80
81 ClassDef(AliRsnFitResult, 1)
82};
83
84#endif