Update PR task: drathee
[u/mrichter/AliRoot.git] / PWGCF / EBYE / PIDFluctuation / task / AliEbyEPidRatioPhy.cxx
CommitLineData
0a28d543 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: ALICE Offline. *
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//=========================================================================//
18// AliEbyE Analysis for Particle Ratio Fluctuation //
19// Deepika Rathee | Satyajit Jena //
20// drathee@cern.ch | sjena@cern.ch //
21// Date: Wed Jul 9 18:38:30 CEST 2014 //
22// New approch to find particle ratio to reduce memory //
23// (Test Only) //
24//=========================================================================//
25
26#include "TMath.h"
27#include "TAxis.h"
28#include "TProfile.h"
29#include "TProfile2D.h"
30#include "TH2D.h"
31#include "TH3D.h"
32
33#include "AliStack.h"
34#include "AliMCEvent.h"
35#include "AliMCParticle.h"
36#include "AliESDEvent.h"
37#include "AliESDtrackCuts.h"
38
39#include "AliCentrality.h"
40#include "AliTracker.h"
41
42#include "AliAODEvent.h"
43#include "AliAODTrack.h"
44#include "AliAODMCParticle.h"
45
46#include "AliEbyEPidRatioPhy.h"
47
48using namespace std;
49
50ClassImp(AliEbyEPidRatioPhy)
51//________________________________________________________________________
52AliEbyEPidRatioPhy::AliEbyEPidRatioPhy() :
53 AliEbyEPidRatioBase("Dist", "Dist"),
54 fOutList(NULL),
55 fOrder(8),
6ce4ad92 56 fNNp(7),
0a28d543 57 fNp(NULL),
1648d22e 58 fNpPt(NULL),
0a28d543 59 fNMCNp(7),
60 fMCNp(NULL),
1648d22e 61 fMCNpPt(NULL),
62 fRedFactp(NULL),
63 fPtBinHist(NULL) {
0a28d543 64 AliLog::SetClassDebugLevel("AliEbyEPidRatioPhy",10);
65}
66
67//________________________________________________________________________
68AliEbyEPidRatioPhy::~AliEbyEPidRatioPhy() {
69 // Destructor
70
1648d22e 71
0a28d543 72 for (Int_t ii = 0; ii < fNNp; ++ii) {
73 for (Int_t kk = 0; kk < 2; ++kk)
74 if (fNp[ii][kk]) delete[] fNp[ii][kk];
75 if (fNp[ii]) delete[] fNp[ii];
76 }
77 if (fNp) delete[] fNp;
78
1648d22e 79
0a28d543 80 for (Int_t ii = 0; ii < fNMCNp; ++ii) {
81 for (Int_t kk = 0; kk < 2; ++kk)
82 if (fMCNp[ii][kk]) delete[] fMCNp[ii][kk];
83 if (fMCNp[ii]) delete[] fMCNp[ii];
84 }
85 if (fMCNp) delete[] fMCNp;
86
87 for (Int_t ii = 0; ii <= fOrder; ++ii)
88 if (fRedFactp[ii]) delete[] fRedFactp[ii];
89 if (fRedFactp) delete[] fRedFactp;
90
1648d22e 91 if(fPtBinHist) delete fPtBinHist;
92
93 for (Int_t ii = 0; ii < fNNp; ++ii) {
94 for (Int_t kk = 0; kk < 2; ++kk)
95 for (Int_t jj = 0; jj < 2; ++jj) {
96 if (fNpPt[ii][kk][jj]) delete[] fNpPt[ii][kk][jj];
97 if(fNpPt[ii][kk]) delete[] fNpPt[ii][kk];
98 }
99 if (fNpPt[ii]) delete[] fNpPt[ii];
100 }
101 if (fNpPt) delete[] fNpPt;
102
103
104
105 for (Int_t ii = 0; ii < fNNp; ++ii) {
106 for (Int_t kk = 0; kk < 2; ++kk)
107 for (Int_t jj = 0; jj < 2; ++jj) {
108 if (fMCNpPt[ii][kk][jj]) delete[] fMCNpPt[ii][kk][jj];
109 if(fMCNpPt[ii][kk]) delete[] fMCNpPt[ii][kk];
110 }
111 if (fMCNpPt[ii]) delete[] fMCNpPt[ii];
112 }
113 if (fMCNpPt) delete[] fMCNpPt;
114
115
116
117
118
0a28d543 119 return;
120}
121
122//________________________________________________________________________
123void AliEbyEPidRatioPhy::Process() {
124 ProcessTracks();
125 if (fIsMC)
126 ProcessParticles();
127 return;
128}
129
130//________________________________________________________________________
131void AliEbyEPidRatioPhy::Init() {
132 fNp = new Int_t**[fNNp];
133 for (Int_t ii = 0 ; ii < fNNp; ++ii) {
134 fNp[ii] = new Int_t*[4];
135 for (Int_t kk = 0 ; kk < 4; ++kk)
136 fNp[ii][kk] = new Int_t[2];
137 }
138
1648d22e 139 fNpPt = new Int_t***[fNNp];
140 for (Int_t ii = 0 ; ii < fNNp; ++ii) {
141 fNpPt[ii] = new Int_t**[4];
142 for (Int_t kk = 0 ; kk < 4; ++kk) {
143 fNpPt[ii][kk] = new Int_t*[2];
144 for (Int_t ll = 0 ; ll < 2; ++ll)
145 fNpPt[ii][kk][ll] = new Int_t[AliEbyEPidRatioHelper::fgkfHistNBinsPt];
146 }
147 }
148
0a28d543 149 fMCNp = new Int_t**[fNMCNp];
150 for (Int_t ii = 0 ; ii < fNMCNp; ++ii) {
151 fMCNp[ii] = new Int_t*[4];
152 for (Int_t kk = 0 ; kk < 4; ++kk)
153 fMCNp[ii][kk] = new Int_t[2];
154 }
155
1648d22e 156 fMCNpPt = new Int_t***[fNMCNp];
157 for (Int_t ii = 0 ; ii < fNMCNp; ++ii) {
158 fMCNpPt[ii] = new Int_t**[4];
159 for (Int_t kk = 0 ; kk < 4; ++kk) {
160 fMCNpPt[ii][kk] = new Int_t*[2];
161 for (Int_t ll = 0 ; ll < 2; ++ll)
162 fMCNpPt[ii][kk][ll] = new Int_t[AliEbyEPidRatioHelper::fgkfHistNBinsPt];
163 }
164 }
165
0a28d543 166 fRedFactp = new Double_t*[fOrder+1];
167 for (Int_t ii = 0 ; ii <= fOrder; ++ii)
168 fRedFactp[ii] = new Double_t[2];
169}
170
171//________________________________________________________________________
172void AliEbyEPidRatioPhy::Reset() {
173 for (Int_t ii = 0; ii < fNNp; ++ii)
174 for (Int_t kk = 0; kk < 4; ++kk)
175 for (Int_t jj = 0; jj < 2; ++jj)
176 fNp[ii][kk][jj] = 0;
177 for (Int_t ii = 0; ii < fNMCNp; ++ii)
178 for (Int_t kk = 0; kk < 4; ++kk)
179 for (Int_t jj = 0; jj < 2; ++jj)
180 fMCNp[ii][kk][jj] = 0;
181 for (Int_t ii = 0; ii <= fOrder; ++ii)
182 for (Int_t jj = 0; jj < 2; ++jj)
183 fRedFactp[ii][jj] = 1.;
1648d22e 184
185 for (Int_t ii = 0; ii < fNNp; ++ii)
186 for (Int_t kk = 0; kk < 4; ++kk)
187 for (Int_t jj = 0; jj < 2; ++jj)
188 for (Int_t ll = 0; ll < AliEbyEPidRatioHelper::fgkfHistNBinsPt; ++ll)
189 fNpPt[ii][kk][jj][ll] = 0;
190
191 for (Int_t ii = 0; ii < fNMCNp; ++ii)
192 for (Int_t kk = 0; kk < 4; ++kk)
193 for (Int_t jj = 0; jj < 2; ++jj)
194 for (Int_t ll = 0; ll < AliEbyEPidRatioHelper::fgkfHistNBinsPt; ++ll)
195 fMCNpPt[ii][kk][jj][ll] = 0;
196
0a28d543 197}
198
199//________________________________________________________________________
200void AliEbyEPidRatioPhy::CreateHistograms() {
1648d22e 201
0a28d543 202 Float_t etaRange[2];
203 fESDTrackCuts->GetEtaRange(etaRange[0],etaRange[1]);
0a28d543 204 Float_t ptRange[2];
205 fESDTrackCuts->GetPtRange(ptRange[0],ptRange[1]);
6ce4ad92 206
207
0a28d543 208 TString sTitle("");
1648d22e 209 fPtBinHist = new TH1F("hPtBinHist","Make the pT Bins",AliEbyEPidRatioHelper::fgkfHistNBinsPt, AliEbyEPidRatioHelper::fgkfHistRangePt[0], AliEbyEPidRatioHelper::fgkfHistRangePt[1]);
210 if (fIsRatio) AddHistSetRatio("Ratio", Form("%s, #it{p}_{T} [%.1f,%.1f]", sTitle.Data(), ptRange[0], ptRange[1]));
211
6ce4ad92 212 AddHistSetCent("Phy", Form("%s, #it{p}_{T} [%.1f,%.1f]", sTitle.Data(), ptRange[0], ptRange[1]));
213 AddHistSetCent("PhyTPC", Form("%s, #it{p}_{T} [%.1f,%.1f]", sTitle.Data(), ptRange[0], fHelper->GetMinPtForTOFRequired()));
214 AddHistSetCent("PhyTOF", Form("%s, #it{p}_{T} [%.1f,%.1f]", sTitle.Data(), fHelper->GetMinPtForTOFRequired(), ptRange[1]));
1648d22e 215 if (fIsPtBin) AddHistSetCentPt("PhyBin", Form("%s, #it{p}_{T} [%.1f,%.1f]", sTitle.Data(), ptRange[0], ptRange[1]));
216
0a28d543 217
218#if USE_PHI
6ce4ad92 219 AddHistSetCent("Phyphi", Form("%s,#it{p}_{T} [%.1f,%.1f], #varphi [%.2f,%.2f]", sTitle.Data(), ptRange[0], ptRange[1], fHelper->GetPhiMin(), fHelper->GetPhiMax()));
220 AddHistSetCent("PhyTPCphi",Form("%s, #it{p}_{T} [%.1f,%.1f], #varphi [%.2f,%.2f]",sTitle.Data(), ptRange[0], fHelper->GetMinPtForTOFRequired(), fHelper->GetPhiMin(), fHelper->GetPhiMax()));
221 AddHistSetCent("PhyTOFphi",Form("%s, #it{p}_{T} [%.1f,%.1f], #varphi [%.2f,%.2f]",sTitle.Data(), fHelper->GetMinPtForTOFRequired(), ptRange[1], fHelper->GetPhiMin(), fHelper->GetPhiMax()));
1648d22e 222 if (fIsPtBin) AddHistSetCentPt("PhyBinPhi", Form("%s, #it{p}_{T} [%.1f,%.1f], #varphi [%.2f,%.2f]",
223 sTitle.Data(), ptRange[0], ptRange[1], fHelper->GetPhiMin(), fHelper->GetPhiMax()));
0a28d543 224#endif
225
226 if (fIsMC) {
227 TString sMCTitle("");
228
f7ea34d2 229 if (fIsRatio) AddHistSetRatio("MCRatio", Form("%s, #it{p}_{T} [%.1f,%.1f]", sTitle.Data(), ptRange[0], ptRange[1]));
230
0a28d543 231 AddHistSetCent("MC", Form("%s", sTitle.Data()));
232 AddHistSetCent("MCpt", Form("%s, #it{p}_{T} [%.1f,%.1f]", sMCTitle.Data(), ptRange[0], ptRange[1]));
6ce4ad92 233 AddHistSetCent("MCTPC", Form("%s, #it{p}_{T} [%.1f,%.1f]", sMCTitle.Data(), ptRange[0], fHelper->GetMinPtForTOFRequired()));
234 AddHistSetCent("MCTOF", Form("%s, #it{p}_{T} [%.1f,%.1f]", sMCTitle.Data(), fHelper->GetMinPtForTOFRequired(), ptRange[1]));
1648d22e 235 if (fIsPtBin) AddHistSetCentPt("MCBin", Form("%s, #it{p}_{T} [%.1f,%.1f]", sMCTitle.Data(), ptRange[0], ptRange[1]));
0a28d543 236#if USE_PHI
1648d22e 237 AddHistSetCent("MCPhi", Form("%s, #it{p}_{T} [%.1f,%.1f], #varphi [%.2f,%.2f]",sMCTitle.Data(), ptRange[0], ptRange[1], fHelper->GetPhiMin(), fHelper->GetPhiMax()));
6ce4ad92 238 AddHistSetCent("MCTPCphi",Form("%s, #it{p}_{T} [%.1f,%.1f], #varphi [%.2f,%.2f]",sMCTitle.Data(), ptRange[0], fHelper->GetMinPtForTOFRequired(), fHelper->GetPhiMin(), fHelper->GetPhiMax()));
239 AddHistSetCent("MCTOFphi",Form("%s, #it{p}_{T} [%.1f,%.1f], #varphi [%.2f,%.2f]",sMCTitle.Data(), fHelper->GetMinPtForTOFRequired(), ptRange[1], fHelper->GetPhiMin(), fHelper->GetPhiMax()));
1648d22e 240 if (fIsPtBin) AddHistSetCentPt("MCBinPhi", Form("%s, #it{p}_{T} [%.1f,%.1f], #varphi [%.2f,%.2f]",
241 sMCTitle.Data(), ptRange[0], ptRange[1], fHelper->GetPhiMin(), fHelper->GetPhiMax()));
0a28d543 242#endif
243
244 }
245
246 return;
247}
248
249//________________________________________________________________________
250Int_t AliEbyEPidRatioPhy::ProcessTracks() {
251 Float_t etaRange[2];
252 fESDTrackCuts->GetEtaRange(etaRange[0],etaRange[1]);
0a28d543 253 Float_t ptRange[2];
254 fESDTrackCuts->GetPtRange(ptRange[0],ptRange[1]);
6ce4ad92 255
0a28d543 256 // -- Track Loop
257 for (Int_t idxTrack = 0; idxTrack < fNTracks; ++idxTrack) {
258 AliVTrack *track = (fESD) ? static_cast<AliVTrack*>(fESD->GetTrack(idxTrack)) : static_cast<AliVTrack*>(fAOD->GetTrack(idxTrack));
259 // -- Check if track is accepted for basic parameters
260 if (!fHelper->IsTrackAcceptedBasicCharged(track))
261 continue;
262 // -- Check if accepted - ESD
263 if (fESD && !fESDTrackCuts->AcceptTrack(dynamic_cast<AliESDtrack*>(track)))
264 continue;
265 // -- Check if accepted - AOD
266 if (fAOD){
267 AliAODTrack * trackAOD = dynamic_cast<AliAODTrack*>(track);
268
269 if (!trackAOD) {
270 AliError("Pointer to dynamic_cast<AliAODTrack*>(track) = ZERO");
271 continue;
272 }
273 if (!trackAOD->TestFilterBit(fAODtrackCutBit))
274 continue;
275 if(!(track->Pt() > ptRange[0] && track->Pt() <= ptRange[1] && TMath::Abs(track->Eta()) <= etaRange[1]))
276 continue;
277 }
278
279 if (!fHelper->IsTrackAcceptedDCA(track))
280 continue;
281
282 Int_t iPid = 0;
283 Double_t pid[3];
284 if (fHelper->IsTrackAcceptedPID(track, pid, (AliPID::kPion))) iPid = 1;
285 else if (fHelper->IsTrackAcceptedPID(track, pid, (AliPID::kKaon))) iPid = 2;
286 else if (fHelper->IsTrackAcceptedPID(track, pid, (AliPID::kProton))) iPid = 3;
287 else iPid = 0;
288
289 Double_t yP;
290 if (iPid != 0 && !fHelper->IsTrackAcceptedRapidity(track, yP, iPid))
291 continue;
292
293 Int_t idxPart = (track->Charge() < 0) ? 0 : 1;
294 // -- in pt Range
295 fNp[0][0][idxPart] += 1;
296 if(iPid != 0) fNp[0][iPid][idxPart] += 1;
1648d22e 297
298 Int_t idxPt = fPtBinHist->FindBin(track->Pt()) -1;
299
300 if (idxPt>=0 && idxPt < AliEbyEPidRatioHelper::fgkfHistNBinsPt) {
301 fNpPt[0][0][idxPart][idxPt] += 1;
302 if(iPid != 0) fNpPt[0][iPid][idxPart][idxPt] += 1;
303 }
304
0a28d543 305 // -- in TPC pt Range
6ce4ad92 306 if (track->Pt() <= fHelper->GetMinPtForTOFRequired()) {
0a28d543 307 fNp[1][0][idxPart] += 1;
308 if(iPid != 0) fNp[1][iPid][idxPart] += 1;
309 }
310 // -- in TPC+TOF pt Range
311 if (track->Pt() > fHelper->GetMinPtForTOFRequired()){
312 fNp[2][0][idxPart] += 1;
313 if(iPid != 0) fNp[2][iPid][idxPart] += 1;
6ce4ad92 314 }
0a28d543 315
316#if USE_PHI
317 if(!fHelper->IsTrackAcceptedPhi(track))
318 continue;
319
320 // -- in pt Range
321 fNp[3][iPid][idxPart] += 1;
322 if(iPid != 0) fNp[3][0][idxPart] += 1;
1648d22e 323
324 if (idxPt>=0 && idxPt < AliEbyEPidRatioHelper::fgkfHistNBinsPt) {
325 fNpPt[1][0][idxPart][idxPt] += 1;
326 if(iPid != 0) fNpPt[1][iPid][idxPart][idxPt] += 1;
327 }
328
0a28d543 329 // -- in TPC pt Range
6ce4ad92 330 if (track->Pt() <= fHelper->GetMinPtForTOFRequired()) {
0a28d543 331 fNp[4][0][idxPart] += 1;
332 if(iPid != 0)fNp[4][iPid][idxPart] += 1;
333 }
334 // -- in TPC+TOF pt Range
335 if (track->Pt() > fHelper->GetMinPtForTOFRequired()) {
336 fNp[5][0][idxPart] += 1;
6ce4ad92 337 if(iPid != 0) fNp[5][iPid][idxPart] += 1;
0a28d543 338 }
339#endif
340 } // for (Int_t idxTrack = 0; idxTrack < fESD->GetNumberOfTracks(); ++idxTrack) {
341
6ce4ad92 342 FillHistSetCent("Phy", 0, kFALSE);
343 FillHistSetCent("PhyTPC", 1, kFALSE);
344 FillHistSetCent("PhyTOF", 2, kFALSE);
345
346 if (fIsRatio) FillHistSetRatio("Ratio", 0, kFALSE);
347 if (fIsPtBin) FillHistSetCentPt("PhyBin", 0, kFALSE);
0a28d543 348#if USE_PHI
6ce4ad92 349 FillHistSetCent("Phyphi", 3, kFALSE);
350 FillHistSetCent("PhyTPCphi", 4, kFALSE);
351 FillHistSetCent("PhyTOFphi", 5, kFALSE);
352 if (fIsPtBin) FillHistSetCentPt("PhyBinPhi", 1, kFALSE);
0a28d543 353 #endif
0a28d543 354
355 return 0;
356}
357
358//________________________________________________________________________
359Int_t AliEbyEPidRatioPhy::ProcessParticles() {
360 // -- Process primary particles from the stack and fill histograms
361
362 Float_t etaRange[2];
363 fESDTrackCuts->GetEtaRange(etaRange[0],etaRange[1]);
0a28d543 364 Float_t ptRange[2];
365 fESDTrackCuts->GetPtRange(ptRange[0],ptRange[1]);
366
6ce4ad92 367
0a28d543 368 for (Int_t idxMC = 0; idxMC < fStack->GetNprimary(); ++idxMC) {
369 AliVParticle* particle = (fESD) ? fMCEvent->GetTrack(idxMC) : NULL;
370
371 if (!particle)
372 continue;
373 if (!fHelper->IsParticleAcceptedBasicCharged(particle, idxMC))
374 continue;
375
376 Int_t iPid = 0;
377 if (TMath::Abs(particle->PdgCode()) == 211) iPid = 1; // pion
378 else if (TMath::Abs(particle->PdgCode()) == 321) iPid = 2; // kaon
379 else if (TMath::Abs(particle->PdgCode()) == 2212) iPid = 3; // proton
380 else iPid = 0;
381
382 Double_t yMC;
383 if ((iPid != 0) && !fHelper->IsParticleAcceptedRapidity(particle, yMC, iPid))
384 continue;
385
386 // -- Check eta window -- for charged particles
387 if ((iPid == 0) && TMath::Abs(particle->Eta()) > etaRange[1])
388 continue;
389
390 Int_t idxPart = (particle->PdgCode() < 0) ? 0 : 1;
391
6ce4ad92 392 // idx 0
0a28d543 393 fMCNp[0][0][idxPart] += 1.;
394 if(iPid != 0) fMCNp[0][iPid][idxPart] += 1.;
395
396 // -- Check main pt window
397 if (!(particle->Pt() > ptRange[0] && particle->Pt() <= ptRange[1]))
398 continue;
399
6ce4ad92 400 // -- in pt Range idx 1
0a28d543 401 fMCNp[1][0][idxPart] += 1.;
402 if(iPid != 0)fMCNp[1][iPid][idxPart] += 1.;
403
1648d22e 404
6ce4ad92 405
406
1648d22e 407 Int_t idxPt = fPtBinHist->FindBin(particle->Pt()) -1;
408
409 if (idxPt>=0 && idxPt < AliEbyEPidRatioHelper::fgkfHistNBinsPt) {
410 fMCNpPt[0][0][idxPart][idxPt] += 1;
411 if(iPid != 0) fMCNpPt[0][iPid][idxPart][idxPt] += 1;
412 }
413
414
6ce4ad92 415
0a28d543 416#if USE_PHI
417 if(!fHelper->IsParticleAcceptedPhi(particle))
418 continue;
419 // idxPhi = 1;
420
1648d22e 421 if (idxPt>=0 && idxPt < AliEbyEPidRatioHelper::fgkfHistNBinsPt) {
422 fMCNpPt[1][0][idxPart][idxPt] += 1;
423 if(iPid != 0) fMCNpPt[1][iPid][idxPart][idxPt] += 1;
424 }
425
0a28d543 426 // -- in pt Range
6ce4ad92 427 fMCNp[2][0][idxPart] += 1;
428 if(iPid != 0)fMCNp[2][iPid][idxPart] += 1;
0a28d543 429
6ce4ad92 430
0a28d543 431#endif
432 } // for (Int_t idxMC = 0; idxMC < nPart; ++idxMC) {
433
6ce4ad92 434 FillHistSetCent("MC", 0, kTRUE);
435 FillHistSetCent("MCpt", 1, kTRUE);
1648d22e 436
6ce4ad92 437 if (fIsRatio) FillHistSetRatio("MCRatio", 0, kTRUE);
438 if (fIsPtBin) FillHistSetCentPt("MCBin", 0, kTRUE);
0a28d543 439
0a28d543 440
6ce4ad92 441#if USE_PHI
442 FillHistSetCent("MCphi", 2, kTRUE);
443 if (fIsPtBin) FillHistSetCentPt("MCBinPhi", 1, kTRUE);
0a28d543 444#endif
445
446 return 0;
447}
448
449//________________________________________________________________________
450void AliEbyEPidRatioPhy::AddHistSetCent(const Char_t *name, const Char_t *title) {
451 TString sName(name);
452 TString sTitle(title);
30f94f08 453
0a28d543 454 Float_t etaRange[2];
1648d22e 455
0a28d543 456 fESDTrackCuts->GetEtaRange(etaRange[0],etaRange[1]);
457
30f94f08 458 //TList *list[4];
459 fOutList->Add(new TList);
460 TList *list = static_cast<TList*>(fOutList->Last());
461 list->SetName(Form("f%s", name));
462 list->SetOwner(kTRUE);
463
eda5b3c1 464
465 Int_t nBinsCent = AliEbyEPidRatioHelper::fgkfHistNBinsCent;
466 Double_t centBinRange[] = {AliEbyEPidRatioHelper::fgkfHistRangeCent[0], AliEbyEPidRatioHelper::fgkfHistRangeCent[1]};
467
eda5b3c1 468
0a28d543 469 for (Int_t iPid = 0; iPid < 4; ++iPid) {
0a28d543 470 TString sNetTitle(Form("%s - %s", AliEbyEPidRatioHelper::fgkPidLatex[iPid][1], AliEbyEPidRatioHelper::fgkPidLatex[iPid][0]));
471
472 sTitle = (iPid != 0 ) ? Form("|y| < %.1f", fHelper->GetRapidityMax()) : Form(" |#eta|<%.1f", etaRange[1]);
473
474 for (Int_t idx = 1; idx <= fOrder; ++idx) {
30f94f08 475 list->Add(new TProfile(Form("fProf%s%sNet%dM", AliEbyEPidRatioHelper::fgkPidName[iPid],name, idx),
0a28d543 476 Form("(%s)^{%d} : %s;Centrality(100);(%s)^{%d}",sNetTitle.Data(), idx, sTitle.Data(), sNetTitle.Data(), idx),
477 100,-0.5,99.5));
478 }
479
480 for (Int_t ii = 0; ii <= fOrder; ++ii) {
481 for (Int_t kk = 0; kk <= fOrder; ++kk) {
30f94f08 482 list->Add(new TProfile(Form("fProf%s%sNetF%02d%02d", AliEbyEPidRatioHelper::fgkPidName[iPid], name, ii, kk),
0a28d543 483 Form("f_{%02d%02d} : %s;Centrality(100);f_{%02d%02d}", ii, kk, sTitle.Data(), ii, kk),
484 100,-0.5,99.5));
485 }
486 }
487
488 }
489
0a28d543 490 for (Int_t iPhy = 0; iPhy < 46; ++iPhy) {
30f94f08 491 list->Add(new TProfile(Form("fProf%sNu%02d",name,iPhy),Form("Physics Variable for index %d | %s ; Centrality;",iPhy,name),100,-0.5,99.5));
0a28d543 492 }
493
eda5b3c1 494
0a28d543 495 for (Int_t iPid = 0; iPid < 4; ++iPid) {
496 TString sNetTitle(Form("%s - %s", AliEbyEPidRatioHelper::fgkPidLatex[iPid][1], AliEbyEPidRatioHelper::fgkPidLatex[iPid][0]));
497 sTitle = (iPid != 0 ) ? Form(" |y|<%.1f", fHelper->GetRapidityMax()) : Form(" |#eta| < %.1f", etaRange[1]);
498
499 for (Int_t idx = 1; idx <= fOrder; ++idx) {
30f94f08 500 list->Add(new TProfile(Form("fProfBin%s%sNet%dM", AliEbyEPidRatioHelper::fgkPidName[iPid],name, idx),
0a28d543 501 Form("(%s)^{%d} : %s;Centrality(11);(%s)^{%d}", sNetTitle.Data(), idx, sTitle.Data(), sNetTitle.Data(), idx),
502 nBinsCent, centBinRange[0], centBinRange[1]));
503 }
504
505 for (Int_t ii = 0; ii <= fOrder; ++ii) {
506 for (Int_t kk = 0; kk <= fOrder; ++kk) {
30f94f08 507 list->Add(new TProfile(Form("fProfBin%s%sNetF%02d%02d", AliEbyEPidRatioHelper::fgkPidName[iPid], name, ii, kk),
0a28d543 508 Form("f_{%02d%02d} : %s;Centrality(11);f_{%02d%02d}", ii, kk, sTitle.Data(), ii, kk),
509 nBinsCent, centBinRange[0], centBinRange[1]));
510 }
511 }
512
513 }
514
515
516 for (Int_t iPhy = 0; iPhy < 46; ++iPhy) {
30f94f08 517 list->Add(new TProfile(Form("fProfBin%sNu%02d",name,iPhy),Form("Physics Variable for index %d | %s ; Centrality;",iPhy,name),nBinsCent, centBinRange[0], centBinRange[1]));
518 }
519
0a28d543 520 return;
521}
522
f7ea34d2 523
524
525//________________________________________________________________________
526void AliEbyEPidRatioPhy::AddHistSetRatio(const Char_t *name, const Char_t *title) {
527 TString sName(name);
528 TString sTitle(title);
529
530 Float_t etaRange[2];
531 fESDTrackCuts->GetEtaRange(etaRange[0],etaRange[1]);
532
533 //TList *list[4];
534 fOutList->Add(new TList);
535 TList *list = static_cast<TList*>(fOutList->Last());
536 list->SetName(Form("f%s", name));
537 list->SetOwner(kTRUE);
538
6ce4ad92 539 Int_t nRbin = 10000;
1648d22e 540 Double_t mRat[] = {0,1};
f7ea34d2 541
542 Int_t nBinsCent = AliEbyEPidRatioHelper::fgkfHistNBinsCent;
543 Double_t centBinRange[] = {AliEbyEPidRatioHelper::fgkfHistRangeCent[0], AliEbyEPidRatioHelper::fgkfHistRangeCent[1]};
544
545 TString xyz = Form("|y| < %.1f",fHelper->GetRapidityMax());
546
547 list->Add(new TH2F(Form("fHistRatioKPi%s",name),
548 Form("(%s %s) : K/#pi;Centrality(11);K/#pi", xyz.Data(), sTitle.Data()),
1648d22e 549 nBinsCent, centBinRange[0], centBinRange[1], nRbin,mRat[0],mRat[1]));
f7ea34d2 550
551 list->Add(new TH2F(Form("fHistRatioKpPip%s",name),
552 Form("(%s %s) : K^{+}/#pi^{+};Centrality(11);K^{+}/#pi^{+}", xyz.Data(), sTitle.Data()),
1648d22e 553 nBinsCent, centBinRange[0], centBinRange[1], nRbin,mRat[0],mRat[1]));
f7ea34d2 554
555 list->Add(new TH2F(Form("fHistRatioKmPip%s",name),
556 Form("(%s %s) : K^{-}/#pi^{+};Centrality(11);K^{-}/#pi^{+}", xyz.Data(), sTitle.Data()),
1648d22e 557 nBinsCent, centBinRange[0], centBinRange[1], nRbin,mRat[0],mRat[1]));
f7ea34d2 558
559 list->Add(new TH2F(Form("fHistRatioKmPim%s",name),
560 Form("(%s %s) : K^{-}/#pi^{-};Centrality(11);K^{-}/#pi^{-}", xyz.Data(), sTitle.Data()),
1648d22e 561 nBinsCent, centBinRange[0], centBinRange[1], nRbin,mRat[0],mRat[1]));
f7ea34d2 562
563
564
565 list->Add(new TH2F(Form("fHistRatioPK%s",name),
566 Form("(%s %s) : P/K;Centrality(11);P/K", xyz.Data(), sTitle.Data()),
1648d22e 567 nBinsCent, centBinRange[0], centBinRange[1], nRbin,mRat[0],mRat[1]));
f7ea34d2 568
569 list->Add(new TH2F(Form("fHistRatioPpKp%s",name),
570 Form("(%s %s) : P/K^{+};Centrality(11);P/K^{+}", xyz.Data(), sTitle.Data()),
1648d22e 571 nBinsCent, centBinRange[0], centBinRange[1], nRbin,mRat[0],mRat[1]));
f7ea34d2 572
573 list->Add(new TH2F(Form("fHistRatioPmKp%s",name),
574 Form("(%s %s) : #bar{P}/K^{+};Centrality(11);#bar{P}/K^{+}", xyz.Data(), sTitle.Data()),
1648d22e 575 nBinsCent, centBinRange[0], centBinRange[1], nRbin,mRat[0],mRat[1]));
f7ea34d2 576
577 list->Add(new TH2F(Form("fHistRatioPmKm%s",name),
578 Form("(%s %s) : #bar{P}/K^{-};Centrality(11);#bar{P}/K^{-}", xyz.Data(), sTitle.Data()),
1648d22e 579 nBinsCent, centBinRange[0], centBinRange[1], nRbin,mRat[0],mRat[1]));
f7ea34d2 580
581
582
583 list->Add(new TH2F(Form("fHistRatioPPi%s",name),
584 Form("(%s %s) : P/#pi;Centrality(11);K/#pi", xyz.Data(), sTitle.Data()),
1648d22e 585 nBinsCent, centBinRange[0], centBinRange[1], nRbin,mRat[0],mRat[1]));
f7ea34d2 586
587 list->Add(new TH2F(Form("fHistRatioPpPip%s",name),
588 Form("(%s %s) : P/#pi^{+};Centrality(11);P/#pi^{+}", xyz.Data(), sTitle.Data()),
1648d22e 589 nBinsCent, centBinRange[0], centBinRange[1], nRbin,mRat[0],mRat[1]));
f7ea34d2 590
591 list->Add(new TH2F(Form("fHistRatioPmPip%s",name),
592 Form("(%s %s) : #bar{P}/#pi^{+};Centrality(11);#bar{P}/#pi^{+}", xyz.Data(), sTitle.Data()),
1648d22e 593 nBinsCent, centBinRange[0], centBinRange[1], nRbin,mRat[0],mRat[1]));
f7ea34d2 594
595 list->Add(new TH2F(Form("fHistRatioPmPim%s",name),
596 Form("(%s %s) : #bar{P}/#pi^{-};Centrality(11);#bar{P}/#pi^{-}", xyz.Data(), sTitle.Data()),
1648d22e 597 nBinsCent, centBinRange[0], centBinRange[1], nRbin,mRat[0],mRat[1]));
f7ea34d2 598 return;
599}
600
0a28d543 601//________________________________________________________________________
602void AliEbyEPidRatioPhy::FillHistSetCent(const Char_t *name, Int_t idx, Bool_t isMC) {
30f94f08 603 Int_t ***np = (isMC) ? fMCNp : fNp;
604
0a28d543 605 Float_t centralityBin = fHelper->GetCentralityBin();
6ce4ad92 606 Float_t centralityPer = fHelper->GetCentralityPercentile();
0a28d543 607
30f94f08 608 TList *list = static_cast<TList*>(fOutList->FindObject(Form("f%s",name)));
609
0a28d543 610 for (Int_t iPid = 0; iPid < 4; ++iPid) {
0a28d543 611 Int_t deltaNp = np[idx][iPid][1]-np[idx][iPid][0];
0a28d543 612 Double_t delta = 1.;
613 for (Int_t idxOrder = 1; idxOrder <= fOrder; ++idxOrder) {
614 delta *= deltaNp;
30f94f08 615 (static_cast<TProfile*>(list->FindObject(Form("fProfBin%s%sNet%dM", AliEbyEPidRatioHelper::fgkPidName[iPid], name, idxOrder))))->Fill(centralityBin, delta);
616 (static_cast<TProfile*>(list->FindObject(Form("fProf%s%sNet%dM", AliEbyEPidRatioHelper::fgkPidName[iPid], name, idxOrder))))->Fill(centralityPer, delta);
0a28d543 617 }
30f94f08 618
0a28d543 619 for (Int_t idxOrder = 0; idxOrder <= fOrder; ++ idxOrder) {
620 fRedFactp[idxOrder][0] = 1.;
621 fRedFactp[idxOrder][1] = 1.;
622 }
623
624 for (Int_t idxOrder = 1; idxOrder <= fOrder; ++ idxOrder) {
625 fRedFactp[idxOrder][0] = fRedFactp[idxOrder-1][0] * Double_t(np[idx][iPid][0]-(idxOrder-1));
626 fRedFactp[idxOrder][1] = fRedFactp[idxOrder-1][1] * Double_t(np[idx][iPid][1]-(idxOrder-1));
627 }
628
6ce4ad92 629 for (Int_t ii = 0; ii <= fOrder; ++ii) {
630 for (Int_t kk = 0; kk <= fOrder; ++kk) {
631 Double_t fik = fRedFactp[ii][1] * fRedFactp[kk][0];
30f94f08 632 (static_cast<TProfile*>(list->FindObject(Form("fProfBin%s%sNetF%02d%02d", AliEbyEPidRatioHelper::fgkPidName[iPid], name, ii, kk))))->Fill(centralityBin, fik);
633 (static_cast<TProfile*>(list->FindObject(Form("fProf%s%sNetF%02d%02d", AliEbyEPidRatioHelper::fgkPidName[iPid], name, ii, kk))))->Fill(centralityPer, fik);
0a28d543 634 }
635 }
636 }
fa4f1804 637
6ce4ad92 638 /* Printf("%6d %20s %6.2f %6d %6d %6d %6d %6d %6d %6d %6d", idx, name, centralityBin,
639 np[idx][0][1], np[idx][0][0],
640 np[idx][1][1], np[idx][1][0],
641 np[idx][2][1], np[idx][2][0],
642 np[idx][3][1], np[idx][3][0]);*/
643
644
0a28d543 645 Double_t a[6][4]; Double_t b[22];
646 for (Int_t iPid = 0; iPid < 4; ++iPid) {
647 a[0][iPid] = np[idx][iPid][1]+np[idx][iPid][0]; // 0 n+ + n-
648 a[1][iPid] = np[idx][iPid][1]; // 1 n+
649 a[2][iPid] = np[idx][iPid][0]; // 2 n-
650 a[3][iPid] = np[idx][iPid][1]*np[idx][iPid][0]; // 3 n+ . n-
651 a[4][iPid] = np[idx][iPid][1]*(np[idx][iPid][1]-1); // 4 n+ (n+ - 1)
652 a[5][iPid] = np[idx][iPid][0]*(np[idx][iPid][0]-1); // 5 n- (n- - 1)
653 }
654
655 b[0] = a[0][0]*a[0][2]; // 24 N K
656 b[1] = a[0][1]*a[0][2]; // 25 Pi K
657 b[2] = a[1][1]*a[1][2]; // 26 pi+ k+
658 b[3] = a[1][1]*a[2][2]; // 27 pi+ k-
659 b[4] = a[2][1]*a[1][2]; // 28 pi- k+
660 b[5] = a[2][1]*a[2][2]; // 29 pi- k-
661
662 b[6] = a[0][0]*a[0][3]; // 30 N P
663 b[7] = a[0][2]*a[0][3]; // 31 K P
664 b[8] = a[1][2]*a[1][3]; // 32 k+ p+
665 b[9] = a[1][2]*a[2][3]; // 33 k+ p-
666 b[10] = a[2][2]*a[1][3]; // 34 k- p+
667 b[11] = a[2][2]*a[2][3]; // 35 k- p-
668
669 b[12] = a[0][0]*a[0][1]; // 36 N Pi
670 b[13] = a[0][3]*a[0][1]; // 37 P Pi
671 b[14] = a[1][3]*a[1][1]; // 38 p+ pi+
672 b[15] = a[1][3]*a[2][1]; // 39 p+ pi-
673 b[16] = a[2][3]*a[1][1]; // 40 p- pi+
674 b[17] = a[2][3]*a[2][1]; // 41 p- pi-
675
676 b[18] = a[0][0]*(a[0][0] - 1); // 42 N ( N - 1 )
677 b[19] = a[0][1]*(a[0][1] - 1); // 43 Pi( Pi- 1 )
678 b[20] = a[0][2]*(a[0][1] - 1); // 44 K ( K - 1 )
679 b[21] = a[0][3]*(a[0][3] - 1); // 45 P ( P - 1 )
30f94f08 680 // TList *list_nu = static_cast<TList*>(fOutList->FindObject(Form("f%s_nu",name)));
0a28d543 681 Int_t k = 0;
682 for (Int_t i = 0; i < 6; i++) {
683 for (Int_t j = 0; j < 4; j++) {
30f94f08 684 (static_cast<TProfile*>(list->FindObject(Form("fProfBin%sNu%02d", name,k))))->Fill(centralityBin,a[i][j]);
685 (static_cast<TProfile*>(list->FindObject(Form("fProf%sNu%02d", name,k))))->Fill(centralityPer,a[i][j]);
0a28d543 686 k++;
687 }
688 }
689
690 for (Int_t j = 0; j < 22; j++) {
9b5bc5a1 691 (static_cast<TProfile*>(list->FindObject(Form("fProfBin%sNu%02d", name,j+24))))->Fill(centralityBin,b[j]);
692 (static_cast<TProfile*>(list->FindObject(Form("fProf%sNu%02d", name,j+24))))->Fill(centralityPer,b[j]);
0a28d543 693 }
694
695 return;
696}
eda5b3c1 697
698
f7ea34d2 699//________________________________________________________________________
700void AliEbyEPidRatioPhy::FillHistSetRatio(const Char_t *name, Int_t idx, Bool_t isMC) {
701
702 Int_t ***np = (isMC) ? fMCNp : fNp;
6ce4ad92 703
f7ea34d2 704 Float_t centralityBin = fHelper->GetCentralityBin();
705
706 TList *list = static_cast<TList*>(fOutList->FindObject(Form("f%s",name)));
707
708 Double_t KPi = -1; if(np[idx][1][1]+np[idx][1][0] != 0 ) KPi = (np[idx][2][1]+np[idx][2][0])/(np[idx][1][1]+np[idx][1][0]);
709 Double_t KpPip = -1;
710 Double_t KmPip = -1;if (np[idx][1][1] != 0 ) { KpPip = (np[idx][2][1])/(np[idx][1][1]); KmPip = (np[idx][2][0])/(np[idx][1][1]); }
711 Double_t KmPim = -1;if (np[idx][1][0] != 0) KmPim = (np[idx][2][0])/(np[idx][1][0]);
712
713 (static_cast<TProfile*>(list->FindObject(Form("fHistRatioKPi%s",name))))->Fill(centralityBin, KPi);
714 (static_cast<TProfile*>(list->FindObject(Form("fHistRatioKpPip%s",name))))->Fill(centralityBin, KpPip);
715 (static_cast<TProfile*>(list->FindObject(Form("fHistRatioKmPip%s",name))))->Fill(centralityBin, KmPip);
716 (static_cast<TProfile*>(list->FindObject(Form("fHistRatioKmPim%s",name))))->Fill(centralityBin, KmPim);
717
718 Double_t PK = -1; if(np[idx][2][1]+np[idx][2][0] != 0 ) PK = (np[idx][3][1]+np[idx][3][0])/(np[idx][2][1]+np[idx][2][0]);
719 Double_t PpKp = -1;
720 Double_t PmKp = -1;if (np[idx][2][1] != 0 ) { PpKp = (np[idx][3][1])/(np[idx][2][1]); PmKp = (np[idx][3][0])/(np[idx][2][1]); }
721 Double_t PmKm = -1;if (np[idx][2][0] != 0) PmKm = (np[idx][3][0])/(np[idx][2][0]);
722
723 (static_cast<TProfile*>(list->FindObject(Form("fHistRatioPK%s",name))))->Fill(centralityBin, PK);
724 (static_cast<TProfile*>(list->FindObject(Form("fHistRatioPpKp%s",name))))->Fill(centralityBin, PpKp);
725 (static_cast<TProfile*>(list->FindObject(Form("fHistRatioPmKp%s",name))))->Fill(centralityBin, PmKp);
726 (static_cast<TProfile*>(list->FindObject(Form("fHistRatioPmKm%s",name))))->Fill(centralityBin, PmKm);
727
728 Double_t PPi = -1; if(np[idx][1][1]+np[idx][1][0] != 0 ) PPi = (np[idx][3][1]+np[idx][3][0])/(np[idx][1][1]+np[idx][1][0]);
729 Double_t PpPip = -1;
730 Double_t PmPip = -1;if (np[idx][1][1] != 0 ) { PpPip = (np[idx][3][1])/(np[idx][1][1]); PmPip = (np[idx][3][0])/(np[idx][1][1]); }
731 Double_t PmPim = -1;if (np[idx][1][0] != 0) PmPim = (np[idx][3][0])/(np[idx][1][0]);
732
6ce4ad92 733 (static_cast<TProfile*>(list->FindObject(Form("fHistRatioPPi%s",name))))->Fill(centralityBin, PPi);
f7ea34d2 734 (static_cast<TProfile*>(list->FindObject(Form("fHistRatioPpPip%s",name))))->Fill(centralityBin, PpPip);
735 (static_cast<TProfile*>(list->FindObject(Form("fHistRatioPmPip%s",name))))->Fill(centralityBin, PmPip);
736 (static_cast<TProfile*>(list->FindObject(Form("fHistRatioPmPim%s",name))))->Fill(centralityBin, PmPim);
737
738 return;
739}
740
1648d22e 741
742//________________________________________________________________________
743void AliEbyEPidRatioPhy::AddHistSetCentPt(const Char_t *name, const Char_t *title) {
744 TString sName(name);
745 TString sTitle(title);
746
747 Float_t etaRange[2];
748 fESDTrackCuts->GetEtaRange(etaRange[0],etaRange[1]);
749
750 //TList *list[4];
751 fOutList->Add(new TList);
752 TList *list = static_cast<TList*>(fOutList->Last());
753 list->SetName(Form("f%s", name));
754 list->SetOwner(kTRUE);
755
756
757 Int_t nBinsCent = AliEbyEPidRatioHelper::fgkfHistNBinsCent;
758 Double_t centBinRange[] = {AliEbyEPidRatioHelper::fgkfHistRangeCent[0], AliEbyEPidRatioHelper::fgkfHistRangeCent[1]};
759 Int_t nBinsPt = AliEbyEPidRatioHelper::fgkfHistNBinsPt;
760 Double_t ptBinRange[] = {-0.5, AliEbyEPidRatioHelper::fgkfHistNBinsPt - 0.5};
761
762 for (Int_t iPid = 0; iPid < 4; ++iPid) {
763 TString sNetTitle(Form("%s - %s", AliEbyEPidRatioHelper::fgkPidLatex[iPid][1], AliEbyEPidRatioHelper::fgkPidLatex[iPid][0]));
764 sTitle = (iPid != 0 ) ? Form("|y| < %.1f", fHelper->GetRapidityMax()) : Form(" |#eta|<%.1f", etaRange[1]);
765 for (Int_t idx = 1; idx <= fOrder; ++idx) {
766 list->Add(new TProfile2D(Form("fProf%s%sNetPt%dM", AliEbyEPidRatioHelper::fgkPidName[iPid],name, idx),
767 Form("(%s)^{%d} Pt: %s;Centrality(100);(%s)^{%d}",sNetTitle.Data(), idx, sTitle.Data(), sNetTitle.Data(), idx),
768 100,-0.5,99.5, nBinsPt, ptBinRange[0], ptBinRange[1]));
769 }
770
771 for (Int_t ii = 0; ii <= fOrder; ++ii) {
772 for (Int_t kk = 0; kk <= fOrder; ++kk) {
773 list->Add(new TProfile2D(Form("fProf%s%sNetPtF%02d%02d", AliEbyEPidRatioHelper::fgkPidName[iPid], name, ii, kk),
774 Form("f_{%02d%02d} Pt: %s;Centrality(100);f_{%02d%02d}", ii, kk, sTitle.Data(), ii, kk),
775 100,-0.5,99.5, nBinsPt, ptBinRange[0], ptBinRange[1]));
776 }
777 }
778
779 }
780
781 for (Int_t iPid = 0; iPid < 4; ++iPid) {
782 TString sNetTitle(Form("%s - %s", AliEbyEPidRatioHelper::fgkPidLatex[iPid][1], AliEbyEPidRatioHelper::fgkPidLatex[iPid][0]));
783 sTitle = (iPid != 0 ) ? Form("|y| < %.1f", fHelper->GetRapidityMax()) : Form(" |#eta|<%.1f", etaRange[1]);
784 for (Int_t idx = 1; idx <= fOrder; ++idx) {
785 list->Add(new TProfile2D(Form("fProfBin%s%sNetPt%dM", AliEbyEPidRatioHelper::fgkPidName[iPid],name, idx),
786 Form("(%s)^{%d} Pt: %s;Centrality(11);(%s)^{%d}", sNetTitle.Data(), idx, sTitle.Data(), sNetTitle.Data(), idx),
787 nBinsCent, centBinRange[0], centBinRange[1],nBinsPt, ptBinRange[0], ptBinRange[1]));
788 }
789
790 for (Int_t ii = 0; ii <= fOrder; ++ii) {
791 for (Int_t kk = 0; kk <= fOrder; ++kk) {
792 list->Add(new TProfile2D(Form("fProfBin%s%sNetPtF%02d%02d", AliEbyEPidRatioHelper::fgkPidName[iPid], name, ii, kk),
793 Form("f_{%02d%02d} Pt : %s;Centrality(11);f_{%02d%02d}", ii, kk, sTitle.Data(), ii, kk),
794 nBinsCent, centBinRange[0], centBinRange[1],nBinsPt, ptBinRange[0], ptBinRange[1]));
795 }
796 }
797 }
798
799 return;
800}
801
802//________________________________________________________________________
803void AliEbyEPidRatioPhy::FillHistSetCentPt(const Char_t *name, Int_t idx, Bool_t isMC) {
804
805 Int_t ****np = (isMC) ? fMCNpPt : fNpPt;
806
807 Float_t centralityBin = fHelper->GetCentralityBin();
808 Float_t centralityPer = fHelper->GetCentralityPercentile();
809
810 TList *list = static_cast<TList*>(fOutList->FindObject(Form("f%s",name)));
811
812
813 for (Int_t idxPt = 0; idxPt < AliEbyEPidRatioHelper::fgkfHistNBinsPt; ++idxPt) {
814 for (Int_t iPid = 0; iPid < 4; ++iPid) {
815 Int_t deltaNp = np[idx][iPid][1][idxPt]-np[idx][iPid][0][idxPt];
816 Double_t delta = 1.;
817 for (Int_t idxOrder = 1; idxOrder <= fOrder; ++idxOrder) {
818 delta *= deltaNp;
819 (static_cast<TProfile2D*>(list->FindObject(Form("fProfBin%s%sNetPt%dM", AliEbyEPidRatioHelper::fgkPidName[iPid], name, idxOrder))))->Fill(centralityBin,idxPt, delta);
820 (static_cast<TProfile2D*>(list->FindObject(Form("fProf%s%sNetPt%dM", AliEbyEPidRatioHelper::fgkPidName[iPid], name, idxOrder))))->Fill(centralityPer,idxPt, delta);
821 }
822
823 for (Int_t idxOrder = 0; idxOrder <= fOrder; ++ idxOrder) {
824 fRedFactp[idxOrder][0] = 1.;
825 fRedFactp[idxOrder][1] = 1.;
826 }
827
828 for (Int_t idxOrder = 1; idxOrder <= fOrder; ++ idxOrder) {
829 fRedFactp[idxOrder][0] = fRedFactp[idxOrder-1][0] * Double_t(np[idx][iPid][0][idxPt]-(idxOrder-1));
830 fRedFactp[idxOrder][1] = fRedFactp[idxOrder-1][1] * Double_t(np[idx][iPid][1][idxPt]-(idxOrder-1));
831 }
832
6ce4ad92 833 for (Int_t ii = 0; ii <= fOrder; ++ii) {
834 for (Int_t kk = 0; kk <= fOrder; ++kk) {
1648d22e 835 Double_t fik = fRedFactp[ii][1] * fRedFactp[kk][0]; // n1 *n2 -> p * pbar
836 (static_cast<TProfile2D*>(list->FindObject(Form("fProfBin%s%sNetPtF%02d%02d", AliEbyEPidRatioHelper::fgkPidName[iPid], name, ii, kk))))->Fill(centralityBin,idxPt, fik);
837 (static_cast<TProfile2D*>(list->FindObject(Form("fProf%s%sNetPtF%02d%02d", AliEbyEPidRatioHelper::fgkPidName[iPid], name, ii, kk))))->Fill(centralityPer,idxPt, fik);
838 }
839 }
840 }
841 }// for (Int_t idxPt = 0; idxPt < AliEbyEPidRatioHelper::fgkfHistNBinsPt; ++idxPt) {
842
843 return;
844}
eda5b3c1 845
846