]>
Commit | Line | Data |
---|---|---|
07c2615a | 1 | #include "AliLog.h" |
2 | #include "TH1D.h" | |
3 | #include "TH2D.h" | |
4 | #include "TTree.h" | |
5 | #include "TAxis.h" | |
6 | #include "AliAODEvent.h" | |
7 | #include "AliAODTrack.h" | |
8 | #include "TMath.h" | |
9 | #include "TString.h" | |
10 | ||
11 | #include "AliAnalysisTaskMuonHadronCorrelations.h" | |
6de71f1d | 12 | #include "AliAnalysisManager.h" |
13 | #include "AliInputEventHandler.h" | |
14 | #include "AliEventPoolManager.h" | |
07c2615a | 15 | |
16 | ClassImp(AliAnalysisTaskMuonHadronCorrelations) | |
17 | ||
18 | //==================================================================================================================================================== | |
19 | ||
20 | AliAnalysisTaskMuonHadronCorrelations::AliAnalysisTaskMuonHadronCorrelations() : | |
21 | AliAnalysisTaskSE(), | |
22 | fAOD(0x0), | |
6de71f1d | 23 | fPoolMgr(0x0), |
07c2615a | 24 | fTrackCB(0x0), |
25 | fTrackMA(0x0), | |
26 | fFilterBitCentralBarrel(0), | |
27 | fMaxEtaCentralBarrel(1.0), | |
29d66ae8 | 28 | fMaxChi2Muon(9999999999.), |
07c2615a | 29 | fMinRAbsMuon(0), |
29d66ae8 | 30 | fMaxRAbsMuon(9999999999.), |
07c2615a | 31 | fTriggerMatchLevelMuon(0), |
07c2615a | 32 | fNbinsCent(1), |
33 | fNbinsPt(1), | |
34 | fCentAxis(0x0), | |
07c2615a | 35 | fPtAxis(0x0), |
b897e6f8 | 36 | fEtaAxis(0x0), |
07c2615a | 37 | fHistV0Multiplicity(0x0), |
38 | fHistITSMultiplicity(0x0), | |
39 | fHistCentrality(0x0), | |
9c92a0e1 | 40 | fHistEvStat(0x0), |
07c2615a | 41 | fCentMethod(0), |
07c2615a | 42 | fOutputList(0x0) |
43 | { | |
44 | ||
45 | // Default constructor | |
46 | ||
47 | for (Int_t iCent=0; iCent<fNMaxBinsCentrality; iCent++) { | |
48 | for (Int_t iPtBinCB=0; iPtBinCB<fNMaxBinsPt; iPtBinCB++) { | |
49 | for (Int_t iPtBinMA=0; iPtBinMA<fNMaxBinsPt; iPtBinMA++) { | |
50 | fHistDeltaPhi[iCent][iPtBinCB][iPtBinMA] = NULL; | |
51 | fHistDeltaPhiMix[iCent][iPtBinCB][iPtBinMA] = NULL; | |
b897e6f8 | 52 | fHistEtaDeltaPhi[iCent][iPtBinCB][iPtBinMA] = NULL; |
53 | fHistEtaDeltaPhiMix[iCent][iPtBinCB][iPtBinMA] = NULL; | |
07c2615a | 54 | } |
55 | } | |
56 | fHistNTracksCB_vs_NTracksMA[iCent] = NULL; | |
57a9cc15 | 57 | fHistNTracksCB_vs_NTracksMAmixed[iCent] = NULL; |
ae1016ae | 58 | fHistTracksEtaMAvsEtaCB[iCent] = NULL; |
59 | fHistTracksEtaMAvsEtaCBmixed[iCent] = NULL; | |
9c92a0e1 | 60 | fHistSingleMuonsPt[iCent] = NULL; |
61 | fHistSingleMuonsPtmixed[iCent] = NULL; | |
b897e6f8 | 62 | fHistSingleMuonsEtaPt[iCent] = NULL; |
63 | fHistSingleMuonsEtaPtmixed[iCent] = NULL; | |
57a9cc15 | 64 | fHistSingleMuonsEtaVsPt[iCent] = NULL; |
65 | fHistSingleMuonsEtaVsRAbs[iCent] = NULL; | |
07c2615a | 66 | } |
67 | ||
68 | } | |
69 | ||
70 | ||
71 | //==================================================================================================================================================== | |
72 | ||
73 | AliAnalysisTaskMuonHadronCorrelations::AliAnalysisTaskMuonHadronCorrelations(const char *name) : | |
74 | AliAnalysisTaskSE(name), | |
75 | fAOD(0x0), | |
6de71f1d | 76 | fPoolMgr(0x0), |
07c2615a | 77 | fTrackCB(0x0), |
78 | fTrackMA(0x0), | |
79 | fFilterBitCentralBarrel(0), | |
80 | fMaxEtaCentralBarrel(1.0), | |
29d66ae8 | 81 | fMaxChi2Muon(9999999999.), |
07c2615a | 82 | fMinRAbsMuon(0), |
29d66ae8 | 83 | fMaxRAbsMuon(9999999999.), |
07c2615a | 84 | fTriggerMatchLevelMuon(0), |
07c2615a | 85 | fNbinsCent(1), |
86 | fNbinsPt(1), | |
87 | fCentAxis(0x0), | |
07c2615a | 88 | fPtAxis(0x0), |
b897e6f8 | 89 | fEtaAxis(0x0), |
07c2615a | 90 | fHistV0Multiplicity(0x0), |
91 | fHistITSMultiplicity(0x0), | |
92 | fHistCentrality(0x0), | |
9c92a0e1 | 93 | fHistEvStat(0x0), |
07c2615a | 94 | fCentMethod(0), |
07c2615a | 95 | fOutputList(0x0) |
96 | { | |
97 | ||
98 | // Constructor | |
99 | ||
100 | for (Int_t iCent=0; iCent<fNMaxBinsCentrality; iCent++) { | |
101 | for (Int_t iPtBinCB=0; iPtBinCB<fNMaxBinsPt; iPtBinCB++) { | |
102 | for (Int_t iPtBinMA=0; iPtBinMA<fNMaxBinsPt; iPtBinMA++) { | |
103 | fHistDeltaPhi[iCent][iPtBinCB][iPtBinMA] = NULL; | |
104 | fHistDeltaPhiMix[iCent][iPtBinCB][iPtBinMA] = NULL; | |
b897e6f8 | 105 | fHistEtaDeltaPhi[iCent][iPtBinCB][iPtBinMA] = NULL; |
106 | fHistEtaDeltaPhiMix[iCent][iPtBinCB][iPtBinMA] = NULL; | |
07c2615a | 107 | } |
108 | } | |
109 | fHistNTracksCB_vs_NTracksMA[iCent] = NULL; | |
57a9cc15 | 110 | fHistNTracksCB_vs_NTracksMAmixed[iCent] = NULL; |
ae1016ae | 111 | fHistTracksEtaMAvsEtaCB[iCent] = NULL; |
112 | fHistTracksEtaMAvsEtaCBmixed[iCent] = NULL; | |
9c92a0e1 | 113 | fHistSingleMuonsPt[iCent] = NULL; |
114 | fHistSingleMuonsPtmixed[iCent] = NULL; | |
b897e6f8 | 115 | fHistSingleMuonsEtaPt[iCent] = NULL; |
116 | fHistSingleMuonsEtaPtmixed[iCent] = NULL; | |
57a9cc15 | 117 | fHistSingleMuonsEtaVsPt[iCent] = NULL; |
118 | fHistSingleMuonsEtaVsRAbs[iCent] = NULL; | |
07c2615a | 119 | } |
120 | ||
121 | // Define input and output slots here | |
122 | DefineOutput(1, TList::Class()); | |
123 | ||
124 | } | |
125 | ||
126 | //==================================================================================================================================================== | |
127 | ||
128 | AliAnalysisTaskMuonHadronCorrelations::~AliAnalysisTaskMuonHadronCorrelations() { | |
129 | ||
07c2615a | 130 | delete fCentAxis; |
131 | delete fPtAxis; | |
b897e6f8 | 132 | delete fEtaAxis; |
07c2615a | 133 | |
6de71f1d | 134 | if (fOutputList && !AliAnalysisManager::GetAnalysisManager()->IsProofMode()) |
135 | delete fOutputList; | |
07c2615a | 136 | } |
137 | ||
138 | //==================================================================================================================================================== | |
139 | ||
140 | void AliAnalysisTaskMuonHadronCorrelations::UserCreateOutputObjects() { | |
141 | ||
142 | fOutputList = new TList(); | |
143 | fOutputList->SetOwner(kTRUE); | |
144 | ||
145 | for (Int_t iCent=0; iCent<fNbinsCent; iCent++) { | |
146 | for (Int_t iPtBinCB=0; iPtBinCB<fNbinsPt; iPtBinCB++) { | |
147 | for (Int_t iPtBinMA=0; iPtBinMA<fNbinsPt; iPtBinMA++) { | |
148 | ||
149 | fHistDeltaPhi[iCent][iPtBinCB][iPtBinMA] = new TH1D(Form("fHistDeltaPhi_Cent%02d_PtBin%02d_%02d",iCent,iPtBinCB,iPtBinMA), | |
150 | Form("%d-%d %%, %3.1f<p_{T}^{TPC}<%3.1f, %3.1f<p_{T}^{Muon}<%3.1f", | |
151 | Int_t(fCentAxis->GetBinLowEdge(iCent+1)), | |
152 | Int_t(fCentAxis->GetBinUpEdge(iCent+1)), | |
153 | fPtAxis->GetBinLowEdge(iPtBinCB+1), | |
154 | fPtAxis->GetBinUpEdge(iPtBinCB+1), | |
155 | fPtAxis->GetBinLowEdge(iPtBinMA+1), | |
156 | fPtAxis->GetBinUpEdge(iPtBinMA+1)), | |
157 | 100, -0.5*TMath::RadToDeg()*TMath::Pi(), 1.5*TMath::RadToDeg()*TMath::Pi()); | |
158 | ||
159 | fHistDeltaPhiMix[iCent][iPtBinCB][iPtBinMA] = new TH1D(Form("fHistDeltaPhiMix_Cent%02d_PtBin%02d_%02d",iCent,iPtBinCB,iPtBinMA), | |
160 | Form("%d-%d %%, %3.1f<p_{T}^{TPC}<%3.1f, %3.1f<p_{T}^{Muon}<%3.1f MIXED", | |
161 | Int_t(fCentAxis->GetBinLowEdge(iCent+1)), | |
162 | Int_t(fCentAxis->GetBinUpEdge(iCent+1)), | |
163 | fPtAxis->GetBinLowEdge(iPtBinCB+1), | |
164 | fPtAxis->GetBinUpEdge(iPtBinCB+1), | |
165 | fPtAxis->GetBinLowEdge(iPtBinMA+1), | |
166 | fPtAxis->GetBinUpEdge(iPtBinMA+1)), | |
167 | 100, -0.5*TMath::RadToDeg()*TMath::Pi(), 1.5*TMath::RadToDeg()*TMath::Pi()); | |
168 | ||
169 | fHistDeltaPhi[iCent][iPtBinCB][iPtBinMA] -> SetXTitle("#Delta#varphi [degrees]"); | |
170 | fHistDeltaPhiMix[iCent][iPtBinCB][iPtBinMA] -> SetXTitle("#Delta#varphi [degrees]"); | |
171 | ||
172 | fHistDeltaPhi[iCent][iPtBinCB][iPtBinMA] -> Sumw2(); | |
173 | fHistDeltaPhiMix[iCent][iPtBinCB][iPtBinMA] -> Sumw2(); | |
174 | ||
175 | fOutputList -> Add(fHistDeltaPhi[iCent][iPtBinCB][iPtBinMA]); | |
176 | fOutputList -> Add(fHistDeltaPhiMix[iCent][iPtBinCB][iPtBinMA]); | |
177 | ||
b897e6f8 | 178 | fHistEtaDeltaPhi[iCent][iPtBinCB][iPtBinMA] = new TH2D(Form("fHistEtaDeltaPhi_Cent%02d_PtBin%02d_%02d",iCent,iPtBinCB,iPtBinMA), |
179 | Form("%d-%d %%, %3.1f<p_{T}^{TPC}<%3.1f, %3.1f<p_{T}^{Muon}<%3.1f", | |
180 | Int_t(fCentAxis->GetBinLowEdge(iCent+1)), | |
181 | Int_t(fCentAxis->GetBinUpEdge(iCent+1)), | |
182 | fPtAxis->GetBinLowEdge(iPtBinCB+1), | |
183 | fPtAxis->GetBinUpEdge(iPtBinCB+1), | |
184 | fPtAxis->GetBinLowEdge(iPtBinMA+1), | |
185 | fPtAxis->GetBinUpEdge(iPtBinMA+1)), | |
186 | 100, -0.5*TMath::RadToDeg()*TMath::Pi(), 1.5*TMath::RadToDeg()*TMath::Pi(), | |
187 | fEtaAxis->GetNbins(),(Double_t*)fEtaAxis->GetXbins()->GetArray()); | |
188 | ||
189 | fHistEtaDeltaPhiMix[iCent][iPtBinCB][iPtBinMA] = new TH2D(Form("fHistEtaDeltaPhiMix_Cent%02d_PtBin%02d_%02d",iCent,iPtBinCB,iPtBinMA), | |
190 | Form("%d-%d %%, %3.1f<p_{T}^{TPC}<%3.1f, %3.1f<p_{T}^{Muon}<%3.1f MIXED", | |
191 | Int_t(fCentAxis->GetBinLowEdge(iCent+1)), | |
192 | Int_t(fCentAxis->GetBinUpEdge(iCent+1)), | |
193 | fPtAxis->GetBinLowEdge(iPtBinCB+1), | |
194 | fPtAxis->GetBinUpEdge(iPtBinCB+1), | |
195 | fPtAxis->GetBinLowEdge(iPtBinMA+1), | |
196 | fPtAxis->GetBinUpEdge(iPtBinMA+1)), | |
197 | 100, -0.5*TMath::RadToDeg()*TMath::Pi(), 1.5*TMath::RadToDeg()*TMath::Pi(), | |
198 | fEtaAxis->GetNbins(),(Double_t*)fEtaAxis->GetXbins()->GetArray()); | |
199 | ||
200 | fHistEtaDeltaPhi[iCent][iPtBinCB][iPtBinMA] -> SetXTitle("#Delta#varphi [degrees]"); | |
201 | fHistEtaDeltaPhiMix[iCent][iPtBinCB][iPtBinMA] -> SetXTitle("#Delta#varphi [degrees]"); | |
202 | fHistEtaDeltaPhi[iCent][iPtBinCB][iPtBinMA] -> SetYTitle("#eta"); | |
203 | fHistEtaDeltaPhiMix[iCent][iPtBinCB][iPtBinMA] -> SetYTitle("#eta"); | |
204 | ||
205 | fHistEtaDeltaPhi[iCent][iPtBinCB][iPtBinMA] -> Sumw2(); | |
206 | fHistEtaDeltaPhiMix[iCent][iPtBinCB][iPtBinMA] -> Sumw2(); | |
207 | ||
208 | fOutputList -> Add(fHistEtaDeltaPhi[iCent][iPtBinCB][iPtBinMA]); | |
209 | fOutputList -> Add(fHistEtaDeltaPhiMix[iCent][iPtBinCB][iPtBinMA]); | |
210 | ||
07c2615a | 211 | } |
212 | } | |
213 | ||
214 | fHistNTracksCB_vs_NTracksMA[iCent] = new TH2D(Form("fHistNTracksCB_vs_NTracksMA_Cent%02d",iCent), | |
215 | Form("%d-%d %%",Int_t(fCentAxis->GetBinLowEdge(iCent+1)),Int_t(fCentAxis->GetBinUpEdge(iCent+1))), | |
57a9cc15 | 216 | 100, 0, 500, 20, 0, 20); |
07c2615a | 217 | fHistNTracksCB_vs_NTracksMA[iCent] -> SetXTitle("N_{tracks} Central Barrel"); |
218 | fHistNTracksCB_vs_NTracksMA[iCent] -> SetYTitle("N_{tracks} Muon Arm"); | |
07c2615a | 219 | fHistNTracksCB_vs_NTracksMA[iCent] -> Sumw2(); |
220 | ||
57a9cc15 | 221 | fHistNTracksCB_vs_NTracksMAmixed[iCent] = new TH2D(Form("fHistNTracksCB_vs_NTracksMAmixed_Cent%02d",iCent), |
222 | Form("%d-%d %% MIXED",Int_t(fCentAxis->GetBinLowEdge(iCent+1)),Int_t(fCentAxis->GetBinUpEdge(iCent+1))), | |
223 | 100, 0, 500, 20, 0, 20); | |
224 | fHistNTracksCB_vs_NTracksMAmixed[iCent] -> SetXTitle("N_{tracks} Central Barrel"); | |
225 | fHistNTracksCB_vs_NTracksMAmixed[iCent] -> SetYTitle("N_{tracks} Muon Arm"); | |
226 | fHistNTracksCB_vs_NTracksMAmixed[iCent] -> Sumw2(); | |
227 | ||
ae1016ae | 228 | fHistTracksEtaMAvsEtaCB[iCent] = new TH2D(Form("fHistTracksEtaMAvsEtaCB_%02d",iCent), |
229 | "#eta muon vs #eta barrel", | |
230 | 100,-4.5,-2.,100,-1.5,1.5); | |
231 | fHistTracksEtaMAvsEtaCBmixed[iCent] = new TH2D(Form("fHistTracksEtaMAvsEtaCBmixed_%02d",iCent), | |
232 | "#eta muon vs #eta barrel", | |
233 | 100,-4.5,-2.,100,-1.5,1.5); | |
234 | ||
07c2615a | 235 | fOutputList -> Add(fHistNTracksCB_vs_NTracksMA[iCent]); |
57a9cc15 | 236 | fOutputList -> Add(fHistNTracksCB_vs_NTracksMAmixed[iCent]); |
ae1016ae | 237 | fOutputList -> Add(fHistTracksEtaMAvsEtaCB[iCent]); |
238 | fOutputList -> Add(fHistTracksEtaMAvsEtaCBmixed[iCent]); | |
57a9cc15 | 239 | |
9c92a0e1 | 240 | fHistSingleMuonsPt[iCent] = new TH1D(Form("fHistSingleMuonPt_Cent%02d",iCent), |
241 | "p_{T} for single muons", | |
242 | fNbinsPt, (Double_t*)fPtAxis->GetXbins()->GetArray()); | |
243 | fHistSingleMuonsPtmixed[iCent] = new TH1D(Form("fHistSingleMuonPtmixed_Cent%02d",iCent), | |
244 | "p_{T} for single muons", | |
245 | fNbinsPt, (Double_t*)fPtAxis->GetXbins()->GetArray()); | |
246 | fOutputList -> Add(fHistSingleMuonsPt[iCent]); | |
247 | fOutputList -> Add(fHistSingleMuonsPtmixed[iCent]); | |
248 | ||
b897e6f8 | 249 | fHistSingleMuonsEtaPt[iCent] = new TH2D(Form("fHistSingleMuonEtaPt_Cent%02d",iCent), |
250 | "#eta vs p_{T} for single muons", | |
251 | fNbinsPt, (Double_t*)fPtAxis->GetXbins()->GetArray(), | |
252 | fEtaAxis->GetNbins(),(Double_t*)fEtaAxis->GetXbins()->GetArray()); | |
253 | fHistSingleMuonsEtaPtmixed[iCent] = new TH2D(Form("fHistSingleMuonEtaPtmixed_Cent%02d",iCent), | |
254 | "#eta vs p_{T} for single muons", | |
255 | fNbinsPt, (Double_t*)fPtAxis->GetXbins()->GetArray(), | |
256 | fEtaAxis->GetNbins(),(Double_t*)fEtaAxis->GetXbins()->GetArray()); | |
257 | fOutputList -> Add(fHistSingleMuonsEtaPt[iCent]); | |
258 | fOutputList -> Add(fHistSingleMuonsEtaPtmixed[iCent]); | |
259 | ||
57a9cc15 | 260 | fHistSingleMuonsEtaVsPt[iCent] = new TH2D(Form("fHistSingleMuonsEtaVsPt_Cent%02d",iCent), |
261 | "#eta vs p_{T} for single muons", | |
9c92a0e1 | 262 | 100, -4.5, -2., 100, 0., 10.); |
57a9cc15 | 263 | fOutputList->Add(fHistSingleMuonsEtaVsPt[iCent]); |
264 | fHistSingleMuonsEtaVsRAbs[iCent] = new TH2D(Form("fHistSingleMuonsEtaVsRAbs_Cent%02d",iCent), | |
9c92a0e1 | 265 | "#eta vs R_{Abs} for single muons", |
266 | 100, -4.5, -2., 100, 0, 100); | |
57a9cc15 | 267 | fOutputList->Add(fHistSingleMuonsEtaVsRAbs[iCent]); |
07c2615a | 268 | |
269 | } | |
270 | ||
271 | fHistV0Multiplicity = new TH1D("fHistV0Multiplicity", "V0 Multiplicity", 500, 0, 1000); | |
272 | fHistV0Multiplicity -> SetXTitle("Multiplicity"); | |
273 | fHistV0Multiplicity -> Sumw2(); | |
274 | ||
275 | fHistITSMultiplicity = new TH1D("fHistITSMultiplicity", "ITS Multiplicity", 500, 0, 500); | |
276 | fHistITSMultiplicity -> SetXTitle("N_{Clusters}"); | |
277 | fHistITSMultiplicity -> Sumw2(); | |
278 | ||
279 | fHistCentrality = new TH1D("fHistCentrality", Form("%s Centrality",fCentMethod.Data()), 300, -100, 200); | |
280 | fHistCentrality -> SetXTitle("Centrality [%]"); | |
281 | fHistCentrality -> Sumw2(); | |
282 | ||
283 | fOutputList -> Add(fHistV0Multiplicity); | |
284 | fOutputList -> Add(fHistITSMultiplicity); | |
285 | fOutputList -> Add(fHistCentrality); | |
286 | ||
9c92a0e1 | 287 | fHistEvStat = new TH1D("fHistEvStat","Event cuts statistics",20,-0.5,19.5); |
288 | fHistEvStat->SetXTitle("Cut index"); | |
289 | fOutputList->Add(fHistEvStat); | |
290 | ||
6de71f1d | 291 | const Int_t kNZvtxBins = 10; |
292 | // bins for further buffers are shifted by 100 cm | |
293 | Double_t vertexBins[kNZvtxBins+1] = { -10, -8, -6, -4, -2, 0, 2, 4, 6, 8, 10 }; | |
294 | Int_t nZvtxBins = kNZvtxBins; | |
295 | Double_t* zvtxbin = vertexBins; | |
296 | ||
297 | fPoolMgr = new AliEventPoolManager(1000, 20000, fNbinsCent, (Double_t*)fCentAxis->GetXbins()->GetArray(), nZvtxBins, zvtxbin); | |
298 | ||
07c2615a | 299 | PostData(1, fOutputList); |
300 | ||
301 | } | |
302 | ||
303 | //==================================================================================================================================================== | |
304 | ||
305 | void AliAnalysisTaskMuonHadronCorrelations::UserExec(Option_t *) { | |
306 | ||
07c2615a | 307 | fAOD = dynamic_cast<AliAODEvent *>(InputEvent()); |
308 | if (!fAOD) return; | |
9c92a0e1 | 309 | |
310 | Int_t cutIndex = 0; | |
311 | fHistEvStat->Fill(cutIndex++); | |
07c2615a | 312 | // Trigger selection |
313 | if (!(IsTriggerFired())) return; | |
9c92a0e1 | 314 | fHistEvStat->Fill(cutIndex++); |
07c2615a | 315 | |
316 | fHistV0Multiplicity -> Fill(GetV0Multiplicity()); | |
317 | fHistITSMultiplicity -> Fill(GetITSMultiplicity()); | |
6de71f1d | 318 | |
07c2615a | 319 | Int_t centBin = GetCentBin(); |
320 | if (centBin<0) return; | |
9c92a0e1 | 321 | fHistEvStat->Fill(cutIndex++); |
6de71f1d | 322 | Double_t percentile = fAOD->GetCentrality()->GetCentralityPercentile(fCentMethod.Data()); |
323 | fHistCentrality->Fill(percentile); | |
324 | ||
9c92a0e1 | 325 | // Vertex selection |
326 | const AliAODVertex* trkVtx = fAOD->GetPrimaryVertex(); | |
327 | if (!trkVtx || trkVtx->GetNContributors()<=0) return; | |
328 | TString vtxTtl = trkVtx->GetTitle(); | |
329 | if (!vtxTtl.Contains("VertexerTracks")) return; | |
330 | fHistEvStat->Fill(cutIndex++); | |
331 | Double_t zvtx = trkVtx->GetZ(); | |
332 | const AliAODVertex* spdVtx = fAOD->GetPrimaryVertexSPD(); | |
333 | if (spdVtx->GetNContributors()<=0) return; | |
334 | TString vtxTyp = spdVtx->GetTitle(); | |
335 | Double_t cov[6]={0}; | |
336 | spdVtx->GetCovarianceMatrix(cov); | |
337 | Double_t zRes = TMath::Sqrt(cov[5]); | |
338 | if (vtxTyp.Contains("vertexer:Z") && (zRes>0.25)) return; | |
339 | if (TMath::Abs(spdVtx->GetZ() - trkVtx->GetZ())>0.5) return; | |
340 | fHistEvStat->Fill(cutIndex++); | |
341 | ||
342 | if (TMath::Abs(zvtx) > 10.) return; | |
343 | fHistEvStat->Fill(cutIndex++); | |
344 | ||
57a9cc15 | 345 | TObjArray *tracksMuonArm = GetAcceptedTracksMuonArm(fAOD,centBin); |
6de71f1d | 346 | if (tracksMuonArm->GetEntriesFast() == 0) { |
347 | delete tracksMuonArm; | |
348 | return; | |
349 | } | |
9c92a0e1 | 350 | fHistEvStat->Fill(cutIndex++); |
6de71f1d | 351 | TObjArray *tracksCentralBarrel = GetAcceptedTracksCentralBarrel(fAOD); |
07c2615a | 352 | |
6de71f1d | 353 | fHistNTracksCB_vs_NTracksMA[centBin] -> Fill(tracksCentralBarrel->GetEntries(), tracksMuonArm->GetEntries()); |
07c2615a | 354 | |
6de71f1d | 355 | AliDebug(1, Form("Single Event analysis : nTracksCB = %4d, nTracksMA = %4d", tracksCentralBarrel->GetEntries(), tracksMuonArm->GetEntries())); |
356 | ||
357 | // Same event | |
358 | for (Int_t iTrMA=0; iTrMA<tracksMuonArm->GetEntriesFast(); iTrMA++) { | |
359 | fTrackMA = (AliAODTrack*) tracksMuonArm->At(iTrMA); | |
9c92a0e1 | 360 | fHistSingleMuonsPt[centBin]->Fill(fTrackMA->Pt()); |
b897e6f8 | 361 | fHistSingleMuonsEtaPt[centBin]->Fill(fTrackMA->Pt(),fTrackMA->Eta()); |
6de71f1d | 362 | for (Int_t iTrCB=0; iTrCB<tracksCentralBarrel->GetEntriesFast(); iTrCB++) { |
363 | fTrackCB = (AliAODTrack*) tracksCentralBarrel -> At(iTrCB); | |
07c2615a | 364 | FillHistograms(centBin, kSingleEvent); |
365 | } | |
366 | } | |
367 | ||
6de71f1d | 368 | // Mixed event |
369 | { | |
9c92a0e1 | 370 | AliEventPool* pool = fPoolMgr->GetEventPool(percentile, zvtx); |
6de71f1d | 371 | //pool->PrintInfo(); |
372 | if (pool->IsReady() || pool->NTracksInPool() > 2000 || pool->GetCurrentNEvents() >= 5) | |
373 | for (Int_t jMix=0; jMix<pool->GetCurrentNEvents(); jMix++) { | |
57a9cc15 | 374 | TObjArray *mixedTracks = pool->GetEvent(jMix); |
375 | fHistNTracksCB_vs_NTracksMAmixed[centBin]->Fill(mixedTracks->GetEntriesFast(), tracksMuonArm->GetEntriesFast()); | |
6de71f1d | 376 | for (Int_t iTrMA=0; iTrMA<tracksMuonArm->GetEntriesFast(); iTrMA++) { |
377 | fTrackMA = (AliAODTrack*) tracksMuonArm->At(iTrMA); | |
9c92a0e1 | 378 | fHistSingleMuonsPtmixed[centBin]->Fill(fTrackMA->Pt()); |
b897e6f8 | 379 | fHistSingleMuonsEtaPtmixed[centBin]->Fill(fTrackMA->Pt(),fTrackMA->Eta()); |
6de71f1d | 380 | for (Int_t iTrCB=0; iTrCB<mixedTracks->GetEntriesFast(); iTrCB++) { |
381 | fTrackCB = (AliAODTrack*) mixedTracks -> At(iTrCB); | |
382 | FillHistograms(centBin, kMixedEvent); | |
383 | } | |
384 | } | |
385 | } | |
386 | pool->UpdatePool(tracksCentralBarrel); | |
387 | } | |
388 | ||
389 | delete tracksMuonArm; | |
07c2615a | 390 | |
391 | PostData(1, fOutputList); | |
392 | ||
393 | } | |
394 | ||
395 | //==================================================================================================================================================== | |
396 | ||
397 | void AliAnalysisTaskMuonHadronCorrelations::FillHistograms(Int_t centrality, Int_t option) { | |
398 | ||
399 | Int_t ptBinTrackCB = fPtAxis -> FindBin(fTrackCB->Pt()); | |
400 | Int_t ptBinTrackMA = fPtAxis -> FindBin(fTrackMA->Pt()); | |
401 | ||
402 | if (ptBinTrackCB<1 || ptBinTrackCB>fNbinsPt || ptBinTrackMA<1 || ptBinTrackMA>fNbinsPt) return; | |
403 | ||
404 | Double_t deltaPhi = fTrackCB->Phi() - fTrackMA->Phi(); | |
405 | if (deltaPhi > 1.5*TMath::Pi()) deltaPhi -= TMath::TwoPi(); | |
406 | if (deltaPhi < -0.5*TMath::Pi()) deltaPhi += TMath::TwoPi(); | |
407 | ||
408 | if (option==kSingleEvent) fHistDeltaPhi[centrality][ptBinTrackCB-1][ptBinTrackMA-1] -> Fill(TMath::RadToDeg()*deltaPhi); | |
409 | else if (option==kMixedEvent) fHistDeltaPhiMix[centrality][ptBinTrackCB-1][ptBinTrackMA-1] -> Fill(TMath::RadToDeg()*deltaPhi); | |
410 | ||
b897e6f8 | 411 | if (option==kSingleEvent) fHistEtaDeltaPhi[centrality][ptBinTrackCB-1][ptBinTrackMA-1] -> Fill(TMath::RadToDeg()*deltaPhi,fTrackMA->Eta()); |
412 | else if (option==kMixedEvent) fHistEtaDeltaPhiMix[centrality][ptBinTrackCB-1][ptBinTrackMA-1] -> Fill(TMath::RadToDeg()*deltaPhi,fTrackMA->Eta()); | |
413 | ||
ae1016ae | 414 | if (option==kSingleEvent) fHistTracksEtaMAvsEtaCB[centrality]->Fill(fTrackMA->Eta(),fTrackCB->Eta()); |
415 | else if (option==kMixedEvent) fHistTracksEtaMAvsEtaCBmixed[centrality]->Fill(fTrackMA->Eta(),fTrackCB->Eta()); | |
07c2615a | 416 | } |
417 | ||
418 | //==================================================================================================================================================== | |
419 | ||
420 | Bool_t AliAnalysisTaskMuonHadronCorrelations::IsTriggerFired() { | |
421 | ||
6de71f1d | 422 | Bool_t isSelected = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & AliVEvent::kINT7); |
07c2615a | 423 | |
6de71f1d | 424 | return isSelected; |
07c2615a | 425 | } |
426 | ||
427 | //==================================================================================================================================================== | |
428 | ||
429 | Float_t AliAnalysisTaskMuonHadronCorrelations::GetV0Multiplicity() { | |
430 | ||
431 | Float_t multiplicity=0; | |
432 | for (Int_t iChannel=0; iChannel<64; iChannel++) multiplicity += fAOD->GetVZEROData()->GetMultiplicity(iChannel); | |
433 | return multiplicity; | |
434 | ||
435 | } | |
436 | ||
437 | //==================================================================================================================================================== | |
438 | ||
6de71f1d | 439 | TObjArray* AliAnalysisTaskMuonHadronCorrelations::GetAcceptedTracksCentralBarrel(AliAODEvent *aodEvent) { |
07c2615a | 440 | |
441 | // fills the array of central barrel tracks that pass the cuts | |
442 | ||
6de71f1d | 443 | TObjArray *tracks = new TObjArray; |
444 | tracks->SetOwner(kTRUE); | |
07c2615a | 445 | |
446 | Int_t nTracks = aodEvent->GetNTracks(); | |
447 | ||
448 | AliAODTrack *track = 0; | |
449 | ||
450 | for (Int_t iTrack=0; iTrack<nTracks; iTrack++) { | |
451 | track = aodEvent->GetTrack(iTrack); | |
452 | if (track->TestFilterBit(fFilterBitCentralBarrel) && TMath::Abs(track->Eta())<fMaxEtaCentralBarrel) { | |
6de71f1d | 453 | tracks->Add(new AliAODTrack(*track)); |
07c2615a | 454 | } |
455 | } | |
456 | ||
457 | return tracks; | |
458 | ||
459 | } | |
460 | ||
461 | //==================================================================================================================================================== | |
462 | ||
57a9cc15 | 463 | TObjArray* AliAnalysisTaskMuonHadronCorrelations::GetAcceptedTracksMuonArm(AliAODEvent *aodEvent, Int_t centBin) { |
07c2615a | 464 | |
465 | // fills the array of muon tracks that pass the cuts | |
466 | ||
6de71f1d | 467 | TObjArray *tracks = new TObjArray; |
468 | tracks->SetOwner(kFALSE); | |
07c2615a | 469 | |
470 | Int_t nTracks = aodEvent->GetNTracks(); | |
471 | ||
472 | AliAODTrack *track = 0; | |
473 | ||
474 | for (Int_t iTrack=0; iTrack<nTracks; iTrack++) { | |
475 | track = aodEvent->GetTrack(iTrack); | |
476 | if (track->IsMuonTrack() && track->GetMatchTrigger()>=fTriggerMatchLevelMuon) { | |
57a9cc15 | 477 | if (track->Chi2perNDF() < 5.) { |
478 | // histos | |
479 | fHistSingleMuonsEtaVsPt[centBin]->Fill(track->Eta(),track->Pt()); | |
480 | fHistSingleMuonsEtaVsRAbs[centBin]->Fill(track->Eta(),track->GetRAtAbsorberEnd()); | |
481 | if (track->Eta() > -4. && track->Eta() < -2.5) { | |
482 | Double_t rabs = track->GetRAtAbsorberEnd(); | |
483 | if (rabs > 17.6 && rabs < 89.5) { | |
484 | tracks->Add(new AliAODTrack(*track)); | |
485 | } | |
486 | } | |
487 | } | |
07c2615a | 488 | } |
489 | } | |
490 | ||
491 | return tracks; | |
492 | ||
493 | } | |
494 | ||
495 | //==================================================================================================================================================== | |
496 | ||
497 | void AliAnalysisTaskMuonHadronCorrelations::SetCentBinning(Int_t nBins, Double_t *limits) { | |
498 | ||
499 | if (nBins>fNMaxBinsCentrality) { | |
500 | AliInfo(Form("WARNING : only %d centrality bins (out of the %d proposed) will be considered",fNMaxBinsCentrality,nBins)); | |
501 | nBins = fNMaxBinsCentrality; | |
502 | } | |
503 | if (nBins<=0) { | |
504 | AliInfo("WARNING : at least one centrality bin must be considered"); | |
505 | nBins = 1; | |
506 | } | |
507 | ||
508 | fNbinsCent = nBins; | |
509 | fCentAxis = new TAxis(fNbinsCent, limits); | |
510 | ||
511 | } | |
512 | ||
513 | //==================================================================================================================================================== | |
514 | ||
07c2615a | 515 | void AliAnalysisTaskMuonHadronCorrelations::SetPtBinning(Int_t nBins, Double_t *limits) { |
516 | ||
517 | if (nBins>fNMaxBinsPt) { | |
518 | AliInfo(Form("WARNING : only %d pt bins (out of the %d proposed) will be considered",fNMaxBinsPt,nBins)); | |
519 | nBins = fNMaxBinsPt; | |
520 | } | |
521 | if (nBins<=0) { | |
522 | AliInfo("WARNING : at least one pt bin must be considered"); | |
523 | nBins = 1; | |
524 | } | |
525 | ||
526 | fNbinsPt = nBins; | |
527 | fPtAxis = new TAxis(fNbinsPt, limits); | |
528 | ||
529 | } | |
530 | ||
531 | //==================================================================================================================================================== | |
532 | ||
b897e6f8 | 533 | void AliAnalysisTaskMuonHadronCorrelations::SetEtaBinning(Int_t nBins, Double_t *limits) { |
534 | ||
535 | if (nBins>fNMaxBinsEta) { | |
536 | AliInfo(Form("WARNING : only %d pt bins (out of the %d proposed) will be considered",fNMaxBinsEta,nBins)); | |
537 | nBins = fNMaxBinsEta; | |
538 | } | |
539 | if (nBins<=0) { | |
540 | AliInfo("WARNING : at least one pt bin must be considered"); | |
541 | nBins = 1; | |
542 | } | |
543 | ||
544 | fEtaAxis = new TAxis(nBins, limits); | |
545 | ||
546 | } | |
547 | ||
548 | //==================================================================================================================================================== | |
549 | ||
07c2615a | 550 | Int_t AliAnalysisTaskMuonHadronCorrelations::GetCentBin() { |
07c2615a | 551 | |
6de71f1d | 552 | Double_t percentile = fAOD->GetCentrality()->GetCentralityPercentile(fCentMethod.Data()); |
07c2615a | 553 | |
6de71f1d | 554 | Int_t bin = fCentAxis->FindBin(percentile) - 1; |
555 | if (bin >= fNbinsCent) bin = -1; | |
556 | return bin; | |
07c2615a | 557 | |
558 | } | |
559 | ||
560 | //==================================================================================================================================================== | |
561 | ||
562 | Double_t AliAnalysisTaskMuonHadronCorrelations::GetITSMultiplicity() { | |
563 | ||
6de71f1d | 564 | Double_t multiplicity = fAOD->GetHeader()->GetNumberOfITSClusters(1); |
07c2615a | 565 | |
566 | return multiplicity; | |
567 | ||
568 | } | |
569 | ||
570 | //==================================================================================================================================================== | |
571 | ||
572 | void AliAnalysisTaskMuonHadronCorrelations::Terminate(Option_t *) { | |
573 | ||
574 | fOutputList = dynamic_cast<TList*> (GetOutputData(1)); | |
575 | if (!fOutputList) { | |
576 | printf("ERROR: Output list not available\n"); | |
577 | return; | |
578 | } | |
579 | ||
580 | } | |
581 | ||
582 | //==================================================================================================================================================== | |
583 |