AliPhysics  59e0e03 (59e0e03)
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  tc->DeleteTracks();
566  }
567 
568  for(Int_t i = 0; i < fTrackFilters[0].GetEntriesFast(); i++){
569  AliConversionTrackCuts * tct = dynamic_cast<AliConversionTrackCuts*>(fTrackFilters[0].At(i));
570  if(tct) {
571  tct->SetEvent(fInputEvent);
572  tct->DeleteTracks();
573  }
574  }
575  for(Int_t i = 0; i < fTrackFilters[1].GetEntriesFast(); i++){
576  AliConversionTrackCuts * tct = dynamic_cast<AliConversionTrackCuts*>(fTrackFilters[1].At(i));
577  if(tct) {
578  tct->SetEvent(fInputEvent);
579  tct->DeleteTracks();
580  }
581  }
582 
583  Double_t centrality = 0.0;
584  Double_t vertexz = fInputEvent->GetPrimaryVertex()->GetZ();
585  if(isAOD) {
586  AliAODHeader * header = static_cast<AliAODHeader*>(fInputEvent->GetHeader());
587  centrality = header->GetCentrality();
588  } else {
589  centrality = static_cast<AliESDEvent*>(fInputEvent)->GetCentrality()->GetCentralityPercentile("V0M");
590  }
591 
592  const Int_t centBin = GetBin(fAxisCent, centrality);
593  const Int_t vertexBin = GetBin(fAxisZ, vertexz);
594 
595  if(DebugLevel () > 4) {
596  cout << "centrality: " << centrality << " " << GetBin(fAxisCent, centrality) << endl;
597  cout << "vertexz: " << vertexz << " " << GetBin(fAxisZ, vertexz) << endl;
598  }
599 
600  if(centBin < 0 || vertexBin < 0) {
601  // AliError("bin out of range");
602  return;
603  }
604 
605 
606  //TClonesArray * aodGammas = GetConversionGammas(isAOD);
607  TClonesArray * aodGammas = fV0Reader->GetReconstructedGammas();
608  if(!aodGammas) {
609  AliError("no aod gammas found!");
610  return;
611  }
612 
613  TObjArray * ggammas = static_cast<TObjArray*>(fGammas.At(0));
614 
616  if(DebugLevel() > 1) printf("Number of conversion gammas %d \n", aodGammas->GetEntriesFast());
617  for(Int_t ig = 0; ig < aodGammas->GetEntriesFast(); ig++) {
618  AliAODConversionPhoton * photon = dynamic_cast<AliAODConversionPhoton*>(aodGammas->At(ig));
619  if(!photon) continue;
620  if(!fV0FilterPhoton || fV0FilterPhoton->PhotonIsSelected(photon, fInputEvent)) {
621  ggammas->Add(photon);
622  } else {
623  for(Int_t igf = 0; igf < fV0Filters[1].GetEntriesFast(); igf++) {
624  AliConversionPhotonCuts * gfilter = dynamic_cast<AliConversionPhotonCuts*>(fV0Filters[1].At(igf));
625  if(gfilter && gfilter->PhotonIsSelected(photon, fInputEvent)) {
626  static_cast<TObjArray*>(fGammas.At(igf+1))->Add(photon);
627  }
628  }
629  }
630  }
631 
632  Bool_t lowgmap[fV0Filters[0].GetEntriesFast()][ggammas->GetEntriesFast()];
633 
634  for(Int_t ig = 0; ig < ggammas->GetEntriesFast(); ig++ ) {
635  AliAODConversionPhoton * gamma = static_cast<AliAODConversionPhoton*>(ggammas->At(ig));
636  for(Int_t igf = 0; igf < fV0Filters[0].GetEntriesFast(); igf++) {
637 
638  AliConversionPhotonCuts * v0cuts = static_cast<AliConversionPhotonCuts*>(fV0Filters[0].At(igf));
639  if(!(v0cuts->PhotonIsSelected(gamma, fInputEvent))) {
640  lowgmap[igf][ig] = kTRUE;
641  } else {
642  lowgmap[igf][ig] = kFALSE;
643  }
644  }
645  }
646 
647 
648  if(DebugLevel() > 4) printf("Number of accepted gammas %d \n", ggammas->GetEntriesFast());
649  hMEvents->Fill(vertexz, centrality);
650 
652  const Int_t ntrackfilters[2] = { fTrackFilters[0].GetEntriesFast(), fTrackFilters[1].GetEntriesFast()};
653 
654  TObjArray * ttracks = static_cast<TObjArray*>(fTracks.At(0));
655  const Double_t aetalim[2] = { fAxisAssEta.GetXmin(), fAxisAssEta.GetXmax()};
656  const Double_t aptlim[2] = { fAxiscPt.GetXmin(), fAxiscPt.GetXmax()};
657  for(Int_t iTrack = 0; iTrack < fInputEvent->GetNumberOfTracks(); iTrack++) {
658  AliVTrack * track = static_cast<AliVTrack*>(fInputEvent->GetTrack(iTrack));
659  if(track->Pt() < aptlim[0] || track->Pt() > aptlim[1]) continue;
660  if(track->Eta() < aetalim[0] || track->Eta() > aetalim[1]) continue;
661  if(fTrackFilter->IsSelected(track)) {
662  hTrackPt->Fill(track->Pt(), centrality);
663  ttracks->Add(track);
664  } else {
666  for(Int_t itf = 1; itf < ntrackfilters[1] + 1; itf++) {
667  AliAnalysisCuts * trackCuts = static_cast<AliAnalysisCuts*>(fTrackFilters[1].At(itf -1));
668  if(trackCuts->IsSelected(track)) {
669  static_cast<TObjArray*>(fTracks.At(itf))->Add(track);
670  }
671  }
672  }
673  }
674 
675 
676  Bool_t lowtrackmap[ntrackfilters[0]][ttracks->GetEntriesFast()];
678  for(Int_t iTrack = 0; iTrack < ttracks->GetEntriesFast(); iTrack++ ) {
679  AliVTrack * track = static_cast<AliVTrack*>(ttracks->At(iTrack));
680  for(Int_t itf = 0; itf < ntrackfilters[0]; itf++) {
681  AliAnalysisCuts * trackCuts = static_cast<AliAnalysisCuts*>(fTrackFilters[0].At(itf));
682  if(!trackCuts->IsSelected(track)) {
683  lowtrackmap[itf][iTrack] = kTRUE;
684  } else {
685  lowtrackmap[itf][iTrack] = kFALSE;
686  }
687  }
688  }
689 
690  hTrackCent->Fill(centrality, ttracks->GetEntriesFast());
691 
692  const Double_t etalim[2] = { fAxisTrigEta.GetXmin(), fAxisTrigEta.GetXmax()};
693  if(DebugLevel() > 4) printf("Number of accepted gammas, tracks %d %d \n", ggammas->GetEntriesFast(), ttracks->GetEntriesFast());
694 
695  //AliAnaConvCorrBase * gCorr = fPhotonCorr; //GetCorrObject(vertexBin, centBin, fPhotonCorr);
696  // AliAnaConvCorrPion * piCorr = fPionCorr; //static_cast<AliAnaConvCorrPion*>(GetCorrObject(vertexBin, centBin, fPionCorr));
697  // if(!piCorr) {
698  // AliError("corr object missing");
699  // return;
700  // }
701 
702  TObjArray pions;
703 
705  Double_t dphivalues[fAxesList.GetSize()];
706  dphivalues[4] = centrality;
707  dphivalues[5] = vertexz;
708 
710  Double_t trigValues[7];
711  trigValues[2] = centrality;
712  trigValues[3] = vertexz;
713 
715  Double_t massval[5];
716  massval[2] = centrality;
717 
719  const Int_t nbins = fAxistPt.GetNbins();
720  Bool_t tmap[fAxistPt.GetNbins()];
721  Bool_t lv0tmap[fAxistPt.GetNbins()][fV0Filters[0].GetEntriesFast()];
722  Bool_t uv0tmap[fAxistPt.GetNbins()][fV0Filters[1].GetEntriesFast()];
723 
724  Bool_t lpitmap[fAxistPt.GetNbins()][fMesonFilters[0].GetEntriesFast()];
725  Bool_t upitmap[fAxistPt.GetNbins()][fMesonFilters[1].GetEntriesFast()];
726 
727  for(Int_t igf = 0; igf < fV0Filters[0].GetEntriesFast(); igf++) {
728  for(Int_t ptbin = 0; ptbin < fAxistPt.GetNbins(); ptbin++) {
729  lv0tmap[ptbin][igf] = kFALSE;
730  }
731  }
732 
733  for(Int_t igf = 0; igf < fV0Filters[1].GetEntriesFast(); igf++) {
734  for(Int_t ptbin = 0; ptbin < fAxistPt.GetNbins(); ptbin++) {
735  uv0tmap[ptbin][igf] = kFALSE;
736  }
737  }
738 
739  for(Int_t igf = 0; igf < fMesonFilters[0].GetEntriesFast(); igf++) {
740  for(Int_t ptbin = 0; ptbin < fAxistPt.GetNbins(); ptbin++) {
741  lpitmap[ptbin][igf] = kFALSE;
742  }
743  }
744 
745  for(Int_t igf = 0; igf < fMesonFilters[1].GetEntriesFast(); igf++) {
746  for(Int_t ptbin = 0; ptbin < fAxistPt.GetNbins(); ptbin++) {
747  upitmap[ptbin][igf] = kFALSE;
748  }
749  }
750 
751  for(Int_t ptbin = 0; ptbin < nbins; ptbin++){
752  tmap[ptbin] = kFALSE;
753  }
754 
756 
757 
758  for(Int_t igf1 = 0; igf1 < fV0Filters[1].GetEntriesFast() + 1; igf1++) {
759  TObjArray * gamm1 = static_cast<TObjArray*>(fGammas.At(igf1));
760  for(Int_t i1 = 0; i1 < gamm1->GetEntriesFast(); i1++) {
761  AliAODConversionPhoton * ph1 = static_cast<AliAODConversionPhoton*>(gamm1->UncheckedAt(i1));
762  Int_t tIDs[4] = {ph1->GetLabel(0), ph1->GetLabel(1), -1, -1};
763 
765  Int_t igmax = 0;
766  for(Int_t igf2 = 0; igf2 <= igf1; igf2++) {
767  TObjArray * gamm2 = NULL;
768  if(igf2 == igf1) {
769  gamm2 = gamm1;
770  igmax = i1;
771  } else {
772  gamm2 = static_cast<TObjArray*>(fGammas.At(igf2));
773  igmax = gamm2->GetEntriesFast();
774  }
775 
776  for(Int_t i2 = 0; i2 < igmax; i2++) {
777  AliAODConversionPhoton * ph2 = static_cast<AliAODConversionPhoton*>(gamm2->UncheckedAt(i2));
778 
779  if( ph2->GetTrackLabelPositive()==ph1->GetTrackLabelPositive()
782  || ph2->GetTrackLabelPositive()==ph1->GetTrackLabelNegative()) {
783  continue;
784  }
785 
786  AliAODConversionMother * pion = new AliAODConversionMother(ph1, ph2);
787  if(pion->Eta() < etalim[0] || pion->Eta() > etalim[1]) continue;
788  pion->CalculateDistanceOfClossetApproachToPrimVtx(fInputEvent->GetPrimaryVertex());
789 
790 
791  tIDs[2] = ph2->GetLabel(0);
792  tIDs[3] = ph2->GetLabel(1);
793 
794  massval[0] = pion->M();
795  massval[1] = pion->Pt();
796  massval[3] = igf1;
797  massval[4] = 0;
798 
799  dphivalues[2] = pion->Pt();
800  dphivalues[6] = pion->M();
801  dphivalues[8] = igf1;
802  dphivalues[9] = 0;
803 
804  trigValues[0] = pion->Eta();
805  trigValues[1] = pion->Pt();
806  trigValues[4] = pion->M();
807  trigValues[5] = igf1;
808  trigValues[6] = 0;
809 
810 
812  if(pion->Pt() > fAxistPt.GetBinLowEdge(1) && pion->Pt() < fAxistPt.GetXmax() &&
813  pion->Eta() > etalim[0] && pion->Eta() < etalim[1] &&
814  pion->M() > 0.04 && pion->M() < 0.4
815  ) {
816 
817 
818  if(fMesonFilter->MesonIsSelected(pion, kTRUE)) {
819 
820  fMassSparse->Fill(massval);
821 
822  Bool_t lpimap[fMesonFilters[0].GetEntriesFast()];
824  if(igf1 == 0 && igf2 == 0) {
825 
827  massval[3] = 0;
828  for(Int_t ilpf = 0; ilpf < fMesonFilters[0].GetEntriesFast(); ilpf++) {
829  if(!(static_cast<AliConversionMesonCuts*>(fMesonFilters[0].At(ilpf))->MesonIsSelected(pion, kTRUE))) {
830  lpimap[ilpf] = kTRUE;
831  massval[4] = -(ilpf + 1);
832  fMassSparse->Fill(massval);
833  } else {
834  lpimap[ilpf] = kFALSE;
835  }
836  massval[4] = 0;
837  }
839  for(Int_t iglf = 0; iglf < fV0Filters[0].GetEntriesFast(); iglf++) {
840  if(lowgmap[iglf][i1] || lowgmap[iglf][i2]){
841  massval[3] = -(iglf+1);
842  fMassSparse->Fill(massval);
843  }
844  }
845  massval[3] = 0;
846  }
847 
848 
850  if(pion->Pt() > fAxistPt.GetBinLowEdge(1) && pion->Pt() < fAxistPt.GetXmax() &&
851  pion->M() > fAxisPiM.GetXmin() && pion->M() < fAxisPiM.GetXmax() &&
852  pion->Eta() > etalim[0] && pion->Eta() < etalim[1]) {
853 
854  const Int_t tbin = fAxistPt.FindFixBin(pion->Pt());
856  fTrigSparse->Fill(trigValues);
857  if(igf1 == 0 && igf2 == 0) {
858  // piCorr->FillTriggerCounters(pion);
859  // piCorr->CorrelateWithTracks(pion, &tracks[0], tIDs, centrality, vertexz);
861  hTrigPt->Fill(pion->Pt(), centrality, pion->M());
862  if(pion->M() > 0.1 && pion->M() < 0.15) {
863  hTrigPhi->Fill(pion->Phi());
865  if (tbin > 0 && tbin < (nbins + 1)) {
866  tmap[tbin-1] = kTRUE;
867  }
869  for(Int_t ilgf = 0; ilgf < fV0Filters[0].GetEntriesFast(); ilgf++) {
870  if(!lowgmap[ilgf][i1] || !lowgmap[ilgf][i2]) {
871  lv0tmap[tbin-1][ilgf] = kTRUE;
872  }
873  }
875  for(Int_t ilpf = 0; ilpf < fMesonFilters[0].GetEntriesFast(); ilpf++) {
876  if(!lpimap[ilpf]) {
877  lpitmap[tbin-1][ilpf] = kTRUE;
878  }
879  }
880  }
881  } else {
882  if(pion->M() > 0.1 && pion->M() < 0.15) {
883  uv0tmap[tbin-1][igf1 - 1] = kTRUE;
884  }
885  }
886 
887 
889  if(igf1 == 0 && igf2 == 0) {
891  for(Int_t iglf = 0; iglf < fV0Filters[0].GetEntriesFast(); iglf++) {
892  if(lowgmap[iglf][i1] || lowgmap[iglf][i2]){
893  trigValues[5] = -(iglf+1);
894  fTrigSparse->Fill(trigValues);
895  }
896  }
898  trigValues[5] = 0;
899  for(Int_t iplf = 0; iplf < fMesonFilters[0].GetEntriesFast(); iplf ++) {
900  if(lpimap[iplf]) {
901  trigValues[6] = -(iplf + 1);
902  fTrigSparse->Fill(trigValues);
903  }
904  }
905  } // ifg1 == 0
906 
907  trigValues[5] = igf1;
908  trigValues[6] = 0;
909 
913 
914  Int_t ntf = 1;
915  if(igf1 == 0 && igf2 == 0) {
916  ntf = fTrackFilters[1].GetEntriesFast() + 1;
917  }
918 
919  for(Int_t itf = 0; itf < ntf; itf++) {
920  TObjArray * tracks = static_cast<TObjArray*>(fTracks.At(itf));
921  for(int ij = 0; ij < tracks->GetEntriesFast(); ij++) {
922  AliVTrack * track = static_cast<AliVTrack*>(tracks->At(ij));
923  Int_t tid = track->GetID();
924 
925  if(tid == tIDs[0] || tid == tIDs[1] || tid == tIDs[2] || tid == tIDs[3]) {
926  continue;
927  }
928 
929  if(tid < 0) {
930  if(-tid-1 == tIDs[0]+1 || -tid-1 == tIDs[1]+1 || -tid-1 == tIDs[2]+1 || -tid-1 == tIDs[3]+1) {
931  continue;
932  }
933  }
934 
935  dphivalues[0] = pion->Eta() - track->Eta();
936  dphivalues[1] = GetDPhi(pion->Phi() - track->Phi());
937  dphivalues[3] = track->Pt();
938  dphivalues[7] = itf;
939  dphivalues[8] = igf1;
940  dphivalues[9] = 0;
941  fCorrSparse->Fill(dphivalues, GetTrackCorrection(vertexz, track));
942 
943  if(itf == 0 && igf1 == 0 && igf2 == 0) {
945  for(Int_t itlf = 0; itlf < fTrackFilters[0].GetEntriesFast(); itlf++) {
946  if(lowtrackmap[itlf][ij]){
947  dphivalues[7] = -(itlf+1);
948  fCorrSparse->Fill(dphivalues, GetTrackCorrection(vertexz, track));
949  }
950  }
952  dphivalues[7] = 0;
953  for(Int_t iglf = 0; iglf < fV0Filters[0].GetEntriesFast(); iglf++) {
954  if(lowgmap[iglf][i1] || lowgmap[iglf][i2]){
955  dphivalues[8] = -(iglf+1);
956  fCorrSparse->Fill(dphivalues, GetTrackCorrection(vertexz, track));
957  }
958  }
959 
961  dphivalues[7] = 0;
962  dphivalues[8] = 0;
963  for(Int_t iplf = 0; iplf < fMesonFilters[0].GetEntriesFast(); iplf ++) {
964  if(lpimap[iplf]) {
965  dphivalues[9] = -(iplf + 1);
966  fCorrSparse->Fill(dphivalues, GetTrackCorrection(vertexz, track));
967  }
968  }
969  }
970 
971  } // end for tracks
972  } // end trackfilters loop
973  } //end check pion in histogram range to prevent overflow
974  } else {
978 
980  if(igf1 == 0 && igf2 == 0) {
981  for(Int_t ipuf = 0; ipuf < fMesonFilters[1].GetEntriesFast(); ipuf++) {
982  if(static_cast<AliConversionMesonCuts*>(fMesonFilters[1].At(ipuf))->MesonIsSelected(pion, kTRUE)) {
984  massval[4] = (ipuf + 1);
985  fMassSparse->Fill(massval);
987 
988 
989 
990  if(pion->Pt() > fAxistPt.GetBinLowEdge(1) && pion->Pt() < fAxistPt.GetXmax() &&
991  pion->M() > fAxisPiM.GetXmin() && pion->M() < fAxisPiM.GetXmax() &&
992  pion->Eta() > etalim[0] && pion->Eta() < etalim[1]) {
993 
994 
996  if(pion->M() > 0.1 && pion->M() < 0.15) {
997  const Int_t tbin = fAxistPt.FindFixBin(pion->Pt());
998  upitmap[tbin-1][ipuf] = kTRUE;
999  }
1000 
1002  trigValues[6] = (ipuf + 1);
1003  fTrigSparse->Fill(trigValues);
1004 
1006  for(int ij = 0; ij < ttracks->GetEntriesFast(); ij++) {
1007  AliVTrack * track = static_cast<AliVTrack*>(ttracks->At(ij));
1008  Int_t tid = track->GetID();
1009 
1010  if(tid == tIDs[0] || tid == tIDs[1] || tid == tIDs[2] || tid == tIDs[3] ) {
1011  continue;
1012  }
1013 
1014  if(tid < 0) {
1015  if(-tid-1 == tIDs[0]+1 || -tid-1 == tIDs[1]+1 || -tid-1 == tIDs[2]+1 || -tid-1 == tIDs[3]+1) {
1016  continue;
1017  }
1018  }
1019 
1020  dphivalues[0] = pion->Eta() - track->Eta();
1021  dphivalues[1] = GetDPhi(pion->Phi() - track->Phi());
1022  dphivalues[3] = track->Pt();
1023  dphivalues[7] = 0; // track filter
1024  dphivalues[8] = 0; // v0 filter
1025  dphivalues[9] = ipuf + 1; // pion filter
1026  fCorrSparse->Fill(dphivalues, GetTrackCorrection(vertexz, track));
1027  }
1028  }
1029  } // MesonIsSelected
1030  }
1031  }
1032  }
1033  }
1035  } // i2 second gamma
1036  }
1037  } // i1 first gamma
1038  }
1039  //FillCounters(&pions, tracks, ntrackfilters, centrality, vertexz);
1040 
1043 
1044  Double_t trackValues[fTrackAxesList.GetSize()];
1045  trackValues[3] = centrality;
1046  trackValues[4] = vertexz;
1047  //trackValues[5] = particle->M(); remove !!!
1048 
1049  for(Int_t tbin = 0; tbin < fAxistPt.GetNbins(); tbin++) {
1050  trackValues[1] = fAxistPt.GetBinCenter(tbin+1);
1051 
1052  if(tmap[tbin]) {
1053 
1054  for(Int_t itf = 0; itf < fTrackFilters[1].GetEntriesFast() + 1; itf++) {
1055  TObjArray * tracks = static_cast<TObjArray*>(fTracks.At(itf));
1056  for(Int_t iTrack = 0; iTrack < tracks->GetEntriesFast(); iTrack++) {
1057  AliVTrack * track = static_cast<AliVTrack*>(tracks->At(iTrack));
1058  trackValues[0] = track->Eta();
1059  trackValues[2] = track->Pt();
1060  trackValues[5] = itf;
1061  trackValues[6] = 0;
1062  trackValues[7] = 0;
1063  fTrackSparse->Fill(trackValues, GetTrackCorrection(vertexz, track));
1064 
1065  if(itf == 0) {
1066  for(Int_t itlf = 0; itlf < fTrackFilters[0].GetEntriesFast(); itlf++) {
1067  if(lowtrackmap[itlf][iTrack]) {
1068  trackValues[5] = -(itlf + 1);
1069  fTrackSparse->Fill(trackValues, GetTrackCorrection(vertexz, track) );
1070  }
1071  }
1072  trackValues[5] = 0;
1073 
1075  for(Int_t iglf = 0; iglf < fV0Filters[0].GetEntriesFast(); iglf++) {
1076  if(!lv0tmap[tbin][iglf]) {
1077  trackValues[6] = -(iglf + 1);
1078  fTrackSparse->Fill(trackValues, GetTrackCorrection(vertexz, track));
1079  }
1080  }
1081  trackValues[6] = 0;
1082 
1084  for(Int_t iplf = 0; iplf < fMesonFilters[0].GetEntriesFast(); iplf++) {
1085  if(!lpitmap[tbin][iplf]) {
1086  trackValues[7] = -(iplf + 1);
1087  fTrackSparse->Fill(trackValues, GetTrackCorrection(vertexz, track));
1088  }
1089  }
1090  } // itf == 00
1091  }
1092  }
1093  } else {
1096  for(Int_t iguf = 0; iguf < fV0Filters[1].GetEntriesFast(); iguf++) {
1097  if (uv0tmap[tbin][iguf] ) {
1098 
1099  //cout << "c vtx " << centrality << vertexz << endl;
1100 
1101  for(Int_t iTrack = 0; iTrack < ttracks->GetEntriesFast(); iTrack++) {
1102  AliVTrack * track = static_cast<AliVTrack*>(ttracks->At(iTrack));
1103  trackValues[0] = track->Eta();
1104  trackValues[2] = track->Pt();
1105  trackValues[5] = 0;
1106  trackValues[6] = iguf+1;
1107  trackValues[7] = 0;
1108  fTrackSparse->Fill(trackValues, GetTrackCorrection(vertexz, track));
1109  }
1110  }
1111  }
1113  for(Int_t ipuf = 0; ipuf < fMesonFilters[1].GetEntriesFast(); ipuf++) {
1114  if (upitmap[tbin][ipuf] ) {
1115  //cout << "c2 vtx2 " << centrality << vertexz << endl;
1116  for(Int_t iTrack = 0; iTrack < ttracks->GetEntriesFast(); iTrack++) {
1117  AliVTrack * track = static_cast<AliVTrack*>(ttracks->At(iTrack));
1118  trackValues[0] = track->Eta();
1119  trackValues[2] = track->Pt();
1120  trackValues[5] = 0;
1121  trackValues[6] = 0;
1122  trackValues[7] = ipuf+1;
1123  fTrackSparse->Fill(trackValues, GetTrackCorrection(vertexz, track));
1124  }
1125  }
1126  }
1127  }
1128  }
1131 
1132  //piCorr->FillCounters(&pions, tracks, centrality, vertexz);
1133 
1134  PostData(1, fHistograms);
1135 
1136 }
1137 
1138 //_______________________________________________________________________________
1139 // void AliAnalysisTaskdPhi::FillCounters(TObjArray * particles, TObjArray tracks[], Int_t ntrackfilters, Float_t cent, Float_t vtxz) {
1140 
1141 // return;
1142 
1143 
1144 // //Fill ME Counters
1145 // const Int_t nbins = fAxistPt.GetNbins();
1146 // Bool_t tmap[nbins];
1147 // for(Int_t ptbin = 0; ptbin < nbins; ptbin++){
1148 // tmap[ptbin] = kFALSE;
1149 // }
1150 // }
1151 
1152 
1153 // Double_t trackValues[fTrackAxesList.GetSize()];
1154 // trackValues[3] = cent;
1155 // trackValues[4] = vtxz;
1156 
1157 // for(Int_t ip = 0; ip < particles->GetEntriesFast(); ip++){
1158 // AliAODConversionParticle * particle = static_cast<AliAODConversionParticle*>(particles->At(ip));
1159 
1160 // Int_t tbin = fAxistPt.FindFixBin(particle->Pt());
1161 // if (tbin > 0 && tbin < nbins + 1) {
1162 // if(tmap[tbin - 1] == kTRUE) {
1163 // continue;
1164 // } else {
1165 // tmap[tbin -1 ] = kTRUE;
1166 
1167 // trackValues[5] = particle->M();
1168 // trackValues[1] = particle->Pt();
1169 
1170 // for(Int_t itf = 0; itf < ntrackfilters; itf++) {
1171 // if(fkTrackAxis) trackValues[6] = itf;
1172 // for(int ij = 0; ij < tracks[itf].GetEntriesFast(); ij++) {
1173 // AliVTrack * track = static_cast<AliVTrack*>(tracks->UncheckedAt(ij));
1174 // trackValues[0] = track->Eta();
1175 // trackValues[2] = track->Pt();
1176 // fTrackSparse->Fill(trackValues);
1177 // }
1178 // }
1179 // }
1180 // }
1181 // }
1182 // }
1183 
1184 
1185 
1186 
1187 // //________________________________________________________________
1188 // void AliAnalysisTaskdPhi::CorrelateWithTracks(AliAODConversionParticle * particle, TObjArray tracks[], Int_t ntrackfilters, Bool_t ** lowtrackmap, Int_t nltf, Int_t const tIDs[4], Double_t dphivalues[]) {
1189 // //Correlate particle with tracks
1190 // ///Correlate with tracks
1191 
1192 // }
1193 
1194 //________________________________________________________________________
1196 
1197  // Draw result to the screen
1198  // Called once at the end of the query
1199 }
1200 
1201 //________________________________________________________________________
1203  if(isAOD) {
1204 
1205  TClonesArray * gammas = dynamic_cast<TClonesArray*>(fInputEvent->FindListObject(fDeltaAODBranchName.Data()));
1206  if(gammas) {
1207  return gammas;
1208  }
1209 
1210  FindDeltaAODBranchName(fInputEvent);
1211  gammas = dynamic_cast<TClonesArray*>(fInputEvent->FindListObject(fDeltaAODBranchName.Data()));
1212  return gammas;
1213 
1214  } else {
1215  TClonesArray * gammas = dynamic_cast<TClonesArray*>(GetInputData(1));
1216  return gammas;
1217  }
1218 
1219 }
1220 
1221 //________________________________________________________________________
1224  TList *list=event->GetList();
1225  for(Int_t ii=0;ii<list->GetEntries();ii++){
1226  TString name((list->At(ii))->GetName());
1227  if(name.BeginsWith("GammaConv")&&name.EndsWith("gamma")){
1228  fDeltaAODBranchName=name;
1229  AliDebug(AliLog::kDebug + 5, Form("Set DeltaAOD BranchName to: %s",fDeltaAODBranchName.Data()));
1230  return;
1231  }
1232  }
1233 }
1234 
1235 
1236 //________________________________________________________________________
1239  Int_t coord[4] = {-1, -1, -1, -1};
1240  if(fCorrectionMap) {
1241  Double_t values[4] = { vtxz, track->Pt(), track->Eta(), track->Phi() };
1242  Double_t correction = fCorrectionMap->GetBinContent(fCorrectionMap->GetBin(values, kFALSE), coord);
1243  if (fCorrectionMap->IsInRange(coord)) {
1244  return correction;
1245  }
1246  }
1247  return 1.0;
1248 }
1249 
1250 
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)