1 #ifndef ALIANALYSISMUMUBASE_H
2 #define ALIANALYSISMUMUBASE_H
6 * \class AliAnalysisMuMuBase
8 * \brief Base class of the sub-analysis for AliAnalysisTaskMuMu
10 * \author L. Aphecetche (Subatech)
17 class AliCounterCollection;
18 class AliAnalysisMuMuBinning;
19 class AliMergeableCollection;
24 class AliInputEventHandler;
25 class AliAnalysisMuMuCutRegistry;
27 class AliAnalysisMuMuBase : public TObject
31 AliAnalysisMuMuBase();
32 virtual ~AliAnalysisMuMuBase() {}
34 /** Define the histograms needed for the path starting at eventSelection/triggerClassName/centrality.
35 * This method has to ensure the histogram creation is performed only once !
37 virtual void DefineHistogramCollection(const char* eventSelection,
38 const char* triggerClassName,
39 const char* centrality) = 0;
41 /** Fill histograms for one event */
42 virtual void FillHistosForEvent(const char* /*eventSelection*/,const char* /*triggerClassName*/,const char* /*centrality*/) {}
44 /** Fill histograms for one MC event */
45 virtual void FillHistosForMCEvent(const char* /*eventSelection*/,const char* /*triggerClassName*/,const char* /*centrality*/) {}
47 /** Fill histograms for one track */
48 virtual void FillHistosForTrack(const char* /*eventSelection*/,const char* /*triggerClassName*/,const char* /*centrality*/,
49 const char* /*trackCutName*/,
50 const AliVParticle& /*part*/) {}
52 /** Fill histograms for one track pair */
53 virtual void FillHistosForPair(const char* /*eventSelection*/,const char* /*triggerClassName*/,const char* /*centrality*/,
54 const char* /*pairCutName*/,
55 const AliVParticle& /*part1*/,
56 const AliVParticle& /*part2*/) {}
58 virtual void Init(AliCounterCollection& cc,
59 AliMergeableCollection& hc,
60 const AliAnalysisMuMuBinning& binning,
61 const AliAnalysisMuMuCutRegistry& cutRegister);
63 virtual void SetEvent(AliVEvent* event, AliMCEvent* mcEvent=0x0);
65 virtual Bool_t IsHistogramDisabled(const char* hname) const;
67 virtual Bool_t IsHistogrammingDisabled() const;
69 virtual void DisableHistograms(const char* pattern="*");
71 AliVEvent* Event() const { return fEvent; }
73 AliMCEvent* MCEvent() const { return fMCEvent; }
75 static const char* MCInputPrefix() { return "MCINPUT" ; }
77 /// Called at each new run
78 virtual void SetRun(const AliInputEventHandler* /*eventHandler*/) {}
80 virtual void Terminate(Option_t* /*opt*/="") {}
84 kHistoForMCInput = (1<<0),
85 kHistoForData = (1<<1)
88 void SetMC() { fHasMC = kTRUE; }
90 Bool_t HasMC() const { return fHasMC; }
92 Bool_t AlwaysTrue(const AliVEvent& /*event*/) const { return kTRUE; }
93 Bool_t AlwaysTrue(const AliVParticle& /*particle*/) const { return kTRUE; }
94 Bool_t AlwaysTrue(const AliVParticle& /*particle*/, const AliVParticle& /*particle*/) const { return kTRUE; }
95 void NameOfAlwaysTrue(TString& name) const { name = "ALL"; }
97 Bool_t AlwaysFalse(const AliVEvent& /*event*/) const { return kFALSE; }
98 Bool_t AlwaysFalse(const AliVParticle& /*particle*/) const { return kFALSE; }
99 Bool_t AlwaysFalse(const AliVParticle& /*particle*/, const AliVParticle& /*particle*/) const { return kFALSE; }
100 void NameOfAlwaysFalse(TString& name) const { name = "NONE"; }
102 void SetHistogramCollection(AliMergeableCollection* h) { fHistogramCollection = h; }
106 void CreateHistos(const TObjArray& paths,
107 const char* hname, const char* htitle,
108 Int_t nbinsx, Double_t xmin, Double_t xmax,
109 Int_t nbinsy=-1, Double_t ymin=0.0, Double_t ymax=0.0) const;
111 void CreateEventHistos(UInt_t dataType,
113 const char* hname, const char* htitle,
114 Int_t nbinsx, Double_t xmin, Double_t xmax,
115 Int_t nbinsy=-1, Double_t ymin=0.0, Double_t ymax=0.0) const;
117 void CreateEventHistos(UInt_t dataType,
118 const char* eventSelection,
119 const char* triggerClassName,
120 const char* centrality,
121 const char* hname, const char* htitle,
122 Int_t nbinsx, Double_t xmin, Double_t xmax,
123 Int_t nbinsy=-1, Double_t ymin=0.0, Double_t ymax=0.0) const;
126 void CreateTrackHistos(UInt_t dataType,
127 const char* eventSelection,
128 const char* triggerClassName,
129 const char* centrality,
130 const char* hname, const char* htitle,
131 Int_t nbinsx, Double_t xmin, Double_t xmax,
132 Int_t nbinsy=-1, Double_t ymin=0.0, Double_t ymax=0.0) const;
134 void CreatePairHistos(UInt_t dataType,
135 const char* eventSelection,
136 const char* triggerClassName,
137 const char* centrality,
138 const char* hname, const char* htitle,
139 Int_t nbinsx, Double_t xmin, Double_t xmax,
140 Int_t nbinsy=-1, Double_t ymin=0.0, Double_t ymax=0.0) const;
142 TH1* Histo(const char* eventSelection, const char* histoname);
143 TH1* Histo(const char* eventSelection, const char* triggerClassName, const char* histoname);
144 TH1* Histo(const char* eventSelection, const char* triggerClassName, const char* cent, const char* histoname);
145 TH1* Histo(const char* eventSelection, const char* triggerClassName, const char* cent,
146 const char* what, const char* histoname);
148 TH1* MCHisto(const char* eventSelection, const char* histoname);
149 TH1* MCHisto(const char* eventSelection, const char* triggerClassName, const char* histoname);
150 TH1* MCHisto(const char* eventSelection, const char* triggerClassName, const char* cent, const char* histoname);
151 TH1* MCHisto(const char* eventSelection, const char* triggerClassName, const char* cent,
152 const char* what, const char* histoname);
154 TProfile* Prof(const char* eventSelection, const char* histoname);
155 TProfile* Prof(const char* eventSelection, const char* triggerClassName, const char* histoname);
156 TProfile* Prof(const char* eventSelection, const char* triggerClassName, const char* cent, const char* histoname);
157 TProfile* Prof(const char* eventSelection, const char* triggerClassName, const char* cent,
158 const char* what, const char* histoname);
160 TProfile* MCProf(const char* eventSelection, const char* histoname);
161 TProfile* MCProf(const char* eventSelection, const char* triggerClassName, const char* histoname);
162 TProfile* MCProf(const char* eventSelection, const char* triggerClassName, const char* cent, const char* histoname);
163 TProfile* MCProf(const char* eventSelection, const char* triggerClassName, const char* cent,
164 const char* what, const char* histoname);
166 Int_t GetNbins(Double_t xmin, Double_t xmax, Double_t xstep);
168 AliCounterCollection* CounterCollection() const { return fEventCounters; }
169 AliMergeableCollection* HistogramCollection() const { return fHistogramCollection; }
170 const AliAnalysisMuMuBinning* Binning() const { return fBinning; }
171 const AliAnalysisMuMuCutRegistry* CutRegistry() const { return fCutRegistry; }
175 /// not implemented on purpose
176 AliAnalysisMuMuBase& operator=(const AliAnalysisMuMuBase& rhs);
177 /// not implemented on purpose
178 AliAnalysisMuMuBase(const AliAnalysisMuMuBase& rhs);
180 AliCounterCollection* fEventCounters; //! event counters
181 AliMergeableCollection* fHistogramCollection; //! collection of histograms
182 const AliAnalysisMuMuBinning* fBinning; //! binning for particles
183 const AliAnalysisMuMuCutRegistry* fCutRegistry; //! registry of cut combinations
184 AliVEvent* fEvent; //! current event
185 AliMCEvent* fMCEvent; //! current MC event
186 TList* fHistogramToDisable; // list of regexp of histo name to disable
187 Bool_t fHasMC; // whether or not we're dealing with MC data
189 ClassDef(AliAnalysisMuMuBase,1) // base class for a companion class to AliAnalysisMuMu