]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGGA/EMCALTasks/AliAnalysisTaskPi0V2.cxx
add a check properly the bad/exotic cluster in the corresponding array, add few histo...
[u/mrichter/AliRoot.git] / PWGGA / EMCALTasks / AliAnalysisTaskPi0V2.cxx
CommitLineData
3c40321c 1/* $Id: AliAnalysisTaskPi0V2.cxx 55404 2012-03-29 10:10:19Z fca $ */
2
3c40321c 3#include "AliAnalysisTaskPi0V2.h"
4
cd0e5e33 5#include <Riostream.h>
6#include <TCanvas.h>
7#include <TChain.h>
8#include <TClonesArray.h>
9#include <TH1F.h>
10#include <TH2F.h>
11#include <TH3F.h>
12#include <THnSparse.h>
13#include <TList.h>
14#include <TProfile.h>
15#include <TString.h>
16#include <TTree.h>
3c40321c 17
04b116e8 18#include "AliAODEvent.h"
cd0e5e33 19#include "AliAnalysisManager.h"
20#include "AliAnalysisTaskSE.h"
9ff4e38b 21#include "AliCaloPID.h"
9ff4e38b 22#include "AliCaloTrackReader.h"
cd0e5e33 23#include "AliCalorimeterUtils.h"
24#include "AliEMCALGeometry.h"
2fbb6418 25#include "AliEPFlattener.h"
cd0e5e33 26#include "AliESDEvent.h"
27#include "AliESDInputHandler.h"
28#include "AliESDtrackCuts.h"
29#include "AliEventplane.h"
30#include "AliMCEvent.h"
79ad78fd 31#include "AliOADBContainer.h"
cd0e5e33 32#include "AliStack.h"
33#include "AliVCluster.h"
3c40321c 34
9d6804f4 35using std::cout;
36using std::endl;
37
3c40321c 38ClassImp(AliAnalysisTaskPi0V2)
39
40//________________________________________________________________________
cd0e5e33 41AliAnalysisTaskPi0V2::AliAnalysisTaskPi0V2(const char *name) :
42 AliAnalysisTaskSE(name),
43 fOutput(0),
44 fESD(0),fAOD(0),
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),
49 fVtxCut(15.),
900db6d2 50 fNcellCut(2.), fECut(1.), fEtaCut(0.65), fM02Cut(0.5),fDrCut(0.025), fPi0AsyCut(0), isV1Clus(1), isPhosCali(0), isCentFlat(0),
cd0e5e33 51 fCentrality(99.),
52 fEPTPC(-999.),
53 fEPTPCreso(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.),
900db6d2 56 hEvtCount(0), hCent(0),
cd0e5e33 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),
91d49d74 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),
cd0e5e33 69 fEPcalibFileName("$ALICE_ROOT/OADB/PHOS/PHOSflat.root"), fTPCFlat(0x0), fV0AFlat(0x0), fV0CFlat(0x0),
70 fClusterPbV0(0), fClusterPbV0A(0), fClusterPbV0C(0), fClusterPbTPC(0),
d118f9e0 71 fHEPV0A(0x0), fHEPV0C(0x0), fHEPTPC(0x0),
72 fHEPV0AM2(0x0), fHEPV0CM2(0x0), fHEPTPCM2(0x0)
3c40321c 73{
cd0e5e33 74 // Dummy constructor ALWAYS needed for I/O.
75 DefineInput(0, TChain::Class());
76 DefineOutput(1, TList::Class()); // for output list
3c40321c 77}
78
79//________________________________________________________________________
cd0e5e33 80AliAnalysisTaskPi0V2::AliAnalysisTaskPi0V2() :
81 AliAnalysisTaskSE("default_name"),
82 fOutput(0),
83 fESD(0),fAOD(0),
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),
88 fVtxCut(15.),
900db6d2 89 fNcellCut(2.), fECut(1.), fEtaCut(0.65), fM02Cut(0.5), fDrCut(0.025), fPi0AsyCut(0), isV1Clus(1),isPhosCali(0),isCentFlat(0),
cd0e5e33 90 fCentrality(99.),
91 fEPTPC(-999.),
92 fEPTPCreso(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.),
900db6d2 95 hEvtCount(0), hCent(0),
cd0e5e33 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),
91d49d74 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),
cd0e5e33 108 fEPcalibFileName("$ALICE_ROOT/OADB/PHOS/PHOSflat.root"), fTPCFlat(0x0), fV0AFlat(0x0), fV0CFlat(0x0),
109 fClusterPbV0(0), fClusterPbV0A(0), fClusterPbV0C(0), fClusterPbTPC(0),
d118f9e0 110 fHEPV0A(0x0), fHEPV0C(0x0), fHEPTPC(0x0),
111 fHEPV0AM2(0x0), fHEPV0CM2(0x0), fHEPTPCM2(0x0)
3c40321c 112{
cd0e5e33 113 // Constructor
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
3c40321c 119}
120
121//________________________________________________________________________
122AliAnalysisTaskPi0V2::~AliAnalysisTaskPi0V2()
123{
cd0e5e33 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.
126 if (fTPCFlat)
127 delete fTPCFlat;
128 fTPCFlat=0x0;
129 if (fV0AFlat)
130 delete fV0AFlat;
131 fV0AFlat=0x0;
132 if (fV0CFlat)
133 delete fV0CFlat;
134 fV0CFlat=0x0;
135 delete fOutput;
3c40321c 136}
cd0e5e33 137
3c40321c 138//_____________________________________________________________________
139Double_t AliAnalysisTaskPi0V2::GetMaxCellEnergy(const AliVCluster *cluster, Short_t &id) const
140{
141 // Get maximum energy of attached cell.
142
143 id = -1;
144
145 AliVCaloCells *cells = 0;
cd0e5e33 146 if (fESD) {
3c40321c 147 cells = fESD->GetEMCALCells();
cd0e5e33 148 } else {
79ad78fd 149 cells = fAOD->GetEMCALCells();
150 }
3c40321c 151 if (!cells)
152 return 0;
153
154 Double_t maxe = 0;
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)));
158 if (e>maxe) {
159 maxe = e;
160 id = cluster->GetCellAbsId(i);
161 }
162 }
163 return maxe;
164}
cd0e5e33 165
3c40321c 166//_____________________________________________________________________
167Double_t AliAnalysisTaskPi0V2::GetCrossEnergy(const AliVCluster *cluster, Short_t &idmax) const
168{
169 // Calculate the energy of cross cells around the leading cell.
170
79ad78fd 171 AliVCaloCells *cells;
cd0e5e33 172 if (fESD) {
3c40321c 173 cells = fESD->GetEMCALCells();
cd0e5e33 174 } else {
79ad78fd 175 cells = fAOD->GetEMCALCells();
176 }
3c40321c 177 if (!cells)
178 return 0;
179
180 AliEMCALGeometry *geom = AliEMCALGeometry::GetInstance();
181 if (!geom)
182 return 0;
183
184 Int_t iSupMod = -1;
185 Int_t iTower = -1;
186 Int_t iIphi = -1;
187 Int_t iIeta = -1;
188 Int_t iphi = -1;
189 Int_t ieta = -1;
190 Int_t iphis = -1;
191 Int_t ietas = -1;
192
965c985f 193 Double_t crossEnergy = 0.;
3c40321c 194
195 geom->GetCellIndex(idmax,iSupMod,iTower,iIphi,iIeta);
196 geom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,iIphi, iIeta,iphis,ietas);
197
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);
204 if (aphidiff>1)
205 continue;
206 Int_t aetadiff = TMath::Abs(ieta-ietas);
207 if (aetadiff>1)
208 continue;
209 if ( (aphidiff==1 && aetadiff==0) ||
210 (aphidiff==0 && aetadiff==1) ) {
211 crossEnergy += cells->GetCellAmplitude(cellAbsId);
212 }
213 }
214
215 return crossEnergy;
216}
cd0e5e33 217
3c40321c 218//_____________________________________________________________________
219Bool_t AliAnalysisTaskPi0V2::IsWithinFiducialVolume(Short_t id) const
220{
221 // Check if cell is within given fiducial volume.
222
223 Double_t fNFiducial = 1;
224
225 Int_t iSupMod = -1;
226 Int_t iTower = -1;
227 Int_t iIphi = -1;
228 Int_t iIeta = -1;
229 Int_t iphi = -1;
230 Int_t ieta = -1;
231
232 Bool_t okrow = kFALSE;
233 Bool_t okcol = kFALSE;
234
04b116e8 235 AliEMCALGeometry *geom = AliEMCALGeometry::GetInstance();
3c40321c 236 if (!geom)
237 return kFALSE;
238
239 Int_t cellAbsId = id;
240 geom->GetCellIndex(cellAbsId,iSupMod,iTower,iIphi,iIeta);
241 geom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,iIphi, iIeta,iphi,ieta);
242
243 // Check rows/phi
244 if (iSupMod < 10) {
245 if (iphi >= fNFiducial && iphi < 24-fNFiducial)
246 okrow = kTRUE;
247 } else {
248 if (iphi >= fNFiducial && iphi < 12-fNFiducial)
249 okrow = kTRUE;
250 }
251 // Check columns/eta
252 Bool_t noEMCALBorderAtEta0 = kTRUE;
253 if (!noEMCALBorderAtEta0) {
254 if (ieta > fNFiducial && ieta < 48-fNFiducial)
255 okcol = kTRUE;
256 } else {
257 if (iSupMod%2==0) {
258 if (ieta >= fNFiducial)
259 okcol = kTRUE;
260 } else {
261 if (ieta < 48-fNFiducial)
262 okcol = kTRUE;
263 }
264 }
265 if (okrow && okcol)
266 return kTRUE;
267
268 return kFALSE;
269}
cd0e5e33 270
3c40321c 271//______________________________________________________________________
ceba2d0c 272Bool_t AliAnalysisTaskPi0V2::IsGoodCluster(const AliVCluster *c) const
3c40321c 273{
cd0e5e33 274 if (!c)
3c40321c 275 return kFALSE;
276
670ffa5c 277 if(c->GetNCells() < fNcellCut)
3c40321c 278 return kFALSE;
279
670ffa5c 280 if(c->E() < fECut)
3c40321c 281 return kFALSE;
3c40321c 282 Short_t id = -1;
283 Double_t maxE = GetMaxCellEnergy(c, id);
965c985f 284 if((1. - double(GetCrossEnergy(c,id))/maxE) > 0.97)
3c40321c 285 return kFALSE;
286
965c985f 287
3c40321c 288 Float_t pos1[3];
289 c->GetPosition(pos1);
290 TVector3 clsPos(pos1);
291 Double_t eta = clsPos.Eta();
292
cd0e5e33 293 if (TMath::Abs(eta) > fEtaCut)
3c40321c 294 return kFALSE;
295
296 if (!IsWithinFiducialVolume(id))
297 return kFALSE;
298
670ffa5c 299 if(c->GetM02() >fM02Cut)
3c40321c 300 return kFALSE;
301
04b116e8 302
3c40321c 303 return kTRUE;
70d53162 304
cc57d293 305}
306//________________________________________________________________________________________________
ceba2d0c 307Bool_t AliAnalysisTaskPi0V2::IsGoodClusterV1(const AliVCluster *c) const
cc57d293 308{
cd0e5e33 309 if (!c)
cc57d293 310 return kFALSE;
311
cd0e5e33 312 if (c->GetNCells() < fNcellCut)
cc57d293 313 return kFALSE;
314
cd0e5e33 315 if (c->E() < fECut)
cc57d293 316 return kFALSE;
317
318 Short_t id = -1;
319 Double_t maxE = GetMaxCellEnergy(c, id);
9ff4e38b 320 if((1. - double(GetCrossEnergy(c,id))/maxE) > 0.97)
cc57d293 321 return kFALSE;
322
323
324 Float_t pos1[3];
325 c->GetPosition(pos1);
326 TVector3 clsPos(pos1);
327 Double_t eta = clsPos.Eta();
328
cd0e5e33 329 if (TMath::Abs(eta) > fEtaCut)
cc57d293 330 return kFALSE;
331
332 if (!IsWithinFiducialVolume(id))
333 return kFALSE;
334
cd0e5e33 335 if (c->GetM02() <fM02Cut)
cc57d293 336 return kFALSE;
337
338 Double_t dr = TMath::Sqrt(c->GetTrackDx()*c->GetTrackDx() + c->GetTrackDz()*c->GetTrackDz());
c45a0734 339 if(dr<fDrCut)
cc57d293 340 return kFALSE;
341
342 return kTRUE;
04b116e8 343}
cd0e5e33 344
3c40321c 345//_____________________________________________________________________
346Bool_t AliAnalysisTaskPi0V2::IsGoodPion(const TLorentzVector &p1, const TLorentzVector &p2) const
347{
348 // Is good pion?
349
670ffa5c 350 if(fPi0AsyCut){
351 Double_t asym = TMath::Abs(p1.E()-p2.E())/(p1.E()+p2.E());
352 if (asym>0.7)
353 return kFALSE;
354 }
3c40321c 355 TLorentzVector pion;
356 pion = p1 + p2;
357 Double_t eta = pion.Eta();
670ffa5c 358 if(TMath::Abs(eta) > fEtaCut)
3c40321c 359 return kFALSE;
360
361 return kTRUE;
362}
cd0e5e33 363
3c40321c 364//_______________________________________________________________________
79ad78fd 365void AliAnalysisTaskPi0V2::FillPion(const TLorentzVector& p1, const TLorentzVector& p2, Double_t EPV0A, Double_t EPV0C, Double_t EPTPC)
3c40321c 366{
367 // Fill histogram.
368
369 if (!IsGoodPion(p1,p2))
370 return;
371 TLorentzVector pion;
372 pion = p1 + p2;
373
374 Double_t mass = pion.M();
375 Double_t pt = pion.Pt();
376 Double_t phi = pion.Phi();
377
3c40321c 378 Double_t dphiV0A = phi-EPV0A;
379 Double_t dphiV0C = phi-EPV0C;
380 Double_t dphiTPC = phi-EPTPC;
381
1accedbd 382 Double_t cos2phiV0A = TMath::Cos(2.*(dphiV0A));
383 Double_t cos2phiV0C = TMath::Cos(2.*(dphiV0C));
384 Double_t cos2phiTPC = TMath::Cos(2.*(dphiTPC));
385
c6ee6f73 386 dphiV0A = TVector2::Phi_0_2pi(dphiV0A); if(dphiV0A >TMath::Pi()) dphiV0A -= TMath::Pi();
387 dphiV0C = TVector2::Phi_0_2pi(dphiV0C); if(dphiV0C >TMath::Pi()) dphiV0C -= TMath::Pi();
388 dphiTPC = TVector2::Phi_0_2pi(dphiTPC); if(dphiTPC >TMath::Pi()) dphiTPC -= TMath::Pi();
3c40321c 389
d118f9e0 390 Double_t xV0A[4]; // Match ndims in fH V0A EP for method 1
3c40321c 391 xV0A[0] = mass;
392 xV0A[1] = pt;
393 xV0A[2] = fCentrality;
394 xV0A[3] = dphiV0A;
3c40321c 395 fHEPV0A->Fill(xV0A);
396
d118f9e0 397
398 Double_t xV0AM2[4]; // Match ndims in fH V0A EP for method 2
399 xV0AM2[0] = mass;
400 xV0AM2[1] = pt;
401 xV0AM2[2] = fCentrality;
402 xV0AM2[3] = cos2phiV0A;
403 fHEPV0AM2->Fill(xV0AM2);
404
405
406 Double_t xV0C[4]; // Match ndims in fH V0C EP for method 1
3c40321c 407 xV0C[0] = mass;
408 xV0C[1] = pt;
409 xV0C[2] = fCentrality;
410 xV0C[3] = dphiV0C;
3c40321c 411 fHEPV0C->Fill(xV0C);
412
d118f9e0 413 Double_t xV0CM2[4]; // Match ndims in fH V0C EP for method 2
414 xV0CM2[0] = mass;
415 xV0CM2[1] = pt;
416 xV0CM2[2] = fCentrality;
417 xV0CM2[3] = cos2phiV0C;
418 fHEPV0CM2->Fill(xV0CM2);
419
420
af1defae 421 if (fEPTPC!=-999.){
d118f9e0 422 Double_t xTPC[4]; // Match ndims in fH TPC EP for method 1
af1defae 423 xTPC[0] = mass;
424 xTPC[1] = pt;
425 xTPC[2] = fCentrality;
91d49d74 426 xTPC[3] = dphiTPC;
af1defae 427 fHEPTPC->Fill(xTPC);
d118f9e0 428
429 Double_t xTPCM2[4]; // Match ndims in fH TPC EP
430 xTPCM2[0] = mass;
431 xTPCM2[1] = pt;
432 xTPCM2[2] = fCentrality;
433 xTPCM2[3] = cos2phiTPC;
434 fHEPTPCM2->Fill(xTPCM2);
435
af1defae 436 }
7bb82cc2 437}
cd0e5e33 438
e50db689 439//________________________________________________________________________________________________________________________________
79ad78fd 440void AliAnalysisTaskPi0V2::FillCluster(const TLorentzVector& p1, Double_t EPV0A, Double_t EPV0C, Double_t EPTPC, AliVCluster *c)
7bb82cc2 441{
cd0e5e33 442 // Cluster(photon) v2 method
443
8e5ac2d1 444 Double_t Et = p1.Et();
7bb82cc2 445 Double_t Phi = p1.Phi();
9ff4e38b 446 Double_t M02 = c->GetM02();
7bb82cc2 447
7bb82cc2 448 Double_t difClusV0A = TVector2::Phi_0_2pi(Phi-EPV0A); if(difClusV0A >TMath::Pi()) difClusV0A -= TMath::Pi();
449 Double_t difClusV0C = TVector2::Phi_0_2pi(Phi-EPV0C); if(difClusV0C >TMath::Pi()) difClusV0C -= TMath::Pi();
450 Double_t difClusTPC = TVector2::Phi_0_2pi(Phi-EPTPC); if(difClusTPC >TMath::Pi()) difClusTPC -= TMath::Pi();
451
900db6d2 452 Double_t DataV0A[4];
8e5ac2d1 453 DataV0A[0] = Et;
454 DataV0A[1] = M02;
455 DataV0A[2] = fCentrality;
79ad78fd 456 DataV0A[3] = difClusV0A;
8e5ac2d1 457 fClusterPbV0A->Fill(DataV0A);
458
900db6d2 459 Double_t DataV0C[4];
8e5ac2d1 460 DataV0C[0] = Et;
461 DataV0C[1] = M02;
462 DataV0C[2] = fCentrality;
79ad78fd 463 DataV0C[3] = difClusV0C;
8e5ac2d1 464 fClusterPbV0C->Fill(DataV0C);
465
900db6d2 466 Double_t DataTPC[4];
8e5ac2d1 467 DataTPC[0] = Et;
468 DataTPC[1] = M02;
469 DataTPC[2] = fCentrality;
79ad78fd 470 DataTPC[3] = difClusTPC;
8e5ac2d1 471 fClusterPbTPC->Fill(DataTPC);
04b116e8 472}
cd0e5e33 473
3c40321c 474//_________________________________________________________________________________________________
ceba2d0c 475void AliAnalysisTaskPi0V2::GetMom(TLorentzVector& p, const AliVCluster *c, Double_t *vertex)
3c40321c 476{
477 // Calculate momentum.
478 Float_t posMom[3];
479 c->GetPosition(posMom);
480 TVector3 clsPos2(posMom);
481
482 Double_t e = c->E();
483 Double_t r = clsPos2.Perp();
484 Double_t eta = clsPos2.Eta();
485 Double_t phi = clsPos2.Phi();
486
487 TVector3 pos;
488 pos.SetPtEtaPhi(r,eta,phi);
489
490 if (vertex) { //calculate direction relative to vertex
491 pos -= vertex;
492 }
493
494 Double_t rad = pos.Mag();
495 p.SetPxPyPzE(e*pos.x()/rad, e*pos.y()/rad, e*pos.z()/rad, e);
70d53162 496
04b116e8 497}
cd0e5e33 498
3c40321c 499//________________________________________________________________________
500void AliAnalysisTaskPi0V2::UserCreateOutputObjects()
501{
cd0e5e33 502 // Create histograms
503 // Called once (on the worker node)
3c40321c 504
cd0e5e33 505 fOutput = new TList();
506 fOutput->SetOwner(); // IMPORTANT!
507
508 hEvtCount = new TH1F("hEvtCount", " Event Plane", 9, 0.5, 9.5);
509 hEvtCount->GetXaxis()->SetBinLabel(1,"All");
510 hEvtCount->GetXaxis()->SetBinLabel(2,"Evt");
511 hEvtCount->GetXaxis()->SetBinLabel(3,"Trg Class");
512 hEvtCount->GetXaxis()->SetBinLabel(4,"Vtx");
513 hEvtCount->GetXaxis()->SetBinLabel(5,"Cent");
514 hEvtCount->GetXaxis()->SetBinLabel(6,"EPtask");
515 hEvtCount->GetXaxis()->SetBinLabel(7,"ClusterTask");
516 hEvtCount->GetXaxis()->SetBinLabel(8,"Pass");
517 fOutput->Add(hEvtCount);
900db6d2 518
519 hCent = new TH1F("hCent", "centrality dist. before App. flat cut", 100, 0., 100.);
520 fOutput->Add(hCent);
521
cd0e5e33 522 hEPTPC = new TH2F("hEPTPC", "EPTPC vs cent", 100, 0., 100., 100, 0., TMath::Pi());
523 hresoTPC = new TH2F("hresoTPC", "TPc reso vs cent", 100, 0., 100., 100, 0., 1.);
524 hEPV0 = new TH2F("hEPV0", "EPV0 vs cent", 100, 0., 100., 100, 0., TMath::Pi());
525 hEPV0A = new TH2F("hEPV0A", "EPV0A vs cent", 100, 0., 100., 100, 0., TMath::Pi());
526 hEPV0C = new TH2F("hEPV0C", "EPV0C vs cent", 100, 0., 100., 100, 0., TMath::Pi());
527 hEPV0Ar = new TH2F("hEPV0Ar", "EPV0Ar vs cent", 100, 0., 100., 100, 0., TMath::Pi());
528 hEPV0Cr = new TH2F("hEPV0Cr", "EPV0Cr vs cent", 100, 0., 100., 100, 0., TMath::Pi());
529 hEPV0r = new TH2F("hEPV0r", "EPV0r vs cent", 100, 0., 100., 100, 0., TMath::Pi());
530 hEPV0AR4 = new TH2F("hEPV0AR4", "EPV0AR4 vs cent", 100, 0., 100., 100, 0., TMath::Pi());
531 hEPV0AR7 = new TH2F("hEPV0AR7", "EPV0AR7 vs cent", 100, 0., 100., 100, 0., TMath::Pi());
532 hEPV0CR0 = new TH2F("hEPV0CR0", "EPV0CR0 vs cent", 100, 0., 100., 100, 0., TMath::Pi());
533 hEPV0CR3 = new TH2F("hEPV0CR3", "EPV0CR3 vs cent", 100, 0., 100., 100, 0., TMath::Pi());
534 fOutput->Add(hEPTPC);
535 fOutput->Add(hresoTPC);
536 fOutput->Add(hEPV0);
537 fOutput->Add(hEPV0A);
538 fOutput->Add(hEPV0C);
539 fOutput->Add(hEPV0Ar);
540 fOutput->Add(hEPV0Cr);
541 fOutput->Add(hEPV0r);
542 fOutput->Add(hEPV0AR4);
543 fOutput->Add(hEPV0AR7);
544 fOutput->Add(hEPV0CR0);
545 fOutput->Add(hEPV0CR3);
546
547 hEPTPCCor = new TH2F("hEPTPCCor", "EPTPC vs cent after PHOS Correct", 100, 0., 100., 100, 0., TMath::Pi());
548 hEPV0ACor = new TH2F("hEPV0ACor", "EPV0A vs cent after PHOS Correct", 100, 0., 100., 100, 0., TMath::Pi());
549 hEPV0CCor = new TH2F("hEPV0CCor", "EPV0C vs cent after PHOS Correct", 100, 0., 100., 100, 0., TMath::Pi());
550 fOutput->Add(hEPTPCCor);
551 fOutput->Add(hEPV0ACor);
552 fOutput->Add(hEPV0CCor);
553
554 hdifV0Ar_V0Cr = new TH2F("hdifV0Ar_V0Cr", "EP Ar-Cr ", 100, 0., 100., 100, -1., 1.);
555 hdifV0A_V0CR0 = new TH2F("hdifV0A_V0CR0", "EP A-R0 ", 100, 0., 100., 100, -1., 1.);
556 hdifV0A_V0CR3 = new TH2F("hdifV0A_V0CR3", "EP A-R3 ", 100, 0., 100., 100, -1., 1.);
557 hdifV0ACR0_V0CR3 = new TH2F("hdifV0ACR0_V0CR3", "EP R0-R3 ", 100, 0., 100., 100, -1., 1.);
558 hdifV0C_V0AR4 = new TH2F("hdifV0C_V0AR4", "EP C-R4 ", 100, 0., 100., 100, -1., 1.);
559 hdifV0C_V0AR7 = new TH2F("hdifV0C_V0AR7", "EP C-R7 ", 100, 0., 100., 100, -1., 1.);
560 hdifV0AR4_V0AR7 = new TH2F("hdifV0AR4_V0AR7", "EP R4-R7 ", 100, 0., 100., 100, -1., 1.);
561 fOutput->Add(hdifV0Ar_V0Cr);
562 fOutput->Add(hdifV0A_V0CR0);
563 fOutput->Add(hdifV0A_V0CR3);
564 fOutput->Add(hdifV0ACR0_V0CR3);
565 fOutput->Add(hdifV0C_V0AR4);
566 fOutput->Add(hdifV0C_V0AR7);
567 fOutput->Add(hdifV0AR4_V0AR7);
568
569 hdifV0A_V0C = new TH2F("hdifV0A_V0C", "EP A-C ", 100, 0., 100., 100, -1., 1.);
570 hdifV0A_TPC = new TH2F("hdifV0A_TPC", "EP A-TPC", 100, 0., 100., 100, -1., 1.);
571 hdifV0C_TPC = new TH2F("hdifV0C_TPC", "EP C-TPC", 100, 0., 100., 100, -1., 1.);
572 hdifV0C_V0A = new TH2F("hdifV0C_V0A", "EP C-A ", 100, 0., 100., 100, -1., 1.);
573 fOutput->Add(hdifV0A_V0C);
574 fOutput->Add(hdifV0A_TPC);
575 fOutput->Add(hdifV0C_TPC);
576 fOutput->Add(hdifV0C_V0A);
577
91d49d74 578 hdifEMC_EPV0A = new TH3F("hdifEMC_EPV0A", "dif phi in EMC with EPV0A", 100, 0., 100., 100, 0., TMath::Pi(), 15, 0., 15.);
579 hdifEMC_EPV0C = new TH3F("hdifEMC_EPV0C", "dif phi in EMC with EPV0C", 100, 0., 100., 100, 0., TMath::Pi(), 15, 0., 15.);
cd0e5e33 580 fOutput->Add(hdifEMC_EPV0A);
581 fOutput->Add(hdifEMC_EPV0C);
582
91d49d74 583 hdifful_EPV0A = new TH3F("hdifful_EPV0A", "dif phi in full with EPV0A", 100, 0., 100., 100, 0., TMath::Pi(), 15, 0., 15.);
584 hdifful_EPV0C = new TH3F("hdifful_EPV0C", "dif phi in full with EPV0C", 100, 0., 100., 100, 0., TMath::Pi(), 15, 0., 15.);
cd0e5e33 585 fOutput->Add(hdifful_EPV0A);
586 fOutput->Add(hdifful_EPV0C);
587
91d49d74 588 hdifout_EPV0A = new TH3F("hdifout_EPV0A", "dif phi NOT in EMC with EPV0A", 100, 0., 100., 100, 0., TMath::Pi(), 15, 0., 15.);
589 hdifout_EPV0C = new TH3F("hdifout_EPV0C", "dif phi NOT in EMC with EPV0C", 100, 0., 100., 100, 0., TMath::Pi(), 15, 0., 15.);
cd0e5e33 590 fOutput->Add(hdifout_EPV0A);
591 fOutput->Add(hdifout_EPV0C);
592
91d49d74 593 hCv2EMC_EPV0A = new TH3F("hCv2EMC_EPV0A", " raw v2 of charged trc in EMC with V0A", 100, 0, 100, 50, -1., 1., 15, 0., 15.);
594 hCv2EMC_EPV0C = new TH3F("hCv2EMC_EPV0C", " raw v2 of charged trc in EMC with V0C", 100, 0, 100, 50, -1., 1., 15, 0., 15.);
595 fOutput->Add(hCv2EMC_EPV0A);
596 fOutput->Add(hCv2EMC_EPV0C);
597
598 hCv2ful_EPV0A = new TH3F("hCv2ful_EPV0A", " raw v2 of charged trc in ful with V0A", 100, 0, 100, 50, -1., 1., 15, 0., 15.);
599 hCv2ful_EPV0C = new TH3F("hCv2ful_EPV0C", " raw v2 of charged trc in ful with V0C", 100, 0, 100, 50, -1., 1., 15, 0., 15.);
600 fOutput->Add(hCv2ful_EPV0A);
601 fOutput->Add(hCv2ful_EPV0C);
602
603 hCv2out_EPV0A = new TH3F("hCv2out_EPV0A", " raw v2 of charged trc out with V0A", 100, 0, 100, 50, -1., 1., 15, 0., 15.);
604 hCv2out_EPV0C = new TH3F("hCv2out_EPV0C", " raw v2 of charged trc out with V0A", 100, 0, 100, 50, -1., 1., 15, 0., 15.);
605 fOutput->Add(hCv2out_EPV0A);
606 fOutput->Add(hCv2out_EPV0C);
607
608 hclusDif_EPV0A = new TH3F("hclusDif_EPV0A", "dif phi of clus with EP V0A", 100, 0., 100., 100, 0., TMath::Pi(), 15, 0., 15.);
609 hclusDif_EPV0C = new TH3F("hclusDif_EPV0C", "dif phi of clus with EP V0C", 100, 0., 100., 100, 0., TMath::Pi(), 15, 0., 15.);
610 fOutput->Add(hclusDif_EPV0A);
611 fOutput->Add(hclusDif_EPV0C);
612
613 hclusv2_EPV0A = new TH3F("hclusv2_EPV0A", " raw v2 of clus in ful with V0A", 100, 0, 100, 50, -1., 1., 15, 0., 15.);
614 hclusv2_EPV0C = new TH3F("hclusv2_EPV0C", " raw v2 of clus in ful with V0C", 100, 0, 100, 50, -1., 1., 15, 0., 15.);
615 fOutput->Add(hclusv2_EPV0A);
616 fOutput->Add(hclusv2_EPV0C);
617
cd0e5e33 618 if (isV1Clus) {
900db6d2 619 // Et M02 spdcent DeltaPhi
620 Int_t bins[4] = { 500, 350, 60, 100 }; // binning
621 Double_t min[4] = { 0.0, 0.0, 0, 0.0 }; // min x
622 Double_t max[4] = { 50.0, 3.5, 60, TMath::Pi()}; // max x
8e5ac2d1 623
79ad78fd 624 fClusterPbV0A = new THnSparseF("fClusterPbV0A","",5,bins,min,max);
cd0e5e33 625 fClusterPbV0A->GetAxis(0)->SetTitle("Transverse Energy [GeV]");
626 fClusterPbV0A->GetAxis(1)->SetTitle("M02");
627 fClusterPbV0A->GetAxis(2)->SetTitle("V0M Centrality");
628 fClusterPbV0A->GetAxis(3)->SetTitle("Delta(#phi) [rad]");
8e5ac2d1 629 fOutput->Add(fClusterPbV0A);
630
79ad78fd 631 fClusterPbV0C = new THnSparseF("fClusterPbV0C","",5,bins,min,max);
cd0e5e33 632 fClusterPbV0C->GetAxis(0)->SetTitle("Transverse Energy [GeV]");
633 fClusterPbV0C->GetAxis(1)->SetTitle("M02");
634 fClusterPbV0C->GetAxis(2)->SetTitle("V0M Centrality");
635 fClusterPbV0C->GetAxis(3)->SetTitle("Delta(#phi) [rad]");
8e5ac2d1 636 fOutput->Add(fClusterPbV0C);
637
79ad78fd 638 fClusterPbTPC = new THnSparseF("fClusterPbTPC","",5,bins,min,max);
cd0e5e33 639 fClusterPbTPC->GetAxis(0)->SetTitle("Transverse Energy [GeV]");
640 fClusterPbTPC->GetAxis(1)->SetTitle("M02");
641 fClusterPbTPC->GetAxis(2)->SetTitle("V0M Centrality");
642 fClusterPbTPC->GetAxis(3)->SetTitle("Delta(#phi) [rad]");
8e5ac2d1 643 fOutput->Add(fClusterPbTPC);
cd0e5e33 644 }
79ad78fd 645
cd0e5e33 646 h2DcosV0A = new TProfile("h2DcosV0A", "cos(Phi) V0r vs Run NUmber", 200, 0., 200.);
647 h2DsinV0A = new TProfile("h2DsinV0A", "sin(Phi) V0r vs Run NUmber", 200, 0., 200.);
648 h2DcosV0C = new TProfile("h2DcosV0C", "cos(Phi) V0r vs Run NUmber", 200, 0., 200.);
649 h2DsinV0C = new TProfile("h2DsinV0C", "sin(Phi) V0r vs Run NUmber", 200, 0., 200.);
650 h2DcosTPC = new TProfile("h2DcosTPC", "cos(Phi) V0r vs Run NUmber", 200, 0., 200.);
651 h2DsinTPC = new TProfile("h2DsinTPC", "sin(Phi) V0r vs Run NUmber", 200, 0., 200.);
652 fOutput->Add(h2DcosV0A);
653 fOutput->Add(h2DsinV0A);
654 fOutput->Add(h2DcosV0C);
655 fOutput->Add(h2DsinV0C);
656 fOutput->Add(h2DcosTPC);
657 fOutput->Add(h2DsinTPC);
658
659 if (isV1Clus) {
660 hM02vsPtA = new TH2F("hM02vsPtA", "M02 vs Et before cut", 5000, 0, 50, 400, 0, 4.);
661 hM02vsPtB = new TH2F("hM02vsPtB", "M02 vs Et before cut", 5000, 0, 50, 400, 0, 4.);
662 fOutput->Add(hM02vsPtA);
663 fOutput->Add(hM02vsPtB);
664 }
665 hClusDxDZA = new TH2F("hClusDxDZA", "clus Dx vs Dz", 1000, -1., 1., 1000, -1., 1);
666 hClusDxDZB = new TH2F("hClusDxDZB", "clus Dx vs Dz", 1000, -1., 1., 1000, -1., 1);
667 fOutput->Add(hClusDxDZA);
668 fOutput->Add(hClusDxDZB);
79ad78fd 669
cd0e5e33 670 if (!isV1Clus) {
d118f9e0 671 const Int_t ndims = 4;
1accedbd 672 Int_t nMgg=500, nPt=40, nCent=20, nDeltaPhi=315, ncos2phi=500;
d118f9e0 673 Int_t binsv1[ndims] = {nMgg, nPt, nCent, nDeltaPhi};
91d49d74 674 Double_t xmin[ndims] = { 0, 0., 0, 0. };
675 Double_t xmax[ndims] = { 0.5, 20., 100, 3.15 };
8e5ac2d1 676 fHEPV0A = new THnSparseF("fHEPV0A", "Flow histogram EPV0A", ndims, binsv1, xmin, xmax);
677 fHEPV0C = new THnSparseF("fHEPV0C", "Flow histogram EPV0C", ndims, binsv1, xmin, xmax);
678 fHEPTPC = new THnSparseF("fHEPTPC", "Flow histogram EPTPC", ndims, binsv1, xmin, xmax);
cd0e5e33 679 fHEPV0A->GetAxis(0)->SetTitle("m_{#gamma#gamma} ");
680 fHEPV0A->GetAxis(1)->SetTitle("p_{T}[GeV]");
681 fHEPV0A->GetAxis(2)->SetTitle("centrality");
682 fHEPV0A->GetAxis(3)->SetTitle("#delta #phi");
683 fHEPV0C->GetAxis(0)->SetTitle("m_{#gamma#gamma} ");
684 fHEPV0C->GetAxis(1)->SetTitle("p_{T}[GeV]");
685 fHEPV0C->GetAxis(2)->SetTitle("centrality");
686 fHEPV0C->GetAxis(3)->SetTitle("#delta #phi");
687 fHEPTPC->GetAxis(0)->SetTitle("m_{#gamma#gamma} ");
688 fHEPTPC->GetAxis(1)->SetTitle("p_{T}[GeV]");
689 fHEPTPC->GetAxis(2)->SetTitle("centrality");
690 fHEPTPC->GetAxis(3)->SetTitle("#delta #phi");
04b116e8 691 fOutput->Add(fHEPV0A);
692 fOutput->Add(fHEPV0C);
693 fOutput->Add(fHEPTPC);
d118f9e0 694
695 Int_t binsv2[ndims] = {nMgg, nPt, nCent, ncos2phi};
696 Double_t xmin2[ndims] = { 0, 0., 0, -1.};
697 Double_t xmax2[ndims] = { 0.5, 20., 100, 1.};
698 fHEPV0AM2 = new THnSparseF("fHEPV0AM2", "Flow histogram EPV0A M2", ndims, binsv2, xmin2, xmax2);
699 fHEPV0CM2 = new THnSparseF("fHEPV0CM2", "Flow histogram EPV0C M2", ndims, binsv2, xmin2, xmax2);
700 fHEPTPCM2 = new THnSparseF("fHEPTPCM2", "Flow histogram EPTPC M2", ndims, binsv2, xmin2, xmax2);
701 fHEPV0AM2->GetAxis(0)->SetTitle("m_{#gamma#gamma} ");
702 fHEPV0AM2->GetAxis(1)->SetTitle("p_{T}[GeV]");
703 fHEPV0AM2->GetAxis(2)->SetTitle("centrality");
704 fHEPV0AM2->GetAxis(3)->SetTitle("cos(2*#delta #phi)");
705 fHEPV0CM2->GetAxis(0)->SetTitle("m_{#gamma#gamma} ");
706 fHEPV0CM2->GetAxis(1)->SetTitle("p_{T}[GeV]");
707 fHEPV0CM2->GetAxis(2)->SetTitle("centrality");
708 fHEPV0CM2->GetAxis(3)->SetTitle("cos(2*#delta #phi)");
709 fHEPTPCM2->GetAxis(0)->SetTitle("m_{#gamma#gamma} ");
710 fHEPTPCM2->GetAxis(1)->SetTitle("p_{T}[GeV]");
711 fHEPTPCM2->GetAxis(2)->SetTitle("centrality");
712 fHEPTPCM2->GetAxis(3)->SetTitle("cos(2*#delta #phi)");
713 fOutput->Add(fHEPV0AM2);
714 fOutput->Add(fHEPV0CM2);
715 fOutput->Add(fHEPTPCM2);
716
79ad78fd 717 }
cd0e5e33 718 PostData(1, fOutput); // Post data for ALL output slots >0 here, to get at least an empty histogram
3c40321c 719}
720
721//________________________________________________________________________
722void AliAnalysisTaskPi0V2::UserExec(Option_t *)
723{
79ad78fd 724 // Main loop
725 // Called for each event
726
727 hEvtCount->Fill(1);
728 // Create pointer to reconstructed event
cd0e5e33 729
79ad78fd 730 AliVEvent *event = InputEvent();
cd0e5e33 731 if (!event) {
732 AliError("Could not retrieve event");
733 return;
734 }
735
736 // create pointer to event
737 TString type = AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()->GetDataType();
af1defae 738 if (type=="ESD") {
79ad78fd 739 fESD = dynamic_cast<AliESDEvent*>(event);
740 if (!fESD) {
cd0e5e33 741 AliError("Cannot get the ESD event");
742 return;
79ad78fd 743 }
af1defae 744 } else if (type=="AOD") {
79ad78fd 745 fAOD = dynamic_cast<AliAODEvent*>(event);
746 if (!fAOD) {
cd0e5e33 747 AliError("Cannot get the AOD event");
748 return;
79ad78fd 749 }
cd0e5e33 750 } else {
751 AliError("Cannot happen");
752 return;
8071d5b2 753 }
ea7921ea 754
4fbbf89d 755 hEvtCount->Fill(2);
cd0e5e33 756 if (!fTrigClass.IsNull()) {
7bb82cc2 757 TString fired;
cd0e5e33 758 if (fESD) {
759 fired = fESD->GetFiredTriggerClasses();
760 } else {
761 fired = fAOD->GetFiredTriggerClasses();
79ad78fd 762 }
7bb82cc2 763 if (!fired.Contains("-B-"))
764 return;
765 TObjArray *arr = fTrigClass.Tokenize("|");
766 if (!arr)
767 return;
768 Bool_t match = 0;
769 for (Int_t i=0;i<arr->GetEntriesFast();++i) {
770 TObject *obj = arr->At(i);
771 if (!obj)
772 continue;
773 if (fired.Contains(obj->GetName())) {
774 match = 1;
775 break;
776 }
777 }
778 delete arr;
cd0e5e33 779 if (!match)
780 return;
7bb82cc2 781 }
cd0e5e33 782 hEvtCount->Fill(3);
79ad78fd 783
a20c44e6 784 if (fRunNumber != event->GetRunNumber()) {
785 fRunNumber = event->GetRunNumber();
786 SetFlatteningData();
79ad78fd 787 }
cd0e5e33 788
af1defae 789 fInterRunNumber = ConvertToInternalRunNumber(fRunNumber);
790
cd0e5e33 791 const AliVVertex* fvertex;
af1defae 792 fvertex = event->GetPrimaryVertex();
965c985f 793
cd0e5e33 794 if (TMath::Abs(fvertex->GetZ())>fVtxCut)
795 return;
796 Double_t vertex[3] = {fvertex->GetX(), fvertex->GetY(), fvertex->GetZ()};
797
798 hEvtCount->Fill(4);
ef7e23cf 799
cd0e5e33 800 fCentrality = event->GetCentrality()->GetCentralityPercentile("CL1"); //spd vertex
900db6d2 801 hCent->Fill(fCentrality);
802 if(isCentFlat){
803 Bool_t bIsNot = kFALSE;
804 if (fCentrality<=10){ //0-10%
805 TRandom3 *rndm = new TRandom3(0);
806 Double_t Nrndm = rndm->Uniform(0.,1.);
807 if(fCentrality<=1){
808 if(Nrndm > 0.759307) bIsNot = kTRUE;
809 } else if(1<fCentrality && fCentrality<=2) {
810 if(Nrndm > 0.748823) bIsNot = kTRUE;
811 } else if (2<fCentrality && fCentrality<=3){
812 if(Nrndm > 0.755646) bIsNot = kTRUE;
813 } else if (3<fCentrality && fCentrality<=4){
814 if(Nrndm > 0.76136) bIsNot = kTRUE;
815 } else if (4<fCentrality && fCentrality<=5){
816 if(Nrndm > 0.755756) bIsNot = kTRUE;
817 } else if (5<fCentrality && fCentrality<=6){
818 if(Nrndm > 0.78468) bIsNot = kTRUE;
819 } else if (6<fCentrality && fCentrality<=7){
820 if(Nrndm > 0.770726) bIsNot = kTRUE;
821 } else if (7<fCentrality && fCentrality<=8){
822 if(Nrndm > 0.779329) bIsNot = kTRUE;
823 } else if (8<fCentrality && fCentrality<=9){
824 if(Nrndm > 0.821996) bIsNot = kTRUE;
825 } else if (9<fCentrality && fCentrality<=10){
826 if(Nrndm > 1) bIsNot = kTRUE;
827 }
828 delete rndm; rndm = 0;
829 if(bIsNot)
830 return;
831 }else if (10<fCentrality && fCentrality<=50){ //10-50%
832 TString centfired;
833 if (fESD) {
834 centfired = fESD->GetFiredTriggerClasses();
835 } else {
836 centfired = fAOD->GetFiredTriggerClasses();
837 }
838 if(!centfired.Contains("CVLN_B2-B-NOPF-ALLNOTRD") || !centfired.Contains("CVLN_R1-B-NOPF-ALLNOTRD") || !centfired.Contains("CSEMI_R1-B-NOPF-ALLNOTRD"))
839 return;
840 }
841 }
cd0e5e33 842
843 hEvtCount->Fill(5);
844
845 AliEventplane *ep = event->GetEventplane();
846 if (ep) {
af1defae 847 if (ep->GetEventplane("Q") != -1)
848 fEPTPC = ep->GetEventplane("Q");
cd0e5e33 849 else
850 fEPTPC = -999.;
af1defae 851 if (ep->GetEventplane("Q") != -1)
852 fEPTPCreso = TMath::Cos(2.*(ep->GetQsubRes()));
cd0e5e33 853 else
854 fEPTPCreso = -1;
af1defae 855
856 fEPV0 = ep->GetEventplane("V0", event);
857 fEPV0A = ep->GetEventplane("V0A", event);
858 fEPV0C = ep->GetEventplane("V0C", event);
cd0e5e33 859 Double_t qx=0, qy=0;
860 Double_t qxr=0, qyr=0;
af1defae 861 fEPV0Ar = ep->CalculateVZEROEventPlane(event, 4, 5, 2, qxr, qyr);
862 fEPV0Cr = ep->CalculateVZEROEventPlane(event, 2, 3, 2, qx, qy);
cd0e5e33 863 qxr += qx;
864 qyr += qy;
865 fEPV0r = TMath::ATan2(qyr,qxr)/2.;
af1defae 866 fEPV0AR4 = ep->CalculateVZEROEventPlane(event, 4, 2, qx, qy);
867 fEPV0AR5 = ep->CalculateVZEROEventPlane(event, 5, 2, qx, qy);
868 fEPV0AR6 = ep->CalculateVZEROEventPlane(event, 6, 2, qx, qy);
869 fEPV0AR7 = ep->CalculateVZEROEventPlane(event, 7, 2, qx, qy);
870 fEPV0CR0 = ep->CalculateVZEROEventPlane(event, 0, 2, qx, qy);
871 fEPV0CR1 = ep->CalculateVZEROEventPlane(event, 1, 2, qx, qy);
872 fEPV0CR2 = ep->CalculateVZEROEventPlane(event, 2, 2, qx, qy);
873 fEPV0CR3 = ep->CalculateVZEROEventPlane(event, 3, 2, qx, qy);
874 }
ef7e23cf 875
cd0e5e33 876 FillEPQA(); //Fill the EP QA
877
878 hEvtCount->Fill(6);
879
880 fEPV0 = TVector2::Phi_0_2pi(fEPV0);
881 if (fEPV0>TMath::Pi())
882 fEPV0 = fEPV0 - TMath::Pi();
883 fEPV0r = TVector2::Phi_0_2pi(fEPV0r);
884 if (fEPV0r>TMath::Pi())
885 fEPV0r = fEPV0r - TMath::Pi();
886 fEPV0A = TVector2::Phi_0_2pi(fEPV0A);
887 if (fEPV0A>TMath::Pi())
888 fEPV0A = fEPV0A - TMath::Pi();
889 fEPV0C = TVector2::Phi_0_2pi(fEPV0C);
890 if (fEPV0C>TMath::Pi())
891 fEPV0C = fEPV0C - TMath::Pi();
892 fEPV0Ar = TVector2::Phi_0_2pi(fEPV0Ar);
893 if (fEPV0Ar>TMath::Pi())
894 fEPV0Ar = fEPV0Ar - TMath::Pi();
895 fEPV0Cr = TVector2::Phi_0_2pi(fEPV0Cr);
896 if (fEPV0Cr>TMath::Pi())
897 fEPV0Cr = fEPV0Cr - TMath::Pi();
898 fEPV0AR4 = TVector2::Phi_0_2pi(fEPV0AR4);
899 if (fEPV0AR4>TMath::Pi())
900 fEPV0AR4 = fEPV0AR4 - TMath::Pi();
901 fEPV0AR7 = TVector2::Phi_0_2pi(fEPV0AR7);
902 if (fEPV0AR7>TMath::Pi())
903 fEPV0AR7 = fEPV0AR7 - TMath::Pi();
904 fEPV0CR0 = TVector2::Phi_0_2pi(fEPV0CR0);
905 if (fEPV0CR0>TMath::Pi())
906 fEPV0CR0 = fEPV0CR0 - TMath::Pi();
907 fEPV0CR3 = TVector2::Phi_0_2pi(fEPV0CR3);
908 if (fEPV0CR3>TMath::Pi())
909 fEPV0CR3 = fEPV0CR3 - TMath::Pi();
af1defae 910 if (fEPTPC != -999. )
cd0e5e33 911 hEPTPC->Fill(fCentrality, fEPTPC);
912 if (fEPTPCreso!=-1)
913 hresoTPC->Fill(fCentrality, fEPTPCreso);
914 hEPV0->Fill(fCentrality, fEPV0);
915 hEPV0A->Fill(fCentrality, fEPV0A);
916 hEPV0C->Fill(fCentrality, fEPV0C);
917 hEPV0Ar->Fill(fCentrality, fEPV0Ar);
918 hEPV0Cr->Fill(fCentrality, fEPV0Cr);
919 hEPV0r->Fill(fCentrality, fEPV0r);
920 hEPV0AR4->Fill(fCentrality, fEPV0AR4);
921 hEPV0AR7->Fill(fCentrality, fEPV0AR7);
922 hEPV0CR0->Fill(fCentrality, fEPV0CR0);
923 hEPV0CR3->Fill(fCentrality, fEPV0CR3);
924
925 if (isPhosCali) {
926 // PHOS Flattening
927 fEPV0A = ApplyFlatteningV0A(fEPV0A, fCentrality); //V0A after Phos flatten
928 fEPV0C = ApplyFlatteningV0C(fEPV0C, fCentrality); //V0C after Phos flatten
af1defae 929 if(fEPTPC != -999.)
930 fEPTPC = ApplyFlattening(fEPTPC, fCentrality); //TPC after Phos flatten
cd0e5e33 931 }
932
933 if (!isPhosCali) {
af1defae 934 if(fEPTPC != -999.)
935 hEPTPCCor->Fill(fCentrality, ApplyFlattening(fEPTPC, fCentrality));
cd0e5e33 936 hEPV0ACor->Fill(fCentrality, ApplyFlatteningV0A(fEPV0A, fCentrality));
937 hEPV0CCor->Fill(fCentrality, ApplyFlatteningV0C(fEPV0C, fCentrality));
938 } else {
af1defae 939 if(fEPTPC != -999.)
940 hEPTPCCor->Fill(fCentrality, fEPTPC);
cd0e5e33 941 hEPV0ACor->Fill(fCentrality, fEPV0A);
942 hEPV0CCor->Fill(fCentrality, fEPV0C);
79ad78fd 943 }
04b116e8 944
cd0e5e33 945 hdifV0Ar_V0Cr->Fill(fCentrality, TMath::Cos(2.*(fEPV0Ar - fEPV0Cr)));
946 hdifV0A_V0CR0->Fill(fCentrality, TMath::Cos(2.*(fEPV0A - fEPV0CR0)));
947 hdifV0A_V0CR3->Fill(fCentrality, TMath::Cos(2.*(fEPV0A - fEPV0CR3)));
948 hdifV0ACR0_V0CR3->Fill(fCentrality, TMath::Cos(2*(fEPV0CR0 - fEPV0CR3)));
949 hdifV0C_V0AR4->Fill(fCentrality, TMath::Cos(2*(fEPV0C - fEPV0AR4)));
950 hdifV0C_V0AR7->Fill(fCentrality, TMath::Cos(2*(fEPV0C - fEPV0AR7)));
951 hdifV0AR4_V0AR7->Fill(fCentrality, TMath::Cos(2*(fEPV0AR4 - fEPV0AR7)));
3c40321c 952
cd0e5e33 953 hdifV0A_V0C->Fill(fCentrality, TMath::Cos(2*(fEPV0A - fEPV0C)));
af1defae 954 if (fEPTPC!=-999.){
cd0e5e33 955 hdifV0A_TPC->Fill(fCentrality, TMath::Cos(2*(fEPV0A - fEPTPC)));
956 hdifV0C_TPC->Fill(fCentrality, TMath::Cos(2*(fEPV0C - fEPTPC)));
957 }
958 hdifV0C_V0A->Fill(fCentrality, TMath::Cos(2*(fEPV0C - fEPV0A)));
959
960 // Cluster loop for reconstructed event
961
962 //================ for v2 clusterize analysis==============================================
963 if (!isV1Clus) {
13e6ff28 964 if (!fV2ClusName.IsNull() && !fV2Clus) {
965 fV2Clus = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fV2ClusName));
966 if (!fV2Clus) {
c0ca428c 967 AliError(Form("%s: Could not retrieve v2 cluster name %s!", GetName(), fV2ClusName.Data()));
13e6ff28 968 return;
969 }
970 }
971 Int_t nCluster = fV2Clus->GetEntries();
cd0e5e33 972 for (Int_t i=0; i<nCluster; ++i) {
13e6ff28 973 AliVCluster *c1 = static_cast<AliVCluster*>(fV2Clus->At(i));
cd0e5e33 974 if (!c1)
975 continue;
13e6ff28 976 hClusDxDZA->Fill(c1->GetTrackDz(), c1->GetTrackDx());
cd0e5e33 977 if (!c1->IsEMCAL())
978 continue;
979 if (!IsGoodCluster(c1))
980 continue;
13e6ff28 981 hClusDxDZB->Fill(c1->GetTrackDz(), c1->GetTrackDx());
982 TLorentzVector p1;
983 GetMom(p1, c1, vertex);
91d49d74 984 Double_t cluPhi = p1.Phi();
985 Double_t cluPt = p1.Pt();
986 Double_t difclusV0A = TVector2::Phi_0_2pi(cluPhi-fEPV0A);
987 if (difclusV0A >TMath::Pi())
988 difclusV0A -= TMath::Pi();
989 Double_t difclusV0C = TVector2::Phi_0_2pi(cluPhi-fEPV0C);
990 if (difclusV0C >TMath::Pi())
991 difclusV0C -= TMath::Pi();
992 hclusDif_EPV0A->Fill(fCentrality, difclusV0A, cluPt);
993 hclusDif_EPV0C->Fill(fCentrality, difclusV0C, cluPt);
994 hclusv2_EPV0A->Fill(fCentrality, TMath::Cos(2.*difclusV0A), cluPt);
995 hclusv2_EPV0C->Fill(fCentrality, TMath::Cos(2.*difclusV0C), cluPt);
cd0e5e33 996 for (Int_t j=i+1; j<nCluster; ++j) {
997 AliVCluster *c2 = static_cast<AliVCluster*>(fV2Clus->At(j));
998 if (!c2)
999 continue;
1000 if (!c2->IsEMCAL())
1001 continue;
1002 if (!IsGoodCluster(c2))
1003 continue;
13e6ff28 1004 TLorentzVector p2;
1005 GetMom(p2, c2, vertex);
79ad78fd 1006 FillPion(p1, p2, fEPV0A, fEPV0C, fEPTPC);
13e6ff28 1007 }
1008 }
ceba2d0c 1009 }
cd0e5e33 1010
13e6ff28 1011 //================ for v1 clusterize analysis==============================================
cd0e5e33 1012 if (isV1Clus) {
ceba2d0c 1013 if (!fV2ClusName.IsNull() && !fV1Clus) {
1014 fV1Clus = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fV1ClusName));
1015 if (!fV1Clus) {
c0ca428c 1016 AliError(Form("%s: Could not retrieve v1 cluster name %s!", GetName(), fV1ClusName.Data()));
ceba2d0c 1017 return;
1018 }
1019 }
1020 Int_t nClusterV1 = fV1Clus->GetEntries();
cd0e5e33 1021 for (Int_t i=0; i<nClusterV1; ++i) {
79ad78fd 1022 AliVCluster *c3 = dynamic_cast<AliVCluster*>(fV1Clus->At(i));
cd0e5e33 1023 if (!c3)
1024 continue;
1025 if (!c3->IsEMCAL())
1026 continue;
9ff4e38b 1027 Double_t M02c3 = c3->GetM02();
1028 Double_t Dxc3 = c3->GetTrackDx();
1029 Double_t Dzc3 = c3->GetTrackDz();
1030
1031 hClusDxDZA->Fill(Dzc3, Dxc3);
13e6ff28 1032 Float_t clsPosEt[3] = {0,0,0};
1033 c3->GetPosition(clsPosEt);
1034 TVector3 clsVec(clsPosEt);
1035 Double_t Et = c3->E()*TMath::Sin(clsVec.Theta());
9ff4e38b 1036 hM02vsPtA->Fill(Et, M02c3);
cd0e5e33 1037 if (!IsGoodClusterV1(c3))
1038 continue;
9ff4e38b 1039 hM02vsPtB->Fill(Et, M02c3);
1040 hClusDxDZB->Fill(Dzc3, Dxc3);
8f4922cb 1041 TLorentzVector p3;
1042 GetMom(p3, c3, vertex);
79ad78fd 1043 FillCluster(p3, fEPV0A, fEPV0C, fEPTPC, c3);
8f4922cb 1044 }
1045 }
1046
cd0e5e33 1047 hEvtCount->Fill(7);
8f4922cb 1048
cd0e5e33 1049 if (!fTracksName.IsNull() && !fTracks) {
1050 fTracks = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fTracksName));
1051 if (!fTracks) {
1052 AliError(Form("%s: Could not retrieve tracks %s!", GetName(), fTracksName.Data()));
1053 return;
1054 }
50ebbe79 1055 }
e5ba16b4 1056
cd0e5e33 1057 Int_t ntracks = fTracks->GetEntries();
1058 for (Int_t i=0; i<ntracks; ++i){
1059 AliVTrack *track = static_cast<AliVTrack*>(fTracks->At(i));
1060 if (!track)
1061 continue;
1062 Double_t tPhi = track->Phi();
1063 Double_t tPt = track->Pt();
1064 Double_t Eta = track->Eta();
1065
1066 Double_t difTrackV0 = TVector2::Phi_0_2pi(tPhi-fEPV0);
1067 if (difTrackV0 >TMath::Pi())
1068 difTrackV0 -= TMath::Pi();
1069 Double_t difTrackV0A = TVector2::Phi_0_2pi(tPhi-fEPV0A);
1070 if (difTrackV0A >TMath::Pi())
1071 difTrackV0A -= TMath::Pi();
1072 Double_t difTrackV0C = TVector2::Phi_0_2pi(tPhi-fEPV0C);
1073 if (difTrackV0C >TMath::Pi())
1074 difTrackV0C -= TMath::Pi();
1075 Double_t difTrackTPC = TVector2::Phi_0_2pi(tPhi-fEPTPC);
1076 if (difTrackTPC >TMath::Pi())
1077 difTrackTPC -= TMath::Pi();
1078 if (tPhi*TMath::RadToDeg()>80. && tPhi*TMath::RadToDeg()<180. && Eta <0.7 && Eta >(-0.7)){
cd0e5e33 1079 hdifEMC_EPV0A->Fill(fCentrality, difTrackV0A, tPt);
1080 hdifEMC_EPV0C->Fill(fCentrality, difTrackV0C, tPt);
91d49d74 1081 hCv2EMC_EPV0A->Fill(fCentrality, TMath::Cos(2.*difTrackV0A), tPt);
1082 hCv2EMC_EPV0C->Fill(fCentrality, TMath::Cos(2.*difTrackV0C), tPt);
cd0e5e33 1083 } else {
cd0e5e33 1084 hdifout_EPV0A->Fill(fCentrality, difTrackV0A, tPt);
1085 hdifout_EPV0C->Fill(fCentrality, difTrackV0C, tPt);
91d49d74 1086 hCv2out_EPV0A->Fill(fCentrality, TMath::Cos(2.*difTrackV0A), tPt);
1087 hCv2out_EPV0C->Fill(fCentrality, TMath::Cos(2.*difTrackV0C), tPt);
cd0e5e33 1088 }
cd0e5e33 1089 hdifful_EPV0A->Fill(fCentrality, difTrackV0A, tPt);
1090 hdifful_EPV0C->Fill(fCentrality, difTrackV0C, tPt);
91d49d74 1091 hCv2ful_EPV0A->Fill(fCentrality, TMath::Cos(2.*difTrackV0A), tPt);
1092 hCv2ful_EPV0C->Fill(fCentrality, TMath::Cos(2.*difTrackV0C), tPt);
cd0e5e33 1093 }
1094 hEvtCount->Fill(8);
1095
1096 // NEW HISTO should be filled before this point, as PostData puts the
1097 // information for this iteration of the UserExec in the container
1098 PostData(1, fOutput);
3c40321c 1099}
cd0e5e33 1100
7bb82cc2 1101//____________________________________________________________________
1102Int_t AliAnalysisTaskPi0V2::ConvertToInternalRunNumber(Int_t n)
1103{
cd0e5e33 1104 switch(n) {
1105 case 170593 : return 179;
1106 case 170572 : return 178;
1107 case 170556 : return 177;
1108 case 170552 : return 176;
1109 case 170546 : return 175;
1110 case 170390 : return 174;
1111 case 170389 : return 173;
1112 case 170388 : return 172;
1113 case 170387 : return 171;
1114 case 170315 : return 170;
1115 case 170313 : return 169;
1116 case 170312 : return 168;
1117 case 170311 : return 167;
1118 case 170309 : return 166;
1119 case 170308 : return 165;
1120 case 170306 : return 164;
1121 case 170270 : return 163;
1122 case 170269 : return 162;
1123 case 170268 : return 161;
1124 case 170267 : return 160;
1125 case 170264 : return 159;
1126 case 170230 : return 158;
1127 case 170228 : return 157;
1128 case 170208 : return 156;
1129 case 170207 : return 155;
1130 case 170205 : return 154;
1131 case 170204 : return 153;
1132 case 170203 : return 152;
1133 case 170195 : return 151;
1134 case 170193 : return 150;
1135 case 170163 : return 149;
1136 case 170162 : return 148;
1137 case 170159 : return 147;
1138 case 170155 : return 146;
1139 case 170152 : return 145;
1140 case 170091 : return 144;
1141 case 170089 : return 143;
1142 case 170088 : return 142;
1143 case 170085 : return 141;
1144 case 170084 : return 140;
1145 case 170083 : return 139;
1146 case 170081 : return 138;
1147 case 170040 : return 137;
1148 case 170038 : return 136;
1149 case 170036 : return 135;
1150 case 170027 : return 134;
1151 case 169981 : return 133;
1152 case 169975 : return 132;
1153 case 169969 : return 131;
1154 case 169965 : return 130;
1155 case 169961 : return 129;
1156 case 169956 : return 128;
1157 case 169926 : return 127;
1158 case 169924 : return 126;
1159 case 169923 : return 125;
1160 case 169922 : return 124;
1161 case 169919 : return 123;
1162 case 169918 : return 122;
1163 case 169914 : return 121;
1164 case 169859 : return 120;
1165 case 169858 : return 119;
1166 case 169855 : return 118;
1167 case 169846 : return 117;
1168 case 169838 : return 116;
1169 case 169837 : return 115;
1170 case 169835 : return 114;
1171 case 169683 : return 113;
1172 case 169628 : return 112;
1173 case 169591 : return 111;
1174 case 169590 : return 110;
1175 case 169588 : return 109;
1176 case 169587 : return 108;
1177 case 169586 : return 107;
1178 case 169584 : return 106;
1179 case 169557 : return 105;
1180 case 169555 : return 104;
1181 case 169554 : return 103;
1182 case 169553 : return 102;
1183 case 169550 : return 101;
1184 case 169515 : return 100;
1185 case 169512 : return 99;
1186 case 169506 : return 98;
1187 case 169504 : return 97;
1188 case 169498 : return 96;
1189 case 169475 : return 95;
1190 case 169420 : return 94;
1191 case 169419 : return 93;
1192 case 169418 : return 92;
1193 case 169417 : return 91;
1194 case 169415 : return 90;
1195 case 169411 : return 89;
1196 case 169238 : return 88;
1197 case 169236 : return 87;
1198 case 169167 : return 86;
1199 case 169160 : return 85;
1200 case 169156 : return 84;
1201 case 169148 : return 83;
1202 case 169145 : return 82;
1203 case 169144 : return 81;
1204 case 169143 : return 80;
1205 case 169138 : return 79;
1206 case 169099 : return 78;
1207 case 169094 : return 77;
1208 case 169091 : return 76;
1209 case 169045 : return 75;
1210 case 169044 : return 74;
1211 case 169040 : return 73;
1212 case 169035 : return 72;
1213 case 168992 : return 71;
1214 case 168988 : return 70;
1215 case 168984 : return 69;
1216 case 168826 : return 68;
1217 case 168777 : return 67;
1218 case 168514 : return 66;
1219 case 168512 : return 65;
1220 case 168511 : return 64;
1221 case 168467 : return 63;
1222 case 168464 : return 62;
1223 case 168461 : return 61;
1224 case 168460 : return 60;
1225 case 168458 : return 59;
1226 case 168362 : return 58;
1227 case 168361 : return 57;
1228 case 168356 : return 56;
1229 case 168342 : return 55;
1230 case 168341 : return 54;
1231 case 168325 : return 53;
1232 case 168322 : return 52;
1233 case 168318 : return 51;
1234 case 168311 : return 50;
1235 case 168310 : return 49;
1236 case 168213 : return 48;
1237 case 168212 : return 47;
1238 case 168208 : return 46;
1239 case 168207 : return 45;
1240 case 168206 : return 44;
1241 case 168205 : return 43;
1242 case 168204 : return 42;
1243 case 168203 : return 41;
1244 case 168181 : return 40;
1245 case 168177 : return 39;
1246 case 168175 : return 38;
1247 case 168173 : return 37;
1248 case 168172 : return 36;
1249 case 168171 : return 35;
1250 case 168115 : return 34;
1251 case 168108 : return 33;
1252 case 168107 : return 32;
1253 case 168105 : return 31;
1254 case 168104 : return 30;
1255 case 168103 : return 29;
1256 case 168076 : return 28;
1257 case 168069 : return 27;
1258 case 168068 : return 26;
1259 case 168066 : return 25;
1260 case 167988 : return 24;
1261 case 167987 : return 23;
1262 case 167986 : return 22;
1263 case 167985 : return 21;
1264 case 167921 : return 20;
1265 case 167920 : return 19;
1266 case 167915 : return 18;
1267 case 167909 : return 17;
1268 case 167903 : return 16;
1269 case 167902 : return 15;
1270 case 167818 : return 14;
1271 case 167814 : return 13;
1272 case 167813 : return 12;
1273 case 167808 : return 11;
1274 case 167807 : return 10;
1275 case 167806 : return 9;
1276 case 167713 : return 8;
1277 case 167712 : return 7;
1278 case 167711 : return 6;
1279 case 167706 : return 5;
1280 case 167693 : return 4;
1281 case 166532 : return 3;
1282 case 166530 : return 2;
1283 case 166529 : return 1;
7bb82cc2 1284
1285 default : return 199;
cd0e5e33 1286 }
7bb82cc2 1287}
cd0e5e33 1288
7bb82cc2 1289//_______________________________________________________________________
1290void AliAnalysisTaskPi0V2::FillEPQA()
1291{
79ad78fd 1292 h2DcosV0A->Fill(fInterRunNumber, TMath::Cos(fEPV0A));
1293 h2DsinV0A->Fill(fInterRunNumber, TMath::Sin(fEPV0A));
1294 h2DcosV0C->Fill(fInterRunNumber, TMath::Cos(fEPV0C));
1295 h2DsinV0C->Fill(fInterRunNumber, TMath::Sin(fEPV0C));
af1defae 1296 if (fEPTPC!=-999.){
1297 h2DcosTPC->Fill(fInterRunNumber, TMath::Cos(fEPTPC));
1298 h2DsinTPC->Fill(fInterRunNumber, TMath::Sin(fEPTPC));
1299 }
79ad78fd 1300}
cd0e5e33 1301
79ad78fd 1302//_________________________________________________________________________________
cd0e5e33 1303void AliAnalysisTaskPi0V2::SetFlatteningData()
1304{
79ad78fd 1305 //Read objects with flattening parameters
1306 AliOADBContainer flatContainer("phosFlat");
1307 flatContainer.InitFromFile(fEPcalibFileName.Data(),"phosFlat");
1308 TObjArray *maps = (TObjArray*)flatContainer.GetObject(fRunNumber,"phosFlat");
cd0e5e33 1309 if (!maps) {
1310 AliError(Form("Can not read Flattening for run %d. \n From file >%s<\n",fRunNumber,fEPcalibFileName.Data())) ;
1311 } else {
79ad78fd 1312 AliInfo(Form("Setting PHOS flattening with name %s \n",maps->GetName())) ;
2fbb6418 1313 AliEPFlattener * h = (AliEPFlattener*)maps->At(0) ;
79ad78fd 1314 if(fTPCFlat) delete fTPCFlat ;
2fbb6418 1315 fTPCFlat = new AliEPFlattener();
79ad78fd 1316 fTPCFlat = h ;
2fbb6418 1317 h = (AliEPFlattener*)maps->At(1);
79ad78fd 1318 if(fV0AFlat) delete fV0AFlat ;
2fbb6418 1319 fV0AFlat = new AliEPFlattener();
79ad78fd 1320 fV0AFlat = h ;
2fbb6418 1321 h = (AliEPFlattener*)maps->At(2);
79ad78fd 1322 if(fV0CFlat) delete fV0CFlat ;
2fbb6418 1323 fV0CFlat = new AliEPFlattener();
cd0e5e33 1324 fV0CFlat = h;
79ad78fd 1325 }
79ad78fd 1326}
79ad78fd 1327
cd0e5e33 1328//____________________________________________________________________________
1329Double_t AliAnalysisTaskPi0V2::ApplyFlattening(Double_t phi, Double_t c)
1330{
79ad78fd 1331 if(fTPCFlat)
1332 return fTPCFlat->MakeFlat(phi,c);
cd0e5e33 1333 return phi;
79ad78fd 1334}
cd0e5e33 1335
79ad78fd 1336//____________________________________________________________________________
cd0e5e33 1337Double_t AliAnalysisTaskPi0V2::ApplyFlatteningV0A(Double_t phi, Double_t c)
1338{
79ad78fd 1339 if(fV0AFlat)
1340 return fV0AFlat->MakeFlat(phi,c);
cd0e5e33 1341 return phi;
79ad78fd 1342}
cd0e5e33 1343
79ad78fd 1344//____________________________________________________________________________
1345Double_t AliAnalysisTaskPi0V2::ApplyFlatteningV0C(Double_t phi, Double_t c){
1346
1347 if(fV0CFlat)
1348 return fV0CFlat->MakeFlat(phi,c);
cd0e5e33 1349 return phi;
7bb82cc2 1350}
cd0e5e33 1351
3c40321c 1352//________________________________________________________________________
1353void AliAnalysisTaskPi0V2::Terminate(Option_t *)
1354{
3c40321c 1355}