]>
Commit | Line | Data |
---|---|---|
3b77b2d1 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Authors: Svein Lindal * | |
5 | * Version 1.0 * | |
6 | * * | |
7 | * * | |
8 | * Permission to use, copy, modify and distribute this software and its * | |
9 | * documentation strictly for non-commercial purposes is hereby granted * | |
10 | * without fee, provided that the above copyright notice appears in all * | |
11 | * copies and that both the copyright notice and this permission notice * | |
12 | * appear in the supporting documentation. The authors make no claims * | |
13 | * about the suitability of this software for any purpose. It is * | |
14 | * provided "as is" without express or implied warranty. * | |
15 | **************************************************************************/ | |
16 | ||
17 | //////////////////////////////////////////////// | |
18 | //--------------------------------------------- | |
19 | // Class doing conversion gamma dPhi correlations | |
20 | // Gamma Conversion analysis | |
21 | //--------------------------------------------- | |
22 | //////////////////////////////////////////////// | |
23 | ||
24 | #include "AliAnalysisTaskdPhi.h" | |
25 | ||
26 | #include <TH2I.h> | |
27 | #include <TList.h> | |
28 | #include <TChain.h> | |
29 | ||
30 | #include <AliAnalysisManager.h> | |
31 | #include <AliInputEventHandler.h> | |
32 | #include <AliESDInputHandler.h> | |
33 | #include <AliAODInputHandler.h> | |
34a878c4 | 34 | #include <TGeoGlobalMagField.h> |
3b77b2d1 | 35 | |
2dd6ec26 | 36 | #include "AliConversionTrackCuts.h" |
3b77b2d1 | 37 | #include "AliConversionCuts.h" |
c15c23b8 | 38 | #include "AliConversionMesonCuts.h" |
3b77b2d1 | 39 | #include "AliAODConversionPhoton.h" |
40 | #include "AliAODConversionMother.h" | |
65ec4890 | 41 | // #include "AliAnaConvCorrPhoton.h" |
42 | // #include "AliAnaConvCorrPion.h" | |
43 | // #include "AliAnaConvIsolation.h" | |
c15c23b8 | 44 | #include "AliV0ReaderV1.h" |
3b77b2d1 | 45 | // Author Svein Lindal <slindal@fys.uio.no> |
46 | using namespace std; | |
47 | ||
48 | ClassImp(AliAnalysisTaskdPhi) | |
49 | ||
50 | ||
51 | //________________________________________________________________________ | |
52 | AliAnalysisTaskdPhi::AliAnalysisTaskdPhi(const char *name) : AliAnalysisTaskSE(name), | |
53 | fHistograms(NULL), | |
65ec4890 | 54 | fCorrSparse(NULL), |
55 | fTrigSparse(NULL), | |
56 | fTrackSparse(NULL), | |
57 | fMassSparse(NULL), | |
c15c23b8 | 58 | fV0Reader(NULL), |
439cf020 | 59 | fSaveReaderHists(kFALSE), |
3b77b2d1 | 60 | fV0Filter(NULL), |
65ec4890 | 61 | fV0Filters(), |
c15c23b8 | 62 | fPhotonFilter(NULL), |
63 | fMesonFilter(NULL), | |
65ec4890 | 64 | fMesonFilters(), |
65 | fTrackFilter(NULL), | |
66 | fTrackFilters(), | |
67 | fGammas(), | |
68 | fTracks(), | |
3b77b2d1 | 69 | hMEvents(NULL), |
439cf020 | 70 | hTrackCent(NULL), |
65ec4890 | 71 | // fPhotonCorr(NULL), |
72 | // fPionCorr(NULL), | |
3b77b2d1 | 73 | fDeltaAODBranchName("AliAODGammaConversion_gamma"), |
3bff49c3 | 74 | fAxistPt(), |
75 | fAxiscPt(), | |
9e6bd607 | 76 | fAxisdEta(), |
77 | fAxisTrigEta(), | |
78 | fAxisAssEta(), | |
65ec4890 | 79 | fAxisdPhi(), |
3b77b2d1 | 80 | fAxisCent(), |
81 | fAxisZ(), | |
6252ea9d | 82 | fAxisPiM(), |
65ec4890 | 83 | fAxisTrackFilters(), |
84 | fAxisV0Filters(), | |
85 | fAxisMesonFilters(), | |
86 | fkTrackAxis(kFALSE), | |
87 | fkV0Axis(kFALSE), | |
88 | fkPionAxis(kFALSE), | |
89 | fAxesList(), | |
90 | fTrigAxesList(), | |
91 | fTrackAxesList(), | |
92 | fMassAxesList(), | |
6252ea9d | 93 | fDoPhoton(kFALSE) |
65ec4890 | 94 | { |
95 | //constructor | |
96 | SetUpBins(); | |
3b77b2d1 | 97 | |
65ec4890 | 98 | DefineInput(0, TChain::Class()); |
99 | DefineOutput(1, TList::Class()); | |
3b77b2d1 | 100 | |
65ec4890 | 101 | fGammas.SetOwner(kTRUE); |
102 | fTracks.SetOwner(kTRUE); | |
103 | ||
104 | } | |
9e6bd607 | 105 | |
9e6bd607 | 106 | |
3bff49c3 | 107 | |
65ec4890 | 108 | //________________________________________________________________________ |
109 | AliAnalysisTaskdPhi::~AliAnalysisTaskdPhi(){ | |
110 | //destructor | |
3bff49c3 | 111 | |
65ec4890 | 112 | if(fV0Filter) |
113 | delete fV0Filter; | |
114 | fV0Filter = NULL; | |
3b77b2d1 | 115 | |
65ec4890 | 116 | if(fMesonFilter) |
117 | delete fMesonFilter; | |
118 | fMesonFilter = NULL; | |
92efd725 | 119 | |
65ec4890 | 120 | if(fPhotonFilter) |
121 | delete fPhotonFilter; | |
122 | fPhotonFilter = NULL; | |
3b77b2d1 | 123 | |
65ec4890 | 124 | if(fHistograms) |
125 | delete fHistograms; | |
126 | fHistograms = NULL; | |
3b77b2d1 | 127 | |
65ec4890 | 128 | if(fTrackFilter) |
129 | delete fTrackFilter; | |
130 | fTrackFilter = NULL; | |
3b77b2d1 | 131 | |
65ec4890 | 132 | fGammas.Delete(); |
133 | fTracks.Delete(); | |
3b77b2d1 | 134 | |
65ec4890 | 135 | } |
3b77b2d1 | 136 | |
65ec4890 | 137 | ///________________________________________________________________________ |
138 | void AliAnalysisTaskdPhi::SetUpBins() { | |
3b77b2d1 | 139 | |
65ec4890 | 140 | fAxisTrigEta.SetNameTitle("tEta", "Eta"); |
141 | fAxisTrigEta.Set(320, -0.8, 0.8); | |
c15c23b8 | 142 | |
65ec4890 | 143 | fAxisAssEta.SetNameTitle("aEta", "Eta"); |
144 | fAxisAssEta.Set(360, -0.9, 0.9); | |
c15c23b8 | 145 | |
65ec4890 | 146 | fAxisdEta.SetNameTitle("dEta", "Eta"); |
147 | fAxisdEta.Set(34, -1.7, 1.7); | |
3b77b2d1 | 148 | |
65ec4890 | 149 | fAxisdPhi.SetNameTitle("dPhi", "delta Phi"); |
150 | fAxisdPhi.Set(32, -TMath::PiOver2(), 3*TMath::PiOver2()); | |
439cf020 | 151 | |
65ec4890 | 152 | Double_t tptbins[10] = {0.1, 3.0, 4.0, 5.0, 6.0, 8.0, 10.0, 15, 50, 100}; fAxistPt.SetNameTitle("tPt", "tPt"); |
153 | fAxistPt.Set(9, tptbins); | |
99d49b30 | 154 | |
65ec4890 | 155 | Double_t cptbins[13] = {0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 4.0, 5.0, 8.0, 10.0, 25, 50, 100}; fAxiscPt.SetNameTitle("cPt", "cPt"); |
156 | fAxiscPt.Set(12, cptbins); | |
157 | ||
158 | fAxisZ.SetNameTitle("vertexz", "Z"); | |
159 | fAxisZ.Set(4, -10, 10); | |
160 | ||
161 | Double_t centbins[5] = {0, 10, 30, 60, 100.1}; | |
162 | fAxisCent.SetNameTitle("centrality", "Cent"); | |
163 | fAxisCent.Set(4, centbins); | |
164 | ||
165 | fAxisPiM.SetNameTitle("InvMassPi0", "Invariant mass"); | |
166 | Double_t mbins[7] = {0.1, 0.11, 0.12, 0.15, 0.16, 0.18, 0.2}; | |
167 | fAxisPiM.Set(6, mbins); | |
3b77b2d1 | 168 | |
6252ea9d | 169 | } |
3b77b2d1 | 170 | |
6252ea9d | 171 | |
65ec4890 | 172 | ///________________________________________________________________________ |
173 | // void AliAnalysisTaskdPhi::SetUpCorrObjects() { | |
174 | // //Set up corr objects | |
175 | // AliDebug(AliLog::kDebug + 5, "Set Up corr objects"); | |
176 | ||
177 | // if(fDoPhoton) { | |
178 | // fPhotonCorr = new AliAnaConvCorrPhoton("PhotonCorr","photon %s"); | |
179 | // SetUpCorrAxes(fPhotonCorr); | |
180 | // fPhotonCorr->CreateHistograms(); | |
181 | // fHistograms->Add(fPhotonCorr->GetHistograms()); | |
182 | // } | |
183 | ||
184 | // fPionCorr = new AliAnaConvCorrPion("PionCorr", "pion"); | |
185 | // SetUpCorrAxes(fPionCorr); | |
186 | // fPionCorr->GetAxisM().Set(fAxisPiM.GetNbins(), fAxisPiM.GetXbins()->GetArray()); | |
187 | // fPionCorr->CreateHistograms(); | |
188 | // fHistograms->Add(fPionCorr->GetHistograms()); | |
189 | //} | |
190 | ||
191 | ///________________________________________________________________________ | |
192 | // void AliAnalysisTaskdPhi::SetUpCorrAxes(AliAnaConvCorrBase * corr) { | |
193 | ///Set up axes in corr object | |
194 | // corr->GetAxisCent().Set(fAxisCent.GetNbins(), fAxisCent.GetXbins()->GetArray()); | |
195 | // const Double_t * zbins = fAxisZ.GetXbins()->GetArray(); | |
196 | // if(zbins) { | |
197 | // corr->GetAxisZ().Set(fAxisZ.GetNbins(), fAxisZ.GetXbins()->GetArray()); | |
198 | // } else { | |
199 | // corr->GetAxisZ().Set(fAxisZ.GetNbins(), fAxisZ.GetBinLowEdge(1), fAxisZ.GetBinUpEdge(fAxisZ.GetNbins())); | |
200 | // } | |
201 | ||
202 | // corr->GetAxistPt().Set(fAxistPt.GetNbins(), fAxistPt.GetXbins()->GetArray()); | |
203 | // corr->GetAxiscPt().Set(fAxiscPt.GetNbins(), fAxiscPt.GetXbins()->GetArray()); | |
204 | // corr->GetAxisdEta().Set(fAxisdEta.GetNbins(), fAxisdEta.GetBinLowEdge(1), fAxisdEta.GetBinUpEdge(fAxisdEta.GetNbins())); | |
205 | // corr->GetAxisTrigEta().Set(fAxisTrigEta.GetNbins(), fAxisTrigEta.GetBinLowEdge(1), fAxisTrigEta.GetBinUpEdge(fAxisTrigEta.GetNbins())); | |
206 | // corr->GetAxisAssEta().Set(fAxisAssEta.GetNbins(), fAxisAssEta.GetBinLowEdge(1), fAxisAssEta.GetBinUpEdge(fAxisAssEta.GetNbins())); | |
207 | // } | |
6252ea9d | 208 | |
3b77b2d1 | 209 | |
210 | //________________________________________________________________________ | |
211 | void AliAnalysisTaskdPhi::UserCreateOutputObjects() { | |
212 | // Create histograms | |
213 | ||
214 | fHistograms = new TList(); | |
215 | fHistograms->SetName("dPhi_histograms"); | |
216 | fHistograms->SetOwner(kTRUE); | |
65ec4890 | 217 | |
218 | ||
439cf020 | 219 | if(!fV0Reader){ |
220 | fV0Reader=(AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager()->GetTask("V0ReaderV1"); | |
221 | } | |
222 | ||
223 | if(!fV0Reader){ | |
224 | printf("Error: No V0 Reader"); | |
225 | } // GetV0Reader | |
65ec4890 | 226 | |
227 | ||
439cf020 | 228 | if(fSaveReaderHists) { |
229 | AliConversionCuts * v0cuts = fV0Reader->GetConversionCuts(); | |
230 | if(v0cuts) { | |
231 | TList * histograms = v0cuts->GetCutHistograms(); | |
232 | if(!histograms) { | |
233 | AliWarning("initializing v0 reader hists"); | |
234 | v0cuts->InitCutHistograms("V0Reader", kTRUE); | |
235 | } | |
236 | histograms = v0cuts->GetCutHistograms(); | |
237 | if(histograms) { | |
238 | fHistograms->Add(histograms); | |
239 | } | |
240 | } | |
241 | } | |
65ec4890 | 242 | |
243 | for(Int_t igf = 0; igf < fV0Filters[0].GetEntriesFast(); igf ++){ | |
244 | AliConversionCuts * f = dynamic_cast<AliConversionCuts*>(fV0Filters[0].At(igf)); | |
245 | if(f) { | |
5f175fb0 SL |
246 | TList * histograms = f->GetCutHistograms(); |
247 | if(histograms) fHistograms->Add(f->GetCutHistograms()); | |
65ec4890 | 248 | } |
249 | } | |
250 | ||
251 | for(Int_t igf = 0; igf < fV0Filters[1].GetEntriesFast(); igf ++){ | |
252 | AliConversionCuts * f = dynamic_cast<AliConversionCuts*>(fV0Filters[1].At(igf)); | |
253 | if(f) { | |
5f175fb0 SL |
254 | TList * histograms = f->GetCutHistograms(); |
255 | if(histograms) fHistograms->Add(f->GetCutHistograms()); | |
65ec4890 | 256 | } |
257 | } | |
258 | ||
259 | for(Int_t igf = 0; igf < fMesonFilters[0].GetEntriesFast(); igf ++){ | |
260 | AliConversionMesonCuts * f = dynamic_cast<AliConversionMesonCuts*>(fMesonFilters[0].At(igf)); | |
261 | if(f) { | |
5f175fb0 SL |
262 | TList * histograms = f->GetCutHistograms(); |
263 | if(histograms) fHistograms->Add(f->GetCutHistograms()); | |
65ec4890 | 264 | } |
265 | } | |
266 | ||
267 | for(Int_t igf = 0; igf < fMesonFilters[1].GetEntriesFast(); igf ++){ | |
268 | AliConversionMesonCuts * f = dynamic_cast<AliConversionMesonCuts*>(fMesonFilters[1].At(igf)); | |
269 | if(f) { | |
5f175fb0 SL |
270 | TList * histograms = f->GetCutHistograms(); |
271 | if(histograms) fHistograms->Add(f->GetCutHistograms()); | |
65ec4890 | 272 | } |
273 | } | |
c15c23b8 | 274 | |
3b77b2d1 | 275 | if(fV0Filter) { |
439cf020 | 276 | fV0Filter->InitCutHistograms("V0Filter", kFALSE); |
c15c23b8 | 277 | fHistograms->Add(fV0Filter->GetCutHistograms()); |
278 | } | |
279 | if(fMesonFilter) { | |
439cf020 | 280 | fMesonFilter->InitCutHistograms("PionFilter", kFALSE); |
c15c23b8 | 281 | fHistograms->Add(fMesonFilter->GetCutHistograms()); |
282 | } | |
283 | if(fPhotonFilter) { | |
439cf020 | 284 | fPhotonFilter->InitCutHistograms("PhotonFilter", kFALSE); |
c15c23b8 | 285 | fHistograms->Add(fPhotonFilter->GetCutHistograms()); |
3b77b2d1 | 286 | } |
65ec4890 | 287 | |
288 | ||
289 | AliConversionTrackCuts * tc = dynamic_cast<AliConversionTrackCuts*>(fTrackFilter); | |
290 | if(tc) { | |
291 | fHistograms->Add(tc->CreateHistograms()); | |
292 | } | |
293 | ||
294 | ||
295 | // for(Int_t i = 0; i < fTrackFilters.GetEntriesFast(); i++) { | |
296 | // AliConversionTrackCuts * tc = dynamic_cast<AliConversionTrackCuts*>(fTrackFilters.At(i)); | |
297 | // if(tc) fHistograms->Add(tc->CreateHistograms()); | |
298 | // } | |
299 | ||
300 | //SetUpCorrObjects(); | |
301 | ||
302 | ///Set up ME histograms | |
303 | TList * MEHistograms = new TList(); | |
304 | MEHistograms->SetName("MEHistograms"); | |
305 | MEHistograms->SetOwner(kTRUE); | |
306 | fHistograms->Add(MEHistograms); | |
307 | ||
308 | hMEvents = new TH2I("hMEvents", "Nevents vs centrality vertexz", | |
309 | fAxisZ.GetNbins(), fAxisZ.GetXbins()->GetArray(), | |
310 | fAxisCent.GetNbins(), fAxisCent.GetXbins()->GetArray()); | |
311 | MEHistograms->Add(hMEvents); | |
312 | ||
313 | hTrackCent = new TH2I("hTrackCent", "N accepted tracks vs centrality", | |
d926594d | 314 | fAxisCent.GetNbins() > 2 ? 90 : 1, fAxisCent.GetBinLowEdge(1), fAxisCent.GetBinUpEdge(fAxisCent.GetNbins()), |
65ec4890 | 315 | 750, 0, 1500); |
316 | MEHistograms->Add(hTrackCent); | |
317 | ||
318 | Int_t ntrackfilters[2] = {fTrackFilters[0].GetEntriesFast(), fTrackFilters[1].GetEntriesFast()}; | |
319 | fkTrackAxis = kTRUE; | |
320 | fAxisTrackFilters.SetNameTitle("trackCuts", "trackCuts"); | |
321 | fAxisTrackFilters.Set(ntrackfilters[0] + ntrackfilters[1] + 1, -ntrackfilters[0] -0.5, ntrackfilters[1] + 0.5); | |
322 | ||
323 | Int_t nV0filters[2] = {fV0Filters[0].GetEntriesFast(), fV0Filters[1].GetEntriesFast()}; | |
324 | fkV0Axis = kTRUE; | |
325 | fAxisV0Filters.SetNameTitle("V0Cuts", "V0Cuts"); | |
326 | fAxisV0Filters.Set(nV0filters[0] + nV0filters[1] + 1, -nV0filters[0] -0.5, nV0filters[1] + 0.5); | |
327 | ||
328 | Int_t nmesonfilters[2] = {fMesonFilters[0].GetEntriesFast(), fMesonFilters[1].GetEntriesFast()}; | |
329 | fkPionAxis = kTRUE; | |
330 | fAxisMesonFilters.SetNameTitle("mesonCuts", "mesonCuts"); | |
331 | fAxisMesonFilters.Set(nmesonfilters[0] + nmesonfilters[1] + 1, -nmesonfilters[0] -0.5, nmesonfilters[1] + 0.5); | |
332 | ||
333 | fAxesList.AddAt(&fAxisdEta, 0); | |
334 | fAxesList.AddAt(&fAxisdPhi, 1); | |
335 | fAxesList.AddAt(&fAxistPt, 2); | |
336 | fAxesList.AddAt(&fAxiscPt, 3); | |
337 | fAxesList.AddAt(&fAxisCent, 4); | |
338 | fAxesList.AddAt(&fAxisZ, 5); | |
339 | fAxesList.AddAt(&fAxisPiM, 6); | |
340 | fAxesList.AddAt(&fAxisTrackFilters, 7); | |
341 | fAxesList.AddAt(&fAxisV0Filters, 8); | |
342 | fAxesList.AddAt(&fAxisMesonFilters, 9); | |
343 | ||
344 | fTrackAxesList.AddAt(&fAxisAssEta, 0); | |
345 | fTrackAxesList.AddAt(&fAxistPt, 1); | |
346 | fTrackAxesList.AddAt(&fAxiscPt, 2); | |
347 | fTrackAxesList.AddAt(&fAxisCent, 3); | |
348 | fTrackAxesList.AddAt(&fAxisZ, 4); | |
349 | //fTrackAxesList.AddAt(&fAxisPiM, 5); | |
350 | fTrackAxesList.AddAt(&fAxisTrackFilters, 5); | |
351 | fTrackAxesList.AddAt(&fAxisV0Filters, 6); | |
352 | fTrackAxesList.AddAt(&fAxisMesonFilters, 7); | |
353 | ||
354 | fTrigAxesList.AddAt(&fAxisTrigEta, 0); | |
355 | fTrigAxesList.AddAt(&fAxistPt, 1); | |
356 | fTrigAxesList.AddAt(&fAxisCent, 2); | |
357 | fTrigAxesList.AddAt(&fAxisZ, 3); | |
358 | fTrigAxesList.AddAt(&fAxisPiM, 4); | |
359 | fTrigAxesList.AddAt(&fAxisV0Filters, 5); | |
360 | fTrigAxesList.AddAt(&fAxisMesonFilters, 6); | |
361 | ||
362 | TList masslist; | |
363 | TAxis massax; | |
364 | massax.SetNameTitle("mass", "mass"); | |
365 | massax.Set(360, 0.04, 0.4); //hardcoded! change also in filling! | |
366 | ||
367 | masslist.AddAt(&massax, 0); | |
368 | masslist.AddAt(&fAxistPt, 1); | |
369 | masslist.AddAt(&fAxisCent, 2); | |
370 | masslist.AddAt(&fAxisV0Filters, 3); | |
371 | masslist.AddAt(&fAxisMesonFilters, 4); | |
372 | ||
373 | fCorrSparse = CreateSparse(TString("pionSparse"), TString("pionSparse"), &fAxesList); | |
374 | fTrackSparse = CreateSparse(TString("trackSparse"), TString("trackSparse"), &fTrackAxesList); | |
375 | fTrigSparse = CreateSparse(TString("trigSparse"), TString("trigSparse"), &fTrigAxesList); | |
376 | fMassSparse = CreateSparse("massSparse", "massSparse", &masslist); | |
99d49b30 | 377 | |
65ec4890 | 378 | fHistograms->Add(fCorrSparse); |
379 | fHistograms->Add(fTrackSparse); | |
380 | fHistograms->Add(fTrigSparse); | |
381 | fHistograms->Add(fMassSparse); | |
ca257f2a | 382 | |
99d49b30 | 383 | |
65ec4890 | 384 | ///Add gamma and track containers: |
385 | for(Int_t i = 0; i < fV0Filters[1].GetEntriesFast() + 1; i++) { | |
386 | fGammas.Add(new TObjArray()); | |
387 | } | |
ca257f2a | 388 | |
65ec4890 | 389 | for(Int_t i = 0; i < fTrackFilters[1].GetEntriesFast() + 1; i++) { |
390 | fTracks.Add(new TObjArray()); | |
391 | } | |
392 | ||
393 | ||
394 | ||
395 | PostData(1, fHistograms); | |
3b77b2d1 | 396 | } |
397 | ||
398 | ///________________________________________________________________________ | |
399 | THnSparseF * AliAnalysisTaskdPhi::CreateSparse(TString nameString, TString titleString, TList * axesList) { | |
65ec4890 | 400 | //Create sparse |
3b77b2d1 | 401 | const Int_t dim = axesList->GetSize(); |
65ec4890 | 402 | |
3b77b2d1 | 403 | TAxis * axes[dim]; |
65ec4890 | 404 | Int_t bins[dim]; |
3b77b2d1 | 405 | Double_t min[dim]; |
406 | Double_t max[dim]; | |
407 | ||
408 | for(Int_t i = 0; i<dim; i++) { | |
65ec4890 | 409 | TAxis * axis = dynamic_cast<TAxis*>(axesList->At(i)); |
410 | if(axis) axes[i] = axis; | |
411 | else { | |
412 | cout << "AliAnalysisTaskdPhi::CreateSparse: Error error, all the axes are not present in axis list" << endl; | |
413 | return NULL; | |
414 | } | |
3b77b2d1 | 415 | } |
65ec4890 | 416 | |
3b77b2d1 | 417 | for(Int_t i = 0; i<dim; i++) { |
65ec4890 | 418 | //cout << axes[i]->GetTitle() << endl; |
419 | bins[i] = axes[i]->GetNbins(); | |
420 | min[i] = axes[i]->GetBinLowEdge(1); | |
421 | max[i] = axes[i]->GetBinUpEdge(axes[i]->GetNbins()); | |
3b77b2d1 | 422 | } |
423 | ||
65ec4890 | 424 | THnSparseF * sparse = new THnSparseF(Form("%s", nameString.Data()), |
425 | Form("%s", titleString.Data()), | |
426 | dim, bins, min, max); | |
3b77b2d1 | 427 | |
428 | for(Int_t i = 0; i<dim; i++) { | |
65ec4890 | 429 | sparse->GetAxis(i)->SetNameTitle(axes[i]->GetName(), axes[i]->GetTitle() ); |
430 | if(axes[i]->GetXbins()->GetSize() > 0) { | |
431 | sparse->SetBinEdges(i, axes[i]->GetXbins()->GetArray() ); | |
432 | } | |
3b77b2d1 | 433 | } |
3b77b2d1 | 434 | return sparse; |
435 | } | |
436 | ||
437 | //________________________________________________________________________ | |
438 | void AliAnalysisTaskdPhi::UserExec(Option_t *) { | |
439 | ///User exec. | |
65ec4890 | 440 | ///This is a very ugly function, cut the complexity of the logic demands it. |
441 | ||
34a878c4 | 442 | |
443 | AliESDEvent * esdEvent = dynamic_cast<AliESDEvent*>(fInputEvent); | |
444 | if(esdEvent) { | |
445 | if (!TGeoGlobalMagField::Instance()->GetField()) esdEvent->InitMagneticField(); | |
446 | } | |
447 | ||
448 | ||
3b77b2d1 | 449 | //if(! fV0Filter->EventIsSelected(fInputEvent)) return; |
439cf020 | 450 | if(!fV0Reader){ |
451 | AliError("Error: No V0 Reader"); | |
452 | return; | |
453 | } // GetV0Reader | |
65ec4890 | 454 | |
439cf020 | 455 | if(!fV0Reader->IsEventSelected()) { |
65ec4890 | 456 | return; |
439cf020 | 457 | } |
65ec4890 | 458 | AliDebug(5, "Processing event"); |
459 | ||
439cf020 | 460 | |
65ec4890 | 461 | for(Int_t i = 0; i < fGammas.GetEntriesFast(); i++) { |
462 | static_cast<TObjArray*>(fGammas.At(i))->Clear(); | |
463 | } | |
464 | ||
465 | for(Int_t i = 0; i < fTracks.GetEntriesFast(); i++) { | |
466 | static_cast<TObjArray*>(fTracks.At(i))->Clear(); | |
467 | } | |
468 | ||
469 | ||
470 | ||
3b77b2d1 | 471 | AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager(); |
472 | Bool_t isAOD=man->GetInputEventHandler()->IsA()==AliAODInputHandler::Class(); | |
473 | ||
474 | AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler()); | |
475 | if (!inputHandler) { | |
65ec4890 | 476 | cout << "cout no input event handler"<<endl; |
477 | return; | |
99d49b30 | 478 | } |
479 | ||
480 | ||
65ec4890 | 481 | |
482 | ||
483 | for(Int_t igf = 0; igf < fV0Filters[0].GetEntriesFast(); igf++) { | |
484 | AliConversionCuts * f = dynamic_cast<AliConversionCuts*>(fV0Filters[0].At(igf)); | |
485 | if ( f && !f->GetPIDResponse() ) { | |
486 | if ( inputHandler->GetPIDResponse() ){ | |
487 | f->SetPIDResponse( inputHandler->GetPIDResponse() ); | |
488 | } else { | |
489 | if (isAOD){ | |
490 | if (!f->GetPIDResponse()){ | |
491 | f->InitAODpidUtil(1); | |
ca257f2a | 492 | } |
99d49b30 | 493 | } |
65ec4890 | 494 | } |
495 | } else { | |
496 | break; | |
497 | } | |
498 | } | |
499 | ||
500 | for(Int_t igf = 0; igf < fV0Filters[1].GetEntriesFast(); igf++) { | |
501 | AliConversionCuts * f = dynamic_cast<AliConversionCuts*>(fV0Filters[1].At(igf)); | |
502 | if ( f && !f->GetPIDResponse() ) { | |
503 | if ( inputHandler->GetPIDResponse() ){ | |
504 | f->SetPIDResponse( inputHandler->GetPIDResponse() ); | |
505 | } else { | |
506 | if (isAOD){ | |
507 | if (!f->GetPIDResponse()){ | |
508 | f->InitAODpidUtil(1); | |
509 | } | |
510 | } | |
511 | } | |
512 | } else { | |
513 | break; | |
514 | } | |
515 | } | |
516 | ||
517 | ||
518 | if ( fV0Filter && !fV0Filter->GetPIDResponse() ) { | |
519 | if ( inputHandler->GetPIDResponse() ){ | |
520 | fV0Filter->SetPIDResponse( inputHandler->GetPIDResponse() ); | |
521 | } else { | |
522 | ||
523 | //AOD case | |
524 | if (isAOD){ | |
525 | if (!fV0Filter->GetPIDResponse()){ | |
526 | fV0Filter->InitAODpidUtil(1); | |
527 | } | |
528 | } | |
529 | } | |
530 | } | |
531 | ||
d926594d SL |
532 | |
533 | ///Initialize track cuts. Delete tracks that have been constrained to vertex (copies) | |
65ec4890 | 534 | AliConversionTrackCuts * tc = dynamic_cast<AliConversionTrackCuts*>(fTrackFilter); |
535 | if(tc) { | |
536 | tc->SetEvent(fInputEvent); | |
537 | tc->DeleteTracks(); | |
3b77b2d1 | 538 | } |
d926594d SL |
539 | |
540 | for(Int_t i = 0; i < fTrackFilters[0].GetEntriesFast(); i++){ | |
541 | AliConversionTrackCuts * tct = dynamic_cast<AliConversionTrackCuts*>(fTrackFilters[0].At(i)); | |
542 | if(tct) { | |
543 | tct->SetEvent(fInputEvent); | |
544 | tct->DeleteTracks(); | |
545 | } | |
546 | } | |
547 | for(Int_t i = 0; i < fTrackFilters[1].GetEntriesFast(); i++){ | |
548 | AliConversionTrackCuts * tct = dynamic_cast<AliConversionTrackCuts*>(fTrackFilters[1].At(i)); | |
549 | if(tct) { | |
550 | tct->SetEvent(fInputEvent); | |
551 | tct->DeleteTracks(); | |
552 | } | |
553 | } | |
554 | ||
555 | ||
556 | ||
557 | ||
558 | ||
3b77b2d1 | 559 | |
560 | Double_t centrality = 0.0; | |
3b77b2d1 | 561 | Double_t vertexz = fInputEvent->GetPrimaryVertex()->GetZ(); |
562 | if(isAOD) { | |
563 | AliAODHeader * header = static_cast<AliAODHeader*>(fInputEvent->GetHeader()); | |
65ec4890 | 564 | centrality = header->GetCentrality(); |
3b77b2d1 | 565 | } else { |
65ec4890 | 566 | centrality = static_cast<AliESDEvent*>(fInputEvent)->GetCentrality()->GetCentralityPercentile("V0M"); |
3b77b2d1 | 567 | } |
65ec4890 | 568 | |
569 | ||
4267afec | 570 | const Int_t centBin = GetBin(fAxisCent, centrality); |
571 | const Int_t vertexBin = GetBin(fAxisZ, vertexz); | |
65ec4890 | 572 | |
573 | ||
3bff49c3 | 574 | if(DebugLevel () > 4) { |
65ec4890 | 575 | cout << "centrality: " << centrality << " " << GetBin(fAxisCent, centrality) << endl; |
576 | cout << "vertexz: " << vertexz << " " << GetBin(fAxisZ, vertexz) << endl; | |
3b77b2d1 | 577 | } |
65ec4890 | 578 | |
579 | ||
580 | ||
3b77b2d1 | 581 | if(centBin < 0 || vertexBin < 0) { |
439cf020 | 582 | // AliError("bin out of range"); |
65ec4890 | 583 | return; |
3b77b2d1 | 584 | } |
65ec4890 | 585 | |
586 | ||
587 | ||
c15c23b8 | 588 | //TClonesArray * aodGammas = GetConversionGammas(isAOD); |
589 | TClonesArray * aodGammas = fV0Reader->GetReconstructedGammas(); | |
3b77b2d1 | 590 | if(!aodGammas) { |
439cf020 | 591 | AliError("no aod gammas found!"); |
592 | return; | |
3b77b2d1 | 593 | } |
ca257f2a | 594 | |
65ec4890 | 595 | TObjArray * ggammas = static_cast<TObjArray*>(fGammas.At(0)); |
596 | ||
597 | ///Fill arrays of accepted gammas | |
3b77b2d1 | 598 | if(DebugLevel() > 1) printf("Number of conversion gammas %d \n", aodGammas->GetEntriesFast()); |
599 | for(Int_t ig = 0; ig < aodGammas->GetEntriesFast(); ig++) { | |
92efd725 | 600 | AliAODConversionPhoton * photon = dynamic_cast<AliAODConversionPhoton*>(aodGammas->At(ig)); |
92efd725 | 601 | if(!photon) continue; |
65ec4890 | 602 | if(!fV0Filter || fV0Filter->PhotonIsSelected(photon, fInputEvent)) { |
603 | ggammas->Add(photon); | |
604 | } else { | |
605 | for(Int_t igf = 0; igf < fV0Filters[1].GetEntriesFast(); igf++) { | |
606 | AliConversionCuts * gfilter = dynamic_cast<AliConversionCuts*>(fV0Filters[1].At(igf)); | |
607 | if(gfilter && gfilter->PhotonIsSelected(photon, fInputEvent)) { | |
608 | static_cast<TObjArray*>(fGammas.At(igf+1))->Add(photon); | |
609 | } | |
610 | } | |
611 | } | |
612 | } | |
613 | ||
614 | Bool_t lowgmap[fV0Filters[0].GetEntriesFast()][ggammas->GetEntriesFast()]; | |
615 | ||
616 | for(Int_t ig = 0; ig < ggammas->GetEntriesFast(); ig++ ) { | |
617 | AliAODConversionPhoton * gamma = static_cast<AliAODConversionPhoton*>(ggammas->At(ig)); | |
618 | for(Int_t igf = 0; igf < fV0Filters[0].GetEntriesFast(); igf++) { | |
619 | ||
620 | AliConversionCuts * v0cuts = static_cast<AliConversionCuts*>(fV0Filters[0].At(igf)); | |
621 | if(!(v0cuts->PhotonIsSelected(gamma, fInputEvent))) { | |
622 | lowgmap[igf][ig] = kTRUE; | |
623 | } else { | |
624 | lowgmap[igf][ig] = kFALSE; | |
625 | } | |
3b77b2d1 | 626 | } |
627 | } | |
628 | ||
65ec4890 | 629 | |
630 | if(DebugLevel() > 4) printf("Number of accepted gammas %d \n", ggammas->GetEntriesFast()); | |
4267afec | 631 | hMEvents->Fill(vertexz, centrality); |
632 | ||
4267afec | 633 | ///create track array |
65ec4890 | 634 | const Int_t ntrackfilters[2] = { fTrackFilters[0].GetEntriesFast(), fTrackFilters[1].GetEntriesFast()}; |
635 | ||
636 | ||
637 | TObjArray * ttracks = static_cast<TObjArray*>(fTracks.At(0)); | |
638 | const Double_t aetalim[2] = { fAxisAssEta.GetXmin(), fAxisAssEta.GetXmax()}; | |
639 | const Double_t aptlim[2] = { fAxiscPt.GetXmin(), fAxiscPt.GetXmax()}; | |
3b77b2d1 | 640 | for(Int_t iTrack = 0; iTrack < fInputEvent->GetNumberOfTracks(); iTrack++) { |
439cf020 | 641 | AliVTrack * track = static_cast<AliVTrack*>(fInputEvent->GetTrack(iTrack)); |
65ec4890 | 642 | if(track->Pt() < aptlim[0] || track->Pt() > aptlim[1]) continue; |
643 | if(track->Eta() < aetalim[0] || track->Eta() > aetalim[1]) continue; | |
644 | if(fTrackFilter->IsSelected(track)) { | |
645 | ttracks->Add(track); | |
646 | } else { | |
647 | ///upside cuts | |
648 | for(Int_t itf = 1; itf < ntrackfilters[1] + 1; itf++) { | |
649 | AliAnalysisCuts * trackCuts = static_cast<AliAnalysisCuts*>(fTrackFilters[1].At(itf -1)); | |
650 | if(trackCuts->IsSelected(track)) { | |
651 | static_cast<TObjArray*>(fTracks.At(itf))->Add(track); | |
652 | } | |
653 | } | |
439cf020 | 654 | } |
3b77b2d1 | 655 | } |
3eeea1ba | 656 | |
99d49b30 | 657 | |
65ec4890 | 658 | Bool_t lowtrackmap[ntrackfilters[0]][ttracks->GetEntriesFast()]; |
659 | ///Check lowside cuts | |
660 | for(Int_t iTrack = 0; iTrack < ttracks->GetEntriesFast(); iTrack++ ) { | |
661 | AliVTrack * track = static_cast<AliVTrack*>(ttracks->At(iTrack)); | |
662 | for(Int_t itf = 0; itf < ntrackfilters[0]; itf++) { | |
663 | AliAnalysisCuts * trackCuts = static_cast<AliAnalysisCuts*>(fTrackFilters[0].At(itf)); | |
664 | if(!trackCuts->IsSelected(track)) { | |
665 | lowtrackmap[itf][iTrack] = kTRUE; | |
666 | } else { | |
667 | lowtrackmap[itf][iTrack] = kFALSE; | |
668 | } | |
669 | } | |
670 | } | |
99d49b30 | 671 | |
65ec4890 | 672 | hTrackCent->Fill(centrality, ttracks->GetEntriesFast()); |
673 | ||
674 | const Double_t etalim[2] = { fAxisTrigEta.GetXmin(), fAxisTrigEta.GetXmax()}; | |
675 | if(DebugLevel() > 4) printf("Number of accepted gammas, tracks %d %d \n", ggammas->GetEntriesFast(), ttracks->GetEntriesFast()); | |
ca257f2a | 676 | |
65ec4890 | 677 | //AliAnaConvCorrBase * gCorr = fPhotonCorr; //GetCorrObject(vertexBin, centBin, fPhotonCorr); |
678 | // AliAnaConvCorrPion * piCorr = fPionCorr; //static_cast<AliAnaConvCorrPion*>(GetCorrObject(vertexBin, centBin, fPionCorr)); | |
99d49b30 | 679 | |
65ec4890 | 680 | // if(!piCorr) { |
681 | // AliError("corr object missing"); | |
682 | // return; | |
683 | // } | |
ca257f2a | 684 | |
ca257f2a | 685 | TObjArray pions; |
99d49b30 | 686 | |
65ec4890 | 687 | ///corr values |
688 | Double_t dphivalues[fAxesList.GetSize()]; | |
689 | dphivalues[4] = centrality; | |
690 | dphivalues[5] = vertexz; | |
691 | ||
692 | ///Trigger me counters | |
693 | Double_t trigValues[7]; | |
694 | trigValues[2] = centrality; | |
695 | trigValues[3] = vertexz; | |
696 | ||
697 | ///Mass histogram | |
698 | Double_t massval[5]; | |
699 | massval[2] = centrality; | |
700 | ||
701 | ///Set up track me counters and initialize | |
702 | const Int_t nbins = fAxistPt.GetNbins(); | |
703 | Bool_t tmap[fAxistPt.GetNbins()]; | |
704 | Bool_t lv0tmap[fAxistPt.GetNbins()][fV0Filters[0].GetEntriesFast()]; | |
705 | Bool_t uv0tmap[fAxistPt.GetNbins()][fV0Filters[1].GetEntriesFast()]; | |
706 | ||
707 | Bool_t lpitmap[fAxistPt.GetNbins()][fMesonFilters[0].GetEntriesFast()]; | |
708 | Bool_t upitmap[fAxistPt.GetNbins()][fMesonFilters[1].GetEntriesFast()]; | |
709 | ||
65ec4890 | 710 | for(Int_t igf = 0; igf < fV0Filters[0].GetEntriesFast(); igf++) { |
711 | for(Int_t ptbin = 0; ptbin < fAxistPt.GetNbins(); ptbin++) { | |
712 | lv0tmap[ptbin][igf] = kFALSE; | |
713 | } | |
714 | } | |
715 | ||
716 | for(Int_t igf = 0; igf < fV0Filters[1].GetEntriesFast(); igf++) { | |
717 | for(Int_t ptbin = 0; ptbin < fAxistPt.GetNbins(); ptbin++) { | |
718 | uv0tmap[ptbin][igf] = kFALSE; | |
719 | } | |
720 | } | |
721 | ||
722 | for(Int_t igf = 0; igf < fMesonFilters[0].GetEntriesFast(); igf++) { | |
723 | for(Int_t ptbin = 0; ptbin < fAxistPt.GetNbins(); ptbin++) { | |
724 | lpitmap[ptbin][igf] = kFALSE; | |
725 | } | |
726 | } | |
727 | ||
728 | for(Int_t igf = 0; igf < fMesonFilters[1].GetEntriesFast(); igf++) { | |
729 | for(Int_t ptbin = 0; ptbin < fAxistPt.GetNbins(); ptbin++) { | |
730 | upitmap[ptbin][igf] = kFALSE; | |
731 | } | |
732 | } | |
733 | ||
734 | for(Int_t ptbin = 0; ptbin < nbins; ptbin++){ | |
735 | tmap[ptbin] = kFALSE; | |
736 | } | |
737 | ||
738 | ///////////////////////////////////////// | |
739 | ||
740 | ||
741 | for(Int_t igf1 = 0; igf1 < fV0Filters[1].GetEntriesFast() + 1; igf1++) { | |
742 | TObjArray * gamm1 = static_cast<TObjArray*>(fGammas.At(igf1)); | |
743 | for(Int_t i1 = 0; i1 < gamm1->GetEntriesFast(); i1++) { | |
744 | AliAODConversionPhoton * ph1 = static_cast<AliAODConversionPhoton*>(gamm1->UncheckedAt(i1)); | |
745 | Int_t tIDs[4] = {ph1->GetLabel(0), ph1->GetLabel(1), -1, -1}; | |
746 | ||
747 | ///Combine gamma into pions | |
748 | Int_t igmax = 0; | |
749 | for(Int_t igf2 = 0; igf2 <= igf1; igf2++) { | |
750 | TObjArray * gamm2 = NULL; | |
751 | if(igf2 == igf1) { | |
752 | gamm2 = gamm1; | |
753 | igmax = i1; | |
754 | } else { | |
755 | gamm2 = static_cast<TObjArray*>(fGammas.At(igf2)); | |
756 | igmax = gamm2->GetEntriesFast(); | |
757 | } | |
758 | ||
759 | for(Int_t i2 = 0; i2 < igmax; i2++) { | |
760 | AliAODConversionPhoton * ph2 = static_cast<AliAODConversionPhoton*>(gamm2->UncheckedAt(i2)); | |
761 | ||
762 | if( ph2->GetTrackLabelPositive()==ph1->GetTrackLabelPositive() | |
763 | || ph2->GetTrackLabelNegative()==ph1->GetTrackLabelNegative() | |
764 | || ph2->GetTrackLabelNegative()==ph1->GetTrackLabelPositive() | |
765 | || ph2->GetTrackLabelPositive()==ph1->GetTrackLabelNegative()) { | |
766 | continue; | |
767 | } | |
768 | ||
769 | AliAODConversionMother * pion = new AliAODConversionMother(ph1, ph2); | |
770 | if(pion->Eta() < etalim[0] || pion->Eta() > etalim[1]) continue; | |
771 | pion->CalculateDistanceOfClossetApproachToPrimVtx(fInputEvent->GetPrimaryVertex()); | |
772 | ||
773 | ||
774 | tIDs[2] = ph2->GetLabel(0); | |
775 | tIDs[3] = ph2->GetLabel(1); | |
776 | ||
777 | massval[0] = pion->M(); | |
778 | massval[1] = pion->Pt(); | |
779 | massval[3] = igf1; | |
780 | massval[4] = 0; | |
781 | ||
782 | dphivalues[2] = pion->Pt(); | |
783 | dphivalues[6] = pion->M(); | |
784 | dphivalues[8] = igf1; | |
785 | dphivalues[9] = 0; | |
786 | ||
787 | trigValues[0] = pion->Eta(); | |
788 | trigValues[1] = pion->Pt(); | |
789 | trigValues[4] = pion->M(); | |
790 | trigValues[5] = igf1; | |
791 | trigValues[6] = 0; | |
792 | ||
793 | ||
794 | ///Check that particle is in histo phase space | |
795 | if(pion->Pt() > fAxistPt.GetBinLowEdge(1) && pion->Pt() < fAxistPt.GetXmax() && | |
796 | pion->Eta() > etalim[0] && pion->Eta() < etalim[1] && | |
797 | pion->M() > 0.04 && pion->M() < 0.4 | |
798 | ) { | |
799 | ||
800 | ||
801 | if(fMesonFilter->MesonIsSelected(pion, kTRUE)) { | |
802 | ||
803 | fMassSparse->Fill(massval); | |
804 | ||
805 | Bool_t lpimap[fMesonFilters[0].GetEntriesFast()]; | |
806 | ///See if it passes lowside cuts | |
807 | if(igf1 == 0 && igf2 == 0) { | |
808 | ||
809 | ///Low side pion | |
810 | massval[3] = 0; | |
811 | for(Int_t ilpf = 0; ilpf < fMesonFilters[0].GetEntriesFast(); ilpf++) { | |
812 | if(!(static_cast<AliConversionMesonCuts*>(fMesonFilters[0].At(ilpf))->MesonIsSelected(pion, kTRUE))) { | |
813 | lpimap[ilpf] = kTRUE; | |
814 | massval[4] = -(ilpf + 1); | |
815 | fMassSparse->Fill(massval); | |
816 | } else { | |
817 | lpimap[ilpf] = kFALSE; | |
818 | } | |
819 | massval[4] = 0; | |
820 | } | |
821 | ///Lowside v0 | |
822 | for(Int_t iglf = 0; iglf < fV0Filters[0].GetEntriesFast(); iglf++) { | |
823 | if(lowgmap[iglf][i1] || lowgmap[iglf][i2]){ | |
824 | massval[3] = -(iglf+1); | |
825 | fMassSparse->Fill(massval); | |
826 | } | |
827 | } | |
828 | massval[3] = 0; | |
829 | } /// End lowside mass histo fillers | |
830 | ||
831 | ||
832 | ///Check that particle is in histo phase space | |
833 | if(pion->Pt() > fAxistPt.GetBinLowEdge(1) && pion->Pt() < fAxistPt.GetXmax() && | |
834 | pion->M() > fAxisPiM.GetXmin() && pion->M() < fAxisPiM.GetXmax() && | |
835 | pion->Eta() > etalim[0] && pion->Eta() < etalim[1]) { | |
836 | ||
837 | ||
838 | const Int_t tbin = fAxistPt.FindFixBin(pion->Pt()); | |
839 | ||
840 | ///Fill standard triggers including upside v0 filters | |
841 | fTrigSparse->Fill(trigValues); | |
842 | ||
843 | ||
844 | if(igf1 == 0 && igf2 == 0) { | |
845 | // piCorr->FillTriggerCounters(pion); | |
846 | // piCorr->CorrelateWithTracks(pion, &tracks[0], tIDs, centrality, vertexz); | |
847 | ||
848 | ||
849 | ////Only mix events with pion in signal region | |
850 | if(pion->M() > 0.1 && pion->M() < 0.15) { | |
851 | ||
852 | ||
853 | ///Check trigger bin | |
854 | if (tbin > 0 && tbin < (nbins + 1)) { | |
855 | tmap[tbin-1] = kTRUE; | |
856 | } | |
857 | ||
858 | ///Check if trigger also in low side (both gamma present in low side!) | |
859 | for(Int_t ilgf = 0; ilgf < fV0Filters[0].GetEntriesFast(); ilgf++) { | |
860 | if(!lowgmap[ilgf][i1] && !lowgmap[ilgf][i2]) { | |
861 | lv0tmap[tbin-1][ilgf] = kTRUE; | |
862 | } | |
863 | } | |
864 | ||
865 | ///See if the lowside pion filter also passes this, if not | |
866 | for(Int_t ilpf = 0; ilpf < fMesonFilters[0].GetEntriesFast(); ilpf++) { | |
867 | if(!lpimap[ilpf]) { | |
868 | lpitmap[tbin-1][ilpf] = kTRUE; | |
869 | } | |
870 | } | |
871 | } | |
872 | ||
873 | } else { | |
874 | if(pion->M() > 0.1 && pion->M() < 0.15) { | |
875 | uv0tmap[tbin-1][igf1 - 1] = kTRUE; | |
876 | } | |
877 | } | |
878 | ||
879 | ||
880 | ///Fill the triggers not selected in lowside filters only if passsing standard v0 filter | |
881 | if(igf1 == 0 && igf2 == 0) { | |
882 | ||
883 | ///Lowside v0 filters | |
884 | for(Int_t iglf = 0; iglf < fV0Filters[0].GetEntriesFast(); iglf++) { | |
885 | if(lowgmap[iglf][i1] || lowgmap[iglf][i2]){ | |
886 | trigValues[5] = -(iglf+1); | |
887 | fTrigSparse->Fill(trigValues); | |
888 | } | |
889 | } | |
890 | ||
891 | ////Low side pion filters | |
892 | trigValues[5] = 0; | |
893 | for(Int_t iplf = 0; iplf < fMesonFilters[0].GetEntriesFast(); iplf ++) { | |
894 | if(lpimap[iplf]) { | |
895 | trigValues[6] = -(iplf + 1); | |
896 | fTrigSparse->Fill(trigValues); | |
897 | } | |
898 | } | |
899 | } // ifg1 == 0 | |
900 | ||
901 | trigValues[5] = igf1; | |
902 | trigValues[6] = 0; | |
903 | ||
904 | /////////////////////////////////////////////// | |
905 | /// Correlate with tracks | |
906 | /////////////////////////////////////////////// | |
907 | ||
908 | Int_t ntf = 1; | |
909 | if(igf1 == 0 && igf2 == 0) { | |
910 | ntf = fTrackFilters[1].GetEntriesFast() + 1; | |
911 | } | |
912 | ||
913 | for(Int_t itf = 0; itf < ntf; itf++) { | |
914 | TObjArray * tracks = static_cast<TObjArray*>(fTracks.At(itf)); | |
915 | for(int ij = 0; ij < tracks->GetEntriesFast(); ij++) { | |
916 | AliVTrack * track = static_cast<AliVTrack*>(tracks->At(ij)); | |
917 | Int_t tid = track->GetID(); | |
266ffce4 SL |
918 | |
919 | ||
920 | if(tid == tIDs[0] || tid == tIDs[1] || tid == tIDs[2] || tid == tIDs[3]) { | |
65ec4890 | 921 | continue; |
922 | } | |
266ffce4 SL |
923 | |
924 | if(tid < 0) { | |
925 | if(-tid-1 == tIDs[0]+1 || -tid-1 == tIDs[1]+1 || -tid-1 == tIDs[2]+1 || -tid-1 == tIDs[3]+1) { | |
926 | continue; | |
927 | } | |
928 | } | |
929 | ||
65ec4890 | 930 | |
931 | dphivalues[0] = pion->Eta() - track->Eta(); | |
932 | dphivalues[1] = GetDPhi(pion->Phi() - track->Phi()); | |
933 | dphivalues[3] = track->Pt(); | |
934 | dphivalues[7] = itf; | |
935 | dphivalues[8] = igf1; | |
936 | dphivalues[9] = 0; | |
937 | fCorrSparse->Fill(dphivalues); | |
c15c23b8 | 938 | |
6252ea9d | 939 | |
65ec4890 | 940 | if(itf == 0 && igf1 == 0 && igf2 == 0) { |
941 | ///Fill the low side track filters | |
942 | for(Int_t itlf = 0; itlf < fTrackFilters[0].GetEntriesFast(); itlf++) { | |
943 | if(lowtrackmap[itlf][ij]){ | |
944 | dphivalues[7] = -(itlf+1); | |
945 | fCorrSparse->Fill(dphivalues); | |
946 | } | |
947 | } | |
948 | ///Fill the low side v0 filters | |
949 | dphivalues[7] = 0; | |
950 | for(Int_t iglf = 0; iglf < fV0Filters[0].GetEntriesFast(); iglf++) { | |
951 | if(lowgmap[iglf][i1] || lowgmap[iglf][i2]){ | |
952 | dphivalues[8] = -(iglf+1); | |
953 | fCorrSparse->Fill(dphivalues); | |
954 | } | |
955 | } | |
956 | ||
957 | ///Fill the low side pi filter | |
958 | dphivalues[7] = 0; | |
959 | dphivalues[8] = 0; | |
960 | for(Int_t iplf = 0; iplf < fMesonFilters[0].GetEntriesFast(); iplf ++) { | |
961 | if(lpimap[iplf]) { | |
962 | dphivalues[9] = -(iplf + 1); | |
963 | fCorrSparse->Fill(dphivalues); | |
964 | } | |
965 | } | |
966 | } /// end non standard filters track corr | |
967 | ||
968 | } // end for tracks | |
969 | } // end trackfilters loop | |
970 | } //end check pion in histogram range to prevent overflow | |
971 | } else { | |
972 | ///////////////////////////// | |
973 | //// Not passing standard meson cuts, check upside filters | |
974 | //////////////////////////// | |
975 | ||
976 | ///Only check the pions from standard v0 filter | |
977 | if(igf1 == 0 && igf2 == 0) { | |
978 | for(Int_t ipuf = 0; ipuf < fMesonFilters[1].GetEntriesFast(); ipuf++) { | |
979 | if(static_cast<AliConversionMesonCuts*>(fMesonFilters[1].At(ipuf))->MesonIsSelected(pion, kTRUE)) { | |
980 | ///Fill invariant mass hist | |
981 | massval[4] = (ipuf + 1); | |
982 | fMassSparse->Fill(massval); | |
983 | ///Check that particle is in histo phase space --- redundant! | |
984 | ||
985 | ||
986 | ||
987 | if(pion->Pt() > fAxistPt.GetBinLowEdge(1) && pion->Pt() < fAxistPt.GetXmax() && | |
988 | pion->M() > fAxisPiM.GetXmin() && pion->M() < fAxisPiM.GetXmax() && | |
989 | pion->Eta() > etalim[0] && pion->Eta() < etalim[1]) { | |
990 | ||
991 | ||
992 | ////Only mix events with pion in signal region | |
993 | if(pion->M() > 0.1 && pion->M() < 0.15) { | |
994 | const Int_t tbin = fAxistPt.FindFixBin(pion->Pt()); | |
995 | upitmap[tbin-1][ipuf] = kTRUE; | |
996 | } | |
997 | ||
998 | ///Fill trigger counters | |
999 | trigValues[6] = (ipuf + 1); | |
1000 | fTrigSparse->Fill(trigValues); | |
1001 | ||
1002 | ///Correlate with standard tracks | |
1003 | for(int ij = 0; ij < ttracks->GetEntriesFast(); ij++) { | |
1004 | AliVTrack * track = static_cast<AliVTrack*>(ttracks->At(ij)); | |
1005 | Int_t tid = track->GetID(); | |
1006 | ||
266ffce4 | 1007 | if(tid == tIDs[0] || tid == tIDs[1] || tid == tIDs[2] || tid == tIDs[3] ) { |
65ec4890 | 1008 | continue; |
1009 | } | |
266ffce4 SL |
1010 | |
1011 | if(tid < 0) { | |
1012 | if(-tid-1 == tIDs[0]+1 || -tid-1 == tIDs[1]+1 || -tid-1 == tIDs[2]+1 || -tid-1 == tIDs[3]+1) { | |
1013 | continue; | |
1014 | } | |
1015 | } | |
1016 | ||
65ec4890 | 1017 | dphivalues[0] = pion->Eta() - track->Eta(); |
1018 | dphivalues[1] = GetDPhi(pion->Phi() - track->Phi()); | |
1019 | dphivalues[3] = track->Pt(); | |
1020 | dphivalues[7] = 0; // track filter | |
1021 | dphivalues[8] = 0; // v0 filter | |
1022 | dphivalues[9] = ipuf + 1; // pion filter | |
1023 | fCorrSparse->Fill(dphivalues); | |
1024 | } /// end track corr | |
1025 | } | |
1026 | } // MesonIsSelected | |
1027 | } | |
1028 | } | |
1029 | } /// end else .. end upside meson filters | |
1030 | ///////////////////////////////////////////// | |
1031 | } ///Etalim && pt limits | |
1032 | ||
1033 | ||
1034 | } // i2 second gamma | |
1035 | } | |
1036 | } // i1 first gamma | |
1037 | } | |
1038 | //FillCounters(&pions, tracks, ntrackfilters, centrality, vertexz); | |
1039 | ||
1040 | ///////Fill track counters after entire event has been passed through | |
1041 | //// | |
1042 | ||
1043 | Double_t trackValues[fTrackAxesList.GetSize()]; | |
1044 | trackValues[3] = centrality; | |
1045 | trackValues[4] = vertexz; | |
1046 | //trackValues[5] = particle->M(); remove !!! | |
1047 | ||
1048 | for(Int_t tbin = 0; tbin < fAxistPt.GetNbins(); tbin++) { | |
1049 | trackValues[1] = fAxistPt.GetBinCenter(tbin+1); | |
1050 | ||
1051 | if(tmap[tbin]) { | |
1052 | ||
1053 | for(Int_t itf = 0; itf < fTrackFilters[1].GetEntriesFast() + 1; itf++) { | |
1054 | TObjArray * tracks = static_cast<TObjArray*>(fTracks.At(itf)); | |
1055 | for(Int_t iTrack = 0; iTrack < tracks->GetEntriesFast(); iTrack++) { | |
1056 | AliVTrack * track = static_cast<AliVTrack*>(tracks->At(iTrack)); | |
1057 | trackValues[0] = track->Eta(); | |
1058 | trackValues[2] = track->Pt(); | |
1059 | trackValues[5] = itf; | |
1060 | trackValues[6] = 0; ///v0 filter | |
1061 | trackValues[7] = 0; ////Pi filter | |
1062 | fTrackSparse->Fill(trackValues); | |
1063 | ||
1064 | if(itf == 0) { | |
1065 | for(Int_t itlf = 0; itlf < fTrackFilters[0].GetEntriesFast(); itlf++) { | |
1066 | if(lowtrackmap[itlf][iTrack]) { | |
1067 | trackValues[5] = -(itlf + 1); | |
1068 | fTrackSparse->Fill(trackValues); | |
1069 | } | |
1070 | } | |
1071 | trackValues[5] = 0; | |
1072 | ||
1073 | ///Check lowside gamma | |
1074 | for(Int_t iglf = 0; iglf < fV0Filters[0].GetEntriesFast(); iglf++) { | |
1075 | if(!lv0tmap[tbin][iglf]) { | |
1076 | trackValues[6] = -(iglf + 1); | |
1077 | fTrackSparse->Fill(trackValues); | |
1078 | } | |
1079 | } | |
1080 | trackValues[6] = 0; | |
1081 | ||
1082 | ////Check lowside pion | |
1083 | for(Int_t iplf = 0; iplf < fMesonFilters[0].GetEntriesFast(); iplf++) { | |
1084 | if(!lpitmap[tbin][iplf]) { | |
1085 | trackValues[7] = -(iplf + 1); | |
1086 | fTrackSparse->Fill(trackValues); | |
1087 | } | |
1088 | } | |
1089 | ||
1090 | ||
1091 | ||
1092 | } // itf == 00 | |
1093 | } | |
1094 | } | |
1095 | } else { | |
1096 | ///If not in main, see if in upside filters | |
1097 | ///Do upside v0 filters | |
1098 | for(Int_t iguf = 0; iguf < fV0Filters[1].GetEntriesFast(); iguf++) { | |
1099 | if (uv0tmap[tbin][iguf] ) { | |
1100 | ||
266ffce4 | 1101 | //cout << "c vtx " << centrality << vertexz << endl; |
65ec4890 | 1102 | |
1103 | for(Int_t iTrack = 0; iTrack < ttracks->GetEntriesFast(); iTrack++) { | |
1104 | AliVTrack * track = static_cast<AliVTrack*>(ttracks->At(iTrack)); | |
1105 | trackValues[0] = track->Eta(); | |
1106 | trackValues[2] = track->Pt(); | |
1107 | trackValues[5] = 0; | |
1108 | trackValues[6] = iguf+1; ///v0 filter | |
1109 | trackValues[7] = 0; ////Pi filter | |
1110 | fTrackSparse->Fill(trackValues); | |
6252ea9d | 1111 | } |
439cf020 | 1112 | } |
c15c23b8 | 1113 | } |
65ec4890 | 1114 | ///Do upside pi filter |
1115 | for(Int_t ipuf = 0; ipuf < fMesonFilters[1].GetEntriesFast(); ipuf++) { | |
1116 | if (upitmap[tbin][ipuf] ) { | |
c15c23b8 | 1117 | |
266ffce4 | 1118 | //cout << "c2 vtx2 " << centrality << vertexz << endl; |
99d49b30 | 1119 | |
65ec4890 | 1120 | |
1121 | for(Int_t iTrack = 0; iTrack < ttracks->GetEntriesFast(); iTrack++) { | |
1122 | AliVTrack * track = static_cast<AliVTrack*>(ttracks->At(iTrack)); | |
1123 | trackValues[0] = track->Eta(); | |
1124 | trackValues[2] = track->Pt(); | |
1125 | trackValues[5] = 0; | |
1126 | trackValues[6] = 0; ///v0 filter | |
1127 | trackValues[7] = ipuf+1; ////Pi filter | |
1128 | fTrackSparse->Fill(trackValues); | |
1129 | } | |
3b77b2d1 | 1130 | } |
c15c23b8 | 1131 | } |
1132 | } | |
3b77b2d1 | 1133 | } |
c15c23b8 | 1134 | |
65ec4890 | 1135 | |
1136 | ||
1137 | ////// | |
1138 | ////// | |
1139 | ||
1140 | ||
1141 | ||
1142 | //piCorr->FillCounters(&pions, tracks, centrality, vertexz); | |
1143 | ||
1144 | PostData(1, fHistograms); | |
1145 | ||
3b77b2d1 | 1146 | } |
1147 | ||
65ec4890 | 1148 | //_______________________________________________________________________________ |
1149 | // void AliAnalysisTaskdPhi::FillCounters(TObjArray * particles, TObjArray tracks[], Int_t ntrackfilters, Float_t cent, Float_t vtxz) { | |
1150 | ||
1151 | // return; | |
1152 | ||
1153 | ||
1154 | // //Fill ME Counters | |
1155 | // const Int_t nbins = fAxistPt.GetNbins(); | |
1156 | // Bool_t tmap[nbins]; | |
1157 | // for(Int_t ptbin = 0; ptbin < nbins; ptbin++){ | |
1158 | // tmap[ptbin] = kFALSE; | |
1159 | // } | |
1160 | // } | |
1161 | ||
1162 | ||
1163 | // Double_t trackValues[fTrackAxesList.GetSize()]; | |
1164 | // trackValues[3] = cent; | |
1165 | // trackValues[4] = vtxz; | |
1166 | ||
1167 | // for(Int_t ip = 0; ip < particles->GetEntriesFast(); ip++){ | |
1168 | // AliAODConversionParticle * particle = static_cast<AliAODConversionParticle*>(particles->At(ip)); | |
1169 | ||
1170 | // Int_t tbin = fAxistPt.FindFixBin(particle->Pt()); | |
1171 | // if (tbin > 0 && tbin < nbins + 1) { | |
1172 | // if(tmap[tbin - 1] == kTRUE) { | |
1173 | // continue; | |
1174 | // } else { | |
1175 | // tmap[tbin -1 ] = kTRUE; | |
1176 | ||
1177 | // trackValues[5] = particle->M(); | |
1178 | // trackValues[1] = particle->Pt(); | |
1179 | ||
1180 | // for(Int_t itf = 0; itf < ntrackfilters; itf++) { | |
1181 | // if(fkTrackAxis) trackValues[6] = itf; | |
1182 | // for(int ij = 0; ij < tracks[itf].GetEntriesFast(); ij++) { | |
1183 | // AliVTrack * track = static_cast<AliVTrack*>(tracks->UncheckedAt(ij)); | |
1184 | // trackValues[0] = track->Eta(); | |
1185 | // trackValues[2] = track->Pt(); | |
1186 | // fTrackSparse->Fill(trackValues); | |
1187 | // } | |
1188 | // } | |
1189 | // } | |
1190 | // } | |
1191 | // } | |
1192 | // } | |
1193 | ||
1194 | ||
1195 | ||
1196 | ||
1197 | // //________________________________________________________________ | |
1198 | // void AliAnalysisTaskdPhi::CorrelateWithTracks(AliAODConversionParticle * particle, TObjArray tracks[], Int_t ntrackfilters, Bool_t ** lowtrackmap, Int_t nltf, Int_t const tIDs[4], Double_t dphivalues[]) { | |
1199 | // //Correlate particle with tracks | |
1200 | // ///Correlate with tracks | |
1201 | ||
1202 | // } | |
1203 | ||
3b77b2d1 | 1204 | //________________________________________________________________________ |
1205 | void AliAnalysisTaskdPhi::Terminate(Option_t *) { | |
1206 | ||
1207 | // Draw result to the screen | |
1208 | // Called once at the end of the query | |
1209 | } | |
1210 | ||
1211 | //________________________________________________________________________ | |
1212 | TClonesArray * AliAnalysisTaskdPhi::GetConversionGammas(Bool_t isAOD) { | |
3b77b2d1 | 1213 | if(isAOD) { |
1214 | ||
65ec4890 | 1215 | TClonesArray * gammas = dynamic_cast<TClonesArray*>(fInputEvent->FindListObject(fDeltaAODBranchName.Data())); |
1216 | if(gammas) { | |
1217 | return gammas; | |
1218 | } | |
1219 | ||
1220 | FindDeltaAODBranchName(fInputEvent); | |
1221 | gammas = dynamic_cast<TClonesArray*>(fInputEvent->FindListObject(fDeltaAODBranchName.Data())); | |
1222 | return gammas; | |
1223 | ||
3b77b2d1 | 1224 | } else { |
c15c23b8 | 1225 | TClonesArray * gammas = dynamic_cast<TClonesArray*>(GetInputData(1)); |
1226 | return gammas; | |
3b77b2d1 | 1227 | } |
65ec4890 | 1228 | |
3b77b2d1 | 1229 | } |
1230 | ||
1231 | //________________________________________________________________________ | |
e3598cd0 | 1232 | void AliAnalysisTaskdPhi::FindDeltaAODBranchName(AliVEvent * event){ |
3b77b2d1 | 1233 | ///Find aod branch |
1234 | TList *list=event->GetList(); | |
1235 | for(Int_t ii=0;ii<list->GetEntries();ii++){ | |
65ec4890 | 1236 | TString name((list->At(ii))->GetName()); |
1237 | if(name.BeginsWith("GammaConv")&&name.EndsWith("gamma")){ | |
1238 | fDeltaAODBranchName=name; | |
1239 | AliDebug(AliLog::kDebug + 5, Form("Set DeltaAOD BranchName to: %s",fDeltaAODBranchName.Data())); | |
1240 | return; | |
1241 | } | |
3b77b2d1 | 1242 | } |
1243 | } | |
1244 | ||
1245 |