]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/SPECTRA/PiKaPr/TestAOD/AliAnalysisTaskV2AllChAOD.cxx
MC closure test
[u/mrichter/AliRoot.git] / PWGLF / SPECTRA / PiKaPr / TestAOD / AliAnalysisTaskV2AllChAOD.cxx
CommitLineData
10a99a07 1/**************************************************************************
2 * Copyright(c) 1998-2009, 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//-----------------------------------------------------------------
17// AliAnalysisTaskV2AllChAOD class
18//-----------------------------------------------------------------
19
20#include "TChain.h"
21#include "TTree.h"
22#include "TLegend.h"
23#include "TH1F.h"
d0761d58 24#include "TH1D.h"
10a99a07 25#include "TH2F.h"
26#include "THnSparse.h"
27#include "TProfile.h"
28#include "TCanvas.h"
29#include "AliAnalysisTask.h"
30#include "AliAODTrack.h"
31#include "AliAODMCParticle.h"
32#include "AliVParticle.h"
33#include "AliAODEvent.h"
34#include "AliAODInputHandler.h"
35#include "AliAnalysisTaskV2AllChAOD.h"
36#include "AliAnalysisTaskESDfilter.h"
37#include "AliAnalysisDataContainer.h"
38#include "AliSpectraAODTrackCuts.h"
39#include "AliSpectraAODEventCuts.h"
40#include "AliPIDCombined.h"
41#include "AliCentrality.h"
42#include "TProof.h"
43#include "AliVEvent.h"
44#include "AliStack.h"
45#include <TMCProcess.h>
bc9bd5b3 46#include <TRandom.h>
10a99a07 47
48#include <iostream>
49
50using namespace std;
51
52ClassImp(AliAnalysisTaskV2AllChAOD)
53
54//________________________________________________________________________
55AliAnalysisTaskV2AllChAOD::AliAnalysisTaskV2AllChAOD(const char *name) : AliAnalysisTaskSE(name),
56 fAOD(0x0),
57 fTrackCuts(0x0),
58 fEventCuts(0x0),
59 fIsMC(0),
60 fCharge(0),
61 fVZEROside(0),
62 fOutput(0x0),
63 fOutput_lq(0x0),
64 fOutput_sq(0x0),
65 fnCentBins(20),
66 fnQvecBins(100),
10a99a07 67 fQvecUpperLim(100),
68 fCutLargeQperc(90.),
69 fCutSmallQperc(10.),
70 fEtaGapMin(-0.5),
71 fEtaGapMax(0.5),
29fbaf8a 72 fTrkBit(128),
d64e71aa 73 fEtaCut(0.8),
74 fMinPt(0),
75 fMaxPt(20.0),
76 fMinTPCNcls(70),
30e20fad 77 fFillTHn(kFALSE),
29fbaf8a 78 fCentrality(0),
10a99a07 79 fResSP(0),
af960b8a 80 fResSP_vs_Cent(0),
81 f2partCumQA_vs_Cent(0),
82 f2partCumQB_vs_Cent(0),
bc76879c 83 fEta_vs_Phi_bef(0),
2ba0e068 84 fEta_vs_PhiA(0),
85 fEta_vs_PhiB(0),
10a99a07 86 fResSP_lq(0),
af960b8a 87 fResSP_vs_Cent_lq(0),
88 f2partCumQA_vs_Cent_lq(0),
89 f2partCumQB_vs_Cent_lq(0),
90 fResSP_sq(0),
af960b8a 91 fResSP_vs_Cent_sq(0),
92 f2partCumQA_vs_Cent_sq(0),
a7abb826 93 f2partCumQB_vs_Cent_sq(0),
29fbaf8a 94 fResSP_inclusive(0),
95 fv2SPGap1A_inclusive_mb(0),
96 fv2SPGap1B_inclusive_mb(0),
97 fv2SPGap1A_inclusive_lq(0),
98 fv2SPGap1B_inclusive_lq(0),
99 fv2SPGap1A_inclusive_sq(0),
100 fv2SPGap1B_inclusive_sq(0),
101 fResSPmc_inclusive(0),
102 fv2SPGap1Amc_inclusive_mb(0),
103 fv2SPGap1Bmc_inclusive_mb(0),
104 fv2SPGap1Amc_inclusive_lq(0),
105 fv2SPGap1Bmc_inclusive_lq(0),
106 fv2SPGap1Amc_inclusive_sq(0),
107 fv2SPGap1Bmc_inclusive_sq(0),
d0761d58 108 fIsRecoEff(0),
29fbaf8a 109 fRecoEffList(0),
110 fQvecGen(0)
10a99a07 111{
112
113 for (Int_t i = 0; i< 9; i++){
30e20fad 114
115 fResSP_vs_Qvec[i] = 0;
116
10a99a07 117 fv2SPGap1A[i] = 0;
10a99a07 118 fv2SPGap1B[i] = 0;
bc76879c 119
120 fSinGap1Aq[i] = 0;
121 fCosGap1Aq[i] = 0;
122 fSinGap1Bq[i] = 0;
123 fCosGap1Bq[i] = 0;
10a99a07 124
125 fSinGap1A[i] = 0;
126 fCosGap1A[i] = 0;
127 fSinGap1B[i] = 0;
128 fCosGap1B[i] = 0;
129
130 //large q
131 fv2SPGap1A_lq[i] = 0;
132 fv2SPGap1B_lq[i] = 0;
bc76879c 133
134 fSinGap1Aq_lq[i] = 0;
135 fCosGap1Aq_lq[i] = 0;
136 fSinGap1Bq_lq[i] = 0;
137 fCosGap1Bq_lq[i] = 0;
138
10a99a07 139 fSinGap1A_lq[i] = 0;
140 fCosGap1A_lq[i] = 0;
141 fSinGap1B_lq[i] = 0;
142 fCosGap1B_lq[i] = 0;
143
144 //small q
145 fv2SPGap1A_sq[i] = 0;
146 fv2SPGap1B_sq[i] = 0;
bc76879c 147
148 fSinGap1Aq_sq[i] = 0;
149 fCosGap1Aq_sq[i] = 0;
150 fSinGap1Bq_sq[i] = 0;
151 fCosGap1Bq_sq[i] = 0;
152
10a99a07 153 fSinGap1A_sq[i] = 0;
154 fCosGap1A_sq[i] = 0;
155 fSinGap1B_sq[i] = 0;
156 fCosGap1B_sq[i] = 0;
157
158 }
159
d0761d58 160 fRecoEffList=new TList();
161 fRecoEffList->SetOwner();
162 fRecoEffList->SetName("fRecoEffList");
163
10a99a07 164 // Default constructor
165 DefineInput(0, TChain::Class());
166 DefineOutput(1, TList::Class());
167 DefineOutput(2, AliSpectraAODEventCuts::Class());
168 DefineOutput(3, AliSpectraAODTrackCuts::Class());
169 DefineOutput(4, TList::Class());
170 DefineOutput(5, TList::Class());
171}
172
173//________________________________________________________________________
174void AliAnalysisTaskV2AllChAOD::UserCreateOutputObjects()
175{
176 // create output objects
177 fOutput=new TList();
178 fOutput->SetOwner();
179 fOutput->SetName("fOutput");
180
181 fOutput_lq=new TList();
182 fOutput_lq->SetOwner();
183 fOutput_lq->SetName("fOutput_lq");
184
185 fOutput_sq=new TList();
186 fOutput_sq->SetOwner();
187 fOutput_sq->SetName("fOutput_sq");
188
189 if (!fTrackCuts) AliFatal("Track Cuts should be set in the steering macro");
190 if (!fEventCuts) AliFatal("Event Cuts should be set in the steering macro");
191
962f3d11 192 if( fFillTHn ){
193 //dimensions of THnSparse for Q vector checks
af960b8a 194 const Int_t nvarev=5;
195 // cent Q vec Qa Qb res
196 Int_t binsHistRealEv[nvarev] = { fnCentBins, fnQvecBins, 100, 100, 100};
197 Double_t xminHistRealEv[nvarev] = { 0., 0., 0., 0., 0.};
198 Double_t xmaxHistRealEv[nvarev] = { 100., fQvecUpperLim, 10., 10., 1.};
962f3d11 199 THnSparseF* NSparseHistEv = new THnSparseF("NSparseHistEv","NSparseHistEv",nvarev,binsHistRealEv,xminHistRealEv,xmaxHistRealEv);
200 NSparseHistEv->GetAxis(0)->SetTitle(Form("%s cent",fEventCuts->GetCentralityMethod().Data()));
201 NSparseHistEv->GetAxis(0)->SetName(Form("%s_cent",fEventCuts->GetCentralityMethod().Data()));
202 NSparseHistEv->GetAxis(1)->SetTitle("Q vec");
203 NSparseHistEv->GetAxis(1)->SetName("Q_vec");
204 NSparseHistEv->GetAxis(2)->SetTitle("Q_vec (A)");
205 NSparseHistEv->GetAxis(2)->SetName("Qvec_A");
206 NSparseHistEv->GetAxis(3)->SetTitle("Q_vec (B)");
207 NSparseHistEv->GetAxis(3)->SetName("Qvec_B");
af960b8a 208 NSparseHistEv->GetAxis(4)->SetTitle("resolution");
209 NSparseHistEv->GetAxis(4)->SetName("res");
962f3d11 210 fOutput->Add(NSparseHistEv);
211 }
212
29fbaf8a 213 fCentrality = new TH1D("fCentrality", "centrality distribution; centrality", 200, 0., 100);
214 fOutput->Add(fCentrality);
215
10a99a07 216 // binning common to all the THn
217 //change it according to your needs + move it to global variables -> setter/getter
218// Double_t ptBins[] = {0., 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.4, 2.8, 3.2, 3.6, 4.0, 4.5, 5.0, 5.5, 6.0, 7.0, 8.0, 9.0, 10.0, 12.0, 14.0, 16.0, 20.0};
219// const Int_t nptBins = 31;
220 Double_t ptBins[] = {0., 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.2, 2.4, 2.6, 3.0, 3.4, 3.8, 4.2, 4.6, 5.0, 5.5, 6.0, 7.0, 8.0, 9.0, 10.0, 12.0, 14.0, 16.0, 20.0};
221 const Int_t nptBins = 33;
222
10a99a07 223 fResSP = new TProfile("fResSP", "Resolution; centrality; Resolution", 9, -0.5, 8.5);
224 fOutput->Add(fResSP);
225
30e20fad 226 fResSP_vs_Cent = new TProfile("fResSP_vs_Cent", "Resolution; centrality; Resolution", 20., 0., 100.);
af960b8a 227 fOutput->Add(fResSP_vs_Cent);
228
30e20fad 229 f2partCumQA_vs_Cent = new TProfile("f2partCumQA_vs_Cent", "Resolution; centrality; Resolution", 100., 0., 100.);
af960b8a 230 fOutput->Add(f2partCumQA_vs_Cent);
231
30e20fad 232 f2partCumQB_vs_Cent = new TProfile("f2partCumQB_vs_Cent", "Resolution; centrality; Resolution", 100., 0., 100.);
af960b8a 233 fOutput->Add(f2partCumQB_vs_Cent);
234
30e20fad 235 fEta_vs_Phi_bef = new TH2D("fEta_vs_Phi_bef","eta vs phi distribution before eta gap;#eta;#phi",200.,-1.,1.,175.,0.,7.);
bc76879c 236 fOutput->Add(fEta_vs_Phi_bef);
d64e71aa 237
30e20fad 238 fEta_vs_PhiA = new TH2D("fEta_vs_PhiA","eta vs phi distribution;#eta;#phi",200.,-1.,1.,175.,0.,7.);
2ba0e068 239 fOutput->Add(fEta_vs_PhiA);
240
30e20fad 241 fEta_vs_PhiB = new TH2D("fEta_vs_PhiB","eta vs phi distribution;#eta;#phi",200.,-1.,1.,175.,0.,7.);
2ba0e068 242 fOutput->Add(fEta_vs_PhiB);
d64e71aa 243
29fbaf8a 244 // MC closure test
245 fResSP_inclusive = new TProfile("fResSP_inclusive", "Resolution; ese; Resolution", 3, 0., 3.);
246 fOutput->Add(fResSP_inclusive);
a7abb826 247
29fbaf8a 248 fv2SPGap1A_inclusive_mb = new TProfile("fv2SPGap1A_inclusive_mb", "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins);
249 fOutput->Add(fv2SPGap1A_inclusive_mb);
250
251 fv2SPGap1B_inclusive_mb = new TProfile("fv2SPGap1B_inclusive_mb", "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins);
252 fOutput->Add(fv2SPGap1B_inclusive_mb);
253
254
255 //large q
10a99a07 256 fResSP_lq = new TProfile("fResSP_lq", "Resolution; centrality; Resolution", 9, -0.5, 8.5);
257 fOutput_lq->Add(fResSP_lq);
258
30e20fad 259 fResSP_vs_Cent_lq = new TProfile("fResSP_vs_Cent_lq", "Resolution; centrality; Resolution", 20., 0., 100.);
af960b8a 260 fOutput_lq->Add(fResSP_vs_Cent_lq);
261
30e20fad 262 f2partCumQA_vs_Cent_lq = new TProfile("f2partCumQA_vs_Cent_lq", "Resolution; centrality; Resolution", 100., 0., 100.);
af960b8a 263 fOutput_lq->Add(f2partCumQA_vs_Cent_lq);
264
30e20fad 265 f2partCumQB_vs_Cent_lq = new TProfile("f2partCumQB_vs_Cent_lq", "Resolution; centrality; Resolution", 100., 0., 100.);
af960b8a 266 fOutput_lq->Add(f2partCumQB_vs_Cent_lq);
29fbaf8a 267
268 // MC closure test
269 fv2SPGap1A_inclusive_lq = new TProfile("fv2SPGap1A_inclusive_lq", "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins);
270 fOutput_lq->Add(fv2SPGap1A_inclusive_lq);
271
272 fv2SPGap1B_inclusive_lq = new TProfile("fv2SPGap1B_inclusive_lq", "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins);
273 fOutput_lq->Add(fv2SPGap1B_inclusive_lq);
af960b8a 274
10a99a07 275 //small q resolution
276 fResSP_sq = new TProfile("fResSP_sq", "Resolution; centrality; Resolution", 9, -0.5, 8.5);
277 fOutput_sq->Add(fResSP_sq);
af960b8a 278
30e20fad 279 fResSP_vs_Cent_sq = new TProfile("fResSP_vs_Cent_sq", "Resolution; centrality; Resolution", 20., 0., 100.);
af960b8a 280 fOutput_sq->Add(fResSP_vs_Cent_sq);
281
30e20fad 282 f2partCumQA_vs_Cent_sq = new TProfile("f2partCumQA_vs_Cent_sq", "Resolution; centrality; Resolution", 100., 0., 100.);
af960b8a 283 fOutput_sq->Add(f2partCumQA_vs_Cent_sq);
284
30e20fad 285 f2partCumQB_vs_Cent_sq = new TProfile("f2partCumQB_vs_Cent_sq", "Resolution; centrality; Resolution", 100., 0., 100.);
af960b8a 286 fOutput_sq->Add(f2partCumQB_vs_Cent_sq);
29fbaf8a 287
288 // MC closure test
289 fv2SPGap1A_inclusive_sq = new TProfile("fv2SPGap1A_inclusive_sq", "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins);
290 fOutput_sq->Add(fv2SPGap1A_inclusive_sq);
291
292 fv2SPGap1B_inclusive_sq = new TProfile("fv2SPGap1B_inclusive_sq", "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins);
293 fOutput_sq->Add(fv2SPGap1B_inclusive_sq);
d64e71aa 294
10a99a07 295 for (Int_t iC = 0; iC < 9; iC++){
30e20fad 296
297 fResSP_vs_Qvec[iC] = new TProfile(Form("fResSP_vs_Qvec_%d", iC), "Resolution; Qvec (V0A); Resolution", 10., 0., 100.);
298 fOutput->Add(fResSP_vs_Qvec[iC]);
10a99a07 299
300 fv2SPGap1A[iC] = new TProfile(Form("fv2SPGap1A_%d", iC), "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins);
301 fOutput->Add(fv2SPGap1A[iC]);
302
10a99a07 303 fv2SPGap1B[iC] = new TProfile(Form("fv2SPGap1B_%d", iC), "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins);
304 fOutput->Add(fv2SPGap1B[iC]);
305
bc76879c 306 fSinGap1Aq[iC] = new TProfile(Form("fSinGap1Aq_%d", iC), ";p_{T} (GeV/c);#LT sin(2*#phi) #GT", nptBins, ptBins);
307 fOutput->Add(fSinGap1Aq[iC]);
10a99a07 308
bc76879c 309 fCosGap1Aq[iC] = new TProfile(Form("fCosGap1Aq_%d", iC), ";p_{T} (GeV/c);#LT cos(2*#phi) #GT", nptBins, ptBins);
310 fOutput->Add(fCosGap1Aq[iC]);
311
312 fSinGap1Bq[iC] = new TProfile(Form("fSinGap1Bq_%d", iC), ";p_{T} (GeV/c);#LT sin(2*#phi) #GT", nptBins, ptBins);
313 fOutput->Add(fSinGap1Bq[iC]);
314
315 fCosGap1Bq[iC] = new TProfile(Form("fCosGap1Bq_%d", iC), ";p_{T} (GeV/c);#LT cos(2*#phi) #GT", nptBins, ptBins);
316 fOutput->Add(fCosGap1Bq[iC]);
317
10a99a07 318 fSinGap1A[iC] = new TProfile(Form("fSinGap1A_%d", iC), ";p_{T} (GeV/c);#LT sin(2*#phi) #GT", nptBins, ptBins);
319 fOutput->Add(fSinGap1A[iC]);
320
321 fCosGap1A[iC] = new TProfile(Form("fCosGap1A_%d", iC), ";p_{T} (GeV/c);#LT cos(2*#phi) #GT", nptBins, ptBins);
322 fOutput->Add(fCosGap1A[iC]);
323
324 fSinGap1B[iC] = new TProfile(Form("fSinGap1B_%d", iC), ";p_{T} (GeV/c);#LT sin(2*#phi) #GT", nptBins, ptBins);
325 fOutput->Add(fSinGap1B[iC]);
326
327 fCosGap1B[iC] = new TProfile(Form("fCosGap1B_%d", iC), ";p_{T} (GeV/c);#LT cos(2*#phi) #GT", nptBins, ptBins);
328 fOutput->Add(fCosGap1B[iC]);
329
330 //large q
331 fv2SPGap1A_lq[iC] = new TProfile(Form("fv2SPGap1A_lq_%d", iC), "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins);
332 fOutput_lq->Add(fv2SPGap1A_lq[iC]);
333
334 fv2SPGap1B_lq[iC] = new TProfile(Form("fv2SPGap1B_lq_%d", iC), "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins);
335 fOutput_lq->Add(fv2SPGap1B_lq[iC]);
336
bc76879c 337 fSinGap1Aq_lq[iC] = new TProfile(Form("fSinGap1Aq_lq_%d", iC), ";p_{T} (GeV/c);#LT sin(2*#phi) #GT", nptBins, ptBins);
338 fOutput_lq->Add(fSinGap1Aq_lq[iC]);
339
340 fCosGap1Aq_lq[iC] = new TProfile(Form("fCosGap1Aq_lq_%d", iC), ";p_{T} (GeV/c);#LT cos(2*#phi) #GT", nptBins, ptBins);
341 fOutput_lq->Add(fCosGap1Aq_lq[iC]);
342
343 fSinGap1Bq_lq[iC] = new TProfile(Form("fSinGap1Bq_lq_%d", iC), ";p_{T} (GeV/c);#LT sin(2*#phi) #GT", nptBins, ptBins);
344 fOutput_lq->Add(fSinGap1Bq_lq[iC]);
345
346 fCosGap1Bq_lq[iC] = new TProfile(Form("fCosGap1Bq_lq_%d", iC), ";p_{T} (GeV/c);#LT cos(2*#phi) #GT", nptBins, ptBins);
347 fOutput_lq->Add(fCosGap1Bq_lq[iC]);
348
10a99a07 349 fSinGap1A_lq[iC] = new TProfile(Form("fSinGap1A_lq_%d", iC), ";p_{T} (GeV/c);#LT sin(2*#phi) #GT", nptBins, ptBins);
350 fOutput_lq->Add(fSinGap1A_lq[iC]);
351
352 fCosGap1A_lq[iC] = new TProfile(Form("fCosGap1A_lq_%d", iC), ";p_{T} (GeV/c);#LT cos(2*#phi) #GT", nptBins, ptBins);
353 fOutput_lq->Add(fCosGap1A_lq[iC]);
354
355 fSinGap1B_lq[iC] = new TProfile(Form("fSinGap1B_lq_%d", iC), ";p_{T} (GeV/c);#LT sin(2*#phi) #GT", nptBins, ptBins);
356 fOutput_lq->Add(fSinGap1B_lq[iC]);
357
358 fCosGap1B_lq[iC] = new TProfile(Form("fCosGap1B_lq_%d", iC), ";p_{T} (GeV/c);#LT cos(2*#phi) #GT", nptBins, ptBins);
359 fOutput_lq->Add(fCosGap1B_lq[iC]);
360
361 //small q
362 fv2SPGap1A_sq[iC] = new TProfile(Form("fv2SPGap1A_sq_%d", iC), "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins);
363 fOutput_sq->Add(fv2SPGap1A_sq[iC]);
364
365 fv2SPGap1B_sq[iC] = new TProfile(Form("fv2SPGap1B_sq_%d", iC), "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins);
366 fOutput_sq->Add(fv2SPGap1B_sq[iC]);
367
bc76879c 368 fSinGap1Aq_sq[iC] = new TProfile(Form("fSinGap1Aq_sq_%d", iC), ";p_{T} (GeV/c);#LT sin(2*#phi) #GT", nptBins, ptBins);
369 fOutput_sq->Add(fSinGap1Aq_sq[iC]);
370
371 fCosGap1Aq_sq[iC] = new TProfile(Form("fCosGap1Aq_sq_%d", iC), ";p_{T} (GeV/c);#LT cos(2*#phi) #GT", nptBins, ptBins);
372 fOutput_sq->Add(fCosGap1Aq_sq[iC]);
373
374 fSinGap1Bq_sq[iC] = new TProfile(Form("fSinGap1Bq_sq_%d", iC), ";p_{T} (GeV/c);#LT sin(2*#phi) #GT", nptBins, ptBins);
375 fOutput_sq->Add(fSinGap1Bq_sq[iC]);
376
377 fCosGap1Bq_sq[iC] = new TProfile(Form("fCosGap1Bq_sq_%d", iC), "p_{T} (GeV/c);#LT cos(2*#phi) #GT", nptBins, ptBins);
378 fOutput_sq->Add(fCosGap1Bq_sq[iC]);
379
10a99a07 380 fSinGap1A_sq[iC] = new TProfile(Form("fSinGap1A_sq_%d", iC), ";p_{T} (GeV/c);#LT sin(2*#phi) #GT", nptBins, ptBins);
381 fOutput_sq->Add(fSinGap1A_sq[iC]);
382
383 fCosGap1A_sq[iC] = new TProfile(Form("fCosGap1A_sq_%d", iC), ";p_{T} (GeV/c);#LT cos(2*#phi) #GT", nptBins, ptBins);
384 fOutput_sq->Add(fCosGap1A_sq[iC]);
385
386 fSinGap1B_sq[iC] = new TProfile(Form("fSinGap1B_sq_%d", iC), ";p_{T} (GeV/c);#LT sin(2*#phi) #GT", nptBins, ptBins);
387 fOutput_sq->Add(fSinGap1B_sq[iC]);
388
389 fCosGap1B_sq[iC] = new TProfile(Form("fCosGap1B_sq_%d", iC), "p_{T} (GeV/c);#LT cos(2*#phi) #GT", nptBins, ptBins);
390 fOutput_sq->Add(fCosGap1B_sq[iC]);
391 };
392
29fbaf8a 393 if(fIsMC){
394 fResSPmc_inclusive = new TProfile("fResSPmc_inclusive", "Resolution; ese; Resolution", 3, 0., 3.);
395 fOutput->Add(fResSPmc_inclusive);
396
397 fv2SPGap1Amc_inclusive_mb = new TProfile("fv2SPGap1Amc_inclusive_mb", "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins);
398 fOutput->Add(fv2SPGap1Amc_inclusive_mb);
d0761d58 399
29fbaf8a 400 fv2SPGap1Bmc_inclusive_mb = new TProfile("fv2SPGap1Bmc_inclusive_mb", "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins);
401 fOutput->Add(fv2SPGap1Bmc_inclusive_mb);
402
403 //large-q
404 fv2SPGap1Amc_inclusive_lq = new TProfile("fv2SPGap1Amc_inclusive_lq", "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins);
405 fOutput_lq->Add(fv2SPGap1Amc_inclusive_lq);
406
407 fv2SPGap1Bmc_inclusive_lq = new TProfile("fv2SPGap1Bmc_inclusive_lq", "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins);
408 fOutput_lq->Add(fv2SPGap1Bmc_inclusive_lq);
409
410 //small-q
411 fv2SPGap1Amc_inclusive_sq = new TProfile("fv2SPGap1Amc_inclusive_sq", "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins);
412 fOutput_sq->Add(fv2SPGap1Amc_inclusive_sq);
d0761d58 413
29fbaf8a 414 fv2SPGap1Bmc_inclusive_sq = new TProfile("fv2SPGap1Bmc_inclusive_sq", "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins);
415 fOutput_sq->Add(fv2SPGap1Bmc_inclusive_sq);
d0761d58 416 }
d0761d58 417
d0761d58 418
10a99a07 419 PostData(1, fOutput );
420 PostData(2, fEventCuts);
421 PostData(3, fTrackCuts);
422 PostData(4, fOutput_lq );
423 PostData(5, fOutput_sq );
424}
425
426//________________________________________________________________________
427
428void AliAnalysisTaskV2AllChAOD::UserExec(Option_t *)
429{
430 //Printf("An event");
431 // main event loop
432 fAOD = dynamic_cast<AliAODEvent*>(fInputEvent);
433 if (!fAOD) {
434 AliWarning("ERROR: AliAODEvent not available \n");
435 return;
436 }
437
438 if (strcmp(fAOD->ClassName(), "AliAODEvent"))
439 {
440 AliFatal("Not processing AODs");
441 }
442
443 if(!fEventCuts->IsSelected(fAOD,fTrackCuts))return;//event selection
10a99a07 444
29fbaf8a 445 //Get q-vector percentile.
446 Double_t QvecVZERO=fEventCuts->GetQvecPercentile(fVZEROside);
447
448 Double_t QvecMC = fEventCuts->GetQvecPercentileMC(fVZEROside);
449
450 Double_t Qvec=0.;
451 if(fIsMC && fQvecGen) Qvec = QvecMC;
452 else Qvec = QvecVZERO;
453
10a99a07 454 Double_t Cent=fEventCuts->GetCent();
29fbaf8a 455 fCentrality->Fill(Cent);
10a99a07 456
30e20fad 457 Int_t centV0 = -1;
10a99a07 458 if ((Cent > 0) && (Cent <= 5.0))
459 centV0 = 0;
460 else if ((Cent > 5.0) && (Cent <= 10.0))
461 centV0 = 1;
462 else if ((Cent > 10.0) && (Cent <= 20.0))
463 centV0 = 2;
464 else if ((Cent > 20.0) && (Cent <= 30.0))
465 centV0 = 3;
466 else if ((Cent > 30.0) && (Cent <= 40.0))
467 centV0 = 4;
468 else if ((Cent > 40.0) && (Cent <= 50.0))
469 centV0 = 5;
470 else if ((Cent > 50.0) && (Cent <= 60.0))
471 centV0 = 6;
472 else if ((Cent > 60.0) && (Cent <= 70.0))
473 centV0 = 7;
474 else if ((Cent > 70.0) && (Cent <= 80.0))
475 centV0 = 8;
476
29fbaf8a 477 if(fIsMC) MCclosure(Qvec); // fill mc histograms for montecarlo closure
10a99a07 478
479 Double_t QxGap1A = 0., QyGap1A = 0.;
480 Double_t QxGap1B = 0., QyGap1B = 0.;
481 Int_t multGap1A = 0, multGap1B = 0;
d57dd83f 482
483 for (Int_t loop = 0; loop < 2; loop++){
10a99a07 484
d57dd83f 485 //main loop on tracks
486 for (Int_t iTracks = 0; iTracks < fAOD->GetNumberOfTracks(); iTracks++) {
487 AliAODTrack* track = fAOD->GetTrack(iTracks);
488 if(fCharge != 0 && track->Charge() != fCharge) continue;//if fCharge != 0 only select fCharge
489 if (!fTrackCuts->IsSelected(track,kTRUE)) continue; //track selection (rapidity selection NOT in the standard cuts)
10a99a07 490
bc76879c 491 fEta_vs_Phi_bef->Fill( track->Eta(), track->Phi() );
d0761d58 492
bc9bd5b3 493 if (fIsRecoEff){
494
495 // 2) reject randomly tracks at high pT until the reconstruction efficiency becomes flat (add the following before the loop == 0 part): (mail by Alexandru)
496
497 Double_t recoEff = GetRecoEff(track->Pt(), centV0);
498 if (recoEff < 0){
499 cout<<"No reconstruction efficiency!"<<endl;
500 continue;
501 }
502
503 Double_t rndPt = gRandom->Rndm();
504// cout<<"rndPt: "<<rndPt<<endl;
505
506 Double_t minRecPt = GetRecoEff(0.200001, centV0);
507// cout<<"minRecPt: "<<minRecPt<<endl;
508
509 if (rndPt > minRecPt/recoEff){
510// cout<<"Track rejected: "<<iTracks<<" from "<<fAOD->GetNumberOfTracks()<<endl;
511 continue;
512 }
513
514 } // end fIsRecoEff
d57dd83f 515
516 if (loop == 0) {
517
518 if (track->Eta() > fEtaGapMax){
519 QxGap1A += TMath::Cos(2.*track->Phi());
520 QyGap1A += TMath::Sin(2.*track->Phi());
521 multGap1A++;
10a99a07 522
bc76879c 523 fSinGap1Aq[centV0]->Fill(track->Pt(), TMath::Sin(2.*track->Phi()));
524 fCosGap1Aq[centV0]->Fill(track->Pt(), TMath::Cos(2.*track->Phi()));
525
2ba0e068 526 fEta_vs_PhiA->Fill( track->Eta(), track->Phi() );
d0761d58 527
962f3d11 528 if (Qvec > fCutLargeQperc && Qvec < 100.){
bc76879c 529 fSinGap1Aq_lq[centV0]->Fill(track->Pt(), TMath::Sin(2.*track->Phi()));
530 fCosGap1Aq_lq[centV0]->Fill(track->Pt(), TMath::Cos(2.*track->Phi()));
d57dd83f 531 }
10a99a07 532
962f3d11 533 if (Qvec > 0. && Qvec < fCutSmallQperc){
bc76879c 534 fSinGap1Aq_sq[centV0]->Fill(track->Pt(), TMath::Sin(2.*track->Phi()));
535 fCosGap1Aq_sq[centV0]->Fill(track->Pt(), TMath::Cos(2.*track->Phi()));
d57dd83f 536 }
d0761d58 537
d57dd83f 538 }
539
540 if (track->Eta() < fEtaGapMin){
541 QxGap1B += TMath::Cos(2.*track->Phi());
542 QyGap1B += TMath::Sin(2.*track->Phi());
543 multGap1B++;
10a99a07 544
bc76879c 545 fCosGap1Bq[centV0]->Fill(track->Pt(), TMath::Cos(2.*track->Phi()));
546 fSinGap1Bq[centV0]->Fill(track->Pt(), TMath::Sin(2.*track->Phi()));
547
2ba0e068 548 fEta_vs_PhiB->Fill( track->Eta(), track->Phi() );
10a99a07 549
962f3d11 550 if (Qvec > fCutLargeQperc && Qvec < 100.){
bc76879c 551 fSinGap1Bq_lq[centV0]->Fill(track->Pt(), TMath::Sin(2.*track->Phi()));
552 fCosGap1Bq_lq[centV0]->Fill(track->Pt(), TMath::Cos(2.*track->Phi()));
d57dd83f 553 }
10a99a07 554
962f3d11 555 if (Qvec > 0. && Qvec < fCutSmallQperc){
bc76879c 556 fSinGap1Bq_sq[centV0]->Fill(track->Pt(), TMath::Sin(2.*track->Phi()));
557 fCosGap1Bq_sq[centV0]->Fill(track->Pt(), TMath::Cos(2.*track->Phi()));
d57dd83f 558 }
d0761d58 559
10a99a07 560 }
10a99a07 561
d57dd83f 562 } else {
10a99a07 563
d57dd83f 564 //eval v2 scalar product
565 if (track->Eta() < fEtaGapMin && multGap1A > 0){
566 Double_t v2SPGap1A = (TMath::Cos(2.*track->Phi())*QxGap1A + TMath::Sin(2.*track->Phi())*QyGap1A)/(Double_t)multGap1A;
567 fv2SPGap1A[centV0]->Fill(track->Pt(), v2SPGap1A);
29fbaf8a 568
569 fv2SPGap1A_inclusive_mb->Fill(track->Pt(), v2SPGap1A); //mb v2 for mc closure
bc76879c 570
571 fSinGap1A[centV0]->Fill(track->Pt(), TMath::Sin(2.*track->Phi()));
572 fCosGap1A[centV0]->Fill(track->Pt(), TMath::Cos(2.*track->Phi()));
10a99a07 573
962f3d11 574 if (Qvec > fCutLargeQperc && Qvec < 100.){
d57dd83f 575 fv2SPGap1A_lq[centV0]->Fill(track->Pt(), v2SPGap1A);
bc76879c 576 fSinGap1A_lq[centV0]->Fill(track->Pt(), TMath::Sin(2.*track->Phi()));
577 fCosGap1A_lq[centV0]->Fill(track->Pt(), TMath::Cos(2.*track->Phi()));
29fbaf8a 578
579 fv2SPGap1A_inclusive_lq->Fill(track->Pt(), v2SPGap1A); //lq v2 for mc closure
bc76879c 580 }
10a99a07 581
962f3d11 582 if (Qvec > 0. && Qvec < fCutSmallQperc){
d57dd83f 583 fv2SPGap1A_sq[centV0]->Fill(track->Pt(), v2SPGap1A);
bc76879c 584 fSinGap1A_sq[centV0]->Fill(track->Pt(), TMath::Sin(2.*track->Phi()));
585 fCosGap1A_sq[centV0]->Fill(track->Pt(), TMath::Cos(2.*track->Phi()));
29fbaf8a 586
587 fv2SPGap1A_inclusive_sq->Fill(track->Pt(), v2SPGap1A); //sq v2 for mc closure
bc76879c 588 }
bc9bd5b3 589
d57dd83f 590 }
10a99a07 591
d57dd83f 592 if (track->Eta() > fEtaGapMax && multGap1B > 0){
593 Double_t v2SPGap1B = (TMath::Cos(2.*track->Phi())*QxGap1B + TMath::Sin(2.*track->Phi())*QyGap1B)/(Double_t)multGap1B;
594 fv2SPGap1B[centV0]->Fill(track->Pt(), v2SPGap1B);
29fbaf8a 595
596 fv2SPGap1B_inclusive_mb->Fill(track->Pt(), v2SPGap1B); //mb v2 for mc closure
bc76879c 597
598 fCosGap1B[centV0]->Fill(track->Pt(), TMath::Cos(2.*track->Phi()));
599 fSinGap1B[centV0]->Fill(track->Pt(), TMath::Sin(2.*track->Phi()));
10a99a07 600
962f3d11 601 if (Qvec > fCutLargeQperc && Qvec < 100.){
d57dd83f 602 fv2SPGap1B_lq[centV0]->Fill(track->Pt(), v2SPGap1B);
bc76879c 603 fSinGap1B_lq[centV0]->Fill(track->Pt(), TMath::Sin(2.*track->Phi()));
604 fCosGap1B_lq[centV0]->Fill(track->Pt(), TMath::Cos(2.*track->Phi()));
29fbaf8a 605
606 fv2SPGap1B_inclusive_lq->Fill(track->Pt(), v2SPGap1B); //lq v2 for mc closure
bc76879c 607 }
d57dd83f 608
962f3d11 609 if (Qvec > 0. && Qvec < fCutSmallQperc){
d57dd83f 610 fv2SPGap1B_sq[centV0]->Fill(track->Pt(), v2SPGap1B);
bc76879c 611 fSinGap1B_sq[centV0]->Fill(track->Pt(), TMath::Sin(2.*track->Phi()));
612 fCosGap1B_sq[centV0]->Fill(track->Pt(), TMath::Cos(2.*track->Phi()));
29fbaf8a 613
614 fv2SPGap1B_inclusive_sq->Fill(track->Pt(), v2SPGap1B); //sq v2 for mc closure
bc76879c 615 }
d0761d58 616
d57dd83f 617 }
618 }// end else
619 } // end loop on tracks
620 } // end loop
621
10a99a07 622
623 if (multGap1A > 0 && multGap1B > 0){
624 Double_t res = (QxGap1A*QxGap1B + QyGap1A*QyGap1B)/(Double_t)multGap1A/(Double_t)multGap1B;
625 fResSP->Fill((Double_t)centV0, res);
29fbaf8a 626
627 fResSP_inclusive->Fill(0., res); //mb v2 for mc closure
30e20fad 628 fResSP_vs_Cent->Fill(Cent, res);
629 fResSP_vs_Qvec[centV0]->Fill(Qvec,res);
af960b8a 630
631 Double_t f2partCumQA = -999.;
632 if(multGap1A>1)
633 f2partCumQA = ( ( (QxGap1A*QxGap1A + QyGap1A*QyGap1A) - (Double_t)multGap1A ) / ((Double_t)multGap1A*((Double_t)multGap1A-1)) );
30e20fad 634 if(f2partCumQA>0)f2partCumQA_vs_Cent->Fill((Double_t)Cent,f2partCumQA);
af960b8a 635
636 Double_t f2partCumQB = -999.;
637 if(multGap1B>1)
638 f2partCumQB = ( ( (QxGap1B*QxGap1B + QyGap1B*QyGap1B) - (Double_t)multGap1B ) / ((Double_t)multGap1B*((Double_t)multGap1B-1)) );
30e20fad 639 if(f2partCumQB>0)f2partCumQB_vs_Cent->Fill((Double_t)Cent,f2partCumQB);
10a99a07 640
962f3d11 641 if (Qvec > fCutLargeQperc && Qvec < 100.){
10a99a07 642 fResSP_lq->Fill((Double_t)centV0, res);
30e20fad 643 fResSP_vs_Cent_lq->Fill(Cent, res);
644 if(f2partCumQA>0)f2partCumQA_vs_Cent_lq->Fill((Double_t)Cent,f2partCumQA);
645 if(f2partCumQB>0)f2partCumQB_vs_Cent_lq->Fill((Double_t)Cent,f2partCumQB);
29fbaf8a 646
647 fResSP_inclusive->Fill(1., res); //lq v2 for mc closure
962f3d11 648 }
649
650 if (Qvec > 0. && Qvec < fCutSmallQperc){
10a99a07 651 fResSP_sq->Fill((Double_t)centV0, res);
30e20fad 652 fResSP_vs_Cent_sq->Fill(Cent, res);
653 if(f2partCumQA>0)f2partCumQA_vs_Cent_sq->Fill((Double_t)Cent,f2partCumQA);
654 if(f2partCumQB>0)f2partCumQB_vs_Cent_sq->Fill((Double_t)Cent,f2partCumQB);
29fbaf8a 655
656 fResSP_inclusive->Fill(2., res); //sq v2 for mc closure
962f3d11 657 }
bc9bd5b3 658
d0761d58 659
962f3d11 660 if( fFillTHn ){
661 Double_t QA = TMath::Sqrt( (QxGap1A*QxGap1A + QyGap1A*QyGap1A)/multGap1A );
662 Double_t QB = TMath::Sqrt( (QxGap1B*QxGap1B + QyGap1B*QyGap1B)/multGap1B );
663
af960b8a 664 Double_t varEv[5];
665 varEv[0]=Cent;
962f3d11 666 varEv[1]=Qvec;
667 varEv[2]=(Double_t)QA;
af960b8a 668 varEv[2]=(Double_t)QB;
669 varEv[4]=(Double_t)res;
962f3d11 670 ((THnSparseF*)fOutput->FindObject("NSparseHistEv"))->Fill(varEv);//event loop
671 }
10a99a07 672 }
673
10a99a07 674 PostData(1, fOutput );
675 PostData(2, fEventCuts);
676 PostData(3, fTrackCuts);
677 PostData(4, fOutput_lq );
678 PostData(5, fOutput_sq );
679}
680
681//_________________________________________________________________
682Bool_t AliAnalysisTaskV2AllChAOD::GetDCA(const AliAODTrack* trk, Double_t * p){
683
684 //AliAODTrack::DCA(): for newest AOD fTrack->DCA() always gives -999. This should fix.
685 //FIXME should update EventCuts?
686 //FIXME add track->GetXYZ(p) method
687
688 double xyz[3],cov[3];
689
690 if (!trk->GetXYZ(xyz)) { // dca is not stored
691 AliExternalTrackParam etp;
692 etp.CopyFromVTrack(trk);
693 AliVEvent* ev = (AliVEvent*)trk->GetEvent();
694 if (!ev) {/*printf("Event is not connected to the track\n");*/ return kFALSE;}
695 if (!etp.PropagateToDCA(ev->GetPrimaryVertex(), ev->GetMagneticField(),999,xyz,cov)) return kFALSE; // failed, track is too far from vertex
696 }
697 p[0] = xyz[0];
698 p[1] = xyz[1];
699 return kTRUE;
700
701}
702
a7abb826 703//_________________________________________________________________
29fbaf8a 704void AliAnalysisTaskV2AllChAOD::MCclosure(Double_t qvec){
a7abb826 705 // First do MC to fill up the MC particle array
706
707 TClonesArray *arrayMC = 0;
708 if (fIsMC)
709 {
710 arrayMC = (TClonesArray*) fAOD->GetList()->FindObject(AliAODMCParticle::StdBranchName());
711 if (!arrayMC) {
712 AliFatal("Error: MC particles branch not found!\n");
713 }
714
715 Double_t QxGap1Amc = 0., QyGap1Amc = 0.;
716 Double_t QxGap1Bmc = 0., QyGap1Bmc = 0.;
717 Int_t multGap1Amc = 0, multGap1Bmc = 0;
718
719 for (Int_t loop = 0; loop < 2; loop++){
720
721 Int_t nMC = arrayMC->GetEntries();
722
723 for (Int_t iMC = 0; iMC < nMC; iMC++)
724 {
725 AliAODMCParticle *partMC = (AliAODMCParticle*) arrayMC->At(iMC);
726 if(!partMC->Charge()) continue;//Skip neutrals
727 if(fCharge != 0 && partMC->Charge()*fCharge < 0.) continue;//if fCharge != 0 only select fCharge
728
729 if (!(partMC->IsPhysicalPrimary()))
730 continue;
731
732 if (partMC->Charge() == 0)
733 continue;
734
735 if(partMC->Eta()<fTrackCuts->GetEtaMin() || partMC->Eta()>fTrackCuts->GetEtaMax()) continue;
736
737 //Printf("a particle");
738
739
740 if (loop == 0) {
741
742 if (partMC->Eta() > fEtaGapMax){
743 QxGap1Amc += TMath::Cos(2.*partMC->Phi());
744 QyGap1Amc += TMath::Sin(2.*partMC->Phi());
745 multGap1Amc++;
746 }
747
748 if (partMC->Eta() < fEtaGapMin){
749 QxGap1Bmc += TMath::Cos(2.*partMC->Phi());
750 QyGap1Bmc += TMath::Sin(2.*partMC->Phi());
751 multGap1Bmc++;
752 }
753
754 } else {
755
756 //eval v2 scalar product
757 if (partMC->Eta() < fEtaGapMin && multGap1Amc > 0){
758 Double_t v2SPGap1Amc = (TMath::Cos(2.*partMC->Phi())*QxGap1Amc + TMath::Sin(2.*partMC->Phi())*QyGap1Amc)/(Double_t)multGap1Amc;
29fbaf8a 759 fv2SPGap1Amc_inclusive_mb->Fill(partMC->Pt(), v2SPGap1Amc);
760
761 if (qvec > fCutLargeQperc && qvec < 100.){
762 fv2SPGap1Amc_inclusive_lq->Fill(partMC->Pt(), v2SPGap1Amc);
763 }
764
765 if (qvec > 0. && qvec < fCutSmallQperc){
766 fv2SPGap1Amc_inclusive_sq->Fill(partMC->Pt(), v2SPGap1Amc);
767 }
768
a7abb826 769 }
770
771 if (partMC->Eta() > fEtaGapMax && multGap1Bmc > 0){
772 Double_t v2SPGap1Bmc = (TMath::Cos(2.*partMC->Phi())*QxGap1Bmc + TMath::Sin(2.*partMC->Phi())*QyGap1Bmc)/(Double_t)multGap1Bmc;
29fbaf8a 773 fv2SPGap1Bmc_inclusive_mb->Fill(partMC->Pt(), v2SPGap1Bmc);
774
775 if (qvec > fCutLargeQperc && qvec < 100.){
776 fv2SPGap1Bmc_inclusive_lq->Fill(partMC->Pt(), v2SPGap1Bmc);
777 }
778
779 if (qvec > 0. && qvec < fCutSmallQperc){
780 fv2SPGap1Bmc_inclusive_sq->Fill(partMC->Pt(), v2SPGap1Bmc);
781 }
782
a7abb826 783 }
784
785
786 }// end else
787 } // end loop on partMCs
788 } // end loop
789
790 if (multGap1Amc > 0 && multGap1Bmc > 0){
791 Double_t resmc = (QxGap1Amc*QxGap1Bmc + QyGap1Amc*QyGap1Bmc)/(Double_t)multGap1Amc/(Double_t)multGap1Bmc;
29fbaf8a 792 fResSPmc_inclusive->Fill(0.,resmc);
793
794 if (qvec > fCutLargeQperc && qvec < 100.){
795 fResSPmc_inclusive->Fill(1.,resmc);
796 }
797
798 if (qvec > 0. && qvec < fCutSmallQperc){
799 fResSPmc_inclusive->Fill(2.,resmc);
800 }
801
a7abb826 802 }
803
804 }// end if MC
805}
806
d0761d58 807//_________________________________________________________________
808Double_t AliAnalysisTaskV2AllChAOD::GetRecoEff(Double_t pt, Int_t iC){
809
810 if(iC>8) return 1.;
811
812 if(pt<0.2 || pt>100.) return 1.;
813
814// // // //spectra ese binning
815// // // //const Double_t ptBins[] = {0.20,0.30,0.4,0.5,0.6,0.7,0.8,0.9,1.0,1.2,1.4,1.6,1.8,2.0,2.4,2.8,3.2,3.6,4.0,5.0,6.0,7.0,8.0,9.0,10.,12.,15.,20.,25.,30.,35.,40.,50.,75.,100.};
816// // // //const Int_t nptBins=34;
817
818 const Double_t fEpsilon=0.000001;
819
820 TH1F *h = (TH1F*)fRecoEffList->At(iC);
821
822 Int_t bin = h->FindBin(pt);
823
824 Double_t lowlim = h->GetBinLowEdge(bin);
825 Double_t uplim = h->GetBinLowEdge(bin) + h->GetBinWidth(bin);
826
827 if( pt>lowlim && pt<uplim ) return h->GetBinContent(bin);
828 if( pt == lowlim ) return h->GetBinContent( h->FindBin(pt+fEpsilon) );
829 if( pt == uplim ) return h->GetBinContent( h->FindBin(pt-fEpsilon) );
830
831 else return 1.;
832
833}
10a99a07 834//_________________________________________________________________
835void AliAnalysisTaskV2AllChAOD::Terminate(Option_t *)
836{
837 // Terminate
838}