1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 /* $Id: AliAnalysisTaskPi0V2.cxx 55404 2012-03-29 10:10:19Z fca $ */
18 /* AliAnalysisTaskPi0V2.cxx
20 * Template task producing a P_t spectrum and pseudorapidity distribution.
21 * Includes explanations of physics and primary track selections
23 * Instructions for adding histograms can be found below, starting with NEW HISTO
25 * Based on tutorial example from offline pages
26 * Edited by Arvinder Palaha
28 #include "AliAnalysisTaskPi0V2.h"
30 #include "Riostream.h"
39 #include "AliAnalysisTaskSE.h"
40 #include "AliAnalysisManager.h"
42 #include "AliESDtrackCuts.h"
43 #include "AliESDEvent.h"
44 #include "AliESDInputHandler.h"
45 #include "AliAODEvent.h"
46 #include "AliMCEvent.h"
48 #include "AliEventplane.h"
49 #include "AliEMCALGeometry.h"
50 #include "THnSparse.h"
55 ClassImp(AliAnalysisTaskPi0V2)
57 //________________________________________________________________________
58 AliAnalysisTaskPi0V2::AliAnalysisTaskPi0V2() // All data members should be initialised here
59 // :AliAnalysisTaskSE(),
68 fEPV0(-999.), fEPV0A(-999.), fEPV0C(-999.), fEPV0Ar(-999.), fEPV0Cr(-999.), fEPV0r(-999.),
69 fEPV0AR4(-999.), fEPV0AR5(-999.), fEPV0AR6(-999.), fEPV0AR7(-999.), fEPV0CR0(-999.), fEPV0CR1(-999.), fEPV0CR2(-999.), fEPV0CR3(-999.),
70 hEPTPC(0), hresoTPC(0),
71 hEPV0(0), hEPV0A(0), hEPV0C(0), hEPV0Ar(0), hEPV0Cr(0), hEPV0r(0), hEPV0AR4(0), hEPV0AR7(0), hEPV0CR0(0), hEPV0CR3(0),
72 hdifV0A_V0CR0(0), hdifV0A_V0CR3(0), hdifV0ACR0_V0CR3(0), hdifV0C_V0AR4(0), hdifV0C_V0AR7(0), hdifV0AR4_V0AR7(0),
73 hdifV0A_V0C(0), hdifV0A_TPC(0), hdifV0C_TPC(0), hdifV0C_V0A(0),
74 hdifEMC_EP(0), hdifful_EP(0), hdifout_EP(0),
75 fHEPV0r(0), fHEPV0A(0), fHEPV0C(0), fHEPTPC(0)
78 // Dummy constructor ALWAYS needed for I/O.
79 DefineInput(0, TChain::Class());
80 DefineOutput(1, TList::Class()); // for output list
83 //________________________________________________________________________
84 AliAnalysisTaskPi0V2::AliAnalysisTaskPi0V2(const char *name) // All data members should be initialised here
85 :AliAnalysisTaskSE(name),
93 fEPV0(-999.), fEPV0A(-999.), fEPV0C(-999.), fEPV0Ar(-999.), fEPV0Cr(-999.), fEPV0r(-999.),
94 fEPV0AR4(-999.), fEPV0AR5(-999.), fEPV0AR6(-999.), fEPV0AR7(-999.), fEPV0CR0(-999.), fEPV0CR1(-999.), fEPV0CR2(-999.), fEPV0CR3(-999.),
95 hEPTPC(0), hresoTPC(0),
96 hEPV0(0), hEPV0A(0), hEPV0C(0), hEPV0Ar(0), hEPV0Cr(0), hEPV0r(0), hEPV0AR4(0), hEPV0AR7(0), hEPV0CR0(0), hEPV0CR3(0),
97 hdifV0A_V0CR0(0), hdifV0A_V0CR3(0), hdifV0ACR0_V0CR3(0), hdifV0C_V0AR4(0), hdifV0C_V0AR7(0), hdifV0AR4_V0AR7(0),
98 hdifV0A_V0C(0), hdifV0A_TPC(0), hdifV0C_TPC(0), hdifV0C_V0A(0),
99 hdifEMC_EP(0), hdifful_EP(0), hdifout_EP(0),
100 fHEPV0r(0), fHEPV0A(0), fHEPV0C(0), fHEPTPC(0)
103 // Define input and output slots here (never in the dummy constructor)
104 // Input slot #0 works with a TChain - it is connected to the default input container
105 // Output slot #1 writes into a TH1 container
106 DefineInput(0, TChain::Class());
107 DefineOutput(1, TList::Class()); // for output list
110 //________________________________________________________________________
111 AliAnalysisTaskPi0V2::~AliAnalysisTaskPi0V2()
113 // Destructor. Clean-up the output list, but not the histograms that are put inside
114 // (the list is owner and will clean-up these histograms). Protect in PROOF case.
115 if (fOutput && !AliAnalysisManager::GetAnalysisManager()->IsProofMode()) {
120 //_____________________________________________________________________
121 Double_t AliAnalysisTaskPi0V2::GetMaxCellEnergy(const AliVCluster *cluster, Short_t &id) const
123 // Get maximum energy of attached cell.
127 AliVCaloCells *cells = 0;
129 cells = fESD->GetEMCALCells();
131 // cells = fAOD->GetEMCALCells();
136 const Int_t ncells = cluster->GetNCells();
137 for (Int_t i=0; i<ncells; i++) {
138 Double_t e = cells->GetCellAmplitude(TMath::Abs(cluster->GetCellAbsId(i)));
141 id = cluster->GetCellAbsId(i);
146 //_____________________________________________________________________
147 Double_t AliAnalysisTaskPi0V2::GetCrossEnergy(const AliVCluster *cluster, Short_t &idmax) const
149 // Calculate the energy of cross cells around the leading cell.
151 AliVCaloCells *cells = 0;
153 cells = fESD->GetEMCALCells();
155 // cells = fAOD->GetEMCALCells();
159 AliEMCALGeometry *geom = AliEMCALGeometry::GetInstance();
172 Double_t crossEnergy = 0;
174 geom->GetCellIndex(idmax,iSupMod,iTower,iIphi,iIeta);
175 geom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,iIphi, iIeta,iphis,ietas);
177 Int_t ncells = cluster->GetNCells();
178 for (Int_t i=0; i<ncells; i++) {
179 Int_t cellAbsId = cluster->GetCellAbsId(i);
180 geom->GetCellIndex(cellAbsId,iSupMod,iTower,iIphi,iIeta);
181 geom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,iIphi, iIeta,iphi,ieta);
182 Int_t aphidiff = TMath::Abs(iphi-iphis);
185 Int_t aetadiff = TMath::Abs(ieta-ietas);
188 if ( (aphidiff==1 && aetadiff==0) ||
189 (aphidiff==0 && aetadiff==1) ) {
190 crossEnergy += cells->GetCellAmplitude(cellAbsId);
196 //_____________________________________________________________________
197 Bool_t AliAnalysisTaskPi0V2::IsWithinFiducialVolume(Short_t id) const
199 // Check if cell is within given fiducial volume.
201 Double_t fNFiducial = 1;
210 Bool_t okrow = kFALSE;
211 Bool_t okcol = kFALSE;
213 AliEMCALGeometry *geom = AliEMCALGeometry::GetInstance();
217 Int_t cellAbsId = id;
218 geom->GetCellIndex(cellAbsId,iSupMod,iTower,iIphi,iIeta);
219 geom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,iIphi, iIeta,iphi,ieta);
223 if (iphi >= fNFiducial && iphi < 24-fNFiducial)
226 if (iphi >= fNFiducial && iphi < 12-fNFiducial)
230 Bool_t noEMCALBorderAtEta0 = kTRUE;
231 if (!noEMCALBorderAtEta0) {
232 if (ieta > fNFiducial && ieta < 48-fNFiducial)
236 if (ieta >= fNFiducial)
239 if (ieta < 48-fNFiducial)
248 //______________________________________________________________________
249 Bool_t AliAnalysisTaskPi0V2::IsGoodCluster(const AliESDCaloCluster *c) const
255 if(c->GetNCells() < 2)
262 Double_t maxE = GetMaxCellEnergy(c, id);
263 if((1. - GetCrossEnergy(c,id) / maxE) > 0.97)
267 c->GetPosition(pos1);
268 TVector3 clsPos(pos1);
269 Double_t eta = clsPos.Eta();
271 if(eta > 0.65 || eta < -0.65)
274 if (!IsWithinFiducialVolume(id))
277 if(c->GetM02() >0.5 )
285 //_____________________________________________________________________
286 Bool_t AliAnalysisTaskPi0V2::IsGoodPion(const TLorentzVector &p1, const TLorentzVector &p2) const
291 Double_t asym = TMath::Abs(p1.E()-p2.E())/(p1.E()+p2.E());
295 // if (TMath::Abs(p1.Eta()-p2.Eta())>0.5)
300 Double_t eta = pion.Eta();
308 //_______________________________________________________________________
309 void AliAnalysisTaskPi0V2::FillPion(const TLorentzVector& p1, const TLorentzVector& p2, Double_t EPV0r, Double_t EPV0A, Double_t EPV0C, Double_t EPTPC)
313 if (!IsGoodPion(p1,p2))
318 Double_t mass = pion.M();
319 Double_t pt = pion.Pt();
320 Double_t phi = pion.Phi();
322 Double_t dphiV0 = phi-EPV0r;
323 Double_t dphiV0A = phi-EPV0A;
324 Double_t dphiV0C = phi-EPV0C;
325 Double_t dphiTPC = phi-EPTPC;
327 Double_t cos2phiV0 = TMath::Cos(2.*(dphiV0));
328 Double_t cos2phiV0A = TMath::Cos(2.*(dphiV0A));
329 Double_t cos2phiV0C = TMath::Cos(2.*(dphiV0C));
330 Double_t cos2phiTPC = TMath::Cos(2.*(dphiTPC));
332 if(dphiV0 < 0.) dphiV0 += TMath::Pi();
333 if(dphiV0A < 0.) dphiV0A += TMath::Pi();
334 if(dphiV0C < 0.) dphiV0C += TMath::Pi();
335 if(dphiTPC < 0.) dphiTPC += TMath::Pi();
337 if(dphiV0 > TMath::Pi()) dphiV0 -= TMath::Pi();
338 if(dphiV0A > TMath::Pi()) dphiV0A -= TMath::Pi();
339 if(dphiV0C > TMath::Pi()) dphiV0C -= TMath::Pi();
340 if(dphiTPC > TMath::Pi()) dphiTPC -= TMath::Pi();
342 cout<<"cos2V0: "<<cos2phiV0<<" cos2V0A: "<<cos2phiV0A<<" cos2V0C: "<<cos2phiV0C<<endl;
343 cout<<mass<<" "<<pt<<" "<<phi<<" "<<endl;
344 cout<<" dphiV0: "<<dphiV0<<" dphiV0A: "<<dphiV0A<<" dphiV0C: "<<dphiV0C<<"+++++++"<<endl;
346 Double_t xV0[5]; // Match ndims in fH V0 EP
349 xV0[2] = fCentrality;
354 Double_t xV0A[5]; // Match ndims in fH V0A EP
357 xV0A[2] = fCentrality;
359 xV0A[4] = cos2phiV0A;
362 Double_t xV0C[5]; // Match ndims in fH V0C EP
365 xV0C[2] = fCentrality;
367 xV0C[4] = cos2phiV0C;
370 Double_t xTPC[5]; // Match ndims in fH TPC EP
373 xTPC[2] = fCentrality;
375 xTPC[4] = cos2phiTPC;
380 //_________________________________________________________________________________________________
381 void AliAnalysisTaskPi0V2::GetMom(TLorentzVector& p, const AliESDCaloCluster *c, Double_t *vertex)
383 // Calculate momentum.
385 c->GetPosition(posMom);
386 TVector3 clsPos2(posMom);
389 Double_t r = clsPos2.Perp();
390 Double_t eta = clsPos2.Eta();
391 Double_t phi = clsPos2.Phi();
394 pos.SetPtEtaPhi(r,eta,phi);
396 if (vertex) { //calculate direction relative to vertex
400 Double_t rad = pos.Mag();
401 p.SetPxPyPzE(e*pos.x()/rad, e*pos.y()/rad, e*pos.z()/rad, e);
404 //________________________________________________________________________
405 void AliAnalysisTaskPi0V2::UserCreateOutputObjects()
408 // Called once (on the worker node)
410 fOutput = new TList();
411 fOutput->SetOwner(); // IMPORTANT!
413 fTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(kTRUE);
415 hEPTPC = new TH2F("hEPTPC", "EPTPC vs cent", 100, 0., 100., 152, 0., 3.2);
416 hresoTPC = new TH2F("hresoTPC", "TPc reso vs cent", 100, 0., 100., 152, 0., 3.2);
417 hEPV0 = new TH2F("hEPV0", "EPV0 vs cent", 100, 0., 100., 152, 0., 3.2);
418 hEPV0A = new TH2F("hEPV0A", "EPV0A vs cent", 100, 0., 100., 152, 0., 3.2);
419 hEPV0C = new TH2F("hEPV0C", "EPV0C vs cent", 100, 0., 100., 152, 0., 3.2);
420 hEPV0Ar = new TH2F("hEPV0Ar", "EPV0Ar vs cent", 100, 0., 100., 152, 0., 3.2);
421 hEPV0Cr = new TH2F("hEPV0Cr", "EPV0Cr vs cent", 100, 0., 100., 152, 0., 3.2);
422 hEPV0r = new TH2F("hEPV0r", "EPV0r vs cent", 100, 0., 100., 152, 0., 3.2);
423 hEPV0AR4 = new TH2F("hEPV0AR4", "EPV0AR4 vs cent", 100, 0., 100., 152, 0., 3.2);
424 hEPV0AR7 = new TH2F("hEPV0AR7", "EPV0AR7 vs cent", 100, 0., 100., 152, 0., 3.2);
425 hEPV0CR0 = new TH2F("hEPV0CR0", "EPV0CR0 vs cent", 100, 0., 100., 152, 0., 3.2);
426 hEPV0CR3 = new TH2F("hEPV0CR3", "EPV0CR3 vs cent", 100, 0., 100., 152, 0., 3.2);
427 fOutput->Add(hEPTPC);
428 fOutput->Add(hresoTPC);
430 fOutput->Add(hEPV0A);
431 fOutput->Add(hEPV0C);
432 fOutput->Add(hEPV0Ar);
433 fOutput->Add(hEPV0Cr);
434 fOutput->Add(hEPV0r);
435 fOutput->Add(hEPV0AR4);
436 fOutput->Add(hEPV0AR7);
437 fOutput->Add(hEPV0CR0);
438 fOutput->Add(hEPV0CR3);
440 hdifV0A_V0CR0 = new TH2F("hdifV0A_V0CR0", "EP A-R0 ", 100, 0., 100., 152, 0., 3.2);
441 hdifV0A_V0CR3 = new TH2F("hdifV0A_V0CR3", "EP A-R3 ", 100, 0., 100., 152, 0., 3.2);
442 hdifV0ACR0_V0CR3 = new TH2F("hdifV0ACR0_V0CR3", "EP R0-R3 ", 100, 0., 100., 152, 0., 3.2);
443 hdifV0C_V0AR4 = new TH2F("hdifV0C_V0AR4", "EP C-R4 ", 100, 0., 100., 152, 0., 3.2);
444 hdifV0C_V0AR7 = new TH2F("hdifV0C_V0AR7", "EP C-R7 ", 100, 0., 100., 152, 0., 3.2);
445 hdifV0AR4_V0AR7 = new TH2F("hdifV0AR4_V0AR7", "EP R4-R7 ", 100, 0., 100., 152, 0., 3.2);
446 fOutput->Add(hdifV0A_V0CR0);
447 fOutput->Add(hdifV0A_V0CR3);
448 fOutput->Add(hdifV0ACR0_V0CR3);
449 fOutput->Add(hdifV0C_V0AR4);
450 fOutput->Add(hdifV0C_V0AR7);
451 fOutput->Add(hdifV0AR4_V0AR7);
453 hdifV0A_V0C = new TH2F("hdifV0A_V0C", "EP A-C ", 100, 0., 100., 152, 0., 3.2);
454 hdifV0A_TPC = new TH2F("hdifV0A_TPC", "EP A-TPC", 100, 0., 100., 152, 0., 3.2);
455 hdifV0C_TPC = new TH2F("hdifV0C_TPC", "EP C-TPC", 100, 0., 100., 152, 0., 3.2);
456 hdifV0C_V0A = new TH2F("hdifV0C_V0A", "EP C-A ", 100, 0., 100., 152, 0., 3.2);
457 fOutput->Add(hdifV0A_V0C);
458 fOutput->Add(hdifV0A_TPC);
459 fOutput->Add(hdifV0C_TPC);
460 fOutput->Add(hdifV0C_V0A);
464 hdifEMC_EP = new TH3F("hdifEMC_EP", "dif phi in EMC with EP", 100, 0., 100., 100., 0., TMath::Pi(), 15, 0., 15.);
465 hdifful_EP = new TH3F("hdifful_EP", "dif phi in full with EP", 100, 0., 100., 100., 0., TMath::Pi(), 15, 0., 15.);
466 hdifout_EP = new TH3F("hdifout_EP", "dif phi NOT in EMC with EP", 100, 0., 100., 100., 0., TMath::Pi(), 15, 0., 15.);
467 fOutput->Add(hdifEMC_EP);
468 fOutput->Add(hdifful_EP);
469 fOutput->Add(hdifout_EP);
471 const Int_t ndims = 5;
472 Int_t nMgg=500, nPt=40, nCent=20, nDeltaPhi=315, ncos2phi=500;
473 Int_t bins[ndims] = {nMgg, nPt, nCent, nDeltaPhi, ncos2phi};
474 Double_t xmin[ndims] = { 0, 0., 0, 0., -1.};
475 Double_t xmax[ndims] = { 0.5, 20., 100, 3.15, 1.};
476 fHEPV0r = new THnSparseF("fHEPV0r", "Flow histogram EPV0", ndims, bins, xmin, xmax);
477 fHEPV0A = new THnSparseF("fHEPV0A", "Flow histogram EPV0A", ndims, bins, xmin, xmax);
478 fHEPV0C = new THnSparseF("fHEPV0C", "Flow histogram EPV0C", ndims, bins, xmin, xmax);
479 fHEPTPC = new THnSparseF("fHEPTPC", "Flow histogram EPTPC", ndims, bins, xmin, xmax);
480 fOutput->Add(fHEPV0r);
481 fOutput->Add(fHEPV0A);
482 fOutput->Add(fHEPV0C);
483 fOutput->Add(fHEPTPC);
487 PostData(1, fOutput); // Post data for ALL output slots >0 here, to get at least an empty histogram
490 //________________________________________________________________________
491 void AliAnalysisTaskPi0V2::UserExec(Option_t *)
494 // Called for each event
497 // Create pointer to reconstructed event
498 AliVEvent *event = InputEvent();
499 if (!event) { Printf("ERROR: Could not retrieve event"); return; }
501 // create pointer to event
502 fESD = dynamic_cast<AliESDEvent*>(event);
504 AliError("Cannot get the ESD event");
507 const AliESDVertex* fvertex = fESD->GetPrimaryVertex();
509 if(!(fvertex->GetStatus())) return;
510 // if vertex is from spd vertexZ, require more stringent cut
511 if (fvertex->IsFromVertexerZ()) {
512 if (fvertex->GetDispersion()>0.02 || fvertex->GetZRes()>0.25 ) return; // bad vertex from VertexerZ
514 Double_t vertex[3] = {fvertex->GetX(), fvertex->GetY(), fvertex->GetZ()};
516 if(fESD->GetCentrality()) {
518 fESD->GetCentrality()->GetCentralityPercentile("V0M");
521 AliEventplane *ep = fESD->GetEventplane();
523 if (ep->GetQVector())
524 fEPTPC = ep->GetQVector()->Phi()/2. ;
527 if (ep->GetQsub1()&&ep->GetQsub2())
528 fEPTPCreso = TMath::Cos(2.*(ep->GetQsub1()->Phi()/2.-ep->GetQsub2()->Phi()/2.));
532 fEPV0 = ep->GetEventplane("V0", fESD);
533 fEPV0A = ep->GetEventplane("V0A", fESD);
534 fEPV0C = ep->GetEventplane("V0C", fESD);
536 Double_t qxr=0, qyr=0;
537 fEPV0Ar = ep->CalculateVZEROEventPlane(fESD, 4, 5, 2, qxr, qyr);
538 fEPV0Cr = ep->CalculateVZEROEventPlane(fESD, 2, 3, 2, qx, qy);
541 fEPV0r = TMath::ATan2(qyr,qxr)/2.;
542 fEPV0AR4 = ep->CalculateVZEROEventPlane(fESD, 4, 2, qx, qy);
543 fEPV0AR5 = ep->CalculateVZEROEventPlane(fESD, 5, 2, qx, qy);
544 fEPV0AR6 = ep->CalculateVZEROEventPlane(fESD, 6, 2, qx, qy);
545 fEPV0AR7 = ep->CalculateVZEROEventPlane(fESD, 7, 2, qx, qy);
546 fEPV0CR0 = ep->CalculateVZEROEventPlane(fESD, 0, 2, qx, qy);
547 fEPV0CR1 = ep->CalculateVZEROEventPlane(fESD, 1, 2, qx, qy);
548 fEPV0CR2 = ep->CalculateVZEROEventPlane(fESD, 2, 2, qx, qy);
549 fEPV0CR3 = ep->CalculateVZEROEventPlane(fESD, 3, 2, qx, qy);
552 //cout<<" fEPV0:"<<fEPV0<<" fEPV0A:"<<fEPV0A<<" fEPV0C:"<<fEPV0C<<" fEPV0Ar:"<<fEPV0Ar<<" fEPV0Cr:"<<fEPV0Cr<<" fEPV0r:"<<fEPV0AR4<<" fEPV0AR7:"<<fEPV0AR7<<" fEPV0CR0:"<<fEPV0CR0<<" fEPV0CR3:"<<fEPV0CR3<<"--------------------------------------------"<<endl;
554 if(fEPV0r<-2. || fEPV0Ar<-2. || fEPV0Cr<-2.) return;
557 if(fEPV0A<-2. || fEPV0C<-2. || fEPV0AR4<-2. || fEPV0AR7<-2. || fEPV0CR0<-2. || fEPV0CR3<-2.) return;
560 if(fEPV0 < TMath::Pi()) fEPV0 += TMath::Pi();
561 if(fEPV0A < TMath::Pi()) fEPV0A += TMath::Pi();
562 if(fEPV0C < TMath::Pi()) fEPV0C += TMath::Pi();
563 if(fEPV0Ar < TMath::Pi()) fEPV0A += TMath::Pi();
564 if(fEPV0Cr < TMath::Pi()) fEPV0C += TMath::Pi();
565 if(fEPV0r < TMath::Pi()) fEPV0A += TMath::Pi();
566 if(fEPV0AR4 < TMath::Pi()) fEPV0AR4 += TMath::Pi();
567 if(fEPV0AR7 < TMath::Pi()) fEPV0AR7 += TMath::Pi();
568 if(fEPV0CR0 < TMath::Pi()) fEPV0CR0 += TMath::Pi();
569 if(fEPV0CR3 < TMath::Pi()) fEPV0CR3 += TMath::Pi();
571 //cout<<" fEPV0:"<<fEPV0<<" fEPV0A:"<<fEPV0A<<" fEPV0C:"<<fEPV0C<<" fEPV0Ar:"<<fEPV0Ar<<" fEPV0Cr:"<<fEPV0Cr<<" fEPV0r:"<<fEPV0AR4<<" fEPV0AR7:"<<fEPV0AR7<<" fEPV0CR0:"<<fEPV0CR0<<" fEPV0CR3:"<<fEPV0CR3<<"--------------------------------------------"<<endl;
572 hEPTPC->Fill(fCentrality, fEPTPC);
573 if(fEPTPCreso!=-1) hresoTPC->Fill(fCentrality, fEPTPCreso);
574 hEPV0->Fill(fCentrality, fEPV0);
575 hEPV0A->Fill(fCentrality, fEPV0A);
576 hEPV0C->Fill(fCentrality, fEPV0C);
577 hEPV0Ar->Fill(fCentrality, fEPV0Ar);
578 hEPV0Cr->Fill(fCentrality, fEPV0Cr);
579 hEPV0r->Fill(fCentrality, fEPV0r);
581 hdifV0A_V0CR0->Fill(fCentrality, TMath::Cos(2.*(fEPV0A - fEPV0CR0)));
582 hdifV0A_V0CR3->Fill(fCentrality, TMath::Cos(2.*(fEPV0A - fEPV0CR3)));
583 hdifV0ACR0_V0CR3->Fill(fCentrality, TMath::Cos(2*(fEPV0CR0 - fEPV0CR3)));
584 hdifV0C_V0AR4->Fill(fCentrality, TMath::Cos(2*(fEPV0C - fEPV0AR4)));
585 hdifV0C_V0AR7->Fill(fCentrality, TMath::Cos(2*(fEPV0C - fEPV0AR7)));
586 hdifV0AR4_V0AR7->Fill(fCentrality, TMath::Cos(2*(fEPV0AR4 - fEPV0AR7)));
588 hdifV0A_V0C->Fill(fCentrality, TMath::Cos(2*(fEPV0A - fEPV0C)));
589 hdifV0A_TPC->Fill(fCentrality, TMath::Cos(2*(fEPV0A - fEPTPC)));
590 hdifV0C_TPC->Fill(fCentrality, TMath::Cos(2*(fEPV0C - fEPTPC)));
591 hdifV0C_V0A->Fill(fCentrality, TMath::Cos(2*(fEPV0C - fEPV0A)));
592 // Cluster loop for reconstructed event
594 Int_t nCluster = fESD->GetNumberOfCaloClusters();
595 for(Int_t i=0; i<nCluster; ++i){
596 AliESDCaloCluster *c1 = fESD->GetCaloCluster(i);
597 if(!IsGoodCluster(c1)) continue;
598 for(Int_t j=i+1; j<nCluster; ++j){
599 AliESDCaloCluster *c2 = fESD->GetCaloCluster(j);
600 if(!IsGoodCluster(c2)) continue;
602 GetMom(p1, c1, vertex);
604 GetMom(p2, c2, vertex);
605 FillPion(p1, p2, fEPV0r, fEPV0A, fEPV0C, fEPTPC);
610 Int_t nTrack = fESD->GetNumberOfTracks();
611 for(Int_t i=0; i<nTrack; ++i){
612 AliESDtrack* esdtrack = fESD->GetTrack(i); // pointer to reconstructed to track
614 AliError(Form("ERROR: Could not retrieve esdtrack %d",i));
617 Double_t tPhi = esdtrack->Phi();
618 Double_t tPt = esdtrack->Pt();
619 // if(tPhi*TMath::RadToDeg() > 80. && tPhi*TMath::RadToDeg()<180.){
620 if(esdtrack->IsEMCAL()){
621 hdifEMC_EP->Fill(fCentrality, tPhi-fEPV0r, tPt);
623 hdifout_EP->Fill(fCentrality, tPhi-fEPV0r, tPt);
625 hdifful_EP->Fill(fCentrality, tPhi-fEPV0r, tPt);
628 // NEW HISTO should be filled before this point, as PostData puts the
629 // information for this iteration of the UserExec in the container
630 PostData(1, fOutput);
634 //________________________________________________________________________
635 void AliAnalysisTaskPi0V2::Terminate(Option_t *)
637 // Draw result to screen, or perform fitting, normalizations
638 // Called once at the end of the query
639 // fOutput = dynamic_cast<TList*> (GetOutputData(1));
640 // if(!fOutput) { Printf("ERROR: could not retrieve TList fOutput"); return; }
642 // Get the physics selection histograms with the selection statistics
643 //AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
644 //AliESDInputHandler *inputH = dynamic_cast<AliESDInputHandler*>(mgr->GetInputEventHandler());
645 //TH2F *histStat = (TH2F*)inputH->GetStatistics();
648 // NEW HISTO should be retrieved from the TList container in the above way,
649 // so it is available to draw on a canvas such as below