]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG/muondep/AliAnalysisMuMuResult.h
Placeholder for like and unlike sign selection
[u/mrichter/AliRoot.git] / PWG / muondep / AliAnalysisMuMuResult.h
1 #ifndef ALIANALYSISMUMURESULT_H
2 #define ALIANALYSISMUMURESULT_H
3
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6
7 // $Id$
8
9 ///
10 /// AliAnalysisMuMuResult : helper class to store results from
11 /// AliAnalysisTaskMuMu
12 ///
13 /// author : Laurent Aphecetche (Subatech)
14
15 #include "TNamed.h"
16 #include <TString.h>
17 #include "AliAnalysisMuMuBinning.h"
18
19 class TH1;
20 class THashList;
21 class TF1;
22 class TMap;
23
24 class AliAnalysisMuMuResult : public TNamed
25 {
26   
27 public:
28   
29   AliAnalysisMuMuResult(TRootIOCtor* io);
30   
31   AliAnalysisMuMuResult(const TH1& hminv);
32
33   AliAnalysisMuMuResult(const TH1& hminv,
34                         const char* fitType,
35                         Int_t nrebin);
36
37   AliAnalysisMuMuResult(const TH1& hminv,
38                         const char* triggerClass,
39                         const char* eventSelection,
40                         const char* pairSelection,
41                         const char* centSelection,
42                         const AliAnalysisMuMuBinning::Range& bin);
43   
44   AliAnalysisMuMuResult(const AliAnalysisMuMuResult& rhs);
45   AliAnalysisMuMuResult& operator=(const AliAnalysisMuMuResult&);
46   
47   virtual ~AliAnalysisMuMuResult();
48
49   virtual TObject* Clone(const char* newname = "") const;
50   
51   Bool_t Correct(const AliAnalysisMuMuResult& other, const char* particle, const char* subResultName="");
52   
53   TH1* Minv() const { return fMinv; }
54   
55   void Set(const char* name, Double_t value, Double_t errorStat);
56   
57   Bool_t HasValue(const char* name, const char* subResultName="") const;
58   
59   Double_t GetValue(const char* name, const char* subResultName="") const;
60   
61   Double_t GetErrorStat(const char* name, const char* subResultName="") const;
62
63   Int_t NofTriggers() const;
64   
65   void SetNofTriggers(Int_t n);
66   
67   void Print(Option_t* opt="") const;
68   
69   Bool_t AddFit(const char* fitType, Int_t rebin=1);
70
71   AliAnalysisMuMuResult* CountJpsi(TH1& h);
72
73 //  void FitJpsiPsiPrimeCB(TH1& h);
74   AliAnalysisMuMuResult*  FitJpsi(TH1& h);
75 //  void FitJpsiCBE(TH1& h);
76 //  void FitJpsiECBE(TH1& h);
77 //  void FitJpsiPCBE(TH1& h);
78 //  void FitUpsilon(TH1& h);
79
80   AliAnalysisMuMuResult* FitJpsi2CB2VWG(const TH1& h);
81   AliAnalysisMuMuResult* FitJpsiGCBE(TH1& h);
82   
83 //  SubResult* FitJpsiPsiPrimeCustom(TH1& h);
84   
85   Int_t NofRuns() const;
86   
87   void SetNofRuns(int n);
88   
89   const AliAnalysisMuMuBinning::Range& Bin() const;
90
91   void SetBin(const AliAnalysisMuMuBinning::Range& bin);
92   
93   void SetNofInputParticles(const char* particle, int n);
94
95   void SetNofInputParticles(const TH1& hminv);
96
97   void SetMinv(const TH1& hminv);
98
99   TObjArray* SubResults() const { return fSubResults; }
100   
101   static Double_t CountParticle(const TH1& hminv, const char* particle, Double_t sigma=-1);
102
103   static Double_t ErrorAB(Double_t a, Double_t aerr, Double_t b, Double_t berr);
104
105   static Double_t ErrorABC(Double_t a, Double_t aerr, Double_t b, Double_t berr, Double_t c, Double_t cerror);
106
107   Long64_t Merge(TCollection* list);
108
109   AliAnalysisMuMuResult* Mother() const { return fMother; }
110   
111   THashList* Keys() const;
112   
113   Double_t Weight() const { return fWeight > 0  ? fWeight : fNofTriggers; }
114   
115   void SetWeight(Double_t w) { fWeight=w; }
116   
117 private:
118   
119   enum EIndex
120   {
121     kValue=0,
122     kErrorStat=1
123   };
124   
125
126   void PrintParticle(const char* particle, const char* opt) const;
127   void PrintValue(const char* key, const char* opt, Double_t value, Double_t errorStat) const;
128
129 private:
130   Int_t fNofRuns; // number of runs used to get this result
131   Int_t fNofTriggers; // number of trigger analyzed
132   TH1* fMinv; // invariant mass spectrum
133   AliAnalysisMuMuBinning::Range fBin; // bin range
134   TObjArray* fSubResults; // TObjArray of AliAnalysisMuMuResult*
135   TMap* fMap; // internal parameter map
136   AliAnalysisMuMuResult* fMother; // mother result
137   mutable THashList* fKeys; //! keys we have in our internal map (or the one of our subresults)
138   Double_t fWeight; // weight of this result (default 1.0)
139   
140   ClassDef(AliAnalysisMuMuResult,5) // a class to hold invariant mass analysis results (counts, yields, AccxEff, R_AB, etc...)
141 };
142
143 #endif