4a0b71019e39aac4378c0bef06ef08051b7591ee
[u/mrichter/AliRoot.git] / PWGDQ / dielectron / AliDielectronBtoJPSItoEleCDFfitHandler.h
1 #ifndef ALIDIELECTRONBTOJPSITOELECDFFITHANDLER_H\r
2 #define ALIDIELECTRONBTOJPSITOELECDFFITHANDLER_H\r
3 /* Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *\r
4  * See cxx source for full Copyright notice                               */\r
5 \r
6 //___________________________________________________________________________\r
7 //                  Class AliDielectronBtoJPSItoEleCDFfitHandler\r
8 //            Class to perform unbinned log-likelihood fit\r
9 //      \r
10 //                         Origin: C. Di Giglio\r
11 //     Contact: Carmelo.Digiglio@ba.infn.it; Giuseppe.Bruno@ba.infn.it\r
12 //____________________________________________________________________________\r
13 \r
14 #include <TNamed.h>\r
15 #include <TBits.h>\r
16 #include <TGraph.h>\r
17 #include <TFitter.h>\r
18 \r
19 class AliDielectronBtoJPSItoEleCDFfitFCN ;\r
20 \r
21 class AliDielectronBtoJPSItoEleCDFfitHandler : public TNamed {\r
22         public:\r
23                 //\r
24                 AliDielectronBtoJPSItoEleCDFfitHandler();\r
25                 AliDielectronBtoJPSItoEleCDFfitHandler& operator= (const  AliDielectronBtoJPSItoEleCDFfitHandler& c);\r
26                 AliDielectronBtoJPSItoEleCDFfitHandler(const AliDielectronBtoJPSItoEleCDFfitHandler& c);\r
27                 AliDielectronBtoJPSItoEleCDFfitHandler(Double_t* decaytime, Double_t* invariantmass, Int_t *type, Int_t ncand);\r
28                 ~AliDielectronBtoJPSItoEleCDFfitHandler(); \r
29                 Double_t Up() const { return fUp; }\r
30                 void SetErrorDef(Double_t up) {fUp = up;}\r
31                 void SetPrintStatus(Bool_t okPrintStatus) { fPrintStatus = okPrintStatus; } \r
32                 Bool_t GetPrintStatus() const { return fPrintStatus ; }\r
33                 void SetParamStartValues (Double_t*);\r
34                 Double_t* GetStartParamValues() { return fParamStartValues; }\r
35                 TBits GetFixedParamList() const { return fIsParamFixed; }\r
36                 TFitter *GetFitter() const {return fitter;}\r
37                 Double_t GetParameter(Int_t numPar) const {return fitter->GetParameter(numPar);}\r
38                 Double_t GetParameterError(Int_t numPar) const {return fitter->GetParError(numPar);}   \r
39 \r
40                 void FixParam(UInt_t param, Bool_t value) { fIsParamFixed.SetBitNumber(param,value); }\r
41                 void FixAllParam(Bool_t value) { for(UInt_t par=0;par<45;par++) fIsParamFixed.SetBitNumber(par,value); }\r
42                 Bool_t IsParamFixed(UInt_t param) { return fIsParamFixed.TestBitNumber(param); }\r
43                 void SetResolutionConstants(Double_t* resolutionConst, Int_t type);\r
44                 void SetCrystalBallFunction(Bool_t okCB);\r
45                 void SetMassWndHigh(Double_t limit);\r
46                 void SetMassWndLow(Double_t limit);\r
47 \r
48                 Double_t operator()(const Double_t* par) const ;\r
49                 void CdfFCN(Int_t & /* npar */, Double_t * /* gin */, Double_t &f, Double_t *par, Int_t /* iflag */);\r
50 \r
51                 Double_t* Decaytime() const         { return fX; }\r
52                 Double_t* InvariantMass() const     { return fM; }\r
53                 Int_t*    TypeCand() const          { return fType;}\r
54                 AliDielectronBtoJPSItoEleCDFfitFCN* LikelihoodPointer() const { return fLikely; }\r
55                 Int_t DoMinimization(Int_t step = 0);\r
56                 \r
57 \r
58         private:\r
59                 //\r
60                 TBits fIsParamFixed;                               //array of bits: 0 = param free; 1 = param fixed;\r
61                 Bool_t fPrintStatus;                               //flag to enable the prit out of the algorithm at each step\r
62                 Double_t fParamStartValues[45];                    //array of parameters input value\r
63                 Double_t fUp;                                      //error definition \r
64                 Double_t* fX;                                      //pseudo-proper decay time X\r
65                 Double_t* fM;                                      //invariant mass M\r
66                 Int_t* fType;                                      //candidate type\r
67                 AliDielectronBtoJPSItoEleCDFfitFCN* fLikely;       //Log likelihood function\r
68                 Int_t fNcand;                                      //number of candidates\r
69                 TGraph* fContPlot1;                                //contour plot       \r
70                 TGraph* fContPlot2;                                //contour plot       \r
71                 TGraph* fContPlot3;                                //contour plot       \r
72                 TFitter *fitter;                                   //pointer to TFitter object  \r
73                 //\r
74                 ClassDef(AliDielectronBtoJPSItoEleCDFfitHandler,1);\r
75 \r
76 }; \r
77 #endif\r