]>
Commit | Line | Data |
---|---|---|
2f331ac9 | 1 | #ifndef ALIANALYSISTASKMUMU_H |
2 | #define ALIANALYSISTASKMUMU_H | |
3 | ||
4 | // | |
5 | // AliAnalysisTaskMuMu : base class for mu pairs analysis | |
6 | // Contains common things for ESD-based and AOD-based analysis | |
7 | // | |
8 | // author: L. Aphecetche (Subatech) | |
9 | // | |
10 | ||
11 | #ifndef ALIANALYSISTASKSE_H | |
12 | # include "AliAnalysisTaskSE.h" | |
13 | #endif | |
14 | ||
15 | #include <set> | |
16 | #include <vector> | |
17 | ||
18 | #ifndef ROOT_TArrayI | |
19 | # include "TArrayI.h" | |
20 | #endif | |
21 | ||
1afce1ce | 22 | #ifndef ROOT_TMath |
23 | # include "TMath.h" | |
24 | #endif | |
25 | ||
d440e2c5 | 26 | class AliAnalysisMuMuBinning; |
2f331ac9 | 27 | class AliCounterCollection; |
d440e2c5 | 28 | class AliMergeableCollection; |
2f331ac9 | 29 | class AliMuonTrackCuts; |
d440e2c5 | 30 | class AliMuonEventCuts; |
2f331ac9 | 31 | class AliVParticle; |
d440e2c5 | 32 | class TArrayF; |
33 | class TList; | |
34 | class TObjArray; | |
2f331ac9 | 35 | |
36 | class AliAnalysisTaskMuMu : public AliAnalysisTaskSE | |
37 | { | |
38 | public: | |
39 | ||
40 | enum ETrackCut | |
41 | { | |
42 | kAll=BIT(0), | |
43 | kPt1=BIT(1), | |
44 | kRabs=BIT(2), | |
45 | kMatched=BIT(3), | |
46 | kMatchedLow=BIT(4), | |
47 | kMatchedHigh=BIT(5), | |
48 | kEta=BIT(6), | |
49 | kChi2=BIT(7), | |
50 | kDCA=BIT(8), | |
51 | kPairRapidity=BIT(9), | |
52 | kBelowPt=BIT(10), | |
53 | kPt1dot2=BIT(11), | |
54 | kPt1dot5=BIT(12), | |
55 | kPt2=BIT(13), | |
56 | kDeg23=BIT(14), | |
57 | kDeg310=BIT(15), | |
58 | kP10=BIT(16), | |
59 | kChi2MatchTrigger=BIT(17) | |
60 | }; | |
61 | ||
62 | enum EEventCut | |
63 | { | |
64 | kEventAll=BIT(0), | |
65 | kEventPS=BIT(1), | |
66 | kEventTVX=BIT(2), | |
67 | kEventV0AND=BIT(3), | |
68 | kEventV0UP=BIT(4), | |
69 | kEventZSPD=BIT(5), | |
70 | kEventZ7=BIT(7), | |
d440e2c5 | 71 | kEventNOTZEROPILEUP=BIT(8), |
72 | kEventOFFLINEMUL1=BIT(9), | |
2f331ac9 | 73 | kEventZ10=BIT(10), |
d440e2c5 | 74 | kEventOFFLINEMUL2=BIT(11), |
91dbbc20 | 75 | kEventSD2=BIT(16), |
61bf1693 | 76 | kEventMSL=BIT(17), |
77 | kEventREJECTED=BIT(18), | |
78 | kEventPSTS=BIT(19) | |
2f331ac9 | 79 | }; |
80 | ||
81 | AliAnalysisTaskMuMu(); | |
82 | AliAnalysisTaskMuMu(Bool_t fromESD, TList* triggerClassesToConsider, const char* beamYear=0x0, TArrayF* centralities=0x0); | |
83 | AliAnalysisTaskMuMu(Bool_t fromESD, const char* beamYear, TArrayF* centralities=0x0); | |
84 | virtual ~AliAnalysisTaskMuMu(); | |
1afce1ce | 85 | |
d440e2c5 | 86 | void AddBin(const char* particle, const char* type, |
87 | Double_t xmin, Double_t xmax, | |
1afce1ce | 88 | Double_t ymin, |
89 | Double_t ymax, | |
90 | const char* flavour=""); | |
d440e2c5 | 91 | |
1afce1ce | 92 | void AddBin(const char* particle, const char* type, |
93 | Double_t xmin, Double_t xmax, | |
94 | const char* flavour="") { AddBin(particle,type,xmin,xmax,TMath::Limits<Double_t>::Max(),TMath::Limits<Double_t>::Max(),flavour); } | |
95 | ||
96 | void CreateMesh(const char* particle, const char* type1, const char* type2, const char* flavour="", Bool_t remove12=kFALSE); | |
d440e2c5 | 97 | |
91dbbc20 | 98 | virtual void AddEventCut(const char* cutName, UInt_t mask); |
2f331ac9 | 99 | |
91dbbc20 | 100 | virtual void AddPairCut(const char* cutName, UInt_t maskForOneOrBothTrack, UInt_t maskForTrackPair=0); |
2f331ac9 | 101 | |
91dbbc20 | 102 | virtual void AddSingleCut(const char* cutName, UInt_t mask); |
2f331ac9 | 103 | |
d440e2c5 | 104 | virtual void DisableHistograms(const char* pattern="*"); |
2f331ac9 | 105 | |
d440e2c5 | 106 | AliMuonEventCuts* EventCuts() const; |
2f331ac9 | 107 | |
91dbbc20 | 108 | virtual void FinishTaskOutput(); |
2f331ac9 | 109 | |
91dbbc20 | 110 | Bool_t IsPP() const; |
2f331ac9 | 111 | |
d440e2c5 | 112 | Bool_t IsHistogrammingDisabled() const; |
113 | ||
114 | virtual Bool_t IsHistogramDisabled(const char* hname) const; | |
2f331ac9 | 115 | |
91dbbc20 | 116 | virtual void NotifyRun(); |
2f331ac9 | 117 | |
91dbbc20 | 118 | virtual void Print(Option_t* opt="") const; |
2f331ac9 | 119 | |
91dbbc20 | 120 | virtual void ShouldSeparatePlusAndMinus(Bool_t value) { fShouldSeparatePlusAndMinus = value; } |
2f331ac9 | 121 | |
91dbbc20 | 122 | virtual Bool_t ShouldSeparatePlusAndMinus() const { return fShouldSeparatePlusAndMinus; } |
123 | ||
124 | virtual void Terminate(Option_t *); | |
125 | ||
126 | void UseBackgroundTriggers(Bool_t value=kTRUE) { fUseBackgroundTriggers = value; } | |
127 | ||
128 | void UserCreateOutputObjects(); | |
129 | ||
130 | virtual void UserExec(Option_t* opt); | |
2f331ac9 | 131 | |
61bf1693 | 132 | AliMuonTrackCuts* MuonTrackCuts(); |
133 | ||
134 | void SetMuonTrackCuts(const AliMuonTrackCuts& trackCuts); | |
135 | ||
2f331ac9 | 136 | class PairCut : public TObject { |
137 | public: | |
138 | PairCut(const char* name="", UInt_t maskForOneOrBothTrack=0, UInt_t maskForTrackPair=0) | |
139 | : TObject(), fName("p"),fMaskForOneOrBothTrack(maskForOneOrBothTrack),fMaskForTrackPair(maskForTrackPair) | |
140 | { | |
141 | fName += name; | |
142 | } | |
143 | const char* GetName() const { return fName.Data(); } | |
144 | UInt_t MaskForOneOrBothTrack() const { return fMaskForOneOrBothTrack; } | |
145 | UInt_t MaskForTrackPair() const { return fMaskForTrackPair; } | |
146 | void Print(Option_t* opt="") const; | |
147 | ||
148 | private: | |
149 | TString fName; // name of the cut | |
150 | UInt_t fMaskForOneOrBothTrack; // mask for the cut that at least of the two tracks should match | |
151 | UInt_t fMaskForTrackPair; // mask for the cut both tracks should match | |
152 | ||
153 | ClassDef(AliAnalysisTaskMuMu::PairCut,1); // a simple wrapper for two masks | |
154 | }; | |
155 | ||
156 | ||
157 | private: | |
158 | ||
d440e2c5 | 159 | virtual void FillHistos(const char* physics, const char* triggerClassName, const char* centrality); |
2f331ac9 | 160 | |
161 | void FillHistosForTrack(const char* physics, const char* triggerClassName, const char* centrality, const AliVParticle& track, Int_t trackIndex); | |
162 | ||
d440e2c5 | 163 | void FillHistogramCollection(const char* physics, const char* triggerClassName); |
164 | ||
165 | void FillEventHistos(const char* physics, const char* triggerClassName, | |
166 | const char* centrality); | |
167 | ||
168 | void Fill(const char* eventtype, TObjString* tname, const char* centrality, float fcent); | |
169 | ||
170 | void FillMC(); | |
2f331ac9 | 171 | |
172 | void AssertHistogramCollection(const char* physics, const char* triggerClassName); | |
173 | ||
174 | void BeautifyHistos(); | |
175 | ||
d440e2c5 | 176 | void CreateMinvHistograms(const char* physics, const char* triggerClassName); |
177 | ||
2f331ac9 | 178 | void CreateHisto(TObjArray* array, |
179 | const char* physics, | |
180 | const char* triggerClassName, | |
181 | const char* hname, const char* htitle, | |
182 | Int_t nbinsx, Double_t xmin, Double_t xmax, | |
183 | Int_t nbinsy, Double_t ymin, Double_t ymax) const; | |
184 | ||
185 | void CreateEventHisto(const char* physics, | |
186 | const char* triggerClassName, | |
187 | const char* hname, const char* htitle, | |
188 | Int_t nbinsx, Double_t xmin, Double_t xmax, | |
189 | Int_t nbinsy=0, Double_t ymin=0.0, Double_t ymax=0.0) const; | |
190 | ||
191 | void CreateSingleHisto(const char* physics, | |
192 | const char* triggerClassName, | |
193 | const char* hname, const char* htitle, | |
194 | Int_t nbinsx, Double_t xmin, Double_t xmax, | |
195 | Int_t nbinsy=0, Double_t ymin=0.0, Double_t ymax=0.0, | |
196 | Bool_t separatePlusAndMinus=kFALSE) const; | |
197 | ||
198 | void CreatePairHisto(const char* physics, | |
199 | const char* triggerClassName, | |
200 | const char* hname, const char* htitle, | |
201 | Int_t nbinsx, Double_t xmin, Double_t xmax, | |
202 | Int_t nbinsy=0, Double_t ymin=0.0, Double_t ymax=0.0) const; | |
203 | ||
204 | void DefineCentralityClasses(TArrayF* centralities); | |
205 | ||
91dbbc20 | 206 | UInt_t GetTriggerInputBitMaskFromInputName(const char* inputName) const; |
207 | ||
2f331ac9 | 208 | TH1* Histo(const char* physics, const char* histoname); |
209 | ||
210 | TH1* Histo(const char* physics, const char* triggerClassName, const char* histoname); | |
211 | ||
212 | TH1* Histo(const char* physics, const char* triggerClassName, const char* what, const char* histoname); | |
213 | ||
214 | TH1* Histo(const char* physics, const char* triggerClassName, const char* cent, const char* what, const char* histoname); | |
215 | ||
216 | Double_t MuonMass2() const; | |
217 | ||
218 | const char* DefaultCentralityName() const; | |
219 | ||
220 | const char* CentralityName(Double_t centrality) const; | |
221 | ||
d440e2c5 | 222 | Bool_t HasMC() const { return fHasMC; } |
2f331ac9 | 223 | |
224 | void ComputeTrackMask(const AliVParticle& track, Int_t trackIndex); | |
225 | ||
d440e2c5 | 226 | UInt_t GetEventMask() const; |
2f331ac9 | 227 | |
228 | void GetPairMask(const AliVParticle& t1, const AliVParticle& t2, | |
229 | Int_t trackIndex1, Int_t trackIndex2, | |
230 | UInt_t& mask1, UInt_t& mask2, | |
231 | UInt_t& mask12) const; | |
232 | ||
233 | UInt_t GetTrackMask(Int_t trackIndex) const; | |
234 | ||
235 | Double_t GetTrackTheta(const AliVParticle& particle) const; | |
236 | ||
237 | Bool_t PairRapidityCut(const AliVParticle& t1, const AliVParticle& t2) const; | |
238 | ||
239 | /* methods prefixed with EA should really not exist at all. They are there | |
240 | only because the some of our base interfaces are shamelessly incomplete or | |
241 | inadequate... | |
242 | */ | |
243 | ||
d440e2c5 | 244 | void EAComputeTrackMasks(); |
2f331ac9 | 245 | |
d440e2c5 | 246 | Int_t EAGetNumberOfMuonTracks() const; |
2f331ac9 | 247 | |
61bf1693 | 248 | Int_t EAGetNumberOfSelectMuonTracks() const; |
249 | ||
2f331ac9 | 250 | Double_t EAGetTrackDCA(const AliVParticle& particle) const; |
251 | ||
d440e2c5 | 252 | Bool_t EAGetTZEROFlags(Bool_t& backgroundFlag, Bool_t& pileupFlag, Bool_t& satelliteFlag) const; |
2f331ac9 | 253 | |
254 | Bool_t AtLeastOneMuonTrigger(const TString& firedTriggerClasses) const; | |
255 | ||
256 | Bool_t AtLeastOneEmcalTrigger(const TString& firedTriggerClasses) const; | |
257 | ||
258 | Bool_t AtLeastOneMBTrigger(const TString& firedTriggerClasses) const; | |
259 | ||
260 | Bool_t TriggerSBACECondition(const TString& triggerName) const; | |
261 | ||
d440e2c5 | 262 | void DefineDefaultBinning(); |
263 | ||
264 | AliVEvent* Event() const; | |
265 | ||
2f331ac9 | 266 | private: |
267 | ||
d440e2c5 | 268 | AliMergeableCollection* fHistogramCollection; //! collection of histograms |
2f331ac9 | 269 | AliCounterCollection* fEventCounters; //! event counters |
270 | ||
271 | AliMuonTrackCuts* fMuonTrackCuts; //! common cuts for muon tracks (from Diego) | |
272 | TArrayI fPrecomputedTrackMasks; //! track masks | |
273 | ||
274 | Bool_t fIsFromESD; // whether we read from ESD or AOD | |
2f331ac9 | 275 | Bool_t fShouldSeparatePlusAndMinus; // whether or not to histogram mu+ and mu- separately |
2f331ac9 | 276 | TString fBeamYear; // beam and year |
d440e2c5 | 277 | |
2f331ac9 | 278 | TObjArray* fSingleTrackCutNames; // cut on single tracks (array of TObjString) |
279 | TObjArray* fPairTrackCutNames; // cut on track pairs (array of TObjString) | |
280 | TObjArray* fCentralityNames; // names to create histograms | |
281 | TObjArray* fEventCutNames; // cut at event level (array of TObjString) | |
282 | ||
283 | Bool_t fUseBackgroundTriggers; // whether or not we should use the ACE triggers | |
91dbbc20 | 284 | |
285 | std::map<std::string,int> fTriggerInputBitMap; // map of L0 input name to bit | |
286 | ||
d440e2c5 | 287 | AliAnalysisMuMuBinning* fBinning; // binning for particles |
288 | ||
289 | TList* fHistogramToDisable; // list of regexp of histo name to disable | |
290 | ||
291 | TObjArray* fBinArray; //! cache for the bins | |
292 | Bool_t fHasMC; //! current event has MC information | |
293 | ||
294 | mutable AliMuonEventCuts* fEventCuts; // common cuts for muon events (from Diego) | |
295 | ||
2f331ac9 | 296 | AliAnalysisTaskMuMu(const AliAnalysisTaskMuMu&); // not implemented (on purpose) |
297 | AliAnalysisTaskMuMu& operator=(const AliAnalysisTaskMuMu&); // not implemented (on purpose) | |
298 | ||
d440e2c5 | 299 | ClassDef(AliAnalysisTaskMuMu,24) // a class to analyse muon pairs (and single also ;-) ) |
2f331ac9 | 300 | }; |
301 | ||
302 | #endif | |
303 |