Add Mahmut's pp task
[u/mrichter/AliRoot.git] / PWGGA / EMCALTasks / AliAnalysisTaskPi0V2.cxx
CommitLineData
04b116e8 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
3c40321c 16/* $Id: AliAnalysisTaskPi0V2.cxx 55404 2012-03-29 10:10:19Z fca $ */
17
04b116e8 18/* AliAnalysisTaskPi0V2.cxx
19 *
20 * Template task producing a P_t spectrum and pseudorapidity distribution.
21 * Includes explanations of physics and primary track selections
22 *
23 * Instructions for adding histograms can be found below, starting with NEW HISTO
24 *
25 * Based on tutorial example from offline pages
26 * Edited by Arvinder Palaha
27 */
3c40321c 28#include "AliAnalysisTaskPi0V2.h"
29
04b116e8 30#include "Riostream.h"
31#include "TChain.h"
32#include "TTree.h"
33#include "TH1F.h"
34#include "TH2F.h"
35#include "TH3F.h"
36#include "TCanvas.h"
37#include "TList.h"
3c40321c 38
70d53162 39#include "AliAnalysisTaskSE.h"
04b116e8 40#include "AliAnalysisManager.h"
41#include "AliStack.h"
42#include "AliESDtrackCuts.h"
3c40321c 43#include "AliESDEvent.h"
44#include "AliESDInputHandler.h"
04b116e8 45#include "AliAODEvent.h"
70d53162 46#include "AliMCEvent.h"
04b116e8 47
48#include "AliEventplane.h"
49#include "AliEMCALGeometry.h"
50#include "THnSparse.h"
e5ba16b4 51#include "TClonesArray.h"
52#include "TString.h"
3c40321c 53
9d6804f4 54using std::cout;
55using std::endl;
56
3c40321c 57ClassImp(AliAnalysisTaskPi0V2)
58
59//________________________________________________________________________
965c985f 60AliAnalysisTaskPi0V2::AliAnalysisTaskPi0V2(const char *name) // All data members should be initialised here
61 :AliAnalysisTaskSE(name),
04b116e8 62 fOutput(0),
04b116e8 63 fESD(0),
7bb82cc2 64 fTracksName("PicoTrack"),
65 fTrigClass("CVLN_|CSEMI_|CCENT|CVHN"),
e5ba16b4 66 fTracks(0),
7bb82cc2 67 fRunNumber(-999.),
8071d5b2 68 fEvtSelect(1),
e50db689 69 fVtxCut(15.),
670ffa5c 70 fNcellCut(2), fECut(1), fEtaCut(0.65), fM02Cut(0.5), fPi0AsyCut(0),
04b116e8 71 fCentrality(99.),
72 fEPTPC(-999.),
73 fEPTPCreso(0.),
74 fEPV0(-999.), fEPV0A(-999.), fEPV0C(-999.), fEPV0Ar(-999.), fEPV0Cr(-999.), fEPV0r(-999.),
75 fEPV0AR4(-999.), fEPV0AR5(-999.), fEPV0AR6(-999.), fEPV0AR7(-999.), fEPV0CR0(-999.), fEPV0CR1(-999.), fEPV0CR2(-999.), fEPV0CR3(-999.),
ef7e23cf 76 hEvtCount(0), hAllcentV0(0), hAllcentV0r(0), hAllcentV0A(0), hAllcentV0C(0), hAllcentTPC(0),
7bb82cc2 77 h2DcosV0r(0), h2DsinV0r(0), h2DcosV0A(0), h2DsinV0A(0), h2DcosV0C(0), h2DsinV0C(0), h2DcosTPC(0), h2DsinTPC(0),
04b116e8 78 hEPTPC(0), hresoTPC(0),
79 hEPV0(0), hEPV0A(0), hEPV0C(0), hEPV0Ar(0), hEPV0Cr(0), hEPV0r(0), hEPV0AR4(0), hEPV0AR7(0), hEPV0CR0(0), hEPV0CR3(0),
e50db689 80 hdifV0Ar_V0Cr(0), hdifV0A_V0CR0(0), hdifV0A_V0CR3(0), hdifV0ACR0_V0CR3(0), hdifV0C_V0AR4(0), hdifV0C_V0AR7(0), hdifV0AR4_V0AR7(0),
04b116e8 81 hdifV0A_V0C(0), hdifV0A_TPC(0), hdifV0C_TPC(0), hdifV0C_V0A(0),
93df010a 82 hdifEMC_EPV0(0), hdifEMC_EPV0A(0), hdifEMC_EPV0C(0), hdifful_EPV0(0), hdifful_EPV0A(0), hdifful_EPV0C(0),
83 hdifout_EPV0(0), hdifout_EPV0A(0), hdifout_EPV0C(0), hdifEMC_EPTPC(0), hdifful_EPTPC(0), hdifout_EPTPC(0),
7bb82cc2 84 hdifClus_EPV0(0), hdifClus_EPV0A(0), hdifClus_EPV0C(0), hdifClus_EPTPC(0),
04b116e8 85 fHEPV0r(0), fHEPV0A(0), fHEPV0C(0), fHEPTPC(0)
86
3c40321c 87{
04b116e8 88 // Dummy constructor ALWAYS needed for I/O.
89 DefineInput(0, TChain::Class());
90 DefineOutput(1, TList::Class()); // for output list
3c40321c 91}
92
93//________________________________________________________________________
965c985f 94AliAnalysisTaskPi0V2::AliAnalysisTaskPi0V2() // All data members should be initialised here
8f40bd27 95 :AliAnalysisTaskSE("default_name"),
04b116e8 96 fOutput(0),
04b116e8 97 fESD(0),
50ebbe79 98 fTracksName("PicoTracks"),
7bb82cc2 99 fTrigClass("CVLN_|CSEMI_|CCENT|CVHN"),
e5ba16b4 100 fTracks(0),
7bb82cc2 101 fRunNumber(-999.),
8071d5b2 102 fEvtSelect(1),
e50db689 103 fVtxCut(15.),
670ffa5c 104 fNcellCut(2), fECut(1), fEtaCut(0.65), fM02Cut(0.5), fPi0AsyCut(0),
04b116e8 105 fCentrality(99.),
106 fEPTPC(-999.),
107 fEPTPCreso(0.),
108 fEPV0(-999.), fEPV0A(-999.), fEPV0C(-999.), fEPV0Ar(-999.), fEPV0Cr(-999.), fEPV0r(-999.),
109 fEPV0AR4(-999.), fEPV0AR5(-999.), fEPV0AR6(-999.), fEPV0AR7(-999.), fEPV0CR0(-999.), fEPV0CR1(-999.), fEPV0CR2(-999.), fEPV0CR3(-999.),
ef7e23cf 110 hEvtCount(0), hAllcentV0(0), hAllcentV0r(0), hAllcentV0A(0), hAllcentV0C(0), hAllcentTPC(0),
7bb82cc2 111 h2DcosV0r(0), h2DsinV0r(0), h2DcosV0A(0), h2DsinV0A(0), h2DcosV0C(0), h2DsinV0C(0), h2DcosTPC(0), h2DsinTPC(0),
04b116e8 112 hEPTPC(0), hresoTPC(0),
113 hEPV0(0), hEPV0A(0), hEPV0C(0), hEPV0Ar(0), hEPV0Cr(0), hEPV0r(0), hEPV0AR4(0), hEPV0AR7(0), hEPV0CR0(0), hEPV0CR3(0),
e50db689 114 hdifV0Ar_V0Cr(0), hdifV0A_V0CR0(0), hdifV0A_V0CR3(0), hdifV0ACR0_V0CR3(0), hdifV0C_V0AR4(0), hdifV0C_V0AR7(0), hdifV0AR4_V0AR7(0),
04b116e8 115 hdifV0A_V0C(0), hdifV0A_TPC(0), hdifV0C_TPC(0), hdifV0C_V0A(0),
93df010a 116 hdifEMC_EPV0(0), hdifEMC_EPV0A(0), hdifEMC_EPV0C(0), hdifful_EPV0(0), hdifful_EPV0A(0), hdifful_EPV0C(0),
117 hdifout_EPV0(0), hdifout_EPV0A(0), hdifout_EPV0C(0), hdifEMC_EPTPC(0), hdifful_EPTPC(0), hdifout_EPTPC(0),
7bb82cc2 118 hdifClus_EPV0(0), hdifClus_EPV0A(0), hdifClus_EPV0C(0), hdifClus_EPTPC(0),
04b116e8 119 fHEPV0r(0), fHEPV0A(0), fHEPV0C(0), fHEPTPC(0)
3c40321c 120{
04b116e8 121 // Constructor
122 // Define input and output slots here (never in the dummy constructor)
123 // Input slot #0 works with a TChain - it is connected to the default input container
124 // Output slot #1 writes into a TH1 container
125 DefineInput(0, TChain::Class());
126 DefineOutput(1, TList::Class()); // for output list
3c40321c 127}
128
129//________________________________________________________________________
130AliAnalysisTaskPi0V2::~AliAnalysisTaskPi0V2()
131{
04b116e8 132 // Destructor. Clean-up the output list, but not the histograms that are put inside
133 // (the list is owner and will clean-up these histograms). Protect in PROOF case.
670ffa5c 134 delete fOutput;
3c40321c 135}
136//_____________________________________________________________________
137Double_t AliAnalysisTaskPi0V2::GetMaxCellEnergy(const AliVCluster *cluster, Short_t &id) const
138{
139 // Get maximum energy of attached cell.
140
141 id = -1;
142
143 AliVCaloCells *cells = 0;
144 if (fESD)
145 cells = fESD->GetEMCALCells();
3c40321c 146 if (!cells)
147 return 0;
148
149 Double_t maxe = 0;
150 const Int_t ncells = cluster->GetNCells();
151 for (Int_t i=0; i<ncells; i++) {
152 Double_t e = cells->GetCellAmplitude(TMath::Abs(cluster->GetCellAbsId(i)));
153 if (e>maxe) {
154 maxe = e;
155 id = cluster->GetCellAbsId(i);
156 }
157 }
158 return maxe;
159}
160//_____________________________________________________________________
161Double_t AliAnalysisTaskPi0V2::GetCrossEnergy(const AliVCluster *cluster, Short_t &idmax) const
162{
163 // Calculate the energy of cross cells around the leading cell.
164
165 AliVCaloCells *cells = 0;
166 if (fESD)
167 cells = fESD->GetEMCALCells();
3c40321c 168 if (!cells)
169 return 0;
170
171 AliEMCALGeometry *geom = AliEMCALGeometry::GetInstance();
172 if (!geom)
173 return 0;
174
175 Int_t iSupMod = -1;
176 Int_t iTower = -1;
177 Int_t iIphi = -1;
178 Int_t iIeta = -1;
179 Int_t iphi = -1;
180 Int_t ieta = -1;
181 Int_t iphis = -1;
182 Int_t ietas = -1;
183
965c985f 184 Double_t crossEnergy = 0.;
3c40321c 185
186 geom->GetCellIndex(idmax,iSupMod,iTower,iIphi,iIeta);
187 geom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,iIphi, iIeta,iphis,ietas);
188
189 Int_t ncells = cluster->GetNCells();
190 for (Int_t i=0; i<ncells; i++) {
191 Int_t cellAbsId = cluster->GetCellAbsId(i);
192 geom->GetCellIndex(cellAbsId,iSupMod,iTower,iIphi,iIeta);
193 geom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,iIphi, iIeta,iphi,ieta);
194 Int_t aphidiff = TMath::Abs(iphi-iphis);
195 if (aphidiff>1)
196 continue;
197 Int_t aetadiff = TMath::Abs(ieta-ietas);
198 if (aetadiff>1)
199 continue;
200 if ( (aphidiff==1 && aetadiff==0) ||
201 (aphidiff==0 && aetadiff==1) ) {
202 crossEnergy += cells->GetCellAmplitude(cellAbsId);
203 }
204 }
205
206 return crossEnergy;
207}
208//_____________________________________________________________________
209Bool_t AliAnalysisTaskPi0V2::IsWithinFiducialVolume(Short_t id) const
210{
211 // Check if cell is within given fiducial volume.
212
213 Double_t fNFiducial = 1;
214
215 Int_t iSupMod = -1;
216 Int_t iTower = -1;
217 Int_t iIphi = -1;
218 Int_t iIeta = -1;
219 Int_t iphi = -1;
220 Int_t ieta = -1;
221
222 Bool_t okrow = kFALSE;
223 Bool_t okcol = kFALSE;
224
04b116e8 225 AliEMCALGeometry *geom = AliEMCALGeometry::GetInstance();
3c40321c 226 if (!geom)
227 return kFALSE;
228
229 Int_t cellAbsId = id;
230 geom->GetCellIndex(cellAbsId,iSupMod,iTower,iIphi,iIeta);
231 geom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,iIphi, iIeta,iphi,ieta);
232
233 // Check rows/phi
234 if (iSupMod < 10) {
235 if (iphi >= fNFiducial && iphi < 24-fNFiducial)
236 okrow = kTRUE;
237 } else {
238 if (iphi >= fNFiducial && iphi < 12-fNFiducial)
239 okrow = kTRUE;
240 }
241 // Check columns/eta
242 Bool_t noEMCALBorderAtEta0 = kTRUE;
243 if (!noEMCALBorderAtEta0) {
244 if (ieta > fNFiducial && ieta < 48-fNFiducial)
245 okcol = kTRUE;
246 } else {
247 if (iSupMod%2==0) {
248 if (ieta >= fNFiducial)
249 okcol = kTRUE;
250 } else {
251 if (ieta < 48-fNFiducial)
252 okcol = kTRUE;
253 }
254 }
255 if (okrow && okcol)
256 return kTRUE;
257
258 return kFALSE;
259}
260//______________________________________________________________________
261Bool_t AliAnalysisTaskPi0V2::IsGoodCluster(const AliESDCaloCluster *c) const
262{
263
264 if(!c)
265 return kFALSE;
266
670ffa5c 267 if(c->GetNCells() < fNcellCut)
3c40321c 268 return kFALSE;
269
670ffa5c 270 if(c->E() < fECut)
3c40321c 271 return kFALSE;
272
273 Short_t id = -1;
274 Double_t maxE = GetMaxCellEnergy(c, id);
965c985f 275 if((1. - double(GetCrossEnergy(c,id))/maxE) > 0.97)
3c40321c 276 return kFALSE;
277
965c985f 278
3c40321c 279 Float_t pos1[3];
280 c->GetPosition(pos1);
281 TVector3 clsPos(pos1);
282 Double_t eta = clsPos.Eta();
283
670ffa5c 284 if(TMath::Abs(eta) > fEtaCut)
3c40321c 285 return kFALSE;
286
287 if (!IsWithinFiducialVolume(id))
288 return kFALSE;
289
670ffa5c 290 if(c->GetM02() >fM02Cut)
3c40321c 291 return kFALSE;
292
04b116e8 293
3c40321c 294 return kTRUE;
70d53162 295
04b116e8 296}
3c40321c 297//_____________________________________________________________________
298Bool_t AliAnalysisTaskPi0V2::IsGoodPion(const TLorentzVector &p1, const TLorentzVector &p2) const
299{
300 // Is good pion?
301
670ffa5c 302 if(fPi0AsyCut){
303 Double_t asym = TMath::Abs(p1.E()-p2.E())/(p1.E()+p2.E());
304 if (asym>0.7)
305 return kFALSE;
306 }
3c40321c 307 TLorentzVector pion;
308 pion = p1 + p2;
309 Double_t eta = pion.Eta();
670ffa5c 310 if(TMath::Abs(eta) > fEtaCut)
3c40321c 311 return kFALSE;
312
313 return kTRUE;
314}
315//_______________________________________________________________________
316void AliAnalysisTaskPi0V2::FillPion(const TLorentzVector& p1, const TLorentzVector& p2, Double_t EPV0r, Double_t EPV0A, Double_t EPV0C, Double_t EPTPC)
317{
318 // Fill histogram.
319
320 if (!IsGoodPion(p1,p2))
321 return;
322 TLorentzVector pion;
323 pion = p1 + p2;
324
325 Double_t mass = pion.M();
326 Double_t pt = pion.Pt();
327 Double_t phi = pion.Phi();
328
329 Double_t dphiV0 = phi-EPV0r;
330 Double_t dphiV0A = phi-EPV0A;
331 Double_t dphiV0C = phi-EPV0C;
332 Double_t dphiTPC = phi-EPTPC;
333
334 Double_t cos2phiV0 = TMath::Cos(2.*(dphiV0));
335 Double_t cos2phiV0A = TMath::Cos(2.*(dphiV0A));
336 Double_t cos2phiV0C = TMath::Cos(2.*(dphiV0C));
337 Double_t cos2phiTPC = TMath::Cos(2.*(dphiTPC));
338
c6ee6f73 339 dphiV0 = TVector2::Phi_0_2pi(dphiV0); if(dphiV0 >TMath::Pi()) dphiV0 -= TMath::Pi();
340 dphiV0A = TVector2::Phi_0_2pi(dphiV0A); if(dphiV0A >TMath::Pi()) dphiV0A -= TMath::Pi();
341 dphiV0C = TVector2::Phi_0_2pi(dphiV0C); if(dphiV0C >TMath::Pi()) dphiV0C -= TMath::Pi();
342 dphiTPC = TVector2::Phi_0_2pi(dphiTPC); if(dphiTPC >TMath::Pi()) dphiTPC -= TMath::Pi();
3c40321c 343
344 Double_t xV0[5]; // Match ndims in fH V0 EP
345 xV0[0] = mass;
346 xV0[1] = pt;
347 xV0[2] = fCentrality;
348 xV0[3] = dphiV0;
349 xV0[4] = cos2phiV0;
350 fHEPV0r->Fill(xV0);
351
352 Double_t xV0A[5]; // Match ndims in fH V0A EP
353 xV0A[0] = mass;
354 xV0A[1] = pt;
355 xV0A[2] = fCentrality;
356 xV0A[3] = dphiV0A;
357 xV0A[4] = cos2phiV0A;
358 fHEPV0A->Fill(xV0A);
359
360 Double_t xV0C[5]; // Match ndims in fH V0C EP
361 xV0C[0] = mass;
362 xV0C[1] = pt;
363 xV0C[2] = fCentrality;
364 xV0C[3] = dphiV0C;
365 xV0C[4] = cos2phiV0C;
366 fHEPV0C->Fill(xV0C);
367
368 Double_t xTPC[5]; // Match ndims in fH TPC EP
369 xTPC[0] = mass;
370 xTPC[1] = pt;
371 xTPC[2] = fCentrality;
372 xTPC[3] = dphiTPC;
373 xTPC[4] = cos2phiTPC;
374 fHEPTPC->Fill(xTPC);
70d53162 375
04b116e8 376
7bb82cc2 377}
e50db689 378//________________________________________________________________________________________________________________________________
7bb82cc2 379void AliAnalysisTaskPi0V2::FillCluster(const TLorentzVector& p1, Double_t EPV0r, Double_t EPV0A, Double_t EPV0C, Double_t EPTPC)
380{
381 //cluster(photon) v2 method
382 Double_t Pt = p1.Pt();
383 Double_t Phi = p1.Phi();
384
385 Double_t difClusV0 = TVector2::Phi_0_2pi(Phi-EPV0r); if(difClusV0 >TMath::Pi()) difClusV0 -= TMath::Pi();
386 Double_t difClusV0A = TVector2::Phi_0_2pi(Phi-EPV0A); if(difClusV0A >TMath::Pi()) difClusV0A -= TMath::Pi();
387 Double_t difClusV0C = TVector2::Phi_0_2pi(Phi-EPV0C); if(difClusV0C >TMath::Pi()) difClusV0C -= TMath::Pi();
388 Double_t difClusTPC = TVector2::Phi_0_2pi(Phi-EPTPC); if(difClusTPC >TMath::Pi()) difClusTPC -= TMath::Pi();
389
390 hdifClus_EPV0->Fill(fCentrality, difClusV0, Pt);
391 hdifClus_EPV0A->Fill(fCentrality, difClusV0A, Pt);
392 hdifClus_EPV0C->Fill(fCentrality, difClusV0C, Pt);
393 hdifClus_EPTPC->Fill(fCentrality, difClusTPC, Pt);
394
395
04b116e8 396}
3c40321c 397//_________________________________________________________________________________________________
398void AliAnalysisTaskPi0V2::GetMom(TLorentzVector& p, const AliESDCaloCluster *c, Double_t *vertex)
399{
400 // Calculate momentum.
401 Float_t posMom[3];
402 c->GetPosition(posMom);
403 TVector3 clsPos2(posMom);
404
405 Double_t e = c->E();
406 Double_t r = clsPos2.Perp();
407 Double_t eta = clsPos2.Eta();
408 Double_t phi = clsPos2.Phi();
409
410 TVector3 pos;
411 pos.SetPtEtaPhi(r,eta,phi);
412
413 if (vertex) { //calculate direction relative to vertex
414 pos -= vertex;
415 }
416
417 Double_t rad = pos.Mag();
418 p.SetPxPyPzE(e*pos.x()/rad, e*pos.y()/rad, e*pos.z()/rad, e);
70d53162 419
04b116e8 420}
3c40321c 421//________________________________________________________________________
422void AliAnalysisTaskPi0V2::UserCreateOutputObjects()
423{
04b116e8 424 // Create histograms
425 // Called once (on the worker node)
3c40321c 426
04b116e8 427 fOutput = new TList();
428 fOutput->SetOwner(); // IMPORTANT!
ef7e23cf 429
430 hEvtCount = new TH1F("hEvtCount", " Event Plane", 10, 0.5, 10.5);
4fbbf89d 431 hEvtCount->GetXaxis()->SetBinLabel(1,"All");
432 hEvtCount->GetXaxis()->SetBinLabel(2,"Evt Cut");
433 hEvtCount->GetXaxis()->SetBinLabel(3,"Trg Class");
434 hEvtCount->GetXaxis()->SetBinLabel(4,"Vtx");
435 hEvtCount->GetXaxis()->SetBinLabel(5,"Cent");
436 hEvtCount->GetXaxis()->SetBinLabel(5,"EPtask");
437 hEvtCount->GetXaxis()->SetBinLabel(7,"EPvalue");
438 hEvtCount->GetXaxis()->SetBinLabel(8,"Pass");
ef7e23cf 439 fOutput->Add(hEvtCount);
04b116e8 440
ebaf288d 441 hEPTPC = new TH2F("hEPTPC", "EPTPC vs cent", 100, 0., 100., 100, 0., TMath::Pi());
442 hresoTPC = new TH2F("hresoTPC", "TPc reso vs cent", 100, 0., 100., 100, 0., 1.);
443 hEPV0 = new TH2F("hEPV0", "EPV0 vs cent", 100, 0., 100., 100, 0., TMath::Pi());
444 hEPV0A = new TH2F("hEPV0A", "EPV0A vs cent", 100, 0., 100., 100, 0., TMath::Pi());
445 hEPV0C = new TH2F("hEPV0C", "EPV0C vs cent", 100, 0., 100., 100, 0., TMath::Pi());
446 hEPV0Ar = new TH2F("hEPV0Ar", "EPV0Ar vs cent", 100, 0., 100., 100, 0., TMath::Pi());
447 hEPV0Cr = new TH2F("hEPV0Cr", "EPV0Cr vs cent", 100, 0., 100., 100, 0., TMath::Pi());
448 hEPV0r = new TH2F("hEPV0r", "EPV0r vs cent", 100, 0., 100., 100, 0., TMath::Pi());
449 hEPV0AR4 = new TH2F("hEPV0AR4", "EPV0AR4 vs cent", 100, 0., 100., 100, 0., TMath::Pi());
450 hEPV0AR7 = new TH2F("hEPV0AR7", "EPV0AR7 vs cent", 100, 0., 100., 100, 0., TMath::Pi());
451 hEPV0CR0 = new TH2F("hEPV0CR0", "EPV0CR0 vs cent", 100, 0., 100., 100, 0., TMath::Pi());
452 hEPV0CR3 = new TH2F("hEPV0CR3", "EPV0CR3 vs cent", 100, 0., 100., 100, 0., TMath::Pi());
04b116e8 453 fOutput->Add(hEPTPC);
454 fOutput->Add(hresoTPC);
455 fOutput->Add(hEPV0);
456 fOutput->Add(hEPV0A);
457 fOutput->Add(hEPV0C);
458 fOutput->Add(hEPV0Ar);
459 fOutput->Add(hEPV0Cr);
460 fOutput->Add(hEPV0r);
461 fOutput->Add(hEPV0AR4);
462 fOutput->Add(hEPV0AR7);
463 fOutput->Add(hEPV0CR0);
464 fOutput->Add(hEPV0CR3);
465
e50db689 466 hdifV0Ar_V0Cr = new TH2F("hdifV0Ar_V0Cr", "EP Ar-Cr ", 100, 0., 100., 100, -1., 1.);
ebaf288d 467 hdifV0A_V0CR0 = new TH2F("hdifV0A_V0CR0", "EP A-R0 ", 100, 0., 100., 100, -1., 1.);
468 hdifV0A_V0CR3 = new TH2F("hdifV0A_V0CR3", "EP A-R3 ", 100, 0., 100., 100, -1., 1.);
469 hdifV0ACR0_V0CR3 = new TH2F("hdifV0ACR0_V0CR3", "EP R0-R3 ", 100, 0., 100., 100, -1., 1.);
470 hdifV0C_V0AR4 = new TH2F("hdifV0C_V0AR4", "EP C-R4 ", 100, 0., 100., 100, -1., 1.);
471 hdifV0C_V0AR7 = new TH2F("hdifV0C_V0AR7", "EP C-R7 ", 100, 0., 100., 100, -1., 1.);
472 hdifV0AR4_V0AR7 = new TH2F("hdifV0AR4_V0AR7", "EP R4-R7 ", 100, 0., 100., 100, -1., 1.);
e50db689 473 fOutput->Add(hdifV0Ar_V0Cr);
04b116e8 474 fOutput->Add(hdifV0A_V0CR0);
475 fOutput->Add(hdifV0A_V0CR3);
476 fOutput->Add(hdifV0ACR0_V0CR3);
477 fOutput->Add(hdifV0C_V0AR4);
478 fOutput->Add(hdifV0C_V0AR7);
479 fOutput->Add(hdifV0AR4_V0AR7);
480
ebaf288d 481 hdifV0A_V0C = new TH2F("hdifV0A_V0C", "EP A-C ", 100, 0., 100., 100, -1., 1.);
482 hdifV0A_TPC = new TH2F("hdifV0A_TPC", "EP A-TPC", 100, 0., 100., 100, -1., 1.);
483 hdifV0C_TPC = new TH2F("hdifV0C_TPC", "EP C-TPC", 100, 0., 100., 100, -1., 1.);
484 hdifV0C_V0A = new TH2F("hdifV0C_V0A", "EP C-A ", 100, 0., 100., 100, -1., 1.);
04b116e8 485 fOutput->Add(hdifV0A_V0C);
486 fOutput->Add(hdifV0A_TPC);
487 fOutput->Add(hdifV0C_TPC);
488 fOutput->Add(hdifV0C_V0A);
489
490
491
93df010a 492 hdifEMC_EPV0 = new TH3F("hdifEMC_EPV0", "dif phi in EMC with EP", 100, 0., 100., 100, 0., TMath::Pi(), 15, 0., 15.);
493 hdifEMC_EPV0A = new TH3F("hdifEMC_EPV0A", "dif phi in EMC with EP", 100, 0., 100., 100, 0., TMath::Pi(), 15, 0., 15.);
494 hdifEMC_EPV0C = new TH3F("hdifEMC_EPV0C", "dif phi in EMC with EP", 100, 0., 100., 100, 0., TMath::Pi(), 15, 0., 15.);
495 fOutput->Add(hdifEMC_EPV0);
496 fOutput->Add(hdifEMC_EPV0A);
497 fOutput->Add(hdifEMC_EPV0C);
498
499 hdifful_EPV0 = new TH3F("hdifful_EPV0", "dif phi in full with EP", 100, 0., 100., 100, 0., TMath::Pi(), 15, 0., 15.);
500 hdifful_EPV0A = new TH3F("hdifful_EPV0A", "dif phi in full with EP", 100, 0., 100., 100, 0., TMath::Pi(), 15, 0., 15.);
501 hdifful_EPV0C = new TH3F("hdifful_EPV0C", "dif phi in full with EP", 100, 0., 100., 100, 0., TMath::Pi(), 15, 0., 15.);
502 fOutput->Add(hdifful_EPV0);
503 fOutput->Add(hdifful_EPV0A);
504 fOutput->Add(hdifful_EPV0C);
505
506 hdifout_EPV0 = new TH3F("hdifout_EPV0", "dif phi NOT in EMC with EP", 100, 0., 100., 100, 0., TMath::Pi(), 15, 0., 15.);
507 hdifout_EPV0A = new TH3F("hdifout_EPV0A", "dif phi NOT in EMC with EP", 100, 0., 100., 100, 0., TMath::Pi(), 15, 0., 15.);
508 hdifout_EPV0C = new TH3F("hdifout_EPV0C", "dif phi NOT in EMC with EP", 100, 0., 100., 100, 0., TMath::Pi(), 15, 0., 15.);
509 fOutput->Add(hdifout_EPV0);
510 fOutput->Add(hdifout_EPV0A);
511 fOutput->Add(hdifout_EPV0C);
512
513 hdifEMC_EPTPC = new TH3F("hdifEMC_EPTPC", "dif phi in EMC with EP", 100, 0., 100., 100, 0., TMath::Pi(), 15, 0., 15.);
514 hdifful_EPTPC = new TH3F("hdifful_EPTPC", "dif phi in full with EP", 100, 0., 100., 100, 0., TMath::Pi(), 15, 0., 15.);
515 hdifout_EPTPC = new TH3F("hdifout_EPTPC", "dif phi NOT in EMC with EP", 100, 0., 100., 100, 0., TMath::Pi(), 15, 0., 15.);
516 fOutput->Add(hdifEMC_EPTPC);
517 fOutput->Add(hdifful_EPTPC);
518 fOutput->Add(hdifout_EPTPC);
04b116e8 519
7bb82cc2 520 hdifClus_EPV0 = new TH3F("hdifClus_EPV0", "dif phi in EMC Clus with EP", 100, 0., 100., 100, 0., TMath::Pi(), 15, 0., 15.);
521 hdifClus_EPV0A = new TH3F("hdifClus_EPV0A", "dif phi in EMC Clus with EP", 100, 0., 100., 100, 0., TMath::Pi(), 15, 0., 15.);
522 hdifClus_EPV0C = new TH3F("hdifClus_EPV0C", "dif phi in EMC Clus with EP", 100, 0., 100., 100, 0., TMath::Pi(), 15, 0., 15.);
523 hdifClus_EPTPC = new TH3F("hdifClus_EPTPC", "dif phi in EMC Clus with EP", 100, 0., 100., 100, 0., TMath::Pi(), 15, 0., 15.);
524 fOutput->Add(hdifClus_EPV0);
525 fOutput->Add(hdifClus_EPV0A);
526 fOutput->Add(hdifClus_EPV0C);
527 fOutput->Add(hdifClus_EPTPC);
528
ebaf288d 529 hAllcentV0 = new TH1F("hAllcentV0", "All cent EP V0", 100, 0., TMath::Pi());
530 hAllcentV0r = new TH1F("hAllcentV0r", "All cent EP V0r", 100, 0., TMath::Pi());
531 hAllcentV0A = new TH1F("hAllcentV0A", "All cent EP V0A", 100, 0., TMath::Pi());
532 hAllcentV0C = new TH1F("hAllcentV0C", "All cent EP V0C", 100, 0., TMath::Pi());
533 hAllcentTPC = new TH1F("hAllcentTPC", "All cent EP TPC", 100, 0., TMath::Pi());
534 fOutput->Add(hAllcentV0);
535 fOutput->Add(hAllcentV0r);
536 fOutput->Add(hAllcentV0A);
537 fOutput->Add(hAllcentV0C);
538 fOutput->Add(hAllcentTPC);
539
7bb82cc2 540 h2DcosV0r = new TH2F("h2DcosV0r", "cos(Phi) V0r vs Run NUmber", 200, 0, 200, 100, -1, 1);
541 h2DsinV0r = new TH2F("h2DsinV0r", "sin(Phi) V0r vs Run NUmber", 200, 0, 200, 100, -1, 1);
542 h2DcosV0A = new TH2F("h2DcosV0A", "cos(Phi) V0r vs Run NUmber", 200, 0, 200, 100, -1, 1);
543 h2DsinV0A = new TH2F("h2DsinV0A", "sin(Phi) V0r vs Run NUmber", 200, 0, 200, 100, -1, 1);
544 h2DcosV0C = new TH2F("h2DcosV0C", "cos(Phi) V0r vs Run NUmber", 200, 0, 200, 100, -1, 1);
545 h2DsinV0C = new TH2F("h2DsinV0C", "sin(Phi) V0r vs Run NUmber", 200, 0, 200, 100, -1, 1);
546 h2DcosTPC = new TH2F("h2DcosTPC", "cos(Phi) V0r vs Run NUmber", 200, 0, 200, 100, -1, 1);
547 h2DsinTPC = new TH2F("h2DsinTPC", "sin(Phi) V0r vs Run NUmber", 200, 0, 200, 100, -1, 1);
548 fOutput->Add(h2DcosV0r);
549 fOutput->Add(h2DsinV0r);
550 fOutput->Add(h2DcosV0A);
551 fOutput->Add(h2DsinV0A);
552 fOutput->Add(h2DcosV0C);
553 fOutput->Add(h2DsinV0C);
554 fOutput->Add(h2DcosTPC);
555 fOutput->Add(h2DsinTPC);
556
04b116e8 557 const Int_t ndims = 5;
558 Int_t nMgg=500, nPt=40, nCent=20, nDeltaPhi=315, ncos2phi=500;
559 Int_t bins[ndims] = {nMgg, nPt, nCent, nDeltaPhi, ncos2phi};
560 Double_t xmin[ndims] = { 0, 0., 0, 0., -1.};
561 Double_t xmax[ndims] = { 0.5, 20., 100, 3.15, 1.};
562 fHEPV0r = new THnSparseF("fHEPV0r", "Flow histogram EPV0", ndims, bins, xmin, xmax);
563 fHEPV0A = new THnSparseF("fHEPV0A", "Flow histogram EPV0A", ndims, bins, xmin, xmax);
564 fHEPV0C = new THnSparseF("fHEPV0C", "Flow histogram EPV0C", ndims, bins, xmin, xmax);
565 fHEPTPC = new THnSparseF("fHEPTPC", "Flow histogram EPTPC", ndims, bins, xmin, xmax);
566 fOutput->Add(fHEPV0r);
567 fOutput->Add(fHEPV0A);
568 fOutput->Add(fHEPV0C);
569 fOutput->Add(fHEPTPC);
570
3c40321c 571
04b116e8 572
573 PostData(1, fOutput); // Post data for ALL output slots >0 here, to get at least an empty histogram
3c40321c 574}
575
576//________________________________________________________________________
577void AliAnalysisTaskPi0V2::UserExec(Option_t *)
578{
04b116e8 579 // Main loop
580 // Called for each event
581
04b116e8 582 // Create pointer to reconstructed event
583 AliVEvent *event = InputEvent();
584 if (!event) { Printf("ERROR: Could not retrieve event"); return; }
7bb82cc2 585 // create pointer to event
586 fESD = dynamic_cast<AliESDEvent*>(event);
587 if (!fESD) {
588 AliError("Cannot get the ESD event");
589 return;
590 }
4fbbf89d 591 hEvtCount->Fill(1);
7bb82cc2 592
593 Int_t AbsRunNumber = fESD->GetRunNumber();
594 fRunNumber = ConvertToInternalRunNumber(AbsRunNumber);
04b116e8 595
0c842c93 596 Bool_t isSelected =0;
670ffa5c 597 if(fEvtSelect == 1){ //MB+SemiCentral
ea7921ea 598 isSelected = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & (AliVEvent::kAnyINT | AliVEvent::kSemiCentral));
670ffa5c 599 } else if (fEvtSelect == 2){ //MB+Central+SemiCentral
ea7921ea 600 isSelected = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & (AliVEvent::kAnyINT | AliVEvent::kSemiCentral | AliVEvent::kCentral));
670ffa5c 601 } else if(fEvtSelect == 3){ //MB
ea7921ea 602 isSelected = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & (AliVEvent::kAnyINT ));
8071d5b2 603 }
ea7921ea 604
8071d5b2 605 if(!isSelected )
0c842c93 606 return;
607
4fbbf89d 608 hEvtCount->Fill(2);
7bb82cc2 609 if(!fTrigClass.IsNull()){
610 TString fired;
611 fired = fESD->GetFiredTriggerClasses();
612 if (!fired.Contains("-B-"))
613 return;
614 TObjArray *arr = fTrigClass.Tokenize("|");
615 if (!arr)
616 return;
617 Bool_t match = 0;
618 for (Int_t i=0;i<arr->GetEntriesFast();++i) {
619 TObject *obj = arr->At(i);
620 if (!obj)
621 continue;
622 if (fired.Contains(obj->GetName())) {
623 match = 1;
624 break;
625 }
626 }
627 delete arr;
628 if (
ea7921ea 629 !match && //select by Trigger classes in KCentral and KSemiCentral
630 !(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & (AliVEvent::kAnyINT )) // always accept MB
7bb82cc2 631 )
632 return; //Not match skip this event
633 }
04b116e8 634
4fbbf89d 635 hEvtCount->Fill(3);
ef7e23cf 636 const AliESDVertex* fvertex = fESD->GetPrimaryVertex();
670ffa5c 637 if(TMath::Abs(fvertex->GetZ())>fVtxCut)
c6ee6f73 638 return;
04b116e8 639 Double_t vertex[3] = {fvertex->GetX(), fvertex->GetY(), fvertex->GetZ()};
70d53162 640
4fbbf89d 641 hEvtCount->Fill(4);
ef7e23cf 642
04b116e8 643 if(fESD->GetCentrality()) {
644 fCentrality =
670ffa5c 645 fESD->GetCentrality()->GetCentralityPercentile("CL1"); //spd vertex
ef7e23cf 646 } else{
647 return;
04b116e8 648 }
3c40321c 649
4fbbf89d 650 hEvtCount->Fill(5);
04b116e8 651 AliEventplane *ep = fESD->GetEventplane();
7bb82cc2 652 if (ep) {
04b116e8 653 if (ep->GetQVector())
7bb82cc2 654 fEPTPC = ep->GetQVector()->Phi()/2. ;
04b116e8 655 else
7bb82cc2 656 fEPTPC = -999.;
04b116e8 657 if (ep->GetQsub1()&&ep->GetQsub2())
7bb82cc2 658 fEPTPCreso = TMath::Cos(2.*(ep->GetQsub1()->Phi()/2.-ep->GetQsub2()->Phi()/2.));
04b116e8 659 else
7bb82cc2 660 fEPTPCreso = -1;
04b116e8 661
662 fEPV0 = ep->GetEventplane("V0", fESD);
663 fEPV0A = ep->GetEventplane("V0A", fESD);
664 fEPV0C = ep->GetEventplane("V0C", fESD);
665 Double_t qx=0, qy=0;
666 Double_t qxr=0, qyr=0;
667 fEPV0Ar = ep->CalculateVZEROEventPlane(fESD, 4, 5, 2, qxr, qyr);
668 fEPV0Cr = ep->CalculateVZEROEventPlane(fESD, 2, 3, 2, qx, qy);
669 qxr += qx;
670 qyr += qy;
671 fEPV0r = TMath::ATan2(qyr,qxr)/2.;
672 fEPV0AR4 = ep->CalculateVZEROEventPlane(fESD, 4, 2, qx, qy);
673 fEPV0AR5 = ep->CalculateVZEROEventPlane(fESD, 5, 2, qx, qy);
674 fEPV0AR6 = ep->CalculateVZEROEventPlane(fESD, 6, 2, qx, qy);
675 fEPV0AR7 = ep->CalculateVZEROEventPlane(fESD, 7, 2, qx, qy);
676 fEPV0CR0 = ep->CalculateVZEROEventPlane(fESD, 0, 2, qx, qy);
677 fEPV0CR1 = ep->CalculateVZEROEventPlane(fESD, 1, 2, qx, qy);
678 fEPV0CR2 = ep->CalculateVZEROEventPlane(fESD, 2, 2, qx, qy);
679 fEPV0CR3 = ep->CalculateVZEROEventPlane(fESD, 3, 2, qx, qy);
04b116e8 680 }
7bb82cc2 681 FillEPQA(); //Fill the EP QA
965c985f 682
4fbbf89d 683 hEvtCount->Fill(6);
ef7e23cf 684
7bb82cc2 685 if( fEPV0A<-2. || fEPV0C<-2. || fEPTPC<-2. || fEPV0r<-2.)
686 return;
ef7e23cf 687
4fbbf89d 688 hEvtCount->Fill(7);
ef7e23cf 689
ebaf288d 690 fEPV0 = TVector2::Phi_0_2pi(fEPV0); if(fEPV0>TMath::Pi()) fEPV0 = fEPV0 - TMath::Pi();
691 fEPV0r = TVector2::Phi_0_2pi(fEPV0r); if(fEPV0r>TMath::Pi()) fEPV0r = fEPV0r - TMath::Pi();
692 fEPV0A = TVector2::Phi_0_2pi(fEPV0A); if(fEPV0A>TMath::Pi()) fEPV0A = fEPV0A - TMath::Pi();
693 fEPV0C = TVector2::Phi_0_2pi(fEPV0C); if(fEPV0C>TMath::Pi()) fEPV0C = fEPV0C - TMath::Pi();
694 fEPV0Ar = TVector2::Phi_0_2pi(fEPV0Ar); if(fEPV0Ar>TMath::Pi()) fEPV0Ar = fEPV0Ar - TMath::Pi();
695 fEPV0Cr = TVector2::Phi_0_2pi(fEPV0Cr); if(fEPV0Cr>TMath::Pi()) fEPV0Cr = fEPV0Cr - TMath::Pi();
696 fEPV0AR4 = TVector2::Phi_0_2pi(fEPV0AR4); if(fEPV0AR4>TMath::Pi()) fEPV0AR4 = fEPV0AR4 - TMath::Pi();
697 fEPV0AR7 = TVector2::Phi_0_2pi(fEPV0AR7); if(fEPV0AR7>TMath::Pi()) fEPV0AR7 = fEPV0AR7 - TMath::Pi();
698 fEPV0CR0 = TVector2::Phi_0_2pi(fEPV0CR0); if(fEPV0CR0>TMath::Pi()) fEPV0CR0 = fEPV0CR0 - TMath::Pi();
699 fEPV0CR3 = TVector2::Phi_0_2pi(fEPV0CR3); if(fEPV0CR3>TMath::Pi()) fEPV0CR3 = fEPV0CR3 - TMath::Pi();
700
8071d5b2 701 if(fEPTPC != -999.)
04b116e8 702 hEPTPC->Fill(fCentrality, fEPTPC);
703 if(fEPTPCreso!=-1) hresoTPC->Fill(fCentrality, fEPTPCreso);
704 hEPV0->Fill(fCentrality, fEPV0);
705 hEPV0A->Fill(fCentrality, fEPV0A);
706 hEPV0C->Fill(fCentrality, fEPV0C);
707 hEPV0Ar->Fill(fCentrality, fEPV0Ar);
708 hEPV0Cr->Fill(fCentrality, fEPV0Cr);
709 hEPV0r->Fill(fCentrality, fEPV0r);
ebaf288d 710 hEPV0AR4->Fill(fCentrality, fEPV0AR4);
711 hEPV0AR7->Fill(fCentrality, fEPV0AR7);
712 hEPV0CR0->Fill(fCentrality, fEPV0CR0);
713 hEPV0CR3->Fill(fCentrality, fEPV0CR3);
714
715 hAllcentV0->Fill(fEPV0);
716 hAllcentV0r->Fill(fEPV0r);
717 hAllcentV0A->Fill(fEPV0A);
718 hAllcentV0C->Fill(fEPV0C);
719 hAllcentTPC->Fill(fEPTPC);
04b116e8 720
e50db689 721 hdifV0Ar_V0Cr->Fill(fCentrality, TMath::Cos(2.*(fEPV0Ar - fEPV0Cr)));
04b116e8 722 hdifV0A_V0CR0->Fill(fCentrality, TMath::Cos(2.*(fEPV0A - fEPV0CR0)));
723 hdifV0A_V0CR3->Fill(fCentrality, TMath::Cos(2.*(fEPV0A - fEPV0CR3)));
724 hdifV0ACR0_V0CR3->Fill(fCentrality, TMath::Cos(2*(fEPV0CR0 - fEPV0CR3)));
725 hdifV0C_V0AR4->Fill(fCentrality, TMath::Cos(2*(fEPV0C - fEPV0AR4)));
726 hdifV0C_V0AR7->Fill(fCentrality, TMath::Cos(2*(fEPV0C - fEPV0AR7)));
727 hdifV0AR4_V0AR7->Fill(fCentrality, TMath::Cos(2*(fEPV0AR4 - fEPV0AR7)));
3c40321c 728
04b116e8 729 hdifV0A_V0C->Fill(fCentrality, TMath::Cos(2*(fEPV0A - fEPV0C)));
730 hdifV0A_TPC->Fill(fCentrality, TMath::Cos(2*(fEPV0A - fEPTPC)));
731 hdifV0C_TPC->Fill(fCentrality, TMath::Cos(2*(fEPV0C - fEPTPC)));
732 hdifV0C_V0A->Fill(fCentrality, TMath::Cos(2*(fEPV0C - fEPV0A)));
733 // Cluster loop for reconstructed event
04b116e8 734
670ffa5c 735 Int_t nCluster = fESD->GetNumberOfCaloClusters();
736 for(Int_t i=0; i<nCluster; ++i){
737 AliESDCaloCluster *c1 = fESD->GetCaloCluster(i);
738 if(!c1->IsEMCAL()) continue;
739 if(!IsGoodCluster(c1)) continue;
7bb82cc2 740 TLorentzVector p1;
741 GetMom(p1, c1, vertex);
742 FillCluster(p1, fEPV0r, fEPV0A, fEPV0C, fEPTPC);
670ffa5c 743 for(Int_t j=i+1; j<nCluster; ++j){
744 AliESDCaloCluster *c2 = fESD->GetCaloCluster(j);
745 if(!c2->IsEMCAL()) continue;
746 if(!IsGoodCluster(c2)) continue;
670ffa5c 747 TLorentzVector p2;
748 GetMom(p2, c2, vertex);
749 FillPion(p1, p2, fEPV0r, fEPV0A, fEPV0C, fEPTPC);
750 }
751 }
752
e5ba16b4 753 if (!fTracksName.IsNull() && !fTracks) {
754 fTracks = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fTracksName));
755 if (!fTracks) {
756 AliError(Form("%s: Could not retrieve tracks %s!", GetName(), fTracksName.Data()));
757 return;
e5ba16b4 758 }
50ebbe79 759 }
e5ba16b4 760
761 Int_t ntracks = fTracks->GetEntries();
762 for(Int_t i=0; i<ntracks; ++i){
763 AliVTrack *track = static_cast<AliVTrack*>(fTracks->At(i));
764 Double_t tPhi = track->Phi();
765 Double_t tPt = track->Pt();
766
767 Double_t difTrackV0 = TVector2::Phi_0_2pi(tPhi-fEPV0); if(difTrackV0 >TMath::Pi()) difTrackV0 -= TMath::Pi();
768 Double_t difTrackV0A = TVector2::Phi_0_2pi(tPhi-fEPV0A); if(difTrackV0A >TMath::Pi()) difTrackV0A -= TMath::Pi();
769 Double_t difTrackV0C = TVector2::Phi_0_2pi(tPhi-fEPV0C); if(difTrackV0C >TMath::Pi()) difTrackV0C -= TMath::Pi();
770 Double_t difTrackTPC = TVector2::Phi_0_2pi(tPhi-fEPTPC); if(difTrackTPC >TMath::Pi()) difTrackTPC -= TMath::Pi();
771 if(track->IsEMCAL()){
772 hdifEMC_EPV0->Fill(fCentrality, difTrackV0, tPt);
773 hdifEMC_EPV0A->Fill(fCentrality, difTrackV0A, tPt);
774 hdifEMC_EPV0C->Fill(fCentrality, difTrackV0C, tPt);
775 hdifEMC_EPTPC->Fill(fCentrality, difTrackTPC, tPt);
776 }else{
777 hdifout_EPV0->Fill(fCentrality, difTrackV0, tPt);
778 hdifout_EPV0A->Fill(fCentrality, difTrackV0A, tPt);
779 hdifout_EPV0C->Fill(fCentrality, difTrackV0C, tPt);
780 hdifout_EPTPC->Fill(fCentrality, difTrackTPC, tPt);
781 }
782 hdifful_EPV0->Fill(fCentrality, difTrackV0, tPt);
783 hdifful_EPV0A->Fill(fCentrality, difTrackV0A, tPt);
784 hdifful_EPV0C->Fill(fCentrality, difTrackV0C, tPt);
785 hdifful_EPTPC->Fill(fCentrality, difTrackTPC, tPt);
04b116e8 786 }
4fbbf89d 787 hEvtCount->Fill(8);
04b116e8 788
789 // NEW HISTO should be filled before this point, as PostData puts the
790 // information for this iteration of the UserExec in the container
791 PostData(1, fOutput);
3c40321c 792}
7bb82cc2 793//____________________________________________________________________
794Int_t AliAnalysisTaskPi0V2::ConvertToInternalRunNumber(Int_t n)
795{
796 switch(n){
797 case 170593 : return 179 ;
798 case 170572 : return 178 ;
799 case 170556 : return 177 ;
800 case 170552 : return 176 ;
801 case 170546 : return 175 ;
802 case 170390 : return 174 ;
803 case 170389 : return 173 ;
804 case 170388 : return 172 ;
805 case 170387 : return 171 ;
806 case 170315 : return 170 ;
807 case 170313 : return 169 ;
808 case 170312 : return 168 ;
809 case 170311 : return 167 ;
810 case 170309 : return 166 ;
811 case 170308 : return 165 ;
812 case 170306 : return 164 ;
813 case 170270 : return 163 ;
814 case 170269 : return 162 ;
815 case 170268 : return 161 ;
816 case 170267 : return 160 ;
817 case 170264 : return 159 ;
818 case 170230 : return 158 ;
819 case 170228 : return 157 ;
820 case 170208 : return 156 ;
821 case 170207 : return 155 ;
822 case 170205 : return 154 ;
823 case 170204 : return 153 ;
824 case 170203 : return 152 ;
825 case 170195 : return 151 ;
826 case 170193 : return 150 ;
827 case 170163 : return 149 ;
828 case 170162 : return 148 ;
829 case 170159 : return 147 ;
830 case 170155 : return 146 ;
831 case 170152 : return 145 ;
832 case 170091 : return 144 ;
833 case 170089 : return 143 ;
834 case 170088 : return 142 ;
835 case 170085 : return 141 ;
836 case 170084 : return 140 ;
837 case 170083 : return 139 ;
838 case 170081 : return 138 ;
839 case 170040 : return 137 ;
840 case 170038 : return 136 ;
841 case 170036 : return 135 ;
842 case 170027 : return 134 ;
843 case 169981 : return 133 ;
844 case 169975 : return 132 ;
845 case 169969 : return 131 ;
846 case 169965 : return 130 ;
847 case 169961 : return 129 ;
848 case 169956 : return 128 ;
849 case 169926 : return 127 ;
850 case 169924 : return 126 ;
851 case 169923 : return 125 ;
852 case 169922 : return 124 ;
853 case 169919 : return 123 ;
854 case 169918 : return 122 ;
855 case 169914 : return 121 ;
856 case 169859 : return 120 ;
857 case 169858 : return 119 ;
858 case 169855 : return 118 ;
859 case 169846 : return 117 ;
860 case 169838 : return 116 ;
861 case 169837 : return 115 ;
862 case 169835 : return 114 ;
863 case 169683 : return 113 ;
864 case 169628 : return 112 ;
865 case 169591 : return 111 ;
866 case 169590 : return 110 ;
867 case 169588 : return 109 ;
868 case 169587 : return 108 ;
869 case 169586 : return 107 ;
870 case 169584 : return 106 ;
871 case 169557 : return 105 ;
872 case 169555 : return 104 ;
873 case 169554 : return 103 ;
874 case 169553 : return 102 ;
875 case 169550 : return 101 ;
876 case 169515 : return 100 ;
877 case 169512 : return 99 ;
878 case 169506 : return 98 ;
879 case 169504 : return 97 ;
880 case 169498 : return 96 ;
881 case 169475 : return 95 ;
882 case 169420 : return 94 ;
883 case 169419 : return 93 ;
884 case 169418 : return 92 ;
885 case 169417 : return 91 ;
886 case 169415 : return 90 ;
887 case 169411 : return 89 ;
888 case 169238 : return 88 ;
889 case 169236 : return 87 ;
890 case 169167 : return 86 ;
891 case 169160 : return 85 ;
892 case 169156 : return 84 ;
893 case 169148 : return 83 ;
894 case 169145 : return 82 ;
895 case 169144 : return 81 ;
896 case 169143 : return 80 ;
897 case 169138 : return 79 ;
898 case 169099 : return 78 ;
899 case 169094 : return 77 ;
900 case 169091 : return 76 ;
901 case 169045 : return 75 ;
902 case 169044 : return 74 ;
903 case 169040 : return 73 ;
904 case 169035 : return 72 ;
905 case 168992 : return 71 ;
906 case 168988 : return 70 ;
907 case 168984 : return 69 ;
908 case 168826 : return 68 ;
909 case 168777 : return 67 ;
910 case 168514 : return 66 ;
911 case 168512 : return 65 ;
912 case 168511 : return 64 ;
913 case 168467 : return 63 ;
914 case 168464 : return 62 ;
915 case 168461 : return 61 ;
916 case 168460 : return 60 ;
917 case 168458 : return 59 ;
918 case 168362 : return 58 ;
919 case 168361 : return 57 ;
920 case 168356 : return 56 ;
921 case 168342 : return 55 ;
922 case 168341 : return 54 ;
923 case 168325 : return 53 ;
924 case 168322 : return 52 ;
925 case 168318 : return 51 ;
926 case 168311 : return 50 ;
927 case 168310 : return 49 ;
928 case 168213 : return 48 ;
929 case 168212 : return 47 ;
930 case 168208 : return 46 ;
931 case 168207 : return 45 ;
932 case 168206 : return 44 ;
933 case 168205 : return 43 ;
934 case 168204 : return 42 ;
935 case 168203 : return 41 ;
936 case 168181 : return 40 ;
937 case 168177 : return 39 ;
938 case 168175 : return 38 ;
939 case 168173 : return 37 ;
940 case 168172 : return 36 ;
941 case 168171 : return 35 ;
942 case 168115 : return 34 ;
943 case 168108 : return 33 ;
944 case 168107 : return 32 ;
945 case 168105 : return 31 ;
946 case 168104 : return 30 ;
947 case 168103 : return 29 ;
948 case 168076 : return 28 ;
949 case 168069 : return 27 ;
950 case 168068 : return 26 ;
951 case 168066 : return 25 ;
952 case 167988 : return 24 ;
953 case 167987 : return 23 ;
954 case 167986 : return 22 ;
955 case 167985 : return 21 ;
956 case 167921 : return 20 ;
957 case 167920 : return 19 ;
958 case 167915 : return 18 ;
959 case 167909 : return 17 ;
960 case 167903 : return 16 ;
961 case 167902 : return 15 ;
962 case 167818 : return 14 ;
963 case 167814 : return 13 ;
964 case 167813 : return 12 ;
965 case 167808 : return 11 ;
966 case 167807 : return 10 ;
967 case 167806 : return 9 ;
968 case 167713 : return 8 ;
969 case 167712 : return 7 ;
970 case 167711 : return 6 ;
971 case 167706 : return 5 ;
972 case 167693 : return 4 ;
973 case 166532 : return 3 ;
974 case 166530 : return 2 ;
975 case 166529 : return 1 ;
976
977 default : return 199;
978 }
979}
980//_______________________________________________________________________
981void AliAnalysisTaskPi0V2::FillEPQA()
982{
983
984 h2DcosV0r->Fill(fRunNumber, TMath::Cos(fEPV0r));
985 h2DsinV0r->Fill(fRunNumber, TMath::Sin(fEPV0r));
986 h2DcosV0A->Fill(fRunNumber, TMath::Cos(fEPV0A));
987 h2DsinV0A->Fill(fRunNumber, TMath::Sin(fEPV0A));
988 h2DcosV0C->Fill(fRunNumber, TMath::Cos(fEPV0C));
989 h2DsinV0C->Fill(fRunNumber, TMath::Sin(fEPV0C));
990 h2DcosTPC->Fill(fRunNumber, TMath::Cos(fEPTPC));
991 h2DsinTPC->Fill(fRunNumber, TMath::Sin(fEPTPC));
3c40321c 992
04b116e8 993
7bb82cc2 994}
3c40321c 995//________________________________________________________________________
996void AliAnalysisTaskPi0V2::Terminate(Option_t *)
997{
04b116e8 998 // Draw result to screen, or perform fitting, normalizations
999 // Called once at the end of the query
1000// fOutput = dynamic_cast<TList*> (GetOutputData(1));
1001 // if(!fOutput) { Printf("ERROR: could not retrieve TList fOutput"); return; }
1002
1003 // Get the physics selection histograms with the selection statistics
1004 //AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
1005 //AliESDInputHandler *inputH = dynamic_cast<AliESDInputHandler*>(mgr->GetInputEventHandler());
1006 //TH2F *histStat = (TH2F*)inputH->GetStatistics();
1007
1008
1009 // NEW HISTO should be retrieved from the TList container in the above way,
1010 // so it is available to draw on a canvas such as below
1011
3c40321c 1012}