1 /* $Id: AliAnalysisTaskPi0V2.cxx 55404 2012-03-29 10:10:19Z fca $ */
3 #include "AliAnalysisTaskPi0V2.h"
8 #include <TClonesArray.h>
12 #include <THnSparse.h>
18 #include "AliAODEvent.h"
19 #include "AliAnalysisManager.h"
20 #include "AliAnalysisTaskSE.h"
21 #include "AliCaloPID.h"
22 #include "AliCaloTrackReader.h"
23 #include "AliCalorimeterUtils.h"
24 #include "AliEMCALGeometry.h"
25 #include "AliEPFlattener.h"
26 #include "AliESDEvent.h"
27 #include "AliESDInputHandler.h"
28 #include "AliESDtrackCuts.h"
29 #include "AliEventplane.h"
30 #include "AliMCEvent.h"
31 #include "AliOADBContainer.h"
33 #include "AliVCluster.h"
38 ClassImp(AliAnalysisTaskPi0V2)
40 //________________________________________________________________________
41 AliAnalysisTaskPi0V2::AliAnalysisTaskPi0V2(const char *name) :
42 AliAnalysisTaskSE(name),
45 fTracksName("PicoTrack"), fV1ClusName("CaloCluster"), fV2ClusName("CaloCluster"),
46 fTrigClass("CVLN_|CSEMI_|CCENT|CVHN"),
47 fTracks(0), fV1Clus(0), fV2Clus(0),
48 fRunNumber(-999),fInterRunNumber(-999),
50 fNcellCut(2.), fECut(1.), fEtaCut(0.65), fM02Cut(0.5),fDrCut(0.025), fPi0AsyCut(0), isV1Clus(1), isPhosCali(0), isCentFlat(0), isFullHist(0),
54 fEPV0(-999.), fEPV0A(-999.), fEPV0C(-999.), fEPV0Ar(-999.), fEPV0Cr(-999.), fEPV0r(-999.),
55 fEPV0AR4(-999.), fEPV0AR5(-999.), fEPV0AR6(-999.), fEPV0AR7(-999.), fEPV0CR0(-999.), fEPV0CR1(-999.), fEPV0CR2(-999.), fEPV0CR3(-999.),
56 hEvtCount(0), hCent(0),
57 h2DcosV0A(0), h2DsinV0A(0), h2DcosV0C(0), h2DsinV0C(0), h2DcosTPC(0), h2DsinTPC(0),
58 hEPTPC(0), hresoTPC(0),
59 hEPV0(0), hEPV0A(0), hEPV0C(0), hEPV0Ar(0), hEPV0Cr(0), hEPV0r(0), hEPV0AR4(0), hEPV0AR7(0), hEPV0CR0(0), hEPV0CR3(0),
60 hEPTPCCor(0), hEPV0ACor(0), hEPV0CCor(0),
61 hdifV0Ar_V0Cr(0), hdifV0A_V0CR0(0), hdifV0A_V0CR3(0), hdifV0ACR0_V0CR3(0), hdifV0C_V0AR4(0), hdifV0C_V0AR7(0), hdifV0AR4_V0AR7(0),
62 hdifV0A_V0C(0), hdifV0A_TPC(0), hdifV0C_TPC(0), hdifV0C_V0A(0),
63 hM02vsPtA(0), hM02vsPtB(0), hClusDxDZA(0), hClusDxDZB(0),
64 hdifEMC_EPV0A(0), hdifEMC_EPV0C(0),
65 hdifful_EPV0A(0), hdifful_EPV0C(0),
66 hdifout_EPV0A(0), hdifout_EPV0C(0),
67 hCv2EMC_EPV0A(0), hCv2EMC_EPV0C(0), hCv2ful_EPV0A(0), hCv2ful_EPV0C(0), hCv2out_EPV0A(0), hCv2out_EPV0C(0),
68 hclusDif_EPV0A(0), hclusDif_EPV0C(0), hclusv2_EPV0A(0), hclusv2_EPV0C(0),
69 fEPcalibFileName("$ALICE_ROOT/OADB/PHOS/PHOSflat.root"), fTPCFlat(0x0), fV0AFlat(0x0), fV0CFlat(0x0),
70 fClusterPbV0(0), fClusterPbV0A(0), fClusterPbV0C(0), fClusterPbTPC(0),
71 fHEPV0A(0x0), fHEPV0C(0x0), fHEPTPC(0x0),
72 fHEPV0AM2(0x0), fHEPV0CM2(0x0), fHEPTPCM2(0x0)
74 // Dummy constructor ALWAYS needed for I/O.
75 DefineInput(0, TChain::Class());
76 DefineOutput(1, TList::Class()); // for output list
79 //________________________________________________________________________
80 AliAnalysisTaskPi0V2::AliAnalysisTaskPi0V2() :
81 AliAnalysisTaskSE("default_name"),
84 fTracksName("PicoTrack"), fV1ClusName("CaloCluster"), fV2ClusName("CaloCluster"),
85 fTrigClass("CVLN_|CSEMI_|CCENT|CVHN"),
86 fTracks(0), fV1Clus(0), fV2Clus(0),
87 fRunNumber(-999),fInterRunNumber(-999),
89 fNcellCut(2.), fECut(1.), fEtaCut(0.65), fM02Cut(0.5), fDrCut(0.025), fPi0AsyCut(0), isV1Clus(1),isPhosCali(0),isCentFlat(0), isFullHist(0),
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 hEvtCount(0), hCent(0),
96 h2DcosV0A(0), h2DsinV0A(0), h2DcosV0C(0), h2DsinV0C(0), h2DcosTPC(0), h2DsinTPC(0),
97 hEPTPC(0), hresoTPC(0),
98 hEPV0(0), hEPV0A(0), hEPV0C(0), hEPV0Ar(0), hEPV0Cr(0), hEPV0r(0), hEPV0AR4(0), hEPV0AR7(0), hEPV0CR0(0), hEPV0CR3(0),
99 hEPTPCCor(0), hEPV0ACor(0), hEPV0CCor(0),
100 hdifV0Ar_V0Cr(0), hdifV0A_V0CR0(0), hdifV0A_V0CR3(0), hdifV0ACR0_V0CR3(0), hdifV0C_V0AR4(0), hdifV0C_V0AR7(0), hdifV0AR4_V0AR7(0),
101 hdifV0A_V0C(0), hdifV0A_TPC(0), hdifV0C_TPC(0), hdifV0C_V0A(0),
102 hM02vsPtA(0), hM02vsPtB(0), hClusDxDZA(0), hClusDxDZB(0),
103 hdifEMC_EPV0A(0), hdifEMC_EPV0C(0),
104 hdifful_EPV0A(0), hdifful_EPV0C(0),
105 hdifout_EPV0A(0), hdifout_EPV0C(0),
106 hCv2EMC_EPV0A(0), hCv2EMC_EPV0C(0), hCv2ful_EPV0A(0), hCv2ful_EPV0C(0), hCv2out_EPV0A(0), hCv2out_EPV0C(0),
107 hclusDif_EPV0A(0), hclusDif_EPV0C(0), hclusv2_EPV0A(0), hclusv2_EPV0C(0),
108 fEPcalibFileName("$ALICE_ROOT/OADB/PHOS/PHOSflat.root"), fTPCFlat(0x0), fV0AFlat(0x0), fV0CFlat(0x0),
109 fClusterPbV0(0), fClusterPbV0A(0), fClusterPbV0C(0), fClusterPbTPC(0),
110 fHEPV0A(0x0), fHEPV0C(0x0), fHEPTPC(0x0),
111 fHEPV0AM2(0x0), fHEPV0CM2(0x0), fHEPTPCM2(0x0)
114 // Define input and output slots here (never in the dummy constructor)
115 // Input slot #0 works with a TChain - it is connected to the default input container
116 // Output slot #1 writes into a TH1 container
117 DefineInput(0, TChain::Class());
118 DefineOutput(1, TList::Class()); // for output list
121 //________________________________________________________________________
122 AliAnalysisTaskPi0V2::~AliAnalysisTaskPi0V2()
124 // Destructor. Clean-up the output list, but not the histograms that are put inside
125 // (the list is owner and will clean-up these histograms). Protect in PROOF case.
138 //_____________________________________________________________________
139 Double_t AliAnalysisTaskPi0V2::GetMaxCellEnergy(const AliVCluster *cluster, Short_t &id) const
141 // Get maximum energy of attached cell.
145 AliVCaloCells *cells = 0;
147 cells = fESD->GetEMCALCells();
149 cells = fAOD->GetEMCALCells();
155 const Int_t ncells = cluster->GetNCells();
156 for (Int_t i=0; i<ncells; i++) {
157 Double_t e = cells->GetCellAmplitude(TMath::Abs(cluster->GetCellAbsId(i)));
160 id = cluster->GetCellAbsId(i);
166 //_____________________________________________________________________
167 Double_t AliAnalysisTaskPi0V2::GetCrossEnergy(const AliVCluster *cluster, Short_t &idmax) const
169 // Calculate the energy of cross cells around the leading cell.
171 AliVCaloCells *cells;
173 cells = fESD->GetEMCALCells();
175 cells = fAOD->GetEMCALCells();
180 AliEMCALGeometry *geom = AliEMCALGeometry::GetInstance();
193 Double_t crossEnergy = 0.;
195 geom->GetCellIndex(idmax,iSupMod,iTower,iIphi,iIeta);
196 geom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,iIphi, iIeta,iphis,ietas);
198 Int_t ncells = cluster->GetNCells();
199 for (Int_t i=0; i<ncells; i++) {
200 Int_t cellAbsId = cluster->GetCellAbsId(i);
201 geom->GetCellIndex(cellAbsId,iSupMod,iTower,iIphi,iIeta);
202 geom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,iIphi, iIeta,iphi,ieta);
203 Int_t aphidiff = TMath::Abs(iphi-iphis);
206 Int_t aetadiff = TMath::Abs(ieta-ietas);
209 if ( (aphidiff==1 && aetadiff==0) ||
210 (aphidiff==0 && aetadiff==1) ) {
211 crossEnergy += cells->GetCellAmplitude(cellAbsId);
218 //_____________________________________________________________________
219 Bool_t AliAnalysisTaskPi0V2::IsWithinFiducialVolume(Short_t id) const
221 // Check if cell is within given fiducial volume.
223 Double_t fNFiducial = 1;
232 Bool_t okrow = kFALSE;
233 Bool_t okcol = kFALSE;
235 AliEMCALGeometry *geom = AliEMCALGeometry::GetInstance();
239 Int_t cellAbsId = id;
240 geom->GetCellIndex(cellAbsId,iSupMod,iTower,iIphi,iIeta);
241 geom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,iIphi, iIeta,iphi,ieta);
245 if (iphi >= fNFiducial && iphi < 24-fNFiducial)
248 if (iphi >= fNFiducial && iphi < 12-fNFiducial)
252 Bool_t noEMCALBorderAtEta0 = kTRUE;
253 if (!noEMCALBorderAtEta0) {
254 if (ieta > fNFiducial && ieta < 48-fNFiducial)
258 if (ieta >= fNFiducial)
261 if (ieta < 48-fNFiducial)
271 //______________________________________________________________________
272 Bool_t AliAnalysisTaskPi0V2::IsGoodCluster(const AliVCluster *c) const
277 if(c->GetNCells() < fNcellCut)
283 Double_t maxE = GetMaxCellEnergy(c, id);
284 if((1. - double(GetCrossEnergy(c,id))/maxE) > 0.97)
289 c->GetPosition(pos1);
290 TVector3 clsPos(pos1);
291 Double_t eta = clsPos.Eta();
293 if (TMath::Abs(eta) > fEtaCut)
296 if (!IsWithinFiducialVolume(id))
299 if(c->GetM02() >fM02Cut)
306 //________________________________________________________________________________________________
307 Bool_t AliAnalysisTaskPi0V2::IsGoodClusterV1(const AliVCluster *c) const
312 if (c->GetNCells() < fNcellCut)
319 Double_t maxE = GetMaxCellEnergy(c, id);
320 if((1. - double(GetCrossEnergy(c,id))/maxE) > 0.97)
325 c->GetPosition(pos1);
326 TVector3 clsPos(pos1);
327 Double_t eta = clsPos.Eta();
329 if (TMath::Abs(eta) > fEtaCut)
332 if (!IsWithinFiducialVolume(id))
335 if (c->GetM02() <fM02Cut)
338 Double_t dr = TMath::Sqrt(c->GetTrackDx()*c->GetTrackDx() + c->GetTrackDz()*c->GetTrackDz());
345 //_____________________________________________________________________
346 Bool_t AliAnalysisTaskPi0V2::IsGoodPion(const TLorentzVector &p1, const TLorentzVector &p2) const
351 Double_t asym = TMath::Abs(p1.E()-p2.E())/(p1.E()+p2.E());
357 Double_t eta = pion.Eta();
358 if(TMath::Abs(eta) > fEtaCut)
364 //_______________________________________________________________________
365 void AliAnalysisTaskPi0V2::FillPion(const TLorentzVector& p1, const TLorentzVector& p2, Double_t EPV0A, Double_t EPV0C, Double_t EPTPC)
369 if (!IsGoodPion(p1,p2))
374 Double_t mass = pion.M();
375 Double_t pt = pion.Pt();
376 Double_t phi = pion.Phi();
378 Double_t dphiV0A = phi-EPV0A;
379 Double_t dphiV0C = phi-EPV0C;
380 Double_t dphiTPC = phi-EPTPC;
382 Double_t cos2phiV0A = TMath::Cos(2.*(dphiV0A));
383 Double_t cos2phiV0C = TMath::Cos(2.*(dphiV0C));
384 Double_t cos2phiTPC = TMath::Cos(2.*(dphiTPC));
386 while(dphiV0A<0.) dphiV0A+=TMath::Pi(); while(dphiV0A>TMath::Pi()) dphiV0A-=TMath::Pi();
387 while(dphiV0C<0.) dphiV0C+=TMath::Pi(); while(dphiV0C>TMath::Pi()) dphiV0C-=TMath::Pi();
388 while(dphiTPC<0.) dphiTPC+=TMath::Pi(); while(dphiTPC>TMath::Pi()) dphiTPC-=TMath::Pi();
391 Double_t xV0A[4]; // Match ndims in fH V0A EP for method 1
394 xV0A[2] = fCentrality;
399 Double_t xV0AM2[4]; // Match ndims in fH V0A EP for method 2
402 xV0AM2[2] = fCentrality;
403 xV0AM2[3] = cos2phiV0A;
404 fHEPV0AM2->Fill(xV0AM2);
407 Double_t xV0C[4]; // Match ndims in fH V0C EP for method 1
410 xV0C[2] = fCentrality;
414 Double_t xV0CM2[4]; // Match ndims in fH V0C EP for method 2
417 xV0CM2[2] = fCentrality;
418 xV0CM2[3] = cos2phiV0C;
419 fHEPV0CM2->Fill(xV0CM2);
423 Double_t xTPC[4]; // Match ndims in fH TPC EP for method 1
426 xTPC[2] = fCentrality;
430 Double_t xTPCM2[4]; // Match ndims in fH TPC EP
433 xTPCM2[2] = fCentrality;
434 xTPCM2[3] = cos2phiTPC;
435 fHEPTPCM2->Fill(xTPCM2);
440 //________________________________________________________________________________________________________________________________
441 void AliAnalysisTaskPi0V2::FillCluster(const TLorentzVector& p1, Double_t EPV0A, Double_t EPV0C, Double_t EPTPC, AliVCluster *c)
443 // Cluster(photon) v2 method
445 Double_t Et = p1.Et();
446 Double_t Phi = p1.Phi();
447 Double_t M02 = c->GetM02();
449 Double_t difClusV0A = Phi-EPV0A;
450 Double_t difClusV0C = Phi-EPV0C;
451 Double_t difClusTPC = Phi-EPTPC;
452 while(difClusV0A<0.) difClusV0A+=TMath::Pi(); while(difClusV0A>TMath::Pi()) difClusV0A-=TMath::Pi();
453 while(difClusV0C<0.) difClusV0C+=TMath::Pi(); while(difClusV0C>TMath::Pi()) difClusV0C-=TMath::Pi();
454 while(difClusTPC<0.) difClusTPC+=TMath::Pi(); while(difClusTPC>TMath::Pi()) difClusTPC-=TMath::Pi();
459 DataV0A[2] = fCentrality;
460 DataV0A[3] = difClusV0A;
461 fClusterPbV0A->Fill(DataV0A);
466 DataV0C[2] = fCentrality;
467 DataV0C[3] = difClusV0C;
468 fClusterPbV0C->Fill(DataV0C);
473 DataTPC[2] = fCentrality;
474 DataTPC[3] = difClusTPC;
475 fClusterPbTPC->Fill(DataTPC);
478 //_________________________________________________________________________________________________
479 void AliAnalysisTaskPi0V2::GetMom(TLorentzVector& p, const AliVCluster *c, Double_t *vertex)
481 // Calculate momentum.
483 c->GetPosition(posMom);
484 TVector3 clsPos2(posMom);
487 Double_t r = clsPos2.Perp();
488 Double_t eta = clsPos2.Eta();
489 Double_t phi = clsPos2.Phi();
492 pos.SetPtEtaPhi(r,eta,phi);
494 if (vertex) { //calculate direction relative to vertex
498 Double_t rad = pos.Mag();
499 p.SetPxPyPzE(e*pos.x()/rad, e*pos.y()/rad, e*pos.z()/rad, e);
503 //________________________________________________________________________
504 void AliAnalysisTaskPi0V2::UserCreateOutputObjects()
507 // Called once (on the worker node)
509 fOutput = new TList();
510 fOutput->SetOwner(); // IMPORTANT!
512 hEvtCount = new TH1F("hEvtCount", " Event Plane", 9, 0.5, 9.5);
513 hEvtCount->GetXaxis()->SetBinLabel(1,"All");
514 hEvtCount->GetXaxis()->SetBinLabel(2,"Evt");
515 hEvtCount->GetXaxis()->SetBinLabel(3,"Trg Class");
516 hEvtCount->GetXaxis()->SetBinLabel(4,"Vtx");
517 hEvtCount->GetXaxis()->SetBinLabel(5,"Cent");
518 hEvtCount->GetXaxis()->SetBinLabel(6,"EPtask");
519 hEvtCount->GetXaxis()->SetBinLabel(7,"ClusterTask");
520 hEvtCount->GetXaxis()->SetBinLabel(8,"Pass");
521 fOutput->Add(hEvtCount);
523 hCent = new TH1F("hCent", "centrality dist. before App. flat cut", 100, 0., 100.);
526 hEPTPC = new TH2F("hEPTPC", "EPTPC vs cent", 100, 0., 100., 100, 0., TMath::Pi());
527 hresoTPC = new TH2F("hresoTPC", "TPc reso vs cent", 100, 0., 100., 100, 0., 1.);
528 hEPV0A = new TH2F("hEPV0A", "EPV0A vs cent", 100, 0., 100., 100, 0., TMath::Pi());
529 hEPV0C = new TH2F("hEPV0C", "EPV0C vs cent", 100, 0., 100., 100, 0., TMath::Pi());
530 fOutput->Add(hEPTPC);
531 fOutput->Add(hresoTPC);
532 fOutput->Add(hEPV0A);
533 fOutput->Add(hEPV0C);
536 hEPV0 = new TH2F("hEPV0", "EPV0 vs cent", 100, 0., 100., 100, 0., TMath::Pi());
537 hEPV0Ar = new TH2F("hEPV0Ar", "EPV0Ar vs cent", 100, 0., 100., 100, 0., TMath::Pi());
538 hEPV0Cr = new TH2F("hEPV0Cr", "EPV0Cr vs cent", 100, 0., 100., 100, 0., TMath::Pi());
539 hEPV0r = new TH2F("hEPV0r", "EPV0r vs cent", 100, 0., 100., 100, 0., TMath::Pi());
540 hEPV0AR4 = new TH2F("hEPV0AR4", "EPV0AR4 vs cent", 100, 0., 100., 100, 0., TMath::Pi());
541 hEPV0AR7 = new TH2F("hEPV0AR7", "EPV0AR7 vs cent", 100, 0., 100., 100, 0., TMath::Pi());
542 hEPV0CR0 = new TH2F("hEPV0CR0", "EPV0CR0 vs cent", 100, 0., 100., 100, 0., TMath::Pi());
543 hEPV0CR3 = new TH2F("hEPV0CR3", "EPV0CR3 vs cent", 100, 0., 100., 100, 0., TMath::Pi());
545 fOutput->Add(hEPV0Ar);
546 fOutput->Add(hEPV0Cr);
547 fOutput->Add(hEPV0r);
548 fOutput->Add(hEPV0AR4);
549 fOutput->Add(hEPV0AR7);
550 fOutput->Add(hEPV0CR0);
551 fOutput->Add(hEPV0CR3);
554 hEPTPCCor = new TH2F("hEPTPCCor", "EPTPC vs cent after PHOS Correct", 100, 0., 100., 100, 0., TMath::Pi());
555 hEPV0ACor = new TH2F("hEPV0ACor", "EPV0A vs cent after PHOS Correct", 100, 0., 100., 100, 0., TMath::Pi());
556 hEPV0CCor = new TH2F("hEPV0CCor", "EPV0C vs cent after PHOS Correct", 100, 0., 100., 100, 0., TMath::Pi());
557 fOutput->Add(hEPTPCCor);
558 fOutput->Add(hEPV0ACor);
559 fOutput->Add(hEPV0CCor);
561 hdifV0A_V0CR0 = new TH2F("hdifV0A_V0CR0", "EP A-R0 ", 100, 0., 100., 100, -1., 1.);
562 hdifV0A_V0CR3 = new TH2F("hdifV0A_V0CR3", "EP A-R3 ", 100, 0., 100., 100, -1., 1.);
563 hdifV0ACR0_V0CR3 = new TH2F("hdifV0ACR0_V0CR3", "EP R0-R3 ", 100, 0., 100., 100, -1., 1.);
564 hdifV0C_V0AR4 = new TH2F("hdifV0C_V0AR4", "EP C-R4 ", 100, 0., 100., 100, -1., 1.);
565 hdifV0C_V0AR7 = new TH2F("hdifV0C_V0AR7", "EP C-R7 ", 100, 0., 100., 100, -1., 1.);
566 hdifV0AR4_V0AR7 = new TH2F("hdifV0AR4_V0AR7", "EP R4-R7 ", 100, 0., 100., 100, -1., 1.);
567 fOutput->Add(hdifV0A_V0CR0);
568 fOutput->Add(hdifV0A_V0CR3);
569 fOutput->Add(hdifV0ACR0_V0CR3);
570 fOutput->Add(hdifV0C_V0AR4);
571 fOutput->Add(hdifV0C_V0AR7);
572 fOutput->Add(hdifV0AR4_V0AR7);
575 hdifV0Ar_V0Cr = new TH2F("hdifV0Ar_V0Cr", "EP Ar-Cr ", 100, 0., 100., 100, -1., 1.);
576 fOutput->Add(hdifV0Ar_V0Cr);
578 hdifV0A_V0C = new TH2F("hdifV0A_V0C", "EP A-C ", 100, 0., 100., 100, -1., 1.);
579 hdifV0A_TPC = new TH2F("hdifV0A_TPC", "EP A-TPC", 100, 0., 100., 100, -1., 1.);
580 hdifV0C_TPC = new TH2F("hdifV0C_TPC", "EP C-TPC", 100, 0., 100., 100, -1., 1.);
581 hdifV0C_V0A = new TH2F("hdifV0C_V0A", "EP C-A ", 100, 0., 100., 100, -1., 1.);
582 fOutput->Add(hdifV0A_V0C);
583 fOutput->Add(hdifV0A_TPC);
584 fOutput->Add(hdifV0C_TPC);
585 fOutput->Add(hdifV0C_V0A);
588 hdifEMC_EPV0A = new TH3F("hdifEMC_EPV0A", "dif phi in EMC with EPV0A", 100, 0., 100., 100, 0., TMath::Pi(), 15, 0., 15.);
589 hdifEMC_EPV0C = new TH3F("hdifEMC_EPV0C", "dif phi in EMC with EPV0C", 100, 0., 100., 100, 0., TMath::Pi(), 15, 0., 15.);
590 fOutput->Add(hdifEMC_EPV0A);
591 fOutput->Add(hdifEMC_EPV0C);
593 hdifful_EPV0A = new TH3F("hdifful_EPV0A", "dif phi in full with EPV0A", 100, 0., 100., 100, 0., TMath::Pi(), 15, 0., 15.);
594 hdifful_EPV0C = new TH3F("hdifful_EPV0C", "dif phi in full with EPV0C", 100, 0., 100., 100, 0., TMath::Pi(), 15, 0., 15.);
595 fOutput->Add(hdifful_EPV0A);
596 fOutput->Add(hdifful_EPV0C);
598 hdifout_EPV0A = new TH3F("hdifout_EPV0A", "dif phi NOT in EMC with EPV0A", 100, 0., 100., 100, 0., TMath::Pi(), 15, 0., 15.);
599 hdifout_EPV0C = new TH3F("hdifout_EPV0C", "dif phi NOT in EMC with EPV0C", 100, 0., 100., 100, 0., TMath::Pi(), 15, 0., 15.);
600 fOutput->Add(hdifout_EPV0A);
601 fOutput->Add(hdifout_EPV0C);
603 hCv2EMC_EPV0A = new TH3F("hCv2EMC_EPV0A", " raw v2 of charged trc in EMC with V0A", 100, 0, 100, 50, -1., 1., 15, 0., 15.);
604 hCv2EMC_EPV0C = new TH3F("hCv2EMC_EPV0C", " raw v2 of charged trc in EMC with V0C", 100, 0, 100, 50, -1., 1., 15, 0., 15.);
605 fOutput->Add(hCv2EMC_EPV0A);
606 fOutput->Add(hCv2EMC_EPV0C);
608 hCv2ful_EPV0A = new TH3F("hCv2ful_EPV0A", " raw v2 of charged trc in ful with V0A", 100, 0, 100, 50, -1., 1., 15, 0., 15.);
609 hCv2ful_EPV0C = new TH3F("hCv2ful_EPV0C", " raw v2 of charged trc in ful with V0C", 100, 0, 100, 50, -1., 1., 15, 0., 15.);
610 fOutput->Add(hCv2ful_EPV0A);
611 fOutput->Add(hCv2ful_EPV0C);
613 hCv2out_EPV0A = new TH3F("hCv2out_EPV0A", " raw v2 of charged trc out with V0A", 100, 0, 100, 50, -1., 1., 15, 0., 15.);
614 hCv2out_EPV0C = new TH3F("hCv2out_EPV0C", " raw v2 of charged trc out with V0A", 100, 0, 100, 50, -1., 1., 15, 0., 15.);
615 fOutput->Add(hCv2out_EPV0A);
616 fOutput->Add(hCv2out_EPV0C);
618 hclusDif_EPV0A = new TH3F("hclusDif_EPV0A", "dif phi of clus with EP V0A", 100, 0., 100., 100, 0., TMath::Pi(), 15, 0., 15.);
619 hclusDif_EPV0C = new TH3F("hclusDif_EPV0C", "dif phi of clus with EP V0C", 100, 0., 100., 100, 0., TMath::Pi(), 15, 0., 15.);
620 fOutput->Add(hclusDif_EPV0A);
621 fOutput->Add(hclusDif_EPV0C);
623 hclusv2_EPV0A = new TH3F("hclusv2_EPV0A", " raw v2 of clus in ful with V0A", 100, 0, 100, 50, -1., 1., 15, 0., 15.);
624 hclusv2_EPV0C = new TH3F("hclusv2_EPV0C", " raw v2 of clus in ful with V0C", 100, 0, 100, 50, -1., 1., 15, 0., 15.);
625 fOutput->Add(hclusv2_EPV0A);
626 fOutput->Add(hclusv2_EPV0C);
629 // Et M02 spdcent DeltaPhi
630 Int_t bins[4] = { 40, 350, 60, 100 }; // binning
631 Double_t min[4] = { 0.0, 0.0, 0, 0.0 }; // min x
632 Double_t max[4] = { 40.0, 3.5, 60, TMath::Pi()}; // max x
634 fClusterPbV0A = new THnSparseF("fClusterPbV0A","",5,bins,min,max);
635 fClusterPbV0A->GetAxis(0)->SetTitle("Transverse Energy [GeV]");
636 fClusterPbV0A->GetAxis(1)->SetTitle("M02");
637 fClusterPbV0A->GetAxis(2)->SetTitle("V0M Centrality");
638 fClusterPbV0A->GetAxis(3)->SetTitle("Delta(#phi) [rad]");
639 fOutput->Add(fClusterPbV0A);
641 fClusterPbV0C = new THnSparseF("fClusterPbV0C","",5,bins,min,max);
642 fClusterPbV0C->GetAxis(0)->SetTitle("Transverse Energy [GeV]");
643 fClusterPbV0C->GetAxis(1)->SetTitle("M02");
644 fClusterPbV0C->GetAxis(2)->SetTitle("V0M Centrality");
645 fClusterPbV0C->GetAxis(3)->SetTitle("Delta(#phi) [rad]");
646 fOutput->Add(fClusterPbV0C);
648 fClusterPbTPC = new THnSparseF("fClusterPbTPC","",5,bins,min,max);
649 fClusterPbTPC->GetAxis(0)->SetTitle("Transverse Energy [GeV]");
650 fClusterPbTPC->GetAxis(1)->SetTitle("M02");
651 fClusterPbTPC->GetAxis(2)->SetTitle("V0M Centrality");
652 fClusterPbTPC->GetAxis(3)->SetTitle("Delta(#phi) [rad]");
653 fOutput->Add(fClusterPbTPC);
657 h2DcosV0C = new TProfile("h2DcosV0C", "cos(Phi) V0r vs Run NUmber", 200, 0., 200.);
658 h2DsinV0C = new TProfile("h2DsinV0C", "sin(Phi) V0r vs Run NUmber", 200, 0., 200.);
659 h2DcosTPC = new TProfile("h2DcosTPC", "cos(Phi) V0r vs Run NUmber", 200, 0., 200.);
660 h2DsinTPC = new TProfile("h2DsinTPC", "sin(Phi) V0r vs Run NUmber", 200, 0., 200.);
661 fOutput->Add(h2DcosV0C);
662 fOutput->Add(h2DsinV0C);
663 fOutput->Add(h2DcosTPC);
664 fOutput->Add(h2DsinTPC);
667 h2DcosV0A = new TProfile("h2DcosV0A", "cos(Phi) V0r vs Run NUmber", 200, 0., 200.);
668 h2DsinV0A = new TProfile("h2DsinV0A", "sin(Phi) V0r vs Run NUmber", 200, 0., 200.);
669 fOutput->Add(h2DcosV0A);
670 fOutput->Add(h2DsinV0A);
673 hM02vsPtA = new TH2F("hM02vsPtA", "M02 vs Et before cut", 5000, 0, 50, 400, 0, 4.);
674 hM02vsPtB = new TH2F("hM02vsPtB", "M02 vs Et before cut", 5000, 0, 50, 400, 0, 4.);
675 fOutput->Add(hM02vsPtA);
676 fOutput->Add(hM02vsPtB);
679 hClusDxDZA = new TH2F("hClusDxDZA", "clus Dx vs Dz", 1000, -1., 1., 1000, -1., 1);
680 hClusDxDZB = new TH2F("hClusDxDZB", "clus Dx vs Dz", 1000, -1., 1., 1000, -1., 1);
681 fOutput->Add(hClusDxDZA);
682 fOutput->Add(hClusDxDZB);
686 const Int_t ndims = 4;
687 Int_t nMgg=500, nPt=40, nCent=20, nDeltaPhi=315, ncos2phi=200;
688 Int_t binsv1[ndims] = {nMgg, nPt, nCent, nDeltaPhi};
689 Double_t xmin[ndims] = { 0, 0., 0, 0. };
690 Double_t xmax[ndims] = { 0.5, 20., 100, 3.15 };
691 fHEPV0A = new THnSparseF("fHEPV0A", "Flow histogram EPV0A", ndims, binsv1, xmin, xmax);
692 fHEPV0C = new THnSparseF("fHEPV0C", "Flow histogram EPV0C", ndims, binsv1, xmin, xmax);
693 fHEPTPC = new THnSparseF("fHEPTPC", "Flow histogram EPTPC", ndims, binsv1, xmin, xmax);
694 fHEPV0A->GetAxis(0)->SetTitle("m_{#gamma#gamma} ");
695 fHEPV0A->GetAxis(1)->SetTitle("p_{T}[GeV]");
696 fHEPV0A->GetAxis(2)->SetTitle("centrality");
697 fHEPV0A->GetAxis(3)->SetTitle("#delta #phi");
698 fHEPV0C->GetAxis(0)->SetTitle("m_{#gamma#gamma} ");
699 fHEPV0C->GetAxis(1)->SetTitle("p_{T}[GeV]");
700 fHEPV0C->GetAxis(2)->SetTitle("centrality");
701 fHEPV0C->GetAxis(3)->SetTitle("#delta #phi");
702 fHEPTPC->GetAxis(0)->SetTitle("m_{#gamma#gamma} ");
703 fHEPTPC->GetAxis(1)->SetTitle("p_{T}[GeV]");
704 fHEPTPC->GetAxis(2)->SetTitle("centrality");
705 fHEPTPC->GetAxis(3)->SetTitle("#delta #phi");
706 fOutput->Add(fHEPV0A);
707 fOutput->Add(fHEPV0C);
708 fOutput->Add(fHEPTPC);
710 Int_t binsv2[ndims] = {nMgg, nPt, nCent, ncos2phi};
711 Double_t xmin2[ndims] = { 0, 0., 0, -1.};
712 Double_t xmax2[ndims] = { 0.5, 20., 100, 1.};
713 fHEPV0AM2 = new THnSparseF("fHEPV0AM2", "Flow histogram EPV0A M2", ndims, binsv2, xmin2, xmax2);
714 fHEPV0CM2 = new THnSparseF("fHEPV0CM2", "Flow histogram EPV0C M2", ndims, binsv2, xmin2, xmax2);
715 fHEPTPCM2 = new THnSparseF("fHEPTPCM2", "Flow histogram EPTPC M2", ndims, binsv2, xmin2, xmax2);
716 fHEPV0AM2->GetAxis(0)->SetTitle("m_{#gamma#gamma} ");
717 fHEPV0AM2->GetAxis(1)->SetTitle("p_{T}[GeV]");
718 fHEPV0AM2->GetAxis(2)->SetTitle("centrality");
719 fHEPV0AM2->GetAxis(3)->SetTitle("cos(2*#delta #phi)");
720 fHEPV0CM2->GetAxis(0)->SetTitle("m_{#gamma#gamma} ");
721 fHEPV0CM2->GetAxis(1)->SetTitle("p_{T}[GeV]");
722 fHEPV0CM2->GetAxis(2)->SetTitle("centrality");
723 fHEPV0CM2->GetAxis(3)->SetTitle("cos(2*#delta #phi)");
724 fHEPTPCM2->GetAxis(0)->SetTitle("m_{#gamma#gamma} ");
725 fHEPTPCM2->GetAxis(1)->SetTitle("p_{T}[GeV]");
726 fHEPTPCM2->GetAxis(2)->SetTitle("centrality");
727 fHEPTPCM2->GetAxis(3)->SetTitle("cos(2*#delta #phi)");
728 fOutput->Add(fHEPV0AM2);
729 fOutput->Add(fHEPV0CM2);
730 fOutput->Add(fHEPTPCM2);
733 PostData(1, fOutput); // Post data for ALL output slots >0 here, to get at least an empty histogram
736 //________________________________________________________________________
737 void AliAnalysisTaskPi0V2::UserExec(Option_t *)
740 // Called for each event
743 // Create pointer to reconstructed event
745 AliVEvent *event = InputEvent();
747 AliError("Could not retrieve event");
751 // create pointer to event
752 TString type = AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()->GetDataType();
754 fESD = dynamic_cast<AliESDEvent*>(event);
756 AliError("Cannot get the ESD event");
759 } else if (type=="AOD") {
760 fAOD = dynamic_cast<AliAODEvent*>(event);
762 AliError("Cannot get the AOD event");
766 AliError("Cannot happen");
771 if (!fTrigClass.IsNull()) {
774 fired = fESD->GetFiredTriggerClasses();
776 fired = fAOD->GetFiredTriggerClasses();
778 if (!fired.Contains("-B-"))
780 TObjArray *arr = fTrigClass.Tokenize("|");
784 for (Int_t i=0;i<arr->GetEntriesFast();++i) {
785 TObject *obj = arr->At(i);
788 if (fired.Contains(obj->GetName())) {
799 if (fRunNumber != event->GetRunNumber()) {
800 fRunNumber = event->GetRunNumber();
804 fInterRunNumber = ConvertToInternalRunNumber(fRunNumber);
806 const AliVVertex* fvertex;
807 fvertex = event->GetPrimaryVertex();
809 if (TMath::Abs(fvertex->GetZ())>fVtxCut)
811 Double_t vertex[3] = {fvertex->GetX(), fvertex->GetY(), fvertex->GetZ()};
815 fCentrality = event->GetCentrality()->GetCentralityPercentile("CL1"); //spd vertex
816 hCent->Fill(fCentrality);
818 Bool_t bIsNot = kFALSE;
819 if (fCentrality<=10){ //0-10%
820 TRandom3 *rndm = new TRandom3(0);
821 Double_t Nrndm = rndm->Uniform(0.,1.);
823 if(Nrndm > 0.77308) bIsNot = kTRUE;
824 } else if(1<fCentrality && fCentrality<=2) {
825 if(Nrndm > 0.75863) bIsNot = kTRUE;
826 } else if (2<fCentrality && fCentrality<=3){
827 if(Nrndm > 0.76365) bIsNot = kTRUE;
828 } else if (3<fCentrality && fCentrality<=4){
829 if(Nrndm > 0.76763) bIsNot = kTRUE;
830 } else if (4<fCentrality && fCentrality<=5){
831 if(Nrndm > 0.76251) bIsNot = kTRUE;
832 } else if (5<fCentrality && fCentrality<=6){
833 if(Nrndm > 0.79069) bIsNot = kTRUE;
834 } else if (6<fCentrality && fCentrality<=7){
835 if(Nrndm > 0.77669) bIsNot = kTRUE;
836 } else if (7<fCentrality && fCentrality<=8){
837 if(Nrndm > 0.78537) bIsNot = kTRUE;
838 } else if (8<fCentrality && fCentrality<=9){
839 if(Nrndm > 0.82727) bIsNot = kTRUE;
840 } else if (9<fCentrality && fCentrality<=10){
841 if(Nrndm > 1) bIsNot = kTRUE;
843 delete rndm; rndm = 0;
848 if (10<fCentrality && fCentrality<=50){ //10-50%
851 centfired = fESD->GetFiredTriggerClasses();
853 centfired = fAOD->GetFiredTriggerClasses();
855 if(!centfired.Contains("CVLN_B2-B-NOPF-ALLNOTRD") && !centfired.Contains("CVLN_R1-B-NOPF-ALLNOTRD") && !centfired.Contains("CSEMI_R1-B-NOPF-ALLNOTRD"))
860 AliEventplane *ep = event->GetEventplane();
862 if (ep->GetEventplane("Q") != -1)
863 fEPTPC = ep->GetEventplane("Q");
866 if (ep->GetEventplane("Q") != -1)
867 fEPTPCreso = TMath::Cos(2.*(ep->GetQsubRes()));
871 fEPV0 = ep->GetEventplane("V0", event);
872 fEPV0A = ep->GetEventplane("V0A", event);
873 fEPV0C = ep->GetEventplane("V0C", event);
875 Double_t qxr=0, qyr=0;
876 fEPV0Ar = ep->CalculateVZEROEventPlane(event, 4, 5, 2, qxr, qyr);
877 fEPV0Cr = ep->CalculateVZEROEventPlane(event, 2, 3, 2, qx, qy);
880 fEPV0r = TMath::ATan2(qyr,qxr)/2.;
881 fEPV0AR4 = ep->CalculateVZEROEventPlane(event, 4, 2, qx, qy);
882 fEPV0AR5 = ep->CalculateVZEROEventPlane(event, 5, 2, qx, qy);
883 fEPV0AR6 = ep->CalculateVZEROEventPlane(event, 6, 2, qx, qy);
884 fEPV0AR7 = ep->CalculateVZEROEventPlane(event, 7, 2, qx, qy);
885 fEPV0CR0 = ep->CalculateVZEROEventPlane(event, 0, 2, qx, qy);
886 fEPV0CR1 = ep->CalculateVZEROEventPlane(event, 1, 2, qx, qy);
887 fEPV0CR2 = ep->CalculateVZEROEventPlane(event, 2, 2, qx, qy);
888 fEPV0CR3 = ep->CalculateVZEROEventPlane(event, 3, 2, qx, qy);
891 FillEPQA(); //Fill the EP QA
895 while(fEPV0<0.) fEPV0+=TMath::Pi(); while(fEPV0>TMath::Pi()) fEPV0-=TMath::Pi();
896 while(fEPV0r<0.) fEPV0r+=TMath::Pi(); while(fEPV0r>TMath::Pi()) fEPV0r-=TMath::Pi();
897 while(fEPV0A<0.) fEPV0A+=TMath::Pi(); while(fEPV0A>TMath::Pi()) fEPV0A-=TMath::Pi();
898 while(fEPV0C<0.) fEPV0C+=TMath::Pi(); while(fEPV0C>TMath::Pi()) fEPV0C-=TMath::Pi();
899 while(fEPV0Ar<0.) fEPV0Ar+=TMath::Pi(); while(fEPV0Ar>TMath::Pi()) fEPV0Ar-=TMath::Pi();
900 while(fEPV0Cr<0.) fEPV0Cr+=TMath::Pi(); while(fEPV0Cr>TMath::Pi()) fEPV0Cr-=TMath::Pi();
902 while(fEPV0AR4<0.) fEPV0AR4+=TMath::Pi(); while(fEPV0AR4>TMath::Pi()) fEPV0AR4-=TMath::Pi();
903 while(fEPV0AR7<0.) fEPV0AR7+=TMath::Pi(); while(fEPV0AR7>TMath::Pi()) fEPV0AR7-=TMath::Pi();
904 while(fEPV0CR0<0.) fEPV0CR0+=TMath::Pi(); while(fEPV0CR0>TMath::Pi()) fEPV0CR0-=TMath::Pi();
905 while(fEPV0CR3<0.) fEPV0CR3+=TMath::Pi(); while(fEPV0CR3>TMath::Pi()) fEPV0CR3-=TMath::Pi();
907 while(fEPTPC<0.) fEPTPC+=TMath::Pi(); while(fEPTPC>TMath::Pi()) fEPTPC-=TMath::Pi();
908 if (fEPTPC != -999. )
909 hEPTPC->Fill(fCentrality, fEPTPC);
911 hresoTPC->Fill(fCentrality, fEPTPCreso);
913 hEPV0->Fill(fCentrality, fEPV0);
914 hEPV0Ar->Fill(fCentrality, fEPV0Ar);
915 hEPV0Cr->Fill(fCentrality, fEPV0Cr);
916 hEPV0r->Fill(fCentrality, fEPV0r);
917 hEPV0AR4->Fill(fCentrality, fEPV0AR4);
918 hEPV0AR7->Fill(fCentrality, fEPV0AR7);
919 hEPV0CR0->Fill(fCentrality, fEPV0CR0);
920 hEPV0CR3->Fill(fCentrality, fEPV0CR3);
922 hEPV0A->Fill(fCentrality, fEPV0A);
923 hEPV0C->Fill(fCentrality, fEPV0C);
927 fEPV0A = ApplyFlatteningV0A(fEPV0A, fCentrality); //V0A after Phos flatten
928 fEPV0C = ApplyFlatteningV0C(fEPV0C, fCentrality); //V0C after Phos flatten
930 fEPTPC = ApplyFlattening(fEPTPC, fCentrality); //TPC after Phos flatten
931 while(fEPV0A <0.) fEPV0A+=TMath::Pi(); while(fEPV0A >TMath::Pi()) fEPV0A-=TMath::Pi();
932 while(fEPV0C <0.) fEPV0C+=TMath::Pi(); while(fEPV0C >TMath::Pi()) fEPV0C-=TMath::Pi();
933 while(fEPTPC <0.) fEPTPC+=TMath::Pi(); while(fEPTPC >TMath::Pi()) fEPTPC-=TMath::Pi();
937 Double_t EPV0ACor = ApplyFlattening(fEPTPC, fCentrality);
938 Double_t EPV0CCor = ApplyFlattening(fEPTPC, fCentrality);
939 Double_t EPTPCCor = ApplyFlattening(fEPTPC, fCentrality);
940 while(EPV0ACor <0.) EPV0ACor+=TMath::Pi(); while(EPV0ACor >TMath::Pi()) EPV0ACor-=TMath::Pi();
941 while(EPV0CCor <0.) EPV0CCor+=TMath::Pi(); while(EPV0CCor >TMath::Pi()) EPV0CCor-=TMath::Pi();
942 while(EPTPCCor <0.) EPTPCCor+=TMath::Pi(); while(EPTPCCor >TMath::Pi()) EPTPCCor-=TMath::Pi();
945 hEPTPCCor->Fill(fCentrality, EPTPCCor);
946 hEPV0ACor->Fill(fCentrality, EPV0ACor);
947 hEPV0CCor->Fill(fCentrality, EPV0CCor);
950 hEPTPCCor->Fill(fCentrality, fEPTPC);
951 hEPV0ACor->Fill(fCentrality, fEPV0A);
952 hEPV0CCor->Fill(fCentrality, fEPV0C);
955 hdifV0A_V0CR0->Fill(fCentrality, TMath::Cos(2.*(fEPV0A - fEPV0CR0)));
956 hdifV0A_V0CR3->Fill(fCentrality, TMath::Cos(2.*(fEPV0A - fEPV0CR3)));
957 hdifV0ACR0_V0CR3->Fill(fCentrality, TMath::Cos(2*(fEPV0CR0 - fEPV0CR3)));
958 hdifV0C_V0AR4->Fill(fCentrality, TMath::Cos(2*(fEPV0C - fEPV0AR4)));
959 hdifV0C_V0AR7->Fill(fCentrality, TMath::Cos(2*(fEPV0C - fEPV0AR7)));
960 hdifV0AR4_V0AR7->Fill(fCentrality, TMath::Cos(2*(fEPV0AR4 - fEPV0AR7)));
963 hdifV0Ar_V0Cr->Fill(fCentrality, TMath::Cos(2.*(fEPV0Ar - fEPV0Cr)));
964 hdifV0A_V0C->Fill(fCentrality, TMath::Cos(2*(fEPV0A - fEPV0C)));
966 hdifV0A_TPC->Fill(fCentrality, TMath::Cos(2*(fEPV0A - fEPTPC)));
967 hdifV0C_TPC->Fill(fCentrality, TMath::Cos(2*(fEPV0C - fEPTPC)));
969 hdifV0C_V0A->Fill(fCentrality, TMath::Cos(2*(fEPV0C - fEPV0A)));
971 // Cluster loop for reconstructed event
973 //================ for v2 clusterize analysis==============================================
975 if (!fV2ClusName.IsNull() && !fV2Clus) {
976 fV2Clus = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fV2ClusName));
978 AliError(Form("%s: Could not retrieve v2 cluster name %s!", GetName(), fV2ClusName.Data()));
982 Int_t nCluster = fV2Clus->GetEntries();
983 for (Int_t i=0; i<nCluster; ++i) {
984 AliVCluster *c1 = static_cast<AliVCluster*>(fV2Clus->At(i));
987 if(isFullHist) hClusDxDZA->Fill(c1->GetTrackDz(), c1->GetTrackDx());
990 if (!IsGoodCluster(c1))
992 if(isFullHist) hClusDxDZB->Fill(c1->GetTrackDz(), c1->GetTrackDx());
994 GetMom(p1, c1, vertex);
995 Double_t cluPhi = p1.Phi();
996 Double_t cluPt = p1.Pt();
997 Double_t difclusV0A = cluPhi-fEPV0A;
998 if(difclusV0A<0.) difclusV0A+=TMath::Pi(); if(difclusV0A>TMath::Pi()) difclusV0A-=TMath::Pi();
999 Double_t difclusV0C = cluPhi-fEPV0C;
1000 if(difclusV0C<0.) difclusV0C+=TMath::Pi(); if(difclusV0C>TMath::Pi()) difclusV0C-=TMath::Pi();
1001 hclusDif_EPV0A->Fill(fCentrality, difclusV0A, cluPt);
1002 hclusDif_EPV0C->Fill(fCentrality, difclusV0C, cluPt);
1003 hclusv2_EPV0A->Fill(fCentrality, TMath::Cos(2.*difclusV0A), cluPt);
1004 hclusv2_EPV0C->Fill(fCentrality, TMath::Cos(2.*difclusV0C), cluPt);
1005 for (Int_t j=i+1; j<nCluster; ++j) {
1006 AliVCluster *c2 = static_cast<AliVCluster*>(fV2Clus->At(j));
1011 if (!IsGoodCluster(c2))
1014 GetMom(p2, c2, vertex);
1015 FillPion(p1, p2, fEPV0A, fEPV0C, fEPTPC);
1020 //================ for v1 clusterize analysis==============================================
1022 if (!fV2ClusName.IsNull() && !fV1Clus) {
1023 fV1Clus = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fV1ClusName));
1025 AliError(Form("%s: Could not retrieve v1 cluster name %s!", GetName(), fV1ClusName.Data()));
1029 Int_t nClusterV1 = fV1Clus->GetEntries();
1030 for (Int_t i=0; i<nClusterV1; ++i) {
1031 AliVCluster *c3 = dynamic_cast<AliVCluster*>(fV1Clus->At(i));
1036 Double_t M02c3 = c3->GetM02();
1037 Double_t Dxc3 = c3->GetTrackDx();
1038 Double_t Dzc3 = c3->GetTrackDz();
1040 if(isFullHist) hClusDxDZA->Fill(Dzc3, Dxc3);
1041 Float_t clsPosEt[3] = {0,0,0};
1042 c3->GetPosition(clsPosEt);
1043 TVector3 clsVec(clsPosEt);
1044 Double_t Et = c3->E()*TMath::Sin(clsVec.Theta());
1045 hM02vsPtA->Fill(Et, M02c3);
1046 if (!IsGoodClusterV1(c3))
1048 hM02vsPtB->Fill(Et, M02c3);
1049 if(isFullHist) hClusDxDZB->Fill(Dzc3, Dxc3);
1051 GetMom(p3, c3, vertex);
1052 FillCluster(p3, fEPV0A, fEPV0C, fEPTPC, c3);
1058 if (!fTracksName.IsNull() && !fTracks) {
1059 fTracks = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fTracksName));
1061 AliError(Form("%s: Could not retrieve tracks %s!", GetName(), fTracksName.Data()));
1066 Int_t ntracks = fTracks->GetEntries();
1067 for (Int_t i=0; i<ntracks; ++i){
1068 AliVTrack *track = static_cast<AliVTrack*>(fTracks->At(i));
1071 Double_t tPhi = track->Phi();
1072 Double_t tPt = track->Pt();
1073 Double_t Eta = track->Eta();
1075 Double_t difTrackV0 = tPhi-fEPV0;
1076 while(difTrackV0 <0.) difTrackV0+=TMath::Pi(); while(difTrackV0 >TMath::Pi()) difTrackV0-=TMath::Pi();
1077 Double_t difTrackV0A = tPhi-fEPV0A;
1078 while(difTrackV0A <0.) difTrackV0A+=TMath::Pi(); while(difTrackV0A >TMath::Pi()) difTrackV0A-=TMath::Pi();
1079 Double_t difTrackV0C = tPhi-fEPV0C;
1080 while(difTrackV0C <0.) difTrackV0C+=TMath::Pi(); while(difTrackV0C >TMath::Pi()) difTrackV0C-=TMath::Pi();
1081 Double_t difTrackTPC = tPhi-fEPTPC;
1082 while(difTrackTPC <0.) difTrackTPC+=TMath::Pi(); while(difTrackTPC >TMath::Pi()) difTrackTPC-=TMath::Pi();
1083 if (tPhi*TMath::RadToDeg()>80. && tPhi*TMath::RadToDeg()<180. && Eta <0.7 && Eta >(-0.7)){
1084 hdifEMC_EPV0A->Fill(fCentrality, difTrackV0A, tPt);
1085 hdifEMC_EPV0C->Fill(fCentrality, difTrackV0C, tPt);
1086 hCv2EMC_EPV0A->Fill(fCentrality, TMath::Cos(2.*difTrackV0A), tPt);
1087 hCv2EMC_EPV0C->Fill(fCentrality, TMath::Cos(2.*difTrackV0C), tPt);
1089 hdifout_EPV0A->Fill(fCentrality, difTrackV0A, tPt);
1090 hdifout_EPV0C->Fill(fCentrality, difTrackV0C, tPt);
1091 hCv2out_EPV0A->Fill(fCentrality, TMath::Cos(2.*difTrackV0A), tPt);
1092 hCv2out_EPV0C->Fill(fCentrality, TMath::Cos(2.*difTrackV0C), tPt);
1094 hdifful_EPV0A->Fill(fCentrality, difTrackV0A, tPt);
1095 hdifful_EPV0C->Fill(fCentrality, difTrackV0C, tPt);
1096 hCv2ful_EPV0A->Fill(fCentrality, TMath::Cos(2.*difTrackV0A), tPt);
1097 hCv2ful_EPV0C->Fill(fCentrality, TMath::Cos(2.*difTrackV0C), tPt);
1101 // NEW HISTO should be filled before this point, as PostData puts the
1102 // information for this iteration of the UserExec in the container
1103 PostData(1, fOutput);
1106 //____________________________________________________________________
1107 Int_t AliAnalysisTaskPi0V2::ConvertToInternalRunNumber(Int_t n)
1110 case 170593 : return 179;
1111 case 170572 : return 178;
1112 case 170556 : return 177;
1113 case 170552 : return 176;
1114 case 170546 : return 175;
1115 case 170390 : return 174;
1116 case 170389 : return 173;
1117 case 170388 : return 172;
1118 case 170387 : return 171;
1119 case 170315 : return 170;
1120 case 170313 : return 169;
1121 case 170312 : return 168;
1122 case 170311 : return 167;
1123 case 170309 : return 166;
1124 case 170308 : return 165;
1125 case 170306 : return 164;
1126 case 170270 : return 163;
1127 case 170269 : return 162;
1128 case 170268 : return 161;
1129 case 170267 : return 160;
1130 case 170264 : return 159;
1131 case 170230 : return 158;
1132 case 170228 : return 157;
1133 case 170208 : return 156;
1134 case 170207 : return 155;
1135 case 170205 : return 154;
1136 case 170204 : return 153;
1137 case 170203 : return 152;
1138 case 170195 : return 151;
1139 case 170193 : return 150;
1140 case 170163 : return 149;
1141 case 170162 : return 148;
1142 case 170159 : return 147;
1143 case 170155 : return 146;
1144 case 170152 : return 145;
1145 case 170091 : return 144;
1146 case 170089 : return 143;
1147 case 170088 : return 142;
1148 case 170085 : return 141;
1149 case 170084 : return 140;
1150 case 170083 : return 139;
1151 case 170081 : return 138;
1152 case 170040 : return 137;
1153 case 170038 : return 136;
1154 case 170036 : return 135;
1155 case 170027 : return 134;
1156 case 169981 : return 133;
1157 case 169975 : return 132;
1158 case 169969 : return 131;
1159 case 169965 : return 130;
1160 case 169961 : return 129;
1161 case 169956 : return 128;
1162 case 169926 : return 127;
1163 case 169924 : return 126;
1164 case 169923 : return 125;
1165 case 169922 : return 124;
1166 case 169919 : return 123;
1167 case 169918 : return 122;
1168 case 169914 : return 121;
1169 case 169859 : return 120;
1170 case 169858 : return 119;
1171 case 169855 : return 118;
1172 case 169846 : return 117;
1173 case 169838 : return 116;
1174 case 169837 : return 115;
1175 case 169835 : return 114;
1176 case 169683 : return 113;
1177 case 169628 : return 112;
1178 case 169591 : return 111;
1179 case 169590 : return 110;
1180 case 169588 : return 109;
1181 case 169587 : return 108;
1182 case 169586 : return 107;
1183 case 169584 : return 106;
1184 case 169557 : return 105;
1185 case 169555 : return 104;
1186 case 169554 : return 103;
1187 case 169553 : return 102;
1188 case 169550 : return 101;
1189 case 169515 : return 100;
1190 case 169512 : return 99;
1191 case 169506 : return 98;
1192 case 169504 : return 97;
1193 case 169498 : return 96;
1194 case 169475 : return 95;
1195 case 169420 : return 94;
1196 case 169419 : return 93;
1197 case 169418 : return 92;
1198 case 169417 : return 91;
1199 case 169415 : return 90;
1200 case 169411 : return 89;
1201 case 169238 : return 88;
1202 case 169236 : return 87;
1203 case 169167 : return 86;
1204 case 169160 : return 85;
1205 case 169156 : return 84;
1206 case 169148 : return 83;
1207 case 169145 : return 82;
1208 case 169144 : return 81;
1209 case 169143 : return 80;
1210 case 169138 : return 79;
1211 case 169099 : return 78;
1212 case 169094 : return 77;
1213 case 169091 : return 76;
1214 case 169045 : return 75;
1215 case 169044 : return 74;
1216 case 169040 : return 73;
1217 case 169035 : return 72;
1218 case 168992 : return 71;
1219 case 168988 : return 70;
1220 case 168984 : return 69;
1221 case 168826 : return 68;
1222 case 168777 : return 67;
1223 case 168514 : return 66;
1224 case 168512 : return 65;
1225 case 168511 : return 64;
1226 case 168467 : return 63;
1227 case 168464 : return 62;
1228 case 168461 : return 61;
1229 case 168460 : return 60;
1230 case 168458 : return 59;
1231 case 168362 : return 58;
1232 case 168361 : return 57;
1233 case 168356 : return 56;
1234 case 168342 : return 55;
1235 case 168341 : return 54;
1236 case 168325 : return 53;
1237 case 168322 : return 52;
1238 case 168318 : return 51;
1239 case 168311 : return 50;
1240 case 168310 : return 49;
1241 case 168213 : return 48;
1242 case 168212 : return 47;
1243 case 168208 : return 46;
1244 case 168207 : return 45;
1245 case 168206 : return 44;
1246 case 168205 : return 43;
1247 case 168204 : return 42;
1248 case 168203 : return 41;
1249 case 168181 : return 40;
1250 case 168177 : return 39;
1251 case 168175 : return 38;
1252 case 168173 : return 37;
1253 case 168172 : return 36;
1254 case 168171 : return 35;
1255 case 168115 : return 34;
1256 case 168108 : return 33;
1257 case 168107 : return 32;
1258 case 168105 : return 31;
1259 case 168104 : return 30;
1260 case 168103 : return 29;
1261 case 168076 : return 28;
1262 case 168069 : return 27;
1263 case 168068 : return 26;
1264 case 168066 : return 25;
1265 case 167988 : return 24;
1266 case 167987 : return 23;
1267 case 167986 : return 22;
1268 case 167985 : return 21;
1269 case 167921 : return 20;
1270 case 167920 : return 19;
1271 case 167915 : return 18;
1272 case 167909 : return 17;
1273 case 167903 : return 16;
1274 case 167902 : return 15;
1275 case 167818 : return 14;
1276 case 167814 : return 13;
1277 case 167813 : return 12;
1278 case 167808 : return 11;
1279 case 167807 : return 10;
1280 case 167806 : return 9;
1281 case 167713 : return 8;
1282 case 167712 : return 7;
1283 case 167711 : return 6;
1284 case 167706 : return 5;
1285 case 167693 : return 4;
1286 case 166532 : return 3;
1287 case 166530 : return 2;
1288 case 166529 : return 1;
1290 default : return 199;
1294 //_______________________________________________________________________
1295 void AliAnalysisTaskPi0V2::FillEPQA()
1297 h2DcosV0A->Fill(fInterRunNumber, TMath::Cos(fEPV0A));
1298 h2DsinV0A->Fill(fInterRunNumber, TMath::Sin(fEPV0A));
1300 h2DcosV0C->Fill(fInterRunNumber, TMath::Cos(fEPV0C));
1301 h2DsinV0C->Fill(fInterRunNumber, TMath::Sin(fEPV0C));
1303 h2DcosTPC->Fill(fInterRunNumber, TMath::Cos(fEPTPC));
1304 h2DsinTPC->Fill(fInterRunNumber, TMath::Sin(fEPTPC));
1309 //_________________________________________________________________________________
1310 void AliAnalysisTaskPi0V2::SetFlatteningData()
1312 //Read objects with flattening parameters
1313 AliOADBContainer flatContainer("phosFlat");
1314 flatContainer.InitFromFile(fEPcalibFileName.Data(),"phosFlat");
1315 TObjArray *maps = (TObjArray*)flatContainer.GetObject(fRunNumber,"phosFlat");
1317 AliError(Form("Can not read Flattening for run %d. \n From file >%s<\n",fRunNumber,fEPcalibFileName.Data())) ;
1319 AliInfo(Form("Setting PHOS flattening with name %s \n",maps->GetName())) ;
1320 AliEPFlattener * h = (AliEPFlattener*)maps->At(0) ;
1321 if(fTPCFlat) delete fTPCFlat ;
1322 fTPCFlat = new AliEPFlattener();
1324 h = (AliEPFlattener*)maps->At(1);
1325 if(fV0AFlat) delete fV0AFlat ;
1326 fV0AFlat = new AliEPFlattener();
1328 h = (AliEPFlattener*)maps->At(2);
1329 if(fV0CFlat) delete fV0CFlat ;
1330 fV0CFlat = new AliEPFlattener();
1335 //____________________________________________________________________________
1336 Double_t AliAnalysisTaskPi0V2::ApplyFlattening(Double_t phi, Double_t c)
1339 return fTPCFlat->MakeFlat(phi,c);
1343 //____________________________________________________________________________
1344 Double_t AliAnalysisTaskPi0V2::ApplyFlatteningV0A(Double_t phi, Double_t c)
1347 return fV0AFlat->MakeFlat(phi,c);
1351 //____________________________________________________________________________
1352 Double_t AliAnalysisTaskPi0V2::ApplyFlatteningV0C(Double_t phi, Double_t c){
1355 return fV0CFlat->MakeFlat(phi,c);
1359 //________________________________________________________________________
1360 void AliAnalysisTaskPi0V2::Terminate(Option_t *)