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)
16 class AliCounterCollection;
17 class AliAnalysisMuMuBinning;
18 class AliMergeableCollection;
23 class AliInputEventHandler;
24 class AliAnalysisMuMuCutRegistry;
26 class AliAnalysisMuMuBase : public TObject
30 AliAnalysisMuMuBase();
31 virtual ~AliAnalysisMuMuBase() {}
33 /** Define the histograms needed for the path starting at eventSelection/triggerClassName/centrality.
34 * This method has to ensure the histogram creation is performed only once !
36 virtual void DefineHistogramCollection(const char* eventSelection,
37 const char* triggerClassName,
38 const char* centrality) = 0;
40 /** Fill histograms for one event */
41 virtual void FillHistosForEvent(const char* /*eventSelection*/,const char* /*triggerClassName*/,const char* /*centrality*/) {}
43 /** Fill histograms for one MC event */
44 virtual void FillHistosForMCEvent(const char* /*eventSelection*/,const char* /*triggerClassName*/,const char* /*centrality*/) {}
46 /** Fill histograms for one track */
47 virtual void FillHistosForTrack(const char* /*eventSelection*/,const char* /*triggerClassName*/,const char* /*centrality*/,
48 const char* /*trackCutName*/,
49 const AliVParticle& /*part*/) {}
51 /** Fill histograms for one track pair */
52 virtual void FillHistosForPair(const char* /*eventSelection*/,const char* /*triggerClassName*/,const char* /*centrality*/,
53 const char* /*pairCutName*/,
54 const AliVParticle& /*part1*/,
55 const AliVParticle& /*part2*/) {}
57 virtual void Init(AliCounterCollection& cc,
58 AliMergeableCollection& hc,
59 const AliAnalysisMuMuBinning& binning,
60 const AliAnalysisMuMuCutRegistry& cutRegister);
62 virtual void SetEvent(AliVEvent* event, AliMCEvent* mcEvent=0x0);
64 virtual Bool_t IsHistogramDisabled(const char* hname) const;
66 virtual Bool_t IsHistogrammingDisabled() const;
68 virtual void DisableHistograms(const char* pattern="*");
70 AliVEvent* Event() const { return fEvent; }
72 AliMCEvent* MCEvent() const { return fMCEvent; }
74 /// Called at each new run
75 void SetRun(const AliInputEventHandler* /*eventHandler*/) {}
77 void Terminate(Option_t* /*opt*/="") {}
81 kHistoForMCInput = (1<<0),
82 kHistoForData = (1<<1)
85 void SetMC() { fHasMC = kTRUE; }
87 Bool_t HasMC() const { return fHasMC; }
89 Bool_t AlwaysTrue(const AliVEvent& /*event*/) const { return kTRUE; }
90 Bool_t AlwaysTrue(const AliVParticle& /*particle*/) const { return kTRUE; }
91 Bool_t AlwaysTrue(const AliVParticle& /*particle*/, const AliVParticle& /*particle*/) const { return kTRUE; }
92 void NameOfAlwaysTrue(TString& name) const { name = "ALL"; }
94 Bool_t AlwaysFalse(const AliVEvent& /*event*/) const { return kFALSE; }
95 Bool_t AlwaysFalse(const AliVParticle& /*particle*/) const { return kFALSE; }
96 Bool_t AlwaysFalse(const AliVParticle& /*particle*/, const AliVParticle& /*particle*/) const { return kFALSE; }
97 void NameOfAlwaysFalse(TString& name) const { name = "NONE"; }
101 void CreateHistos(const TObjArray& paths,
102 const char* hname, const char* htitle,
103 Int_t nbinsx, Double_t xmin, Double_t xmax,
104 Int_t nbinsy=-1, Double_t ymin=0.0, Double_t ymax=0.0) const;
106 void CreateEventHistos(UInt_t dataType,
108 const char* hname, const char* htitle,
109 Int_t nbinsx, Double_t xmin, Double_t xmax,
110 Int_t nbinsy=-1, Double_t ymin=0.0, Double_t ymax=0.0) const;
112 void CreateEventHistos(UInt_t dataType,
113 const char* eventSelection,
114 const char* triggerClassName,
115 const char* centrality,
116 const char* hname, const char* htitle,
117 Int_t nbinsx, Double_t xmin, Double_t xmax,
118 Int_t nbinsy=-1, Double_t ymin=0.0, Double_t ymax=0.0) const;
121 void CreateTrackHistos(const char* eventSelection,
122 const char* triggerClassName,
123 const char* centrality,
124 const char* hname, const char* htitle,
125 Int_t nbinsx, Double_t xmin, Double_t xmax,
126 Int_t nbinsy=-1, Double_t ymin=0.0, Double_t ymax=0.0) const;
128 void CreatePairHistos(const char* eventSelection,
129 const char* triggerClassName,
130 const char* centrality,
131 const char* hname, const char* htitle,
132 Int_t nbinsx, Double_t xmin, Double_t xmax,
133 Int_t nbinsy=-1, Double_t ymin=0.0, Double_t ymax=0.0) const;
135 TH1* Histo(const char* eventSelection, const char* histoname);
136 TH1* Histo(const char* eventSelection, const char* triggerClassName, const char* histoname);
137 TH1* Histo(const char* eventSelection, const char* triggerClassName, const char* cent, const char* histoname);
138 TH1* Histo(const char* eventSelection, const char* triggerClassName, const char* cent,
139 const char* what, const char* histoname);
141 TH1* MCHisto(const char* eventSelection, const char* histoname);
142 TH1* MCHisto(const char* eventSelection, const char* triggerClassName, const char* histoname);
143 TH1* MCHisto(const char* eventSelection, const char* triggerClassName, const char* cent, const char* histoname);
144 TH1* MCHisto(const char* eventSelection, const char* triggerClassName, const char* cent,
145 const char* what, const char* histoname);
147 Int_t GetNbins(Double_t xmin, Double_t xmax, Double_t xstep);
149 AliCounterCollection* CounterCollection() const { return fEventCounters; }
150 AliMergeableCollection* HistogramCollection() const { return fHistogramCollection; }
151 const AliAnalysisMuMuBinning* Binning() const { return fBinning; }
152 const AliAnalysisMuMuCutRegistry* CutRegistry() const { return fCutRegistry; }
156 AliCounterCollection* fEventCounters; //! event counters
157 AliMergeableCollection* fHistogramCollection; //! collection of histograms
158 const AliAnalysisMuMuBinning* fBinning; //! binning for particles
159 const AliAnalysisMuMuCutRegistry* fCutRegistry; //! registry of cut combinations
160 AliVEvent* fEvent; //! current event
161 AliMCEvent* fMCEvent; //! current MC event
162 TList* fHistogramToDisable; // list of regexp of histo name to disable
163 Bool_t fHasMC; // whether or not we're dealing with MC data
165 ClassDef(AliAnalysisMuMuBase,1) // base class for a companion class to AliAnalysisMuMu