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