]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG/muondep/AliAnalysisMuMuJpsiResult.h
added runs for jason
[u/mrichter/AliRoot.git] / PWG / muondep / AliAnalysisMuMuJpsiResult.h
1 #ifndef ALIANALYSISMUMUJPSIRESULT_H
2 #define ALIANALYSISMUMUJPSIRESULT_H
3
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6
7 ///
8 /// AliAnalysisMuMuJpsiResult : helper class to store Jpsi results from
9 /// AliAnalysisTaskMuMu
10 ///
11 /// author : Laurent Aphecetche (Subatech)
12
13 #include "TNamed.h"
14 #include <TString.h>
15 #include "AliAnalysisMuMuResult.h"
16 #include "AliAnalysisMuMuBinning.h"
17
18 class TH1;
19 class THashList;
20 class TF1;
21 class TMap;
22 class TFitResultPtr;
23
24 class AliAnalysisMuMuJpsiResult : public AliAnalysisMuMuResult
25 {
26   
27 public:
28   
29   AliAnalysisMuMuJpsiResult(TRootIOCtor* io);
30   
31 //  AliAnalysisMuMuJpsiResult(const TH1& hminv);
32
33   AliAnalysisMuMuJpsiResult(const char* particle,
34                             const TH1& hminv,
35                             const char* fitType);
36
37   AliAnalysisMuMuJpsiResult(const char* particle,
38                             const TH1& hminv,
39                             const char* triggerClass,
40                             const char* eventSelection,
41                             const char* pairSelection,
42                             const char* centSelection,
43                             const AliAnalysisMuMuBinning::Range& bin);
44   
45   AliAnalysisMuMuJpsiResult(const AliAnalysisMuMuJpsiResult& rhs);
46   AliAnalysisMuMuJpsiResult& operator=(const AliAnalysisMuMuJpsiResult& rhs);
47   
48   virtual ~AliAnalysisMuMuJpsiResult();
49
50   virtual TObject* Clone(const char* newname = "") const;
51   
52   Bool_t Correct(const AliAnalysisMuMuJpsiResult& other, const char* particle, const char* subResultName="");
53   
54   TH1* Histo() const { return fHisto; }
55   
56   Int_t NofTriggers() const;
57   
58   void SetNofTriggers(Int_t n);
59   
60   void Print(Option_t* opt="") const;
61   
62   Bool_t AddFit(const char* fitType);
63
64   AliAnalysisMuMuJpsiResult* CountJpsi(TH1& h);
65
66   /** All the fit functions should have a prototype starting like :
67
68    AliAnalysisMuMuJpsiResult* FitXXX();
69    
70    If extra parameters to the specific FitXXX function are needed, they should be given
71    using the SetValue(...) method, and retrieved from the FitXXX method using 
72    the GetValue(...) method.
73    */
74   
75
76   void FitPSICOUNT();
77   void FitPSICB2();
78   void FitPSINA60NEW();
79   
80   void FitPSIPSIPRIMECB2VWG();
81   void FitPSIPSIPRIMECB2POL2EXP();
82   void FitPSIPSIPRIMENA60NEWVWG();
83   void FitPSIPSIPRIMENA60NEWPOL2EXP();
84   
85   void FitPSIPSIPRIMECB2POL4EXP();
86   void FitPSIPSIPRIMENA60NEWPOL4EXP();
87   void FitPSIPSIPRIMECB2VWGINDEPTAILS();
88   
89   //** All the mean pt fit methods MUST contain the corresponding name of the inv mass spectra method
90   void FitMPTPSIPSIPRIMECB2VWG_BKGMPTPOL2();
91   void FitMPTPSIPSIPRIMECB2VWG_BKGMPTPOL2EXP();  
92   void FitMPTPSIPSIPRIMECB2POL2EXP_BKGMPTPOL2();
93   void FitMPTPSIPSIPRIMECB2POL2EXP_BKGMPTPOL2EXP();
94   
95   void FitMPTPSIPSIPRIMECB2VWG_BKGMPTLIN();
96   void FitMPTPSIPSIPRIMECB2VWG_BKGMPTPOL3();
97   void FitMPTPSIPSIPRIMECB2VWG_BKGMPTPOL4();
98   void FitMPTPSIPSIPRIMECB2VWGINDEPTAILS_BKGMPTPOL2();
99   
100 //  void FitMPT2CB2POL2EXP_BKGMPTPOL4();
101 //  void FitMPT2CB2POL4EXP_BKGMPTPOL2();
102 //  void FitMPT2CB2POL4EXP_BKGMPTPOL4();
103   
104   void FitMPTPSIPSIPRIMENA60NEWVWG_BKGMPTPOL2();
105   void FitMPTPSIPSIPRIMENA60NEWVWG_BKGMPTPOL2EXP();
106   void FitMPTPSIPSIPRIMENA60NEWPOL2EXP_BKGMPTPOL2();
107   void FitMPTPSIPSIPRIMENA60NEWPOL2EXP_BKGMPTPOL2EXP();
108   void FitMPTPSIPSIPRIMENA60NEWPOL4EXP_BKGMPTPOL2();
109   
110   void FitPSIPSIPRIMECOMB_CB2VWG_MPTCB2VWG_BKGMPTPOL2();
111   
112 //  void FitMPT2NA60NEWVWG_BKGMPTPOL4();
113 //  void FitMPT2NA60NEWPOL2EXP_BKGMPTPOL4();
114 //  void FitMPT2NA60NEWPOL4EXP_BKGMPTPOL4();
115
116   Int_t NofRuns() const;
117   
118   void SetNofRuns(int n);
119   
120   const AliAnalysisMuMuBinning::Range& Bin() const;
121
122   void SetBin(const AliAnalysisMuMuBinning::Range& bin);
123   
124   void SetNofInputParticles(const char* particle, int n);
125
126   void SetNofInputParticles(const TH1& hminv);
127
128   void SetHisto(const TH1& h);
129
130   Long64_t Merge(TCollection* list);
131
132   static Double_t CountParticle(const TH1& hminv, const char* particle, Double_t sigma=-1.0);
133   
134   virtual AliAnalysisMuMuJpsiResult* Mother() const { return static_cast<AliAnalysisMuMuJpsiResult*>(AliAnalysisMuMuResult::Mother()); }
135
136   void PrintValue(const char* key, const char* opt, Double_t value, Double_t errorStat, Double_t rms=0.0) const; 
137
138   TString FitFunctionName() const { return fFitFunction; }
139   
140   TString GetFitFunctionMethodName() const;
141   
142   void Draw(Option_t* opt="");
143   
144   const char* GetParticle() { return fParticle; } 
145   
146 private:
147   
148   enum EIndex
149   {
150     kValue=0,
151     kErrorStat=1
152   };
153
154   void DecodeFitType(const char* fitType);
155   
156   void PrintParticle(const char* particle, const char* opt) const;
157   
158   Double_t FitFunctionBackgroundLin(Double_t *x, Double_t *par);
159
160   Double_t FitFunctionBackgroundPol2Exp(Double_t* x, Double_t* par);
161   
162   Double_t FitFunctionBackgroundPol4Exp(Double_t *x, Double_t *par);
163   
164   Double_t FitFunctionBackgroundPol2(Double_t *x, Double_t *par);
165   
166   Double_t FitFunctionBackgroundPol3(Double_t *x, Double_t *par);
167   
168   Double_t FitFunctionBackgroundPol4(Double_t *x, Double_t *par);
169
170   Double_t FitFunctionBackgroundVWG(Double_t* x, Double_t* par);
171
172   Double_t FitFunctionSignalCrystalBallExtended(Double_t *x,Double_t *par);
173   
174   Double_t FitFunctionNA60New(Double_t *x,Double_t *par);
175   
176   Double_t FitFunctionTotalTwoNA60NewVWG(Double_t *x, Double_t *par);
177   
178   Double_t FitFunctionTotalTwoNA60NewPol2Exp(Double_t *x, Double_t *par);
179   
180   Double_t FitFunctionTotalTwoNA60NewPol4Exp(Double_t *x, Double_t *par);
181
182   Double_t FitFunctionTotalTwoCB2Pol2Exp(Double_t *x, Double_t *par);
183   
184   Double_t FitFunctionTotalTwoCB2Pol4Exp(Double_t *x, Double_t *par);
185   
186   Double_t FitFunctionTotalTwoCB2VWG(Double_t *x, Double_t *par);
187   
188   Double_t FitFunctionTotalTwoCB2Lin(Double_t *x, Double_t *par);
189   
190   Double_t FitFunctionTotalTwoCB2VWGINDEPTAILS(Double_t *x, Double_t *par);
191   
192   Double_t alphaCB2VWG(Double_t*x, Double_t* par);
193   
194   Double_t alphaCB2POL2EXP(Double_t*x, Double_t* par);
195   
196   Double_t alphaNA60NEWVWG(Double_t*x, Double_t* par);
197   
198   Double_t alphaNA60NEWPOL2EXP(Double_t*x, Double_t* par);
199   
200   Double_t FitFunctionMeanPtSCB2Lin(Double_t* x, Double_t* par);
201   
202   Double_t FitFunctionMeanPtS2CB2Lin(Double_t *x, Double_t *par);
203   
204   Double_t FitFunctionMeanPtSCB2VWGPOL2(Double_t* x, Double_t* par);
205   
206   
207   
208   Double_t FitFunctionMeanPtS2CB2VWGPOL2(Double_t *x, Double_t *par);
209   
210   Double_t FitFunctionMeanPtS2CB2VWGPOL2EXP(Double_t *x, Double_t *par);
211   
212   Double_t FitFunctionMeanPtS2CB2POL2EXPPOL2(Double_t *x, Double_t *par);
213   
214   Double_t FitFunctionMeanPtS2CB2POL2EXPPOL2EXP(Double_t *x, Double_t *par);
215   
216   Double_t FitFunctionMeanPtS2NA60NEWVWGPOL2(Double_t *x, Double_t *par);
217   
218   Double_t FitFunctionMeanPtS2NA60NEWVWGPOL2EXP(Double_t *x, Double_t *par);
219   
220   Double_t FitFunctionMeanPtS2NA60NEWPOL2EXPPOL2(Double_t *x, Double_t *par);
221   
222   Double_t FitFunctionMeanPtS2NA60NEWPOL2EXPPOL2EXP(Double_t *x, Double_t *par);
223   
224  
225   
226   Double_t FitFunctionMeanPtS2CB2VWGPOL3(Double_t *x, Double_t *par);
227   
228   Double_t FitFunctionMeanPtS2CB2VWGPOL2INDEPTAILS(Double_t *x, Double_t *par);
229   
230   Double_t FitFunctionMeanPtS2CB2VWGPOL4(Double_t *x, Double_t *par);
231
232   void SetFitRejectRange(Double_t a=TMath::Limits<Double_t>::Max(),
233                          Double_t b=TMath::Limits<Double_t>::Max());
234
235   void AttachFunctionsToHisto(TF1* signal, TF1* bck, TF1* total, Double_t xmin, Double_t xmax); //Might be unnecesary since we have the one with 2 signals
236   
237   void AttachFunctionsToHisto(TF1* signal1, TF1* signal2, TF1* bck, TF1* total,Double_t xmin, Double_t xmax);
238
239   void SetParameter(TF1* func, Int_t npar, Double_t fix, Double_t initialValue,
240                     Double_t min, Double_t max) const;
241
242   Bool_t WrongParameter(TF1* fitFunction, Int_t npar, Double_t fixValueIfWrong);
243   
244   Bool_t StrongCorrelation(TFitResultPtr& fitResult, TF1* fitFunction, Int_t npar1, Int_t npar2, Double_t fixValueIfWrong);
245
246   
247 private:
248   Int_t fNofRuns; // number of runs used to get this result
249   Int_t fNofTriggers; // number of trigger analyzed
250   TH1* fHisto; // invariant mass spectrum
251   AliAnalysisMuMuBinning::Range fBin; // bin range
252   
253   TString fTriggerClass; // trigger class for this result
254   TString fEventSelection; // event selection for this result
255   TString fPairSelection; // pair selection for this result
256   TString fCentralitySelection; // centrality selection for this result
257
258   TString fFitFunction; // fit function used
259   Double_t fFitRejectRangeLow; // fit range to reject
260   Double_t fFitRejectRangeHigh; // fit range to reject
261   Bool_t fRejectFitPoints; // whether or not some fit points should be rejected
262   
263   TString fParticle;
264   TString fMinvRS; // minv spectra range and sigmaPsiP factor for the mpt fits
265   
266   ClassDef(AliAnalysisMuMuJpsiResult,8) // a class to hold invariant mass analysis results (counts, yields, AccxEff, R_AB, etc...)
267 };
268
269 #endif