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