]>
Commit | Line | Data |
---|---|---|
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> | |
46 | ||
47 | #include <iostream> | |
48 | ||
49 | using namespace std; | |
50 | ||
51 | ClassImp(AliAnalysisTaskV2AllChAOD) | |
52 | ||
53 | //________________________________________________________________________ | |
54 | AliAnalysisTaskV2AllChAOD::AliAnalysisTaskV2AllChAOD(const char *name) : AliAnalysisTaskSE(name), | |
55 | fAOD(0x0), | |
56 | fTrackCuts(0x0), | |
57 | fEventCuts(0x0), | |
58 | fIsMC(0), | |
59 | fCharge(0), | |
60 | fVZEROside(0), | |
61 | fOutput(0x0), | |
62 | fOutput_lq(0x0), | |
63 | fOutput_sq(0x0), | |
64 | fnCentBins(20), | |
65 | fnQvecBins(100), | |
66 | fIsQvecCalibMode(0), | |
67 | fQvecUpperLim(100), | |
68 | fCutLargeQperc(90.), | |
69 | fCutSmallQperc(10.), | |
70 | fEtaGapMin(-0.5), | |
71 | fEtaGapMax(0.5), | |
d64e71aa | 72 | fTrkBit(272), |
73 | fEtaCut(0.8), | |
74 | fMinPt(0), | |
75 | fMaxPt(20.0), | |
76 | fMinTPCNcls(70), | |
30e20fad | 77 | fFillTHn(kFALSE), |
10a99a07 | 78 | fResSP(0), |
af960b8a | 79 | fResSP_vs_Cent(0), |
80 | f2partCumQA_vs_Cent(0), | |
81 | f2partCumQB_vs_Cent(0), | |
bc76879c | 82 | fEta_vs_Phi_bef(0), |
2ba0e068 | 83 | fEta_vs_PhiA(0), |
84 | fEta_vs_PhiB(0), | |
10a99a07 | 85 | fResSP_lq(0), |
af960b8a | 86 | fResSP_vs_Cent_lq(0), |
87 | f2partCumQA_vs_Cent_lq(0), | |
88 | f2partCumQB_vs_Cent_lq(0), | |
89 | fResSP_sq(0), | |
af960b8a | 90 | fResSP_vs_Cent_sq(0), |
91 | f2partCumQA_vs_Cent_sq(0), | |
a7abb826 | 92 | f2partCumQB_vs_Cent_sq(0), |
93 | fv2SPGap1A_mb(0), | |
94 | fv2SPGap1B_mb(0), | |
95 | fResSP_mb(0), | |
96 | fv2SPGap1Amc(0), | |
97 | fv2SPGap1Bmc(0), | |
d0761d58 | 98 | fResSPmc(0), |
99 | fIsRecoEff(0), | |
100 | fRecoEffList(0), | |
101 | fResSPRecoEff(0), | |
102 | fResSPRecoEff_lq(0), | |
103 | fResSPRecoEff_sq(0) | |
10a99a07 | 104 | { |
105 | ||
106 | for (Int_t i = 0; i< 9; i++){ | |
30e20fad | 107 | |
108 | fResSP_vs_Qvec[i] = 0; | |
109 | ||
10a99a07 | 110 | fv2SPGap1A[i] = 0; |
10a99a07 | 111 | fv2SPGap1B[i] = 0; |
bc76879c | 112 | |
113 | fSinGap1Aq[i] = 0; | |
114 | fCosGap1Aq[i] = 0; | |
115 | fSinGap1Bq[i] = 0; | |
116 | fCosGap1Bq[i] = 0; | |
10a99a07 | 117 | |
118 | fSinGap1A[i] = 0; | |
119 | fCosGap1A[i] = 0; | |
120 | fSinGap1B[i] = 0; | |
121 | fCosGap1B[i] = 0; | |
122 | ||
123 | //large q | |
124 | fv2SPGap1A_lq[i] = 0; | |
125 | fv2SPGap1B_lq[i] = 0; | |
bc76879c | 126 | |
127 | fSinGap1Aq_lq[i] = 0; | |
128 | fCosGap1Aq_lq[i] = 0; | |
129 | fSinGap1Bq_lq[i] = 0; | |
130 | fCosGap1Bq_lq[i] = 0; | |
131 | ||
10a99a07 | 132 | fSinGap1A_lq[i] = 0; |
133 | fCosGap1A_lq[i] = 0; | |
134 | fSinGap1B_lq[i] = 0; | |
135 | fCosGap1B_lq[i] = 0; | |
136 | ||
137 | //small q | |
138 | fv2SPGap1A_sq[i] = 0; | |
139 | fv2SPGap1B_sq[i] = 0; | |
bc76879c | 140 | |
141 | fSinGap1Aq_sq[i] = 0; | |
142 | fCosGap1Aq_sq[i] = 0; | |
143 | fSinGap1Bq_sq[i] = 0; | |
144 | fCosGap1Bq_sq[i] = 0; | |
145 | ||
10a99a07 | 146 | fSinGap1A_sq[i] = 0; |
147 | fCosGap1A_sq[i] = 0; | |
148 | fSinGap1B_sq[i] = 0; | |
149 | fCosGap1B_sq[i] = 0; | |
150 | ||
d0761d58 | 151 | //reco eff check |
152 | fv2SPGap1ARecoEff[i] = 0; | |
153 | fv2SPGap1BRecoEff[i] = 0; | |
154 | ||
155 | fv2SPGap1ARecoEff_lq[i] = 0; | |
156 | fv2SPGap1BRecoEff_lq[i] = 0; | |
157 | ||
158 | fv2SPGap1ARecoEff_sq[i] = 0; | |
159 | fv2SPGap1BRecoEff_sq[i] = 0; | |
160 | ||
10a99a07 | 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 | //________________________________________________________________________ | |
177 | void 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 | |
af960b8a | 197 | const Int_t nvarev=5; |
198 | // cent Q vec Qa Qb res | |
199 | Int_t binsHistRealEv[nvarev] = { fnCentBins, fnQvecBins, 100, 100, 100}; | |
200 | Double_t xminHistRealEv[nvarev] = { 0., 0., 0., 0., 0.}; | |
201 | Double_t xmaxHistRealEv[nvarev] = { 100., fQvecUpperLim, 10., 10., 1.}; | |
962f3d11 | 202 | THnSparseF* NSparseHistEv = new THnSparseF("NSparseHistEv","NSparseHistEv",nvarev,binsHistRealEv,xminHistRealEv,xmaxHistRealEv); |
203 | NSparseHistEv->GetAxis(0)->SetTitle(Form("%s cent",fEventCuts->GetCentralityMethod().Data())); | |
204 | NSparseHistEv->GetAxis(0)->SetName(Form("%s_cent",fEventCuts->GetCentralityMethod().Data())); | |
205 | NSparseHistEv->GetAxis(1)->SetTitle("Q vec"); | |
206 | NSparseHistEv->GetAxis(1)->SetName("Q_vec"); | |
207 | NSparseHistEv->GetAxis(2)->SetTitle("Q_vec (A)"); | |
208 | NSparseHistEv->GetAxis(2)->SetName("Qvec_A"); | |
209 | NSparseHistEv->GetAxis(3)->SetTitle("Q_vec (B)"); | |
210 | NSparseHistEv->GetAxis(3)->SetName("Qvec_B"); | |
af960b8a | 211 | NSparseHistEv->GetAxis(4)->SetTitle("resolution"); |
212 | NSparseHistEv->GetAxis(4)->SetName("res"); | |
962f3d11 | 213 | fOutput->Add(NSparseHistEv); |
214 | } | |
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 | |
a7abb826 | 244 | fResSP_mb = new TProfile("fResSP_mb", "Resolution; ese; Resolution", 3, 0., 3.); |
245 | fOutput->Add(fResSP_mb); | |
246 | ||
247 | fv2SPGap1A_mb = new TProfile("fv2SPGap1A_mb", "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins); | |
248 | fOutput->Add(fv2SPGap1A_mb); | |
249 | ||
250 | fv2SPGap1B_mb = new TProfile("fv2SPGap1B_mb", "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins); | |
251 | fOutput->Add(fv2SPGap1B_mb); | |
252 | ||
10a99a07 | 253 | //large q resolution |
254 | fResSP_lq = new TProfile("fResSP_lq", "Resolution; centrality; Resolution", 9, -0.5, 8.5); | |
255 | fOutput_lq->Add(fResSP_lq); | |
256 | ||
30e20fad | 257 | fResSP_vs_Cent_lq = new TProfile("fResSP_vs_Cent_lq", "Resolution; centrality; Resolution", 20., 0., 100.); |
af960b8a | 258 | fOutput_lq->Add(fResSP_vs_Cent_lq); |
259 | ||
30e20fad | 260 | f2partCumQA_vs_Cent_lq = new TProfile("f2partCumQA_vs_Cent_lq", "Resolution; centrality; Resolution", 100., 0., 100.); |
af960b8a | 261 | fOutput_lq->Add(f2partCumQA_vs_Cent_lq); |
262 | ||
30e20fad | 263 | f2partCumQB_vs_Cent_lq = new TProfile("f2partCumQB_vs_Cent_lq", "Resolution; centrality; Resolution", 100., 0., 100.); |
af960b8a | 264 | fOutput_lq->Add(f2partCumQB_vs_Cent_lq); |
265 | ||
10a99a07 | 266 | //small q resolution |
267 | fResSP_sq = new TProfile("fResSP_sq", "Resolution; centrality; Resolution", 9, -0.5, 8.5); | |
268 | fOutput_sq->Add(fResSP_sq); | |
af960b8a | 269 | |
30e20fad | 270 | fResSP_vs_Cent_sq = new TProfile("fResSP_vs_Cent_sq", "Resolution; centrality; Resolution", 20., 0., 100.); |
af960b8a | 271 | fOutput_sq->Add(fResSP_vs_Cent_sq); |
272 | ||
30e20fad | 273 | f2partCumQA_vs_Cent_sq = new TProfile("f2partCumQA_vs_Cent_sq", "Resolution; centrality; Resolution", 100., 0., 100.); |
af960b8a | 274 | fOutput_sq->Add(f2partCumQA_vs_Cent_sq); |
275 | ||
30e20fad | 276 | f2partCumQB_vs_Cent_sq = new TProfile("f2partCumQB_vs_Cent_sq", "Resolution; centrality; Resolution", 100., 0., 100.); |
af960b8a | 277 | fOutput_sq->Add(f2partCumQB_vs_Cent_sq); |
d64e71aa | 278 | |
10a99a07 | 279 | for (Int_t iC = 0; iC < 9; iC++){ |
30e20fad | 280 | |
281 | fResSP_vs_Qvec[iC] = new TProfile(Form("fResSP_vs_Qvec_%d", iC), "Resolution; Qvec (V0A); Resolution", 10., 0., 100.); | |
282 | fOutput->Add(fResSP_vs_Qvec[iC]); | |
10a99a07 | 283 | |
284 | fv2SPGap1A[iC] = new TProfile(Form("fv2SPGap1A_%d", iC), "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins); | |
285 | fOutput->Add(fv2SPGap1A[iC]); | |
286 | ||
10a99a07 | 287 | fv2SPGap1B[iC] = new TProfile(Form("fv2SPGap1B_%d", iC), "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins); |
288 | fOutput->Add(fv2SPGap1B[iC]); | |
289 | ||
bc76879c | 290 | fSinGap1Aq[iC] = new TProfile(Form("fSinGap1Aq_%d", iC), ";p_{T} (GeV/c);#LT sin(2*#phi) #GT", nptBins, ptBins); |
291 | fOutput->Add(fSinGap1Aq[iC]); | |
10a99a07 | 292 | |
bc76879c | 293 | fCosGap1Aq[iC] = new TProfile(Form("fCosGap1Aq_%d", iC), ";p_{T} (GeV/c);#LT cos(2*#phi) #GT", nptBins, ptBins); |
294 | fOutput->Add(fCosGap1Aq[iC]); | |
295 | ||
296 | fSinGap1Bq[iC] = new TProfile(Form("fSinGap1Bq_%d", iC), ";p_{T} (GeV/c);#LT sin(2*#phi) #GT", nptBins, ptBins); | |
297 | fOutput->Add(fSinGap1Bq[iC]); | |
298 | ||
299 | fCosGap1Bq[iC] = new TProfile(Form("fCosGap1Bq_%d", iC), ";p_{T} (GeV/c);#LT cos(2*#phi) #GT", nptBins, ptBins); | |
300 | fOutput->Add(fCosGap1Bq[iC]); | |
301 | ||
10a99a07 | 302 | fSinGap1A[iC] = new TProfile(Form("fSinGap1A_%d", iC), ";p_{T} (GeV/c);#LT sin(2*#phi) #GT", nptBins, ptBins); |
303 | fOutput->Add(fSinGap1A[iC]); | |
304 | ||
305 | fCosGap1A[iC] = new TProfile(Form("fCosGap1A_%d", iC), ";p_{T} (GeV/c);#LT cos(2*#phi) #GT", nptBins, ptBins); | |
306 | fOutput->Add(fCosGap1A[iC]); | |
307 | ||
308 | fSinGap1B[iC] = new TProfile(Form("fSinGap1B_%d", iC), ";p_{T} (GeV/c);#LT sin(2*#phi) #GT", nptBins, ptBins); | |
309 | fOutput->Add(fSinGap1B[iC]); | |
310 | ||
311 | fCosGap1B[iC] = new TProfile(Form("fCosGap1B_%d", iC), ";p_{T} (GeV/c);#LT cos(2*#phi) #GT", nptBins, ptBins); | |
312 | fOutput->Add(fCosGap1B[iC]); | |
313 | ||
314 | //large q | |
315 | 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); | |
316 | fOutput_lq->Add(fv2SPGap1A_lq[iC]); | |
317 | ||
318 | 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); | |
319 | fOutput_lq->Add(fv2SPGap1B_lq[iC]); | |
320 | ||
bc76879c | 321 | fSinGap1Aq_lq[iC] = new TProfile(Form("fSinGap1Aq_lq_%d", iC), ";p_{T} (GeV/c);#LT sin(2*#phi) #GT", nptBins, ptBins); |
322 | fOutput_lq->Add(fSinGap1Aq_lq[iC]); | |
323 | ||
324 | fCosGap1Aq_lq[iC] = new TProfile(Form("fCosGap1Aq_lq_%d", iC), ";p_{T} (GeV/c);#LT cos(2*#phi) #GT", nptBins, ptBins); | |
325 | fOutput_lq->Add(fCosGap1Aq_lq[iC]); | |
326 | ||
327 | fSinGap1Bq_lq[iC] = new TProfile(Form("fSinGap1Bq_lq_%d", iC), ";p_{T} (GeV/c);#LT sin(2*#phi) #GT", nptBins, ptBins); | |
328 | fOutput_lq->Add(fSinGap1Bq_lq[iC]); | |
329 | ||
330 | fCosGap1Bq_lq[iC] = new TProfile(Form("fCosGap1Bq_lq_%d", iC), ";p_{T} (GeV/c);#LT cos(2*#phi) #GT", nptBins, ptBins); | |
331 | fOutput_lq->Add(fCosGap1Bq_lq[iC]); | |
332 | ||
10a99a07 | 333 | fSinGap1A_lq[iC] = new TProfile(Form("fSinGap1A_lq_%d", iC), ";p_{T} (GeV/c);#LT sin(2*#phi) #GT", nptBins, ptBins); |
334 | fOutput_lq->Add(fSinGap1A_lq[iC]); | |
335 | ||
336 | fCosGap1A_lq[iC] = new TProfile(Form("fCosGap1A_lq_%d", iC), ";p_{T} (GeV/c);#LT cos(2*#phi) #GT", nptBins, ptBins); | |
337 | fOutput_lq->Add(fCosGap1A_lq[iC]); | |
338 | ||
339 | fSinGap1B_lq[iC] = new TProfile(Form("fSinGap1B_lq_%d", iC), ";p_{T} (GeV/c);#LT sin(2*#phi) #GT", nptBins, ptBins); | |
340 | fOutput_lq->Add(fSinGap1B_lq[iC]); | |
341 | ||
342 | fCosGap1B_lq[iC] = new TProfile(Form("fCosGap1B_lq_%d", iC), ";p_{T} (GeV/c);#LT cos(2*#phi) #GT", nptBins, ptBins); | |
343 | fOutput_lq->Add(fCosGap1B_lq[iC]); | |
344 | ||
345 | //small q | |
346 | 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); | |
347 | fOutput_sq->Add(fv2SPGap1A_sq[iC]); | |
348 | ||
349 | 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); | |
350 | fOutput_sq->Add(fv2SPGap1B_sq[iC]); | |
351 | ||
bc76879c | 352 | fSinGap1Aq_sq[iC] = new TProfile(Form("fSinGap1Aq_sq_%d", iC), ";p_{T} (GeV/c);#LT sin(2*#phi) #GT", nptBins, ptBins); |
353 | fOutput_sq->Add(fSinGap1Aq_sq[iC]); | |
354 | ||
355 | fCosGap1Aq_sq[iC] = new TProfile(Form("fCosGap1Aq_sq_%d", iC), ";p_{T} (GeV/c);#LT cos(2*#phi) #GT", nptBins, ptBins); | |
356 | fOutput_sq->Add(fCosGap1Aq_sq[iC]); | |
357 | ||
358 | fSinGap1Bq_sq[iC] = new TProfile(Form("fSinGap1Bq_sq_%d", iC), ";p_{T} (GeV/c);#LT sin(2*#phi) #GT", nptBins, ptBins); | |
359 | fOutput_sq->Add(fSinGap1Bq_sq[iC]); | |
360 | ||
361 | fCosGap1Bq_sq[iC] = new TProfile(Form("fCosGap1Bq_sq_%d", iC), "p_{T} (GeV/c);#LT cos(2*#phi) #GT", nptBins, ptBins); | |
362 | fOutput_sq->Add(fCosGap1Bq_sq[iC]); | |
363 | ||
10a99a07 | 364 | fSinGap1A_sq[iC] = new TProfile(Form("fSinGap1A_sq_%d", iC), ";p_{T} (GeV/c);#LT sin(2*#phi) #GT", nptBins, ptBins); |
365 | fOutput_sq->Add(fSinGap1A_sq[iC]); | |
366 | ||
367 | fCosGap1A_sq[iC] = new TProfile(Form("fCosGap1A_sq_%d", iC), ";p_{T} (GeV/c);#LT cos(2*#phi) #GT", nptBins, ptBins); | |
368 | fOutput_sq->Add(fCosGap1A_sq[iC]); | |
369 | ||
370 | fSinGap1B_sq[iC] = new TProfile(Form("fSinGap1B_sq_%d", iC), ";p_{T} (GeV/c);#LT sin(2*#phi) #GT", nptBins, ptBins); | |
371 | fOutput_sq->Add(fSinGap1B_sq[iC]); | |
372 | ||
373 | fCosGap1B_sq[iC] = new TProfile(Form("fCosGap1B_sq_%d", iC), "p_{T} (GeV/c);#LT cos(2*#phi) #GT", nptBins, ptBins); | |
374 | fOutput_sq->Add(fCosGap1B_sq[iC]); | |
375 | }; | |
376 | ||
d0761d58 | 377 | if(!fIsMC){ |
378 | fResSPmc = new TProfile("fResSPmc", "Resolution; ese; Resolution", 3, 0., 3.); | |
379 | fOutput->Add(fResSPmc); | |
380 | ||
381 | fv2SPGap1Amc = new TProfile("fv2SPGap1Amc", "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins); | |
382 | fOutput->Add(fv2SPGap1Amc); | |
383 | ||
384 | fv2SPGap1Bmc = new TProfile("fv2SPGap1Bmc", "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins); | |
385 | fOutput->Add(fv2SPGap1Bmc); | |
386 | } | |
387 | ||
388 | if(fIsRecoEff){ | |
389 | ||
390 | fResSPRecoEff = new TProfile("fResSPRecoEff", "Resolution; centrality; Resolution", 9, -0.5, 8.5); | |
391 | fOutput->Add(fResSPRecoEff); | |
392 | ||
393 | fResSPRecoEff_lq = new TProfile("fResSPRecoEff_lq", "Resolution; centrality; Resolution", 9, -0.5, 8.5); | |
394 | fOutput_lq->Add(fResSPRecoEff_lq); | |
395 | ||
396 | fResSPRecoEff_sq = new TProfile("fResSPRecoEff_sq", "Resolution; centrality; Resolution", 9, -0.5, 8.5); | |
397 | fOutput_sq->Add(fResSPRecoEff_sq); | |
398 | ||
399 | for (Int_t iC = 0; iC < 9; iC++){ | |
400 | ||
401 | fv2SPGap1ARecoEff[iC] = new TProfile(Form("fv2SPGap1ARecoEff_%d", iC), "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins); | |
402 | fOutput->Add(fv2SPGap1ARecoEff[iC]); | |
403 | ||
404 | fv2SPGap1BRecoEff[iC] = new TProfile(Form("fv2SPGap1BRecoEff_%d", iC), "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins); | |
405 | fOutput->Add(fv2SPGap1BRecoEff[iC]); | |
406 | ||
407 | fv2SPGap1ARecoEff_lq[iC] = new TProfile(Form("fv2SPGap1ARecoEff_lq_%d", iC), "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins); | |
408 | fOutput_lq->Add(fv2SPGap1ARecoEff_lq[iC]); | |
409 | ||
410 | fv2SPGap1BRecoEff_lq[iC] = new TProfile(Form("fv2SPGap1BRecoEff_lq_%d", iC), "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins); | |
411 | fOutput_lq->Add(fv2SPGap1BRecoEff_lq[iC]); | |
412 | ||
413 | fv2SPGap1ARecoEff_sq[iC] = new TProfile(Form("fv2SPGap1ARecoEff_sq_%d", iC), "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins); | |
414 | fOutput_sq->Add(fv2SPGap1ARecoEff_sq[iC]); | |
415 | ||
416 | fv2SPGap1BRecoEff_sq[iC] = new TProfile(Form("fv2SPGap1BRecoEff_sq_%d", iC), "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins); | |
417 | fOutput_sq->Add(fv2SPGap1BRecoEff_sq[iC]); | |
418 | ||
419 | } | |
420 | } | |
421 | ||
10a99a07 | 422 | PostData(1, fOutput ); |
423 | PostData(2, fEventCuts); | |
424 | PostData(3, fTrackCuts); | |
425 | PostData(4, fOutput_lq ); | |
426 | PostData(5, fOutput_sq ); | |
427 | } | |
428 | ||
429 | //________________________________________________________________________ | |
430 | ||
431 | void AliAnalysisTaskV2AllChAOD::UserExec(Option_t *) | |
432 | { | |
433 | //Printf("An event"); | |
434 | // main event loop | |
435 | fAOD = dynamic_cast<AliAODEvent*>(fInputEvent); | |
436 | if (!fAOD) { | |
437 | AliWarning("ERROR: AliAODEvent not available \n"); | |
438 | return; | |
439 | } | |
440 | ||
441 | if (strcmp(fAOD->ClassName(), "AliAODEvent")) | |
442 | { | |
443 | AliFatal("Not processing AODs"); | |
444 | } | |
445 | ||
446 | if(!fEventCuts->IsSelected(fAOD,fTrackCuts))return;//event selection | |
447 | ||
448 | Double_t Qvec=0.;//in case of MC we save space in the memory | |
449 | if(!fIsMC){ | |
450 | if(fIsQvecCalibMode){ | |
451 | if(fVZEROside==0)Qvec=fEventCuts->GetqV0A(); | |
452 | else if (fVZEROside==1)Qvec=fEventCuts->GetqV0C(); | |
453 | } | |
454 | else Qvec=fEventCuts->GetQvecPercentile(fVZEROside); | |
455 | } | |
456 | ||
457 | Double_t Cent=fEventCuts->GetCent(); | |
458 | ||
30e20fad | 459 | Int_t centV0 = -1; |
10a99a07 | 460 | if ((Cent > 0) && (Cent <= 5.0)) |
461 | centV0 = 0; | |
462 | else if ((Cent > 5.0) && (Cent <= 10.0)) | |
463 | centV0 = 1; | |
464 | else if ((Cent > 10.0) && (Cent <= 20.0)) | |
465 | centV0 = 2; | |
466 | else if ((Cent > 20.0) && (Cent <= 30.0)) | |
467 | centV0 = 3; | |
468 | else if ((Cent > 30.0) && (Cent <= 40.0)) | |
469 | centV0 = 4; | |
470 | else if ((Cent > 40.0) && (Cent <= 50.0)) | |
471 | centV0 = 5; | |
472 | else if ((Cent > 50.0) && (Cent <= 60.0)) | |
473 | centV0 = 6; | |
474 | else if ((Cent > 60.0) && (Cent <= 70.0)) | |
475 | centV0 = 7; | |
476 | else if ((Cent > 70.0) && (Cent <= 80.0)) | |
477 | centV0 = 8; | |
478 | ||
a7abb826 | 479 | if(fIsMC) MCclosure(); // fill mc histograms for montecarlo closure |
10a99a07 | 480 | |
481 | Double_t QxGap1A = 0., QyGap1A = 0.; | |
482 | Double_t QxGap1B = 0., QyGap1B = 0.; | |
483 | Int_t multGap1A = 0, multGap1B = 0; | |
d0761d58 | 484 | |
485 | //reco eff Qvector | |
486 | Double_t QxGap1ARecoEff = 0., QyGap1ARecoEff = 0.; | |
487 | Double_t QxGap1BRecoEff = 0., QyGap1BRecoEff = 0.; | |
d57dd83f | 488 | |
489 | for (Int_t loop = 0; loop < 2; loop++){ | |
10a99a07 | 490 | |
d57dd83f | 491 | //main loop on tracks |
492 | for (Int_t iTracks = 0; iTracks < fAOD->GetNumberOfTracks(); iTracks++) { | |
493 | AliAODTrack* track = fAOD->GetTrack(iTracks); | |
494 | if(fCharge != 0 && track->Charge() != fCharge) continue;//if fCharge != 0 only select fCharge | |
495 | if (!fTrackCuts->IsSelected(track,kTRUE)) continue; //track selection (rapidity selection NOT in the standard cuts) | |
10a99a07 | 496 | |
bc76879c | 497 | fEta_vs_Phi_bef->Fill( track->Eta(), track->Phi() ); |
d0761d58 | 498 | |
499 | Double_t recoEff = 1.; | |
500 | if (fIsRecoEff) recoEff = GetRecoEff(track->Pt(), centV0); | |
d57dd83f | 501 | |
502 | if (loop == 0) { | |
503 | ||
504 | if (track->Eta() > fEtaGapMax){ | |
505 | QxGap1A += TMath::Cos(2.*track->Phi()); | |
506 | QyGap1A += TMath::Sin(2.*track->Phi()); | |
507 | multGap1A++; | |
10a99a07 | 508 | |
bc76879c | 509 | fSinGap1Aq[centV0]->Fill(track->Pt(), TMath::Sin(2.*track->Phi())); |
510 | fCosGap1Aq[centV0]->Fill(track->Pt(), TMath::Cos(2.*track->Phi())); | |
511 | ||
2ba0e068 | 512 | fEta_vs_PhiA->Fill( track->Eta(), track->Phi() ); |
d0761d58 | 513 | |
962f3d11 | 514 | if (Qvec > fCutLargeQperc && Qvec < 100.){ |
bc76879c | 515 | fSinGap1Aq_lq[centV0]->Fill(track->Pt(), TMath::Sin(2.*track->Phi())); |
516 | fCosGap1Aq_lq[centV0]->Fill(track->Pt(), TMath::Cos(2.*track->Phi())); | |
d57dd83f | 517 | } |
10a99a07 | 518 | |
962f3d11 | 519 | if (Qvec > 0. && Qvec < fCutSmallQperc){ |
bc76879c | 520 | fSinGap1Aq_sq[centV0]->Fill(track->Pt(), TMath::Sin(2.*track->Phi())); |
521 | fCosGap1Aq_sq[centV0]->Fill(track->Pt(), TMath::Cos(2.*track->Phi())); | |
d57dd83f | 522 | } |
d0761d58 | 523 | |
524 | if(fIsRecoEff){ | |
525 | QxGap1ARecoEff += ( TMath::Cos(2.*track->Phi()) )/recoEff; | |
526 | QyGap1ARecoEff += ( TMath::Sin(2.*track->Phi()) )/recoEff; | |
527 | } | |
528 | ||
d57dd83f | 529 | } |
530 | ||
531 | if (track->Eta() < fEtaGapMin){ | |
532 | QxGap1B += TMath::Cos(2.*track->Phi()); | |
533 | QyGap1B += TMath::Sin(2.*track->Phi()); | |
534 | multGap1B++; | |
10a99a07 | 535 | |
bc76879c | 536 | fCosGap1Bq[centV0]->Fill(track->Pt(), TMath::Cos(2.*track->Phi())); |
537 | fSinGap1Bq[centV0]->Fill(track->Pt(), TMath::Sin(2.*track->Phi())); | |
538 | ||
2ba0e068 | 539 | fEta_vs_PhiB->Fill( track->Eta(), track->Phi() ); |
10a99a07 | 540 | |
962f3d11 | 541 | if (Qvec > fCutLargeQperc && Qvec < 100.){ |
bc76879c | 542 | fSinGap1Bq_lq[centV0]->Fill(track->Pt(), TMath::Sin(2.*track->Phi())); |
543 | fCosGap1Bq_lq[centV0]->Fill(track->Pt(), TMath::Cos(2.*track->Phi())); | |
d57dd83f | 544 | } |
10a99a07 | 545 | |
962f3d11 | 546 | if (Qvec > 0. && Qvec < fCutSmallQperc){ |
bc76879c | 547 | fSinGap1Bq_sq[centV0]->Fill(track->Pt(), TMath::Sin(2.*track->Phi())); |
548 | fCosGap1Bq_sq[centV0]->Fill(track->Pt(), TMath::Cos(2.*track->Phi())); | |
d57dd83f | 549 | } |
d0761d58 | 550 | |
551 | if(fIsRecoEff){ | |
552 | QxGap1BRecoEff += ( TMath::Cos(2.*track->Phi()) )/recoEff; | |
553 | QyGap1BRecoEff += ( TMath::Sin(2.*track->Phi()) )/recoEff; | |
554 | } | |
555 | ||
10a99a07 | 556 | } |
10a99a07 | 557 | |
d57dd83f | 558 | } else { |
10a99a07 | 559 | |
d57dd83f | 560 | //eval v2 scalar product |
561 | if (track->Eta() < fEtaGapMin && multGap1A > 0){ | |
562 | Double_t v2SPGap1A = (TMath::Cos(2.*track->Phi())*QxGap1A + TMath::Sin(2.*track->Phi())*QyGap1A)/(Double_t)multGap1A; | |
563 | fv2SPGap1A[centV0]->Fill(track->Pt(), v2SPGap1A); | |
d0761d58 | 564 | fv2SPGap1A_mb->Fill(track->Pt(), v2SPGap1A); //mb v2 for mc closure |
bc76879c | 565 | |
566 | fSinGap1A[centV0]->Fill(track->Pt(), TMath::Sin(2.*track->Phi())); | |
567 | fCosGap1A[centV0]->Fill(track->Pt(), TMath::Cos(2.*track->Phi())); | |
10a99a07 | 568 | |
962f3d11 | 569 | if (Qvec > fCutLargeQperc && Qvec < 100.){ |
d57dd83f | 570 | fv2SPGap1A_lq[centV0]->Fill(track->Pt(), v2SPGap1A); |
bc76879c | 571 | fSinGap1A_lq[centV0]->Fill(track->Pt(), TMath::Sin(2.*track->Phi())); |
572 | fCosGap1A_lq[centV0]->Fill(track->Pt(), TMath::Cos(2.*track->Phi())); | |
573 | } | |
10a99a07 | 574 | |
962f3d11 | 575 | if (Qvec > 0. && Qvec < fCutSmallQperc){ |
d57dd83f | 576 | fv2SPGap1A_sq[centV0]->Fill(track->Pt(), v2SPGap1A); |
bc76879c | 577 | fSinGap1A_sq[centV0]->Fill(track->Pt(), TMath::Sin(2.*track->Phi())); |
578 | fCosGap1A_sq[centV0]->Fill(track->Pt(), TMath::Cos(2.*track->Phi())); | |
579 | } | |
d0761d58 | 580 | |
581 | if(fIsRecoEff){ | |
582 | Double_t uxGap1ARecoEff = ( TMath::Cos(2.*track->Phi()) )/recoEff; | |
583 | Double_t uyGap1ARecoEff = ( TMath::Sin(2.*track->Phi()) )/recoEff; | |
584 | Double_t v2SPGap1ARecoEff = ( uxGap1ARecoEff*QxGap1ARecoEff + uyGap1ARecoEff*QyGap1ARecoEff)/(Double_t)multGap1A; | |
585 | fv2SPGap1ARecoEff[centV0]->Fill(track->Pt(), v2SPGap1ARecoEff); | |
586 | ||
587 | if (Qvec > fCutLargeQperc && Qvec < 100.) | |
588 | fv2SPGap1ARecoEff_lq[centV0]->Fill(track->Pt(), v2SPGap1ARecoEff); | |
589 | if (Qvec > 0. && Qvec < fCutSmallQperc) | |
590 | fv2SPGap1ARecoEff_sq[centV0]->Fill(track->Pt(), v2SPGap1ARecoEff); | |
591 | } | |
d57dd83f | 592 | } |
10a99a07 | 593 | |
d57dd83f | 594 | if (track->Eta() > fEtaGapMax && multGap1B > 0){ |
595 | Double_t v2SPGap1B = (TMath::Cos(2.*track->Phi())*QxGap1B + TMath::Sin(2.*track->Phi())*QyGap1B)/(Double_t)multGap1B; | |
596 | fv2SPGap1B[centV0]->Fill(track->Pt(), v2SPGap1B); | |
a7abb826 | 597 | fv2SPGap1B_mb->Fill(track->Pt(), v2SPGap1B); //mb v2 |
bc76879c | 598 | |
599 | fCosGap1B[centV0]->Fill(track->Pt(), TMath::Cos(2.*track->Phi())); | |
600 | fSinGap1B[centV0]->Fill(track->Pt(), TMath::Sin(2.*track->Phi())); | |
10a99a07 | 601 | |
962f3d11 | 602 | if (Qvec > fCutLargeQperc && Qvec < 100.){ |
d57dd83f | 603 | fv2SPGap1B_lq[centV0]->Fill(track->Pt(), v2SPGap1B); |
bc76879c | 604 | fSinGap1B_lq[centV0]->Fill(track->Pt(), TMath::Sin(2.*track->Phi())); |
605 | fCosGap1B_lq[centV0]->Fill(track->Pt(), TMath::Cos(2.*track->Phi())); | |
606 | } | |
d57dd83f | 607 | |
962f3d11 | 608 | if (Qvec > 0. && Qvec < fCutSmallQperc){ |
d57dd83f | 609 | fv2SPGap1B_sq[centV0]->Fill(track->Pt(), v2SPGap1B); |
bc76879c | 610 | fSinGap1B_sq[centV0]->Fill(track->Pt(), TMath::Sin(2.*track->Phi())); |
611 | fCosGap1B_sq[centV0]->Fill(track->Pt(), TMath::Cos(2.*track->Phi())); | |
612 | } | |
d0761d58 | 613 | |
614 | if(fIsRecoEff){ | |
615 | Double_t uxGap1BRecoEff = ( TMath::Cos(2.*track->Phi()) )/recoEff; | |
616 | Double_t uyGap1BRecoEff = ( TMath::Sin(2.*track->Phi()) )/recoEff; | |
617 | Double_t v2SPGap1BRecoEff = ( uxGap1BRecoEff*QxGap1BRecoEff + uyGap1BRecoEff*QyGap1BRecoEff)/(Double_t)multGap1B; | |
618 | fv2SPGap1BRecoEff[centV0]->Fill(track->Pt(), v2SPGap1BRecoEff); | |
619 | ||
620 | if (Qvec > fCutLargeQperc && Qvec < 100.) | |
621 | fv2SPGap1BRecoEff_lq[centV0]->Fill(track->Pt(), v2SPGap1BRecoEff); | |
622 | if (Qvec > 0. && Qvec < fCutSmallQperc) | |
623 | fv2SPGap1BRecoEff_sq[centV0]->Fill(track->Pt(), v2SPGap1BRecoEff); | |
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); | |
a7abb826 | 634 | fResSP_mb->Fill(0., res); |
30e20fad | 635 | fResSP_vs_Cent->Fill(Cent, res); |
636 | fResSP_vs_Qvec[centV0]->Fill(Qvec,res); | |
af960b8a | 637 | |
638 | Double_t f2partCumQA = -999.; | |
639 | if(multGap1A>1) | |
640 | f2partCumQA = ( ( (QxGap1A*QxGap1A + QyGap1A*QyGap1A) - (Double_t)multGap1A ) / ((Double_t)multGap1A*((Double_t)multGap1A-1)) ); | |
30e20fad | 641 | if(f2partCumQA>0)f2partCumQA_vs_Cent->Fill((Double_t)Cent,f2partCumQA); |
af960b8a | 642 | |
643 | Double_t f2partCumQB = -999.; | |
644 | if(multGap1B>1) | |
645 | f2partCumQB = ( ( (QxGap1B*QxGap1B + QyGap1B*QyGap1B) - (Double_t)multGap1B ) / ((Double_t)multGap1B*((Double_t)multGap1B-1)) ); | |
30e20fad | 646 | if(f2partCumQB>0)f2partCumQB_vs_Cent->Fill((Double_t)Cent,f2partCumQB); |
10a99a07 | 647 | |
962f3d11 | 648 | if (Qvec > fCutLargeQperc && Qvec < 100.){ |
10a99a07 | 649 | fResSP_lq->Fill((Double_t)centV0, res); |
30e20fad | 650 | fResSP_vs_Cent_lq->Fill(Cent, res); |
651 | if(f2partCumQA>0)f2partCumQA_vs_Cent_lq->Fill((Double_t)Cent,f2partCumQA); | |
652 | if(f2partCumQB>0)f2partCumQB_vs_Cent_lq->Fill((Double_t)Cent,f2partCumQB); | |
962f3d11 | 653 | } |
654 | ||
655 | if (Qvec > 0. && Qvec < fCutSmallQperc){ | |
10a99a07 | 656 | fResSP_sq->Fill((Double_t)centV0, res); |
30e20fad | 657 | fResSP_vs_Cent_sq->Fill(Cent, res); |
658 | if(f2partCumQA>0)f2partCumQA_vs_Cent_sq->Fill((Double_t)Cent,f2partCumQA); | |
659 | if(f2partCumQB>0)f2partCumQB_vs_Cent_sq->Fill((Double_t)Cent,f2partCumQB); | |
962f3d11 | 660 | } |
661 | ||
d0761d58 | 662 | if(fIsRecoEff){ |
663 | Double_t resRecoEff = (QxGap1ARecoEff*QxGap1BRecoEff + QyGap1ARecoEff*QyGap1BRecoEff)/(Double_t)multGap1A/(Double_t)multGap1B; | |
664 | fResSPRecoEff->Fill((Double_t)centV0, resRecoEff); | |
665 | ||
666 | if (Qvec > fCutLargeQperc && Qvec < 100.) | |
667 | fResSPRecoEff_lq->Fill((Double_t)centV0, resRecoEff); | |
668 | ||
669 | if (Qvec > 0. && Qvec < fCutSmallQperc) | |
670 | fResSPRecoEff_sq->Fill((Double_t)centV0, resRecoEff); | |
671 | } | |
672 | ||
962f3d11 | 673 | if( fFillTHn ){ |
674 | Double_t QA = TMath::Sqrt( (QxGap1A*QxGap1A + QyGap1A*QyGap1A)/multGap1A ); | |
675 | Double_t QB = TMath::Sqrt( (QxGap1B*QxGap1B + QyGap1B*QyGap1B)/multGap1B ); | |
676 | ||
af960b8a | 677 | Double_t varEv[5]; |
678 | varEv[0]=Cent; | |
962f3d11 | 679 | varEv[1]=Qvec; |
680 | varEv[2]=(Double_t)QA; | |
af960b8a | 681 | varEv[2]=(Double_t)QB; |
682 | varEv[4]=(Double_t)res; | |
962f3d11 | 683 | ((THnSparseF*)fOutput->FindObject("NSparseHistEv"))->Fill(varEv);//event loop |
684 | } | |
10a99a07 | 685 | } |
686 | ||
10a99a07 | 687 | PostData(1, fOutput ); |
688 | PostData(2, fEventCuts); | |
689 | PostData(3, fTrackCuts); | |
690 | PostData(4, fOutput_lq ); | |
691 | PostData(5, fOutput_sq ); | |
692 | } | |
693 | ||
694 | //_________________________________________________________________ | |
695 | Bool_t AliAnalysisTaskV2AllChAOD::GetDCA(const AliAODTrack* trk, Double_t * p){ | |
696 | ||
697 | //AliAODTrack::DCA(): for newest AOD fTrack->DCA() always gives -999. This should fix. | |
698 | //FIXME should update EventCuts? | |
699 | //FIXME add track->GetXYZ(p) method | |
700 | ||
701 | double xyz[3],cov[3]; | |
702 | ||
703 | if (!trk->GetXYZ(xyz)) { // dca is not stored | |
704 | AliExternalTrackParam etp; | |
705 | etp.CopyFromVTrack(trk); | |
706 | AliVEvent* ev = (AliVEvent*)trk->GetEvent(); | |
707 | if (!ev) {/*printf("Event is not connected to the track\n");*/ return kFALSE;} | |
708 | if (!etp.PropagateToDCA(ev->GetPrimaryVertex(), ev->GetMagneticField(),999,xyz,cov)) return kFALSE; // failed, track is too far from vertex | |
709 | } | |
710 | p[0] = xyz[0]; | |
711 | p[1] = xyz[1]; | |
712 | return kTRUE; | |
713 | ||
714 | } | |
715 | ||
a7abb826 | 716 | //_________________________________________________________________ |
717 | void AliAnalysisTaskV2AllChAOD::MCclosure(){ | |
718 | // First do MC to fill up the MC particle array | |
719 | ||
720 | TClonesArray *arrayMC = 0; | |
721 | if (fIsMC) | |
722 | { | |
723 | arrayMC = (TClonesArray*) fAOD->GetList()->FindObject(AliAODMCParticle::StdBranchName()); | |
724 | if (!arrayMC) { | |
725 | AliFatal("Error: MC particles branch not found!\n"); | |
726 | } | |
727 | ||
728 | Double_t QxGap1Amc = 0., QyGap1Amc = 0.; | |
729 | Double_t QxGap1Bmc = 0., QyGap1Bmc = 0.; | |
730 | Int_t multGap1Amc = 0, multGap1Bmc = 0; | |
731 | ||
732 | for (Int_t loop = 0; loop < 2; loop++){ | |
733 | ||
734 | Int_t nMC = arrayMC->GetEntries(); | |
735 | ||
736 | for (Int_t iMC = 0; iMC < nMC; iMC++) | |
737 | { | |
738 | AliAODMCParticle *partMC = (AliAODMCParticle*) arrayMC->At(iMC); | |
739 | if(!partMC->Charge()) continue;//Skip neutrals | |
740 | if(fCharge != 0 && partMC->Charge()*fCharge < 0.) continue;//if fCharge != 0 only select fCharge | |
741 | ||
742 | if (!(partMC->IsPhysicalPrimary())) | |
743 | continue; | |
744 | ||
745 | if (partMC->Charge() == 0) | |
746 | continue; | |
747 | ||
748 | if(partMC->Eta()<fTrackCuts->GetEtaMin() || partMC->Eta()>fTrackCuts->GetEtaMax()) continue; | |
749 | ||
750 | //Printf("a particle"); | |
751 | ||
752 | ||
753 | if (loop == 0) { | |
754 | ||
755 | if (partMC->Eta() > fEtaGapMax){ | |
756 | QxGap1Amc += TMath::Cos(2.*partMC->Phi()); | |
757 | QyGap1Amc += TMath::Sin(2.*partMC->Phi()); | |
758 | multGap1Amc++; | |
759 | } | |
760 | ||
761 | if (partMC->Eta() < fEtaGapMin){ | |
762 | QxGap1Bmc += TMath::Cos(2.*partMC->Phi()); | |
763 | QyGap1Bmc += TMath::Sin(2.*partMC->Phi()); | |
764 | multGap1Bmc++; | |
765 | } | |
766 | ||
767 | } else { | |
768 | ||
769 | //eval v2 scalar product | |
770 | if (partMC->Eta() < fEtaGapMin && multGap1Amc > 0){ | |
771 | Double_t v2SPGap1Amc = (TMath::Cos(2.*partMC->Phi())*QxGap1Amc + TMath::Sin(2.*partMC->Phi())*QyGap1Amc)/(Double_t)multGap1Amc; | |
772 | fv2SPGap1Amc->Fill(partMC->Pt(), v2SPGap1Amc); | |
773 | } | |
774 | ||
775 | if (partMC->Eta() > fEtaGapMax && multGap1Bmc > 0){ | |
776 | Double_t v2SPGap1Bmc = (TMath::Cos(2.*partMC->Phi())*QxGap1Bmc + TMath::Sin(2.*partMC->Phi())*QyGap1Bmc)/(Double_t)multGap1Bmc; | |
777 | fv2SPGap1Bmc->Fill(partMC->Pt(), v2SPGap1Bmc); | |
778 | } | |
779 | ||
780 | ||
781 | }// end else | |
782 | } // end loop on partMCs | |
783 | } // end loop | |
784 | ||
785 | if (multGap1Amc > 0 && multGap1Bmc > 0){ | |
786 | Double_t resmc = (QxGap1Amc*QxGap1Bmc + QyGap1Amc*QyGap1Bmc)/(Double_t)multGap1Amc/(Double_t)multGap1Bmc; | |
787 | fResSPmc->Fill(0.,resmc); | |
788 | } | |
789 | ||
790 | }// end if MC | |
791 | } | |
792 | ||
d0761d58 | 793 | //_________________________________________________________________ |
794 | Double_t AliAnalysisTaskV2AllChAOD::GetRecoEff(Double_t pt, Int_t iC){ | |
795 | ||
796 | if(iC>8) return 1.; | |
797 | ||
798 | if(pt<0.2 || pt>100.) return 1.; | |
799 | ||
800 | // // // //spectra ese binning | |
801 | // // // //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.}; | |
802 | // // // //const Int_t nptBins=34; | |
803 | ||
804 | const Double_t fEpsilon=0.000001; | |
805 | ||
806 | TH1F *h = (TH1F*)fRecoEffList->At(iC); | |
807 | ||
808 | Int_t bin = h->FindBin(pt); | |
809 | ||
810 | Double_t lowlim = h->GetBinLowEdge(bin); | |
811 | Double_t uplim = h->GetBinLowEdge(bin) + h->GetBinWidth(bin); | |
812 | ||
813 | if( pt>lowlim && pt<uplim ) return h->GetBinContent(bin); | |
814 | if( pt == lowlim ) return h->GetBinContent( h->FindBin(pt+fEpsilon) ); | |
815 | if( pt == uplim ) return h->GetBinContent( h->FindBin(pt-fEpsilon) ); | |
816 | ||
817 | else return 1.; | |
818 | ||
819 | } | |
10a99a07 | 820 | //_________________________________________________________________ |
821 | void AliAnalysisTaskV2AllChAOD::Terminate(Option_t *) | |
822 | { | |
823 | // Terminate | |
824 | } |