AliPhysics  9fe175b (9fe175b)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnaPi0Flow.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
7  * Permission to use, copy, modify and distribute this software and its *
8  * documentation strictly for non-commercial purposes is hereby granted *
9  * without fee, provided that the above copyright notice appears in all *
10  * copies and that both the copyright notice and this permission notice *
11  * appear in the supporting documentation. The authors make no claims *
12  * about the suitability of this software for any purpose. It is *
13  * provided "as is" without express or implied warranty. *
14  **************************************************************************/
15 
16 // --- ROOT system ---
17 #include "TH3.h"
18 #include "TH2F.h"
19 //#include "Riostream.h"
20 #include "TCanvas.h"
21 #include "TPad.h"
22 #include "TROOT.h"
23 #include "TClonesArray.h"
24 #include "TObjString.h"
25 #include "TDatabasePDG.h"
26 #include <TParticle.h>
27 #include <TRefArray.h>
28 #include <TCanvas.h>
29 #include <TChain.h>
30 #include <TFile.h>
31 #include <TH1I.h>
32 #include <TH1F.h>
33 #include <TH1D.h>
34 #include <TH2F.h>
35 #include <THnSparse.h>
36 #include <TList.h>
37 #include <TMath.h>
38 #include <TProfile.h>
39 #include <TRandom3.h>
40 #include <TVirtualFFT.h>
41 
42 
43 //---- AliRoot system ----
44 #include "AliAnaPi0Flow.h"
45 #include "AliCaloTrackReader.h"
46 #include "AliCaloPID.h"
47 #include "AliStack.h"
48 #include "AliFiducialCut.h"
49 #include "TParticle.h"
50 #include "AliVEvent.h"
51 #include "AliESDCaloCluster.h"
52 #include "AliESDEvent.h"
53 #include "AliAODEvent.h"
55 #include "AliMixedEvent.h"
56 #include "AliAODMCParticle.h"
57 
58 #include "AliAnalysisTaskSE.h"
59 #include "AliRunLoader.h"
60 #include "AliAnalysisManager.h"
61 #include "AliAnalysisTask.h"
62 #include "AliStack.h"
63 #include "AliEMCALGeometry.h"
64 #include "AliEPFlattener.h"
65 #include "AliESDEvent.h"
66 #include "AliESDVertex.h"
67 #include "AliESDCaloCells.h"
68 #include "AliESDCaloCluster.h"
69 #include "AliESDEvent.h"
70 #include "AliESDHeader.h"
71 #include "AliESDInputHandler.h"
72 #include "AliESDtrack.h"
73 #include "AliKFParticle.h"
74 #include "AliAODEvent.h"
75 #include "AliVCluster.h"
76 #include "AliCentrality.h"
77 #include "AliEventplane.h"
78 #include "AliOADBContainer.h"
79 
80 // --- Detectors ---
81 #include "AliPHOSGeoUtils.h"
82 #include "AliEMCALGeometry.h"
83 
84 #include <iostream>
85 
86 using std::cout;
87 using std::endl;
88 
91 
92 //
93 // Constructor
94 //
96 
97 isPhosCali(0), isCentFlat(0),
98 fInputEvent(0x0), fEventPlane(0x0), fCentrality(-999.), fRunNumber(0), fInternalRunNum(0), fFlatContainer(0x0),
99 
100 fTPCFlat(0x0), fV0AFlat(0x0), fV0CFlat(0x0),
101 fEPTPC(-999.), fEPTPCResolution(0.),
102 fEPV0(-999.), fEPV0A(-999.), fEPV0C(-999.),
103 fEPV0AR(-999.), fEPV0CR(-999.), fEPV0R(-999.),
104 fEPV0AR4(-999.), fEPV0AR5(-999.), fEPV0AR6(-999.), fEPV0AR7(-999.),
105 fEPV0CR0(-999.), fEPV0CR1(-999.), fEPV0CR2(-999.), fEPV0CR3(-999.),
106 
107 fHistStatCentrality(0), fHistStatCentralityCorrected(0), fHistStatRunNum(0),
108 
109 fHistEPTPC(0), fHistEPTPCResolution(0),
110 fHistEPV0(0), fHistEPV0A(0), fHistEPV0C(0),
111 fHistEPV0AR(0), fHistEPV0CR(0), fHistEPV0R(0),
112 fHistEPV0AR4(0), fHistEPV0AR7(0), fHistEPV0CR0(0), fHistEPV0CR3(0),
113 fHistEPTPCFlatten(0), fHistEPV0AFlatten(0), fHistEPV0CFlatten(0),
114 fHistEPDiffV0A_V0CR0(0), fHistEPDiffV0A_V0CR3(0), fHistEPDiffV0CR0_V0CR3(0),
115 fHistEPDiffV0C_V0AR4(0), fHistEPDiffV0C_V0AR7(0), fHistEPDiffV0AR4_V0AR7(0), fHistEPDiffV0AR_V0CR(0),
116 fHistEPRBRCosV0A(0), fHistEPRBRSinV0A(0), fHistEPRBRCosV0C(0), fHistEPRBRSinV0C(0), fHistEPRBRCosTPC(0), fHistEPRBRSinTPC(0),
117 fHistClusterEtaPhi(0), fHistClusterEN(0), fHistClusterEtN(0), fHistClusterEM02(0), fHistClusterEtM02(0),
118 
119 fDataV0(0), fDataV0A(0), fDataV0C(0), fDataTPC(0)
120 {
121  InitParameters();
122 }
123 
124 
126 {}
127 
128 //
129 // Initialize parameters
130 //
132 {
133  SetInputAODName("AliAODPWG4Particle");
134  AddToHistogramsName("AnaPi0Flow_");
135 
136  fFlatContainer = new AliOADBContainer("phosFlat");
137  fFlatContainer->InitFromFile("$ALICE_PHYSICS/OADB/PHOS/PHOSflat.root", "phosFlat");
138 }
139 
140 //
141 // Add cuts (needed by AliAnaCaloTrackCorrMaker)
142 //
143 TObjString* AliAnaPi0Flow::GetAnalysisCuts()
144 {
145  TString parList ; //this will be list of parameters used for this analysis.
146 
147  //Get parameters set in base class.
148  parList += GetBaseParametersList() ;
149 
150  return new TObjString(parList) ;
151 }
152 
153 //
154 // Create output (needed by AliAnaCaloTrackCorrMaker)
155 //
157 {
158  TList * outputList = new TList() ;
159  outputList->SetName(GetName());
160 
161  //
162  // statistics
163  //
164  fHistStatRunNum = new TH1I("fHistStatRunNum", "", 45, 0, 45);
165  outputList->Add(fHistStatRunNum);
166 
167  fHistStatCentrality = new TH1D("fHistStatCentrality", "", 200, 0, 100);
168  outputList->Add(fHistStatCentrality);
169 
170  fHistStatCentralityCorrected = new TH1D("fHistStatCentralityCorrected", "", 200, 0, 100);
171  outputList->Add(fHistStatCentralityCorrected);
172 
173  //
174  // event plane
175  //
176  fHistEPTPC = new TH2F("fHistEPTPC","",100,0,100,100,0.0,TMath::Pi());
177  outputList->Add(fHistEPTPC);
178 
179  fHistEPTPCResolution = new TH2F("fHistEPTPCResolution","",100,0,100,100,0.0,1.0);
180  outputList->Add(fHistEPTPCResolution);
181 
182  fHistEPV0 = new TH2F("fHistEPV0","",100,0,100,100,0.0,TMath::Pi());
183  outputList->Add(fHistEPV0);
184 
185  fHistEPV0A = new TH2F("fHistEPV0A","",100,0,100,100,0.0,TMath::Pi());
186  outputList->Add(fHistEPV0A);
187 
188  fHistEPV0C = new TH2F("fHistEPV0C","",100,0,100,100,0.0,TMath::Pi());
189  outputList->Add(fHistEPV0C);
190 
191  fHistEPV0AR = new TH2F("fHistEPV0AR","",100,0,100,100,0.0,TMath::Pi());
192  outputList->Add(fHistEPV0AR);
193 
194  fHistEPV0CR = new TH2F("fHistEPV0CR","",100,0,100,100,0.0,TMath::Pi());
195  outputList->Add(fHistEPV0CR);
196 
197  fHistEPV0R = new TH2F("fHistEPV0R","",100,0,100,100,0.0,TMath::Pi());
198  outputList->Add(fHistEPV0R);
199 
200  fHistEPV0AR4 = new TH2F("fHistEPV0AR4","",100,0,100,100,0.0,TMath::Pi());
201  outputList->Add(fHistEPV0AR4);
202 
203  fHistEPV0AR7 = new TH2F("fHistEPV0AR7","",100,0,100,100,0.0,TMath::Pi());
204  outputList->Add(fHistEPV0AR7);
205 
206  fHistEPV0CR0 = new TH2F("fHistEPV0CR0","",100,0,100,100,0.0,TMath::Pi());
207  outputList->Add(fHistEPV0CR0);
208 
209  fHistEPV0CR3 = new TH2F("fHistEPV0CR3","",100,0,100,100,0.0,TMath::Pi());
210  outputList->Add(fHistEPV0CR3);
211 
212  fHistEPV0AFlatten = new TH2F("fHistEPV0AFlatten","",100,0,100,100,0.0,TMath::Pi());
213  outputList->Add(fHistEPV0AFlatten);
214 
215  fHistEPV0CFlatten = new TH2F("fHistEPV0CFlatten","",100,0,100,100,0.0,TMath::Pi());
216  outputList->Add(fHistEPV0CFlatten);
217 
218  fHistEPTPCFlatten = new TH2F("fHistEPTPFlatten","",100,0,100,100,0.0,TMath::Pi());
219  outputList->Add(fHistEPTPCFlatten);
220 
221  fHistEPDiffV0A_V0CR0 = new TH2F("fHistEPDiffV0A_V0CR0","",100,0,100,100,-1.0,1.0);
222  outputList->Add(fHistEPDiffV0A_V0CR0);
223 
224  fHistEPDiffV0A_V0CR3 = new TH2F("fHistEPDiffV0A_V0CR3","",100,0,100,100,-1.0,1.0);
225  outputList->Add(fHistEPDiffV0A_V0CR3);
226 
227  fHistEPDiffV0CR0_V0CR3 = new TH2F("fHistEPDiffV0CR0_V0CR3","",100,0,100,100,-1.0,1.0);
228  outputList->Add(fHistEPDiffV0CR0_V0CR3);
229 
230  fHistEPDiffV0C_V0AR4 = new TH2F("fHistEPDiffV0C_V0AR4","",100,0,100,100,-1.0,1.0);
231  outputList->Add(fHistEPDiffV0C_V0AR4);
232 
233  fHistEPDiffV0C_V0AR7 = new TH2F("fHistEPDiffV0C_V0AR7","",100,0,100,100,-1.0,1.0);
234  outputList->Add(fHistEPDiffV0C_V0AR7);
235 
236  fHistEPDiffV0AR4_V0AR7 = new TH2F("fHistEPDiffV0AR4_V0AR7","",100,0,100,100,-1.0,1.0);
237  outputList->Add(fHistEPDiffV0AR4_V0AR7);
238 
239  fHistEPDiffV0AR_V0CR = new TH2F("fHistEPDiffV0AR_V0CR","",100,0,100,100,-1.0,1.0);
240  outputList->Add(fHistEPDiffV0AR_V0CR);
241 
242  fHistEPRBRCosV0A = new TProfile("fHistEPRBRCosV0A","",45,0,45,-1.,1.);
243  outputList->Add(fHistEPRBRCosV0A);
244 
245  fHistEPRBRSinV0A = new TProfile("fHistEPRBRSinV0A","",45,0,45,-1.,1.);
246  outputList->Add(fHistEPRBRSinV0A);
247 
248  fHistEPRBRCosV0C = new TProfile("fHistEPRBRCosV0C","",45,0,45,-1.,1.);
249  outputList->Add(fHistEPRBRCosV0C);
250 
251  fHistEPRBRSinV0C = new TProfile("fHistEPRBRSinV0C","",45,0,45,-1.,1.);
252  outputList->Add(fHistEPRBRSinV0C);
253 
254  fHistEPRBRCosTPC = new TProfile("fHistEPRBRCosTPC","",45,0,45,-1.,1.);
255  outputList->Add(fHistEPRBRCosTPC);
256 
257  fHistEPRBRSinTPC = new TProfile("fHistEPRBRSinTPC","",45,0,45,-1.,1.);
258  outputList->Add(fHistEPRBRSinTPC);
259 
260  fHistClusterEtaPhi = new TH2F("fHistClusterEtaPhi","Cluster #eta vs #phi",100,-1.0,1.0,100,0.0,6.29);
261  fHistClusterEtaPhi->GetXaxis()->SetTitle("#eta"); fHistClusterEtaPhi->GetYaxis()->SetTitle("#phi [rad]");
262  outputList->Add(fHistClusterEtaPhi);
263 
264  fHistClusterEN = new TH2F("fHistClusterEN","N vs E",100,0.0,50.0,30,0.0,30.0);
265  fHistClusterEN->GetYaxis()->SetTitle("N"); fHistClusterEN->GetXaxis()->SetTitle("E [GeV]");
266  outputList->Add(fHistClusterEN);
267 
268  fHistClusterEtN = new TH2F("fHistClusterEtN","N vs Cluster E_{T}",100,0.0,50.0,30,0.0,30.0);
269  fHistClusterEtN->GetYaxis()->SetTitle("N"); fHistClusterEtN->GetXaxis()->SetTitle("E_{T} [GeV]");
270  outputList->Add(fHistClusterEtN);
271 
272  fHistClusterEM02 = new TH2F("fHistClusterEM02","Cluster E vs M02",500,0.0,50.0,100,0.0,10.0);
273  fHistClusterEM02->GetYaxis()->SetTitle("M02"); fHistClusterEM02->GetXaxis()->SetTitle("E [GeV]");
274  outputList->Add(fHistClusterEM02);
275 
276  fHistClusterEtM02 = new TH2F("fHistClusterEtM02","Cluster E_{T} vs M02",100,0.0,50.0,100,0.0,10.0);
277  fHistClusterEtM02->GetYaxis()->SetTitle("M02"); fHistClusterEtM02->GetXaxis()->SetTitle("E_{T} [GeV]");
278  outputList->Add(fHistClusterEtM02);
279 
280  // Et M02 Cent DeltaPhi Cos[2*DeltaPhi]
281  Int_t bins[5] = { 500, 500, 100, 100, 100};
282  Double_t min[5] = { 0.0, 0.0, 0, 0.0, -1.0};
283  Double_t max[5] = { 50.0, 10.0, 100, TMath::Pi(), 1.0};
284 
285  fDataV0 = new THnSparseF("fDataV0","",5,bins,min,max);
286  fDataV0->GetAxis(0)->SetTitle("E_{T} [GeV]"); fDataV0->GetAxis(1)->SetTitle("M02"); fDataV0->GetAxis(2)->SetTitle("Centrality");
287  fDataV0->GetAxis(3)->SetTitle("#Delta(#phi) [rad]"); fDataV0->GetAxis(4)->SetTitle("Cos[2*#Delta(#phi)]");
288  outputList->Add(fDataV0);
289 
290  fDataV0A = new THnSparseF("fDataV0A","",5,bins,min,max);
291  fDataV0A->GetAxis(0)->SetTitle("E_{T} [GeV]"); fDataV0A->GetAxis(1)->SetTitle("M02"); fDataV0A->GetAxis(2)->SetTitle("Centrality");
292  fDataV0A->GetAxis(3)->SetTitle("#Delta(#phi) [rad]"); fDataV0A->GetAxis(4)->SetTitle("Cos[2*#Delta(#phi)]");
293  outputList->Add(fDataV0A);
294 
295  fDataV0C = new THnSparseF("fDataV0C","",5,bins,min,max);
296  fDataV0C->GetAxis(0)->SetTitle("E_{T} [GeV]"); fDataV0C->GetAxis(1)->SetTitle("M02"); fDataV0C->GetAxis(2)->SetTitle("Centrality");
297  fDataV0C->GetAxis(3)->SetTitle("#Delta(#phi) [rad]"); fDataV0C->GetAxis(4)->SetTitle("Cos[2*#Delta(#phi)]");
298  outputList->Add(fDataV0C);
299 
300  fDataTPC = new THnSparseF("fDataTPC","",5,bins,min,max);
301  fDataTPC->GetAxis(0)->SetTitle("E_{T} [GeV]"); fDataTPC->GetAxis(1)->SetTitle("M02"); fDataTPC->GetAxis(2)->SetTitle("Centrality");
302  fDataTPC->GetAxis(3)->SetTitle("#Delta(#phi) [rad]"); fDataTPC->GetAxis(4)->SetTitle("Cos[2*#Delta(#phi)]");
303  outputList->Add(fDataTPC);
304 
305  return outputList;
306 }
307 
308 //
309 // Print (needed by AliAnaCaloTrackCorrMaker)
310 //
311 void AliAnaPi0Flow::Print(const Option_t * /*opt*/) const
312 {
313  printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
315  printf("------------------------------------------------------\n") ;
316 }
317 
318 //
319 // Main method (needed by AliAnaCaloTrackCorrMaker)
320 //
322 {
323  if (!GetInputAODBranch()) {
324  AliFatal(Form("ERROR: No input in AOD with name branch < %s >", GetInputAODName().Data()));
325  return;
326  }
327 
329  fEventPlane = fInputEvent->GetEventplane();
332  if (isCentFlat && !IsCentAccepted()) return;
334 
335  Int_t fRunNumber = fInputEvent->GetRunNumber();
336  fInternalRunNum = GetInternalRunNum(fRunNumber);
338 
339  TObjArray *maps = (TObjArray*)fFlatContainer->GetObject(fRunNumber,"phosFlat");
340  fTPCFlat = (AliEPFlattener*)maps->At(0);
341  fV0AFlat = (AliEPFlattener*)maps->At(1);
342  fV0CFlat = (AliEPFlattener*)maps->At(2);
343  if (fEventPlane) {
345  } else {
346  AliFatal("ERROR: Could not retrieve the Event Plane!");
347  return;
348  }
349 
350  //
351  // Get me some pions
352  //
353  Int_t naod = GetInputAODBranch()->GetEntriesFast();
354  if (naod == 0) {
355  AliDebug(1, "No cluster found in this event!");
356  return;
357  }
358 
359  for (Int_t i = 0; i < naod; ++i) {
360  AliAODPWG4Particle* c = (AliAODPWG4Particle*) (GetInputAODBranch()->At(i));
361 
362  Double_t E = c->E();
363  Double_t eta = c->Eta();
364  Double_t Et = E / TMath::CosH(eta);
365 // Double_t pt = c->Pt();
366  Double_t phi = c->Phi();
367  Double_t M02 = c->GetM02();
368  Double_t N = c->GetNCells();
369 
370  Double_t dphiV0 = TVector2::Phi_0_2pi(phi-fEPV0R); if(dphiV0>TMath::Pi()) {dphiV0-=TMath::Pi();} // ??
371  Double_t dphiV0A = TVector2::Phi_0_2pi(phi-fEPV0A); if(dphiV0A>TMath::Pi()) {dphiV0A-=TMath::Pi();}
372  Double_t dphiV0C = TVector2::Phi_0_2pi(phi-fEPV0C); if(dphiV0C>TMath::Pi()) {dphiV0C-=TMath::Pi();}
373  Double_t dphiTPC = TVector2::Phi_0_2pi(phi-fEPTPC); if(dphiTPC>TMath::Pi()) {dphiTPC-=TMath::Pi();}
374 
375  //
376  // Fill flow data
377  //
378  Double_t dataV0[5];
379  dataV0[0] = Et;
380  dataV0[1] = M02;
381  dataV0[2] = fCentrality;
382  dataV0[3] = dphiV0;
383  dataV0[4] = TMath::Cos(2.0*(dphiV0));
384  fDataV0->Fill(dataV0);
385 
386  Double_t dataV0A[5];
387  dataV0A[0] = Et;
388  dataV0A[1] = M02;
389  dataV0A[2] = fCentrality;
390  dataV0A[3] = dphiV0A;
391  dataV0A[4] = TMath::Cos(2.0*(dphiV0A));
392  fDataV0A->Fill(dataV0A);
393 
394  Double_t dataV0C[5];
395  dataV0C[0] = Et;
396  dataV0C[1] = M02;
397  dataV0C[2] = fCentrality;
398  dataV0C[3] = dphiV0C;
399  dataV0C[4] = TMath::Cos(2.0*(dphiV0C));
400  fDataV0C->Fill(dataV0C);
401 
402  Double_t dataTPC[5];
403  dataTPC[0] = Et;
404  dataTPC[1] = M02;
405  dataTPC[2] = fCentrality;
406  dataTPC[3] = dphiTPC;
407  dataTPC[4] = TMath::Cos(2.0*(dphiTPC));
408  fDataTPC->Fill(dataTPC);
409 
410  //
411  // Fill some QA hists
412  //
413  fHistClusterEtaPhi->Fill(eta,phi);
414  fHistClusterEN->Fill(E,N);
415  fHistClusterEtN->Fill(Et,N);
416  fHistClusterEM02->Fill(E,M02);
417  fHistClusterEtM02->Fill(Et,M02);
418  }
419 
420  AliDebug(1, "End fill histograms");
421 }
422 
423 //
424 // Flatten centrality
425 //
427 {
428  if (fCentrality<=10) { // 0-10%
429  Bool_t isGoodCent = kFALSE;
430  TRandom3 *rndm = new TRandom3(0);
431  Double_t Nrndm = rndm->Uniform(0.,1.);
432  Double_t rejectR[10] = {0.864235, 0.855794, 0.838345, 0.837401, 0.838991,
433  0.859132, 0.852702, 0.859955, 0.880277, 1};
434 
435  if (fCentrality<=1) {
436  if (Nrndm < rejectR[0]) isGoodCent = kTRUE;
437  } else if (1<fCentrality && fCentrality<=2) {
438  if (Nrndm < rejectR[1]) isGoodCent = kTRUE;
439  } else if (2<fCentrality && fCentrality<=3) {
440  if (Nrndm < rejectR[2]) isGoodCent = kTRUE;
441  } else if (3<fCentrality && fCentrality<=4) {
442  if (Nrndm < rejectR[3]) isGoodCent = kTRUE;
443  } else if (4<fCentrality && fCentrality<=5) {
444  if (Nrndm < rejectR[4]) isGoodCent = kTRUE;
445  } else if (5<fCentrality && fCentrality<=6) {
446  if (Nrndm < rejectR[5]) isGoodCent = kTRUE;
447  } else if (6<fCentrality && fCentrality<=7) {
448  if (Nrndm < rejectR[6]) isGoodCent = kTRUE;
449  } else if (7<fCentrality && fCentrality<=8) {
450  if (Nrndm < rejectR[7]) isGoodCent = kTRUE;
451  } else if (8<fCentrality && fCentrality<=9) {
452  if (Nrndm < rejectR[8]) isGoodCent = kTRUE;
453  } else if (9<fCentrality && fCentrality<=10) {
454  if (Nrndm < rejectR[9]) isGoodCent = kTRUE;
455  }
456 
457  delete rndm; rndm = NULL;
458  return isGoodCent;
459  } else if (10<fCentrality && fCentrality<=50) { // 10-50%
460  TString centfired;
461  centfired = fInputEvent->GetFiredTriggerClasses();
462  if (!centfired.Contains("CVLN_B2-B-NOPF-ALLNOTRD") &&
463  !centfired.Contains("CVLN_R1-B-NOPF-ALLNOTRD") &&
464  !centfired.Contains("CSEMI_R1-B-NOPF-ALLNOTRD")) return kFALSE;
465  else return kTRUE;
466  } else return kTRUE; // other%
467 
468  return kFALSE;
469 }
470 
471 //
472 // Internal run number
473 //
474 Int_t AliAnaPi0Flow::GetInternalRunNum(Int_t runnumber)
475 { // LHC11h_AOD_145, train runlist listPCMgood+VaryingVoltages (no phi cut)
476  Int_t stdRunNum[45] = {167987, 167988, 168310, 168311, 168322, 168325, 168341, 168342, 168361, 168362,
477  168458, 168460, 168464, 168467, 168511, 168512, 168514, 168777, 168826, 168984,
478  168988, 168992, 169035, 169091, 169094, 169138, 169143, 169144, 169145, 169148,
479  169156, 169160, 169167, 169238, 169411, 169415, 169417, 169835, 169837, 169846,
480  169855, 169858, 169859, 169923, 169965};
481 
482  for (int i = 0; i < 45; ++i) {
483  if (i%10==0) fHistStatRunNum->GetXaxis()->SetBinLabel(i+1, Form("%i",stdRunNum[i]));
484  if (runnumber==stdRunNum[i]) return i;
485  }
486 
487  return -1;
488 }
489 
490 
491 //
492 // Get different event planes, flatten them, and fill some QA plots
493 //
494 void AliAnaPi0Flow::GetVZEROEventPlane(Bool_t flattenEP)
495 { // Calculate the V0 Event Plane
496  if (fEventPlane->GetQVector()) {
497  // fEPTPC = TVector2::Phi_0_2pi(fEventPlane->GetQVector()->Phi())/2.0; //if(fEPTPC>TMath::Pi()) {fEPTPC-=TMath::Pi();}
498  fEPTPC = fEventPlane->GetEventplane("Q");
499  } else fEPTPC = -999;
500 
501  if (fEventPlane->GetQsub1() && fEventPlane->GetQsub2()) {
502  // fEPTPCResolution = TMath::Cos(2.0*(fEventPlane->GetQsub1()->Phi()/2.0-fEventPlane->GetQsub2()->Phi()/2.0));
503  fEPTPCResolution = TMath::Cos(2.*(fEventPlane->GetQsubRes()));
504  } else fEPTPCResolution = -1;
505 
506  fEPV0 = TVector2::Phi_0_2pi(fEventPlane->GetEventplane("V0", fInputEvent)); if (fEPV0>TMath::Pi()) fEPV0-=TMath::Pi();
507  fEPV0A = TVector2::Phi_0_2pi(fEventPlane->GetEventplane("V0A", fInputEvent)); if (fEPV0A>TMath::Pi()) fEPV0A-=TMath::Pi();
508  fEPV0C = TVector2::Phi_0_2pi(fEventPlane->GetEventplane("V0C", fInputEvent)); if (fEPV0C>TMath::Pi()) fEPV0C-=TMath::Pi();
509 
510  Double_t qx=0, qy=0, qxr=0, qyr=0;
511  fEPV0AR = TVector2::Phi_0_2pi(fEventPlane->CalculateVZEROEventPlane(fInputEvent, 4, 5, 2, qxr, qyr)); if (fEPV0AR>TMath::Pi()) fEPV0AR-=TMath::Pi();
512  fEPV0CR = TVector2::Phi_0_2pi(fEventPlane->CalculateVZEROEventPlane(fInputEvent, 2, 3, 2, qx, qy)); if (fEPV0CR>TMath::Pi()) fEPV0CR-=TMath::Pi();
513  qxr += qx; qyr += qy;
514  fEPV0R = TVector2::Phi_0_2pi(TMath::ATan2(qyr,qxr))/2.0; // equals to ring 2-5
515  fEPV0AR4 = TVector2::Phi_0_2pi(fEventPlane->CalculateVZEROEventPlane(fInputEvent, 4, 2, qx, qy)); if (fEPV0AR4>TMath::Pi()) fEPV0AR4-=TMath::Pi();
516  fEPV0AR5 = TVector2::Phi_0_2pi(fEventPlane->CalculateVZEROEventPlane(fInputEvent, 5, 2, qx, qy)); if (fEPV0AR5>TMath::Pi()) fEPV0AR5-=TMath::Pi();
517  fEPV0AR6 = TVector2::Phi_0_2pi(fEventPlane->CalculateVZEROEventPlane(fInputEvent, 6, 2, qx, qy)); if (fEPV0AR6>TMath::Pi()) fEPV0AR6-=TMath::Pi();
518  fEPV0AR7 = TVector2::Phi_0_2pi(fEventPlane->CalculateVZEROEventPlane(fInputEvent, 7, 2, qx, qy)); if (fEPV0AR7>TMath::Pi()) fEPV0AR7-=TMath::Pi();
519  fEPV0CR0 = TVector2::Phi_0_2pi(fEventPlane->CalculateVZEROEventPlane(fInputEvent, 0, 2, qx, qy)); if (fEPV0CR0>TMath::Pi()) fEPV0CR0-=TMath::Pi();
520  fEPV0CR1 = TVector2::Phi_0_2pi(fEventPlane->CalculateVZEROEventPlane(fInputEvent, 1, 2, qx, qy)); if (fEPV0CR1>TMath::Pi()) fEPV0CR1-=TMath::Pi();
521  fEPV0CR2 = TVector2::Phi_0_2pi(fEventPlane->CalculateVZEROEventPlane(fInputEvent, 2, 2, qx, qy)); if (fEPV0CR2>TMath::Pi()) fEPV0CR2-=TMath::Pi();
522  fEPV0CR3 = TVector2::Phi_0_2pi(fEventPlane->CalculateVZEROEventPlane(fInputEvent, 3, 2, qx, qy)); if (fEPV0CR3>TMath::Pi()) fEPV0CR3-=TMath::Pi();
523 
524  fHistEPTPC->Fill(fCentrality, fEPTPC);
526  fHistEPV0->Fill(fCentrality, fEPV0);
527  fHistEPV0A->Fill(fCentrality, fEPV0A);
528  fHistEPV0C->Fill(fCentrality, fEPV0C);
531  fHistEPV0R->Fill(fCentrality, fEPV0R);
536 
537  if (flattenEP) {
541  while (fEPV0A<0.) fEPV0A+=TMath::Pi(); while (fEPV0A>TMath::Pi()) fEPV0A-=TMath::Pi();
542  while (fEPV0C<0.) fEPV0C+=TMath::Pi(); while (fEPV0C>TMath::Pi()) fEPV0C-=TMath::Pi();
543  while (fEPTPC<0.) fEPTPC+=TMath::Pi(); while (fEPTPC>TMath::Pi()) fEPTPC-=TMath::Pi();
544 
548  }
549 
550  fHistEPDiffV0A_V0CR0->Fill(fCentrality, TMath::Cos(2.0*(fEPV0A - fEPV0CR0)));
551  fHistEPDiffV0A_V0CR3->Fill(fCentrality, TMath::Cos(2.0*(fEPV0A - fEPV0CR3)));
552  fHistEPDiffV0CR0_V0CR3->Fill(fCentrality, TMath::Cos(2.0*(fEPV0CR0 - fEPV0CR3)));
553  fHistEPDiffV0C_V0AR4->Fill(fCentrality, TMath::Cos(2.0*(fEPV0C - fEPV0AR4)));
554  fHistEPDiffV0C_V0AR7->Fill(fCentrality, TMath::Cos(2.0*(fEPV0C - fEPV0AR7)));
555  fHistEPDiffV0AR4_V0AR7->Fill(fCentrality, TMath::Cos(2.0*(fEPV0AR4 - fEPV0AR7)));
556  fHistEPDiffV0AR_V0CR->Fill(fCentrality, TMath::Cos(2.0*(fEPV0AR - fEPV0CR)));
557 
558  // run-by-run QA
559  fHistEPRBRCosV0A->Fill(fInternalRunNum, TMath::Cos(2*fEPV0A));
560  fHistEPRBRSinV0A->Fill(fInternalRunNum, TMath::Sin(2*fEPV0A));
561  fHistEPRBRCosV0C->Fill(fInternalRunNum, TMath::Cos(2*fEPV0C));
562  fHistEPRBRSinV0C->Fill(fInternalRunNum, TMath::Sin(2*fEPV0C));
563  fHistEPRBRCosTPC->Fill(fInternalRunNum, TMath::Cos(2*fEPTPC));
564  fHistEPRBRSinTPC->Fill(fInternalRunNum, TMath::Sin(2*fEPTPC));
565 }
566 
567 Double_t AliAnaPi0Flow::ApplyFlatteningV0A(Double_t phi, Double_t c)
568 {
569  if (fV0AFlat) return fV0AFlat->MakeFlat(phi,c);
570  return phi;
571 }
572 
573 Double_t AliAnaPi0Flow::ApplyFlatteningV0C(Double_t phi, Double_t c)
574 {
575  if (fV0CFlat) return fV0CFlat->MakeFlat(phi,c);
576  return phi;
577 }
578 
579 Double_t AliAnaPi0Flow::ApplyFlatteningTPC(Double_t phi, Double_t c)
580 {
581  if (fTPCFlat) return fTPCFlat->MakeFlat(phi,c);
582  return phi;
583 }
584 
TH2F * fHistClusterEM02
Double_t fEPTPC
Definition: AliAnaPi0Flow.h:67
virtual void AddToHistogramsName(TString add)
Double_t fEPV0AR
Definition: AliAnaPi0Flow.h:72
void MakeAnalysisFillHistograms()
AliEPFlattener * fV0CFlat
Definition: AliAnaPi0Flow.h:66
Double_t fEPTPCResolution
Definition: AliAnaPi0Flow.h:68
TH2F * fHistEPDiffV0C_V0AR4
TH2F * fHistEPDiffV0C_V0AR7
TH2F * fHistEPDiffV0AR4_V0AR7
TH2F * fHistEPV0R
Definition: AliAnaPi0Flow.h:97
Double_t fEPV0AR6
Definition: AliAnaPi0Flow.h:77
TH2F * fHistEPV0CR
Definition: AliAnaPi0Flow.h:96
TH1D * fHistStatCentrality
Definition: AliAnaPi0Flow.h:87
virtual AliVEvent * GetInputEvent() const
virtual void SetInputAODName(TString name)
Bool_t isCentFlat
Definition: AliAnaPi0Flow.h:55
TH2F * fHistEPTPC
Definition: AliAnaPi0Flow.h:90
void InitParameters()
Initialize the parameters of the analysis with default values.
TH2F * fHistEPV0CR0
Double_t fEPV0AR5
Definition: AliAnaPi0Flow.h:76
THnSparse * fDataV0C
TH1I * fHistStatRunNum
Definition: AliAnaPi0Flow.h:89
THnSparse * fDataV0
AliOADBContainer * fFlatContainer
Definition: AliAnaPi0Flow.h:62
Double_t fEPV0CR0
Definition: AliAnaPi0Flow.h:79
TH1D * fHistStatCentralityCorrected
Definition: AliAnaPi0Flow.h:88
void Print(const Option_t *opt) const
Print some relevant parameters set for the analysis.
Base class for CaloTrackCorr analysis algorithms.
TH2F * fHistClusterEN
AliEPFlattener * fV0AFlat
Definition: AliAnaPi0Flow.h:65
void GetVZEROEventPlane(Bool_t isFlatten)
TH2F * fHistEPV0A
Definition: AliAnaPi0Flow.h:93
virtual TClonesArray * GetInputAODBranch() const
Int_t GetInternalRunNum(Int_t runnumber)
Double_t fEPV0A
Definition: AliAnaPi0Flow.h:70
Double_t fCentrality
Definition: AliAnaPi0Flow.h:59
Double_t fEPV0R
Definition: AliAnaPi0Flow.h:74
Double_t fEPV0AR4
Definition: AliAnaPi0Flow.h:75
Double_t fEPV0
Definition: AliAnaPi0Flow.h:69
AliEPFlattener * fTPCFlat
Definition: AliAnaPi0Flow.h:64
THnSparse * fDataV0A
TH2F * fHistEPV0
Definition: AliAnaPi0Flow.h:92
Bool_t isPhosCali
Definition: AliAnaPi0Flow.h:54
TProfile * fHistEPRBRSinV0A
AliEventplane * fEventPlane
Definition: AliAnaPi0Flow.h:58
Double_t ApplyFlatteningV0A(Double_t phi, Double_t c)
Bool_t Data(TH1F *h, Double_t *rangefit, Bool_t writefit, Double_t &sgn, Double_t &errsgn, Double_t &bkg, Double_t &errbkg, Double_t &sgnf, Double_t &errsgnf, Double_t &sigmafit, Int_t &status)
Int_t fInternalRunNum
Definition: AliAnaPi0Flow.h:61
TProfile * fHistEPRBRSinTPC
TH2F * fHistEPV0C
Definition: AliAnaPi0Flow.h:94
THnSparse * fDataTPC
Double_t fEPV0C
Definition: AliAnaPi0Flow.h:71
TH2F * fHistClusterEtN
TProfile * fHistEPRBRCosV0C
void InitParameters()
Initialize the parameters of the analysis.
TH2F * fHistEPDiffV0A_V0CR0
Double_t fEPV0CR
Definition: AliAnaPi0Flow.h:73
virtual ~AliAnaPi0Flow()
Double_t fEPV0AR7
Definition: AliAnaPi0Flow.h:78
Double_t ApplyFlatteningTPC(Double_t phi, Double_t c)
Double_t ApplyFlatteningV0C(Double_t phi, Double_t c)
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
TObjString * GetAnalysisCuts()
TProfile * fHistEPRBRCosV0A
AliVEvent * fInputEvent
Definition: AliAnaPi0Flow.h:57
Double_t fEPV0CR1
Definition: AliAnaPi0Flow.h:80
TH2F * fHistClusterEtaPhi
virtual void Print(const Option_t *) const
Print some relevant parameters set for the analysis.
TH2F * fHistEPV0CR3
TProfile * fHistEPRBRCosTPC
TH2F * fHistEPDiffV0AR_V0CR
Double_t fEPV0CR3
Definition: AliAnaPi0Flow.h:82
TH2F * fHistEPDiffV0A_V0CR3
TH2F * fHistEPV0AR
Definition: AliAnaPi0Flow.h:95
Bool_t IsCentAccepted()
TProfile * fHistEPRBRSinV0C
virtual AliCaloTrackReader * GetReader() const
TH2F * fHistEPTPCFlatten
TH2F * fHistClusterEtM02
TList * GetCreateOutputObjects()
Double_t fEPV0CR2
Definition: AliAnaPi0Flow.h:81
TH2F * fHistEPV0AR7
Definition: AliAnaPi0Flow.h:99
TH2F * fHistEPV0AR4
Definition: AliAnaPi0Flow.h:98
TH2F * fHistEPV0CFlatten
TH2F * fHistEPV0AFlatten
TH2F * fHistEPTPCResolution
Definition: AliAnaPi0Flow.h:91
TH2F * fHistEPDiffV0CR0_V0CR3