AliPhysics  c7b8e89 (c7b8e89)
AliAnalysisTaskGammaPureMC.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: Baldo Sahlmueller, Friederike Bock *
5  * Version 1.0 *
6  * *
7  * *
8  * Permission to use, copy, modify and distribute this software and its *
9  * documentation strictly for non-commercial purposes is hereby granted *
10  * without fee, provided that the above copyright notice appears in all *
11  * copies and that both the copyright notice and this permission notice *
12  * appear in the supporting documentation. The authors make no claims *
13  * about the suitability of this software for any purpose. It is *
14  * provided "as is" without express or implied warranty. *
15  **************************************************************************/
16 
18 //----------------------------------------------------------------
19 // Class used to do analysis on conversion photons + calo photons
20 //----------------------------------------------------------------
22 #include "TChain.h"
23 #include "TTree.h"
24 #include "TBranch.h"
25 #include "TFile.h"
26 #include "TH1F.h"
27 #include "TH2F.h"
28 #include "TPDGCode.h"
29 #include "TProfile.h"
30 #include "THnSparse.h"
31 #include "TCanvas.h"
32 #include "TNtuple.h"
33 #include "AliAnalysisTask.h"
34 #include "AliAnalysisManager.h"
35 #include "AliESDEvent.h"
36 #include "AliESDInputHandler.h"
37 #include "AliMCEventHandler.h"
38 #include "AliMCEvent.h"
39 #include "AliMCParticle.h"
41 #include "AliVParticle.h"
42 #include "AliGenCocktailEventHeader.h"
43 #include "AliGenDPMjetEventHeader.h"
44 #include "AliGenPythiaEventHeader.h"
45 #include "AliGenHijingEventHeader.h"
46 #include "AliEventplane.h"
47 #include "AliInputEventHandler.h"
48 #include <algorithm>
49 #include <array>
50 #include <vector>
51 #include <map>
52 
54 
55 //________________________________________________________________________
57  fOutputContainer(nullptr),
58  fHistNEvents(nullptr),
59  fHistXSection(nullptr),
60  fHistPtHard(nullptr),
61  fHistPtYPi0(nullptr),
62  fHistPtYPiPl(nullptr),
63  fHistPtYPiMi(nullptr),
64  fHistPtYEta(nullptr),
65  fHistPtYEtaPrime(nullptr),
66  fHistPtYOmega(nullptr),
67  fHistPtYRho0(nullptr),
68  fHistPtYRhoPl(nullptr),
69  fHistPtYRhoMi(nullptr),
70  fHistPtYPhi(nullptr),
71  fHistPtYJPsi(nullptr),
72  fHistPtYSigma0(nullptr),
73  fHistPtYK0s(nullptr),
74  fHistPtYK0l(nullptr),
75  fHistPtYK0star(nullptr),
76  fHistPtYDeltaPlPl(nullptr),
77  fHistPtYDeltaPl(nullptr),
78  fHistPtYDeltaMi(nullptr),
79  fHistPtYDelta0(nullptr),
80  fHistPtYLambda(nullptr),
81  fHistPtYKPl(nullptr),
82  fHistPtYKMi(nullptr),
83  fHistPtYPi0FromEta(nullptr),
84  fHistPtYPi0FromLambda(nullptr),
85  fHistPtYPi0FromK(nullptr),
86  fHistPtYPiPlFromK(nullptr),
87  fHistPtYPiMiFromK(nullptr),
88  fHistPtYPi0GG(nullptr),
89  fHistPtYPi0GGPCMAcc(nullptr),
90  fHistPtYPi0GGEMCAcc(nullptr),
91  fHistPtYPi0GGPHOAcc(nullptr),
92  fHistPtYPi0GGPCMEMCAcc(nullptr),
93  fHistPtYPi0GGPCMPHOAcc(nullptr),
94  fHistPtAlphaPi0GGPCMAcc(nullptr),
95  fHistPtAlphaPi0GGEMCAcc(nullptr),
96  fHistPtAlphaPi0GGPHOAcc(nullptr),
97  fHistPtAlphaPi0GGPCMEMCAcc(nullptr),
98  fHistPtAlphaPi0GGPCMPHOAcc(nullptr),
99  fHistPtYEtaGG(nullptr),
100  fHistPtYEtaGGPCMAcc(nullptr),
101  fHistPtYEtaGGEMCAcc(nullptr),
102  fHistPtYEtaGGPHOAcc(nullptr),
103  fHistPtYEtaGGPCMEMCAcc(nullptr),
104  fHistPtYEtaGGPCMPHOAcc(nullptr),
105  fHistPtAlphaEtaGGPCMAcc(nullptr),
106  fHistPtAlphaEtaGGEMCAcc(nullptr),
107  fHistPtAlphaEtaGGPHOAcc(nullptr),
108  fHistPtAlphaEtaGGPCMEMCAcc(nullptr),
109  fHistPtAlphaEtaGGPCMPHOAcc(nullptr),
110  fHistPtYEtaPrimeGG(nullptr),
111  fHistPtYEtaPrimeGGPCMAcc(nullptr),
112  fHistPtYEtaPrimeGGEMCAcc(nullptr),
113  fHistPtYEtaPrimeGGPHOAcc(nullptr),
114  fHistPtYEtaPrimeGGPCMEMCAcc(nullptr),
115  fHistPtYEtaPrimeGGPCMPHOAcc(nullptr),
116  fHistPtAlphaEtaPrimeGGPCMAcc(nullptr),
117  fHistPtAlphaEtaPrimeGGEMCAcc(nullptr),
118  fHistPtAlphaEtaPrimeGGPHOAcc(nullptr),
119  fHistPtAlphaEtaPrimeGGPCMEMCAcc(nullptr),
120  fHistPtAlphaEtaPrimeGGPCMPHOAcc(nullptr),
121  fHistPtYPi0FromKGG(nullptr),
122  fHistPtYPi0FromKGGPCMAcc(nullptr),
123  fHistPtYPi0FromKGGEMCAcc(nullptr),
124  fHistPtYPi0FromKGGPCMEMCAcc(nullptr),
125  fHistPtYPi0FromKGGEMCPCMAcc(nullptr),
126  fHistPtYPi0FromKGGEMCAccSamePi0(nullptr),
127  fHistPtYPi0FromKGGEMCAccDiffPi0(nullptr),
128  fHistPtAlphaPi0FromKGG(nullptr),
129  fHistPtAlphaPi0FromKGGPCMAcc(nullptr),
130  fHistPtAlphaPi0FromKGGEMCAcc(nullptr),
131  fHistPtAlphaPi0FromKGGPCMEMCAcc(nullptr),
132  fHistPtAlphaPi0FromKGGEMCPCMAcc(nullptr),
133  fHistPtAlphaPi0FromKGGEMCAccSamePi0(nullptr),
134  fHistPtAlphaPi0FromKGGEMCAccDiffPi0(nullptr),
135  fIsK0(1),
136  fIsMC(1),
137  fMaxpT(100)
138 {
139 
140 }
141 
142 //________________________________________________________________________
144  AliAnalysisTaskSE(name),
145  fOutputContainer(nullptr),
146  fHistNEvents(nullptr),
147  fHistXSection(nullptr),
148  fHistPtHard(nullptr),
149  fHistPtYPi0(nullptr),
150  fHistPtYPiPl(nullptr),
151  fHistPtYPiMi(nullptr),
152  fHistPtYEta(nullptr),
153  fHistPtYEtaPrime(nullptr),
154  fHistPtYOmega(nullptr),
155  fHistPtYRho0(nullptr),
156  fHistPtYRhoPl(nullptr),
157  fHistPtYRhoMi(nullptr),
158  fHistPtYPhi(nullptr),
159  fHistPtYJPsi(nullptr),
160  fHistPtYSigma0(nullptr),
161  fHistPtYK0s(nullptr),
162  fHistPtYK0l(nullptr),
163  fHistPtYK0star(nullptr),
164  fHistPtYDeltaPlPl(nullptr),
165  fHistPtYDeltaPl(nullptr),
166  fHistPtYDeltaMi(nullptr),
167  fHistPtYDelta0(nullptr),
168  fHistPtYLambda(nullptr),
169  fHistPtYKPl(nullptr),
170  fHistPtYKMi(nullptr),
171  fHistPtYPi0FromEta(nullptr),
172  fHistPtYPi0FromLambda(nullptr),
173  fHistPtYPi0FromK(nullptr),
174  fHistPtYPiPlFromK(nullptr),
175  fHistPtYPiMiFromK(nullptr),
176  fHistPtYPi0GG(nullptr),
177  fHistPtYPi0GGPCMAcc(nullptr),
178  fHistPtYPi0GGEMCAcc(nullptr),
179  fHistPtYPi0GGPHOAcc(nullptr),
180  fHistPtYPi0GGPCMEMCAcc(nullptr),
181  fHistPtYPi0GGPCMPHOAcc(nullptr),
182  fHistPtAlphaPi0GGPCMAcc(nullptr),
183  fHistPtAlphaPi0GGEMCAcc(nullptr),
184  fHistPtAlphaPi0GGPHOAcc(nullptr),
185  fHistPtAlphaPi0GGPCMEMCAcc(nullptr),
186  fHistPtAlphaPi0GGPCMPHOAcc(nullptr),
187  fHistPtYEtaGG(nullptr),
188  fHistPtYEtaGGPCMAcc(nullptr),
189  fHistPtYEtaGGEMCAcc(nullptr),
190  fHistPtYEtaGGPHOAcc(nullptr),
191  fHistPtYEtaGGPCMEMCAcc(nullptr),
192  fHistPtYEtaGGPCMPHOAcc(nullptr),
193  fHistPtAlphaEtaGGPCMAcc(nullptr),
194  fHistPtAlphaEtaGGEMCAcc(nullptr),
195  fHistPtAlphaEtaGGPHOAcc(nullptr),
196  fHistPtAlphaEtaGGPCMEMCAcc(nullptr),
197  fHistPtAlphaEtaGGPCMPHOAcc(nullptr),
198  fHistPtYEtaPrimeGG(nullptr),
199  fHistPtYEtaPrimeGGPCMAcc(nullptr),
200  fHistPtYEtaPrimeGGEMCAcc(nullptr),
201  fHistPtYEtaPrimeGGPHOAcc(nullptr),
202  fHistPtYEtaPrimeGGPCMEMCAcc(nullptr),
203  fHistPtYEtaPrimeGGPCMPHOAcc(nullptr),
204  fHistPtAlphaEtaPrimeGGPCMAcc(nullptr),
205  fHistPtAlphaEtaPrimeGGEMCAcc(nullptr),
206  fHistPtAlphaEtaPrimeGGPHOAcc(nullptr),
207  fHistPtAlphaEtaPrimeGGPCMEMCAcc(nullptr),
208  fHistPtAlphaEtaPrimeGGPCMPHOAcc(nullptr),
209  fHistPtYPi0FromKGG(nullptr),
210  fHistPtYPi0FromKGGPCMAcc(nullptr),
211  fHistPtYPi0FromKGGEMCAcc(nullptr),
212  fHistPtYPi0FromKGGPCMEMCAcc(nullptr),
213  fHistPtYPi0FromKGGEMCPCMAcc(nullptr),
214  fHistPtYPi0FromKGGEMCAccSamePi0(nullptr),
215  fHistPtYPi0FromKGGEMCAccDiffPi0(nullptr),
216  fHistPtAlphaPi0FromKGG(nullptr),
217  fHistPtAlphaPi0FromKGGPCMAcc(nullptr),
218  fHistPtAlphaPi0FromKGGEMCAcc(nullptr),
219  fHistPtAlphaPi0FromKGGPCMEMCAcc(nullptr),
220  fHistPtAlphaPi0FromKGGEMCPCMAcc(nullptr),
221  fHistPtAlphaPi0FromKGGEMCAccSamePi0(nullptr),
222  fHistPtAlphaPi0FromKGGEMCAccDiffPi0(nullptr),
223  fIsK0(1),
224  fIsMC(1),
225  fMaxpT(100)
226 {
227  // Define output slots here
228  DefineOutput(1, TList::Class());
229 }
230 
232 {
233 
234 }
235 
236 //________________________________________________________________________
238 
239  // Create histograms
240  if(fOutputContainer != nullptr){
241  delete fOutputContainer;
242  fOutputContainer = nullptr;
243  }
244  if(fOutputContainer == nullptr){
245  fOutputContainer = new TList();
246  fOutputContainer->SetOwner(kTRUE);
247  }
248 
249  fHistNEvents = new TH1F("NEvents", "NEvents", 3, -0.5, 2.5);
250  fHistNEvents->Sumw2();
252 
253  fHistXSection = new TH1D("XSection", "XSection", 1000000, 0, 1e4);
254 
255  // SetLogBinningXTH1(fHistXSection);
256  fHistXSection->Sumw2();
258 
259  fHistPtHard = new TH1F("PtHard", "PtHard", 400, 0, 200);
260  fHistPtHard->Sumw2();
262 
263  fHistPtYPi0 = new TH2F("Pt_Y_Pi0","Pt_Y_Pi0", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
264  fHistPtYPi0->Sumw2();
266 
267  fHistPtYPiPl = new TH2F("Pt_Y_PiPl","Pt_Y_PiPl", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
268  fHistPtYPiPl->Sumw2();
270 
271  fHistPtYPiMi = new TH2F("Pt_Y_PiMi","Pt_Y_PiMi", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
272  fHistPtYPiMi->Sumw2();
274 
275  fHistPtYEta = new TH2F("Pt_Y_Eta","Pt_Y_Eta", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
276  fHistPtYEta->Sumw2();
278 
279  fHistPtYEtaPrime = new TH2F("Pt_Y_EtaPrime","Pt_Y_EtaPrime", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
280  fHistPtYEtaPrime->Sumw2();
282 
283  fHistPtYOmega = new TH2F("Pt_Y_Omega","Pt_Y_Omega", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
284  fHistPtYOmega->Sumw2();
286 
287  fHistPtYRho0 = new TH2F("Pt_Y_Rho0","Pt_Y_Rho0", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
288  fHistPtYRho0->Sumw2();
290 
291  fHistPtYRhoPl = new TH2F("Pt_Y_RhoPl","Pt_Y_RhoPl", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
292  fHistPtYRhoPl->Sumw2();
294 
295  fHistPtYRhoMi = new TH2F("Pt_Y_RhoMi","Pt_Y_RhoMi", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
296  fHistPtYRhoMi->Sumw2();
298 
299  fHistPtYPhi = new TH2F("Pt_Y_Phi","Pt_Y_Phi", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
300  fHistPtYPhi->Sumw2();
302 
303  fHistPtYJPsi = new TH2F("Pt_Y_JPsi","Pt_Y_JPsi", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
304  fHistPtYJPsi->Sumw2();
306 
307  fHistPtYSigma0 = new TH2F("Pt_Y_Sigma0","Pt_Y_Sigma0", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
308  fHistPtYSigma0->Sumw2();
310 
311  fHistPtYK0s = new TH2F("Pt_Y_K0s","Pt_Y_K0s", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
312  fHistPtYK0s->Sumw2();
314 
315  fHistPtYK0l = new TH2F("Pt_Y_K0l","Pt_Y_K0l", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
316  fHistPtYK0l->Sumw2();
318 
319  fHistPtYK0star = new TH2F("Pt_Y_K0star","Pt_Y_K0star", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
320  fHistPtYK0star->Sumw2();
322 
323  fHistPtYDeltaPlPl = new TH2F("Pt_Y_DeltaPlPl","Pt_Y_DeltaPlPl", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
324  fHistPtYDeltaPlPl->Sumw2();
326 
327  fHistPtYDeltaPl = new TH2F("Pt_Y_DeltaPl","Pt_Y_DeltaPl", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
328  fHistPtYDeltaPl->Sumw2();
330 
331  fHistPtYDeltaMi = new TH2F("Pt_Y_DeltaMi","Pt_Y_DeltaMi", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
332  fHistPtYDeltaMi->Sumw2();
334 
335  fHistPtYDelta0 = new TH2F("Pt_Y_Delta0","Pt_Y_Delta0", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
336  fHistPtYDelta0->Sumw2();
338 
339  fHistPtYLambda = new TH2F("Pt_Y_Lambda","Pt_Y_Lambda", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
340  fHistPtYLambda->Sumw2();
342 
343  fHistPtYKPl = new TH2F("Pt_Y_KPl","Pt_Y_KPl", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
344  fHistPtYKPl->Sumw2();
346 
347  fHistPtYKMi = new TH2F("Pt_Y_KMi","Pt_Y_KMi", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
348  fHistPtYKMi->Sumw2();
350 
351  fHistPtYPi0FromEta = new TH2F("Pt_Y_Pi0FromEta","Pt_Y_Pi0FromEta", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
352  fHistPtYPi0FromEta->Sumw2();
354 
355  fHistPtYPi0FromLambda = new TH2F("Pt_Y_Pi0FromLambda","Pt_Y_Pi0FromLambda", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
356  fHistPtYPi0FromLambda->Sumw2();
358 
359  fHistPtYPi0FromK = new TH2F("Pt_Y_Pi0FromK","Pt_Y_Pi0FromK", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
360  fHistPtYPi0FromK->Sumw2();
362 
363  fHistPtYPiPlFromK = new TH2F("Pt_Y_PiPlFromK","Pt_Y_PiPlFromK", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
364  fHistPtYPiPlFromK->Sumw2();
366 
367  fHistPtYPiMiFromK = new TH2F("Pt_Y_PiMiFromK","Pt_Y_PiMiFromK", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
368  fHistPtYPiMiFromK->Sumw2();
370 
371 
372  fHistPtYPi0GG = new TH2F("Pt_Y_Pi0GG","Pt_Y_Pi0GG", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
373  fHistPtYPi0GG->Sumw2();
375  fHistPtYPi0GGPCMAcc = new TH2F("Pt_Y_Pi0GGPCMAcc","Pt_Y_Pi0GGPCMAcc", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
376  fHistPtYPi0GGPCMAcc->Sumw2();
378  fHistPtYPi0GGEMCAcc = new TH2F("Pt_Y_Pi0GGEMCAcc","Pt_Y_Pi0GGEMCAcc", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
379  fHistPtYPi0GGEMCAcc->Sumw2();
381  fHistPtYPi0GGPHOAcc = new TH2F("Pt_Y_Pi0GGPHOAcc","Pt_Y_Pi0GGPHOAcc", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
382  fHistPtYPi0GGPHOAcc->Sumw2();
384  fHistPtYPi0GGPCMEMCAcc = new TH2F("Pt_Y_Pi0GGPCMEMCAcc","Pt_Y_Pi0GGPCMEMCAcc", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
385  fHistPtYPi0GGPCMEMCAcc->Sumw2();
387  fHistPtYPi0GGPCMPHOAcc = new TH2F("Pt_Y_Pi0GGPCMPHOAcc","Pt_Y_Pi0GGPCMPHOAcc", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
388  fHistPtYPi0GGPCMPHOAcc->Sumw2();
390 
391  fHistPtYEtaGG = new TH2F("Pt_Y_EtaGG","Pt_Y_EtaGG", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
392  fHistPtYEtaGG->Sumw2();
394  fHistPtYEtaGGPCMAcc = new TH2F("Pt_Y_EtaGGPCMAcc","Pt_Y_EtaGGPCMAcc", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
395  fHistPtYEtaGGPCMAcc->Sumw2();
397  fHistPtYEtaGGEMCAcc = new TH2F("Pt_Y_EtaGGEMCAcc","Pt_Y_EtaGGEMCAcc", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
398  fHistPtYEtaGGEMCAcc->Sumw2();
400  fHistPtYEtaGGPHOAcc = new TH2F("Pt_Y_EtaGGPHOAcc","Pt_Y_EtaGGPHOAcc", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
401  fHistPtYEtaGGPHOAcc->Sumw2();
403  fHistPtYEtaGGPCMEMCAcc = new TH2F("Pt_Y_EtaGGPCMEMCAcc","Pt_Y_EtaGGPCMEMCAcc", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
404  fHistPtYEtaGGPCMEMCAcc->Sumw2();
406  fHistPtYEtaGGPCMPHOAcc = new TH2F("Pt_Y_EtaGGPCMPHOAcc","Pt_Y_EtaGGPCMPHOAcc", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
407  fHistPtYEtaGGPCMPHOAcc->Sumw2();
409 
410  fHistPtYEtaPrimeGG = new TH2F("Pt_Y_EtaPrimeGG","Pt_Y_EtaPrimeGG", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
411  fHistPtYEtaPrimeGG->Sumw2();
413  fHistPtYEtaPrimeGGPCMAcc = new TH2F("Pt_Y_EtaPrimeGGPCMAcc","Pt_Y_EtaPrimeGGPCMAcc", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
414  fHistPtYEtaPrimeGGPCMAcc->Sumw2();
416  fHistPtYEtaPrimeGGEMCAcc = new TH2F("Pt_Y_EtaPrimeGGEMCAcc","Pt_Y_EtaPrimeGGEMCAcc", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
417  fHistPtYEtaPrimeGGEMCAcc->Sumw2();
419  fHistPtYEtaPrimeGGPHOAcc = new TH2F("Pt_Y_EtaPrimeGGPHOAcc","Pt_Y_EtaPrimeGGPHOAcc", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
420  fHistPtYEtaPrimeGGPHOAcc->Sumw2();
422  fHistPtYEtaPrimeGGPCMEMCAcc = new TH2F("Pt_Y_EtaPrimeGGPCMEMCAcc","Pt_Y_EtaPrimeGGPCMEMCAcc", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
425  fHistPtYEtaPrimeGGPCMPHOAcc = new TH2F("Pt_Y_EtaPrimeGGPCMPHOAcc","Pt_Y_EtaPrimeGGPCMPHOAcc", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
428 
429  fHistPtAlphaPi0GGPCMAcc = new TH2F("Pt_Alpha_Pi0GGPCMAcc","Pt_Alpha_Pi0GGPCMAcc", fMaxpT*5, 0.1, fMaxpT/2, 100, 0., 1.);
431  fHistPtAlphaPi0GGPCMAcc->Sumw2();
433  fHistPtAlphaPi0GGEMCAcc = new TH2F("Pt_Alpha_Pi0GGEMCAcc","Pt_Alpha_Pi0GGEMCAcc", fMaxpT*5, 0.1, fMaxpT/2, 100, 0., 1.);
435  fHistPtAlphaPi0GGEMCAcc->Sumw2();
437  fHistPtAlphaPi0GGPHOAcc = new TH2F("Pt_Alpha_Pi0GGPHOAcc","Pt_Alpha_Pi0GGPHOAcc", fMaxpT*5, 0.1, fMaxpT/2, 100, 0., 1.);
439  fHistPtAlphaPi0GGPHOAcc->Sumw2();
441  fHistPtAlphaPi0GGPCMEMCAcc = new TH2F("Pt_Alpha_Pi0GGPCMEMCAcc","Pt_Alpha_Pi0GGPCMEMCAcc", fMaxpT*5, 0.1, fMaxpT/2, 200, -1., 1.);
445  fHistPtAlphaPi0GGPCMPHOAcc = new TH2F("Pt_Alpha_Pi0GGPCMPHOAcc","Pt_Alpha_Pi0GGPCMPHOAcc", fMaxpT*5, 0.1, fMaxpT/2, 200, -1., 1.);
449 
450  fHistPtAlphaEtaGGPCMAcc = new TH2F("Pt_Alpha_EtaGGPCMAcc","Pt_Alpha_EtaGGPCMAcc", fMaxpT*5, 0.1, fMaxpT/2, 100, 0., 1.);
452  fHistPtAlphaEtaGGPCMAcc->Sumw2();
454  fHistPtAlphaEtaGGEMCAcc = new TH2F("Pt_Alpha_EtaGGEMCAcc","Pt_Alpha_EtaGGEMCAcc", fMaxpT*5, 0.1, fMaxpT/2, 100, 0., 1.);
456  fHistPtAlphaEtaGGEMCAcc->Sumw2();
458  fHistPtAlphaEtaGGPHOAcc = new TH2F("Pt_Alpha_EtaGGPHOAcc","Pt_Alpha_EtaGGPHOAcc", fMaxpT*5, 0.1, fMaxpT/2, 100, 0., 1.);
460  fHistPtAlphaEtaGGPHOAcc->Sumw2();
462  fHistPtAlphaEtaGGPCMEMCAcc = new TH2F("Pt_Alpha_EtaGGPCMEMCAcc","Pt_Alpha_EtaGGPCMEMCAcc", fMaxpT*5, 0.1, fMaxpT/2, 200, -1., 1.);
466  fHistPtAlphaEtaGGPCMPHOAcc = new TH2F("Pt_Alpha_EtaGGPCMPHOAcc","Pt_Alpha_EtaGGPCMPHOAcc", fMaxpT*5, 0.1, fMaxpT/2, 200, -1., 1.);
470 
471  fHistPtAlphaEtaPrimeGGPCMAcc = new TH2F("Pt_Alpha_EtaPrimeGGPCMAcc","Pt_Alpha_EtaPrimeGGPCMAcc", fMaxpT*5, 0.1, fMaxpT/2, 100, 0., 1.);
475  fHistPtAlphaEtaPrimeGGEMCAcc = new TH2F("Pt_Alpha_EtaPrimeGGEMCAcc","Pt_Alpha_EtaPrimeGGEMCAcc", fMaxpT*5, 0.1, fMaxpT/2, 100, 0., 1.);
479  fHistPtAlphaEtaPrimeGGPHOAcc = new TH2F("Pt_Alpha_EtaPrimeGGPHOAcc","Pt_Alpha_EtaPrimeGGPHOAcc", fMaxpT*5, 0.1, fMaxpT/2, 100, 0., 1.);
483  fHistPtAlphaEtaPrimeGGPCMEMCAcc = new TH2F("Pt_Alpha_EtaPrimeGGPCMEMCAcc","Pt_Alpha_EtaPrimeGGPCMEMCAcc", fMaxpT*5, 0.1, fMaxpT/2, 200, -1., 1.);
487  fHistPtAlphaEtaPrimeGGPCMPHOAcc = new TH2F("Pt_Alpha_EtaPrimeGGPCMPHOAcc","Pt_Alpha_EtaPrimeGGPCMPHOAcc", fMaxpT*5, 0.1, fMaxpT/2, 200, -1., 1.);
491 
492  if (fIsK0 == 1){
493  fHistPtYPi0FromKGG = new TH2F("Pt_Y_Pi0FromKGG","Pt_Y_Pi0FromKGG", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
494  fHistPtYPi0FromKGG->Sumw2();
496  fHistPtYPi0FromKGGPCMAcc = new TH2F("Pt_Y_Pi0FromKGGPCMAcc","Pt_Y_Pi0FromKGGPCMAcc", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
497  fHistPtYPi0FromKGGPCMAcc->Sumw2();
499  fHistPtYPi0FromKGGEMCAcc = new TH2F("Pt_Y_Pi0FromKGGEMCAcc","Pt_Y_Pi0FromKGGEMCAcc", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
500  fHistPtYPi0FromKGGEMCAcc->Sumw2();
502  fHistPtYPi0FromKGGPCMEMCAcc = new TH2F("Pt_Y_Pi0FromKGGPCMEMCAcc","Pt_Y_Pi0FromKGGPCMEMCAcc", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
505  fHistPtYPi0FromKGGEMCPCMAcc = new TH2F("Pt_Y_Pi0FromKGGEMCPCMAcc","Pt_Y_Pi0FromKGGEMCPCMAcc", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
508  fHistPtYPi0FromKGGEMCAccSamePi0 = new TH2F("Pt_Y_Pi0FromKGGEMCAccSamePi0","Pt_Y_Pi0FromKGGEMCAccSamePi0", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
511  fHistPtYPi0FromKGGEMCAccDiffPi0 = new TH2F("Pt_Y_Pi0FromKGGEMCAccDiffPi0","Pt_Y_Pi0FromKGGEMCAccDiffPi0", fMaxpT*10, 0, fMaxpT, 200, -1.0, 1.0);
514  fHistPtAlphaPi0FromKGG = new TH2F("Pt_Alpha_Pi0FromKGG","Pt_Alpha_Pi0FromKGG", fMaxpT*5, 0.1, fMaxpT/2, 200, -1., 1.);
516  fHistPtAlphaPi0FromKGG->Sumw2();
518  fHistPtAlphaPi0FromKGGPCMAcc = new TH2F("Pt_Alpha_Pi0FromKGGPCMAcc","Pt_Alpha_Pi0FromKGGPCMAcc", fMaxpT*5, 0.1, fMaxpT/2, 200, -1., 1.);
522  fHistPtAlphaPi0FromKGGEMCAcc = new TH2F("Pt_Alpha_Pi0FromKGGEMCAcc","Pt_Alpha_Pi0FromKGGEMCAcc", fMaxpT*5, 0.1, fMaxpT/2, 200, -1., 1.);
526  fHistPtAlphaPi0FromKGGPCMEMCAcc = new TH2F("Pt_Alpha_Pi0FromKGGPCMEMCAcc","Pt_Alpha_Pi0FromKGGPCMEMCAcc", fMaxpT*5, 0.1, fMaxpT/2, 200, -1., 1.);
530  fHistPtAlphaPi0FromKGGEMCPCMAcc = new TH2F("Pt_Alpha_Pi0FromKGGEMCPCMAcc","Pt_Alpha_Pi0FromKGGEMCPCMAcc", fMaxpT*5, 0.1, fMaxpT/2, 200, -1., 1.);
534  fHistPtAlphaPi0FromKGGEMCAccSamePi0 = new TH2F("Pt_Alpha_Pi0FromKGGEMCAccSamePi0","Pt_Alpha_Pi0FromKGGEMCAccSamePi0", fMaxpT*5, 0.1, fMaxpT/2, 200, -1., 1.);
538  fHistPtAlphaPi0FromKGGEMCAccDiffPi0 = new TH2F("Pt_Alpha_Pi0FromKGGEMCAccDiffPi0","Pt_Alpha_Pi0FromKGGEMCAccDiffPi0", fMaxpT*5, 0.1, fMaxpT/2, 200, -1., 1.);
542  }
543 
544 
545 
546  PostData(1, fOutputContainer);
547 }
548 
549 //_____________________________________________________________________________
551 {
552 
553  fInputEvent = InputEvent();
554  // cout << "I found an Event" << endl;
555 
556  fMCEvent = MCEvent();
557  if(fMCEvent == nullptr) fIsMC = 0;
558  if (fIsMC==0) return;
559  // cout << "I found an MC header" << endl;
560 
561  const AliVVertex* primVtxMC = fMCEvent->GetPrimaryVertex();
562  Double_t mcProdVtxZ = primVtxMC->GetZ();
563 
564  if (TMath::Abs(mcProdVtxZ) < 10 ){
565  fHistNEvents->Fill(0);
566  } else {
567  fHistNEvents->Fill(1);
568  }
569 
570  AliGenEventHeader* mcEH = fMCEvent->GenEventHeader();
571  AliGenPythiaEventHeader *pyH = dynamic_cast<AliGenPythiaEventHeader*>(mcEH);
572  AliGenHijingEventHeader *hiH = 0;
573  AliGenDPMjetEventHeader *dpmH = 0;
574 
575  // it can be only one save some casts
576  // assuming PYTHIA and HIJING are the most likely ones...
577  if(!pyH){
578  hiH = dynamic_cast<AliGenHijingEventHeader*>(mcEH);
579  if(!hiH){
580  dpmH = dynamic_cast<AliGenDPMjetEventHeader*>(mcEH);
581  }
582  }
583 
584  // fetch the trials on a event by event basis, not from pyxsec.root otherwise
585  // we will get a problem when running on proof since Notify may be called
586  // more than once per file
587  // consider storing this information in the AOD output via AliAODHandler
588  Float_t ntrials = 0;
589  if (!pyH || !hiH || dpmH) {
590  AliGenCocktailEventHeader *ccEH = dynamic_cast<AliGenCocktailEventHeader *>(mcEH);
591  if (ccEH) {
592  TList *genHeaders = ccEH->GetHeaders();
593  for (int imch=0; imch<genHeaders->GetEntries(); imch++) {
594  if(!pyH)pyH = dynamic_cast<AliGenPythiaEventHeader*>(genHeaders->At(imch));
595  if(!hiH)hiH = dynamic_cast<AliGenHijingEventHeader*>(genHeaders->At(imch));
596  if(!dpmH)dpmH = dynamic_cast<AliGenDPMjetEventHeader*>(genHeaders->At(imch));
597  }
598  }
599  }
600 
601  // take the trials from the p+p event
602  if(hiH)ntrials = hiH->Trials();
603  if(dpmH)ntrials = dpmH->Trials();
604  if(pyH)ntrials = pyH->Trials();
605  if(ntrials)fHistNEvents->Fill(2,ntrials);
606 
607  Double_t xSection = 0;
608  Double_t ptHard = 0;
609  if (pyH) xSection = pyH->GetXsection();
610  if (pyH) ptHard = pyH->GetPtHard();
611  if (xSection) fHistXSection->Fill(xSection);
612  if (ptHard) fHistPtHard->Fill(ptHard);
613 
615 
616 
617  PostData(1, fOutputContainer);
618 }
619 
620 
621 //________________________________________________________________________
623 {
624  // Loop over all primary MC particle
625  for(Long_t i = 0; i < fMCEvent->GetNumberOfTracks(); i++) {
626  // fill primary histograms
627  TParticle* particle = nullptr;
628  particle = (TParticle *)fMCEvent->Particle(i);
629  if (!particle) continue;
630  Bool_t hasMother = kFALSE;
631  // cout << i << "\t"<< particle->GetMother(0) << endl;
632  if (particle->GetMother(0)>-1)
633  hasMother = kTRUE;
634  TParticle* motherParticle = nullptr;
635  if( hasMother )
636  motherParticle = (TParticle *)fMCEvent->Particle(particle->GetMother(0));
637  if (motherParticle)
638  hasMother = kTRUE;
639  else
640  hasMother = kFALSE;
641 
643  if(std::find(kAcceptPdgCodes.begin(), kAcceptPdgCodes.end(), TMath::Abs(particle->GetPdgCode())) == kAcceptPdgCodes.end()) continue; // species not supported
644 
645  if (!(TMath::Abs(particle->Energy()-particle->Pz())>0.)) continue;
646  Double_t yPre = (particle->Energy()+particle->Pz())/(particle->Energy()-particle->Pz());
647  // cout << i << "\t"<< particle->GetPdgCode() << "\t"<< particle->Pz() << "\t" << particle->Energy()<< "\t" << particle->Energy()-particle->Pz() << "\t"<< yPre << endl;
648  if( yPre <= 0 ) continue;
649 
650  Double_t y = 0.5*TMath::Log(yPre);
651 
652 
653  if (y > 1.000) continue;
654  switch(particle->GetPdgCode()){
655  case kPdgPi0:
656  fHistPtYPi0->Fill(particle->Pt(), particle->Y());
657  if (hasMother){
658  if (TMath::Abs(motherParticle->GetPdgCode()) == kPdgK0Short ||
659  TMath::Abs(motherParticle->GetPdgCode()) == kPdgK0Long ||
660  TMath::Abs(motherParticle->GetPdgCode()) == kPdgKPlus
661  )
662  fHistPtYPi0FromK->Fill(particle->Pt(), particle->Y());
663  if (TMath::Abs(motherParticle->GetPdgCode()) == kPdgLambda)
664  fHistPtYPi0FromLambda->Fill(particle->Pt(), particle->Y());
665  if (motherParticle->GetPdgCode() == kPdgEta)
666  fHistPtYPi0FromEta->Fill(particle->Pt(), particle->Y());
667  }
668  break;
669  case kPdgEta:
670  fHistPtYEta->Fill(particle->Pt(), particle->Y());
671  break;
672  case kPdgEtaPrime:
673  fHistPtYEtaPrime->Fill(particle->Pt(), particle->Y());
674  break;
675  case kPdgOmega:
676  fHistPtYOmega->Fill(particle->Pt(), particle->Y());
677  break;
678  case kPdgPiPlus:
679  fHistPtYPiPl->Fill(particle->Pt(), particle->Y());
680  if (hasMother){
681  if (TMath::Abs(motherParticle->GetPdgCode()) == kPdgK0Short ||
682  TMath::Abs(motherParticle->GetPdgCode()) == kPdgK0Long ||
683  TMath::Abs(motherParticle->GetPdgCode()) == kPdgKPlus
684  )
685  fHistPtYPiPlFromK->Fill(particle->Pt(), particle->Y());
686  }
687  break;
688  case kPdgPiMinus:
689  fHistPtYPiMi->Fill(particle->Pt(), particle->Y());
690  if (hasMother){
691  if (TMath::Abs(motherParticle->GetPdgCode()) == kPdgK0Short ||
692  TMath::Abs(motherParticle->GetPdgCode()) == kPdgK0Long ||
693  TMath::Abs(motherParticle->GetPdgCode()) == kPdgKPlus
694  )
695  fHistPtYPiMiFromK->Fill(particle->Pt(), particle->Y());
696  }
697  break;
698  case kPdgRho0:
699  fHistPtYRho0->Fill(particle->Pt(), particle->Y());
700  break;
701  case kPdgRhoPlus:
702  fHistPtYRhoPl->Fill(particle->Pt(), particle->Y());
703  break;
704  case kPdgRhoMinus:
705  fHistPtYRhoMi->Fill(particle->Pt(), particle->Y());
706  break;
707  case kPdgPhi:
708  fHistPtYPhi->Fill(particle->Pt(), particle->Y());
709  break;
710  case kPdgJPsi:
711  fHistPtYJPsi->Fill(particle->Pt(), particle->Y());
712  break;
713  case 3212:
714  fHistPtYSigma0->Fill(particle->Pt(), particle->Y());
715  break;
716  case kPdgK0Short:
717  fHistPtYK0s->Fill(particle->Pt(), particle->Y());
718  break;
719  case kPdgK0Long:
720  fHistPtYK0l->Fill(particle->Pt(), particle->Y());
721  break;
722  case kPdgKStar:
723  fHistPtYK0star->Fill(particle->Pt(), particle->Y());
724  break;
725  case kPdgDeltaPlusPlus:
726  fHistPtYDeltaPlPl->Fill(particle->Pt(), particle->Y());
727  break;
728  case kPdgDeltaPlus:
729  fHistPtYDeltaPl->Fill(particle->Pt(), particle->Y());
730  break;
731  case kPdgDeltaMinus:
732  fHistPtYDeltaMi->Fill(particle->Pt(), particle->Y());
733  break;
734  case kPdgDelta0:
735  fHistPtYDelta0->Fill(particle->Pt(), particle->Y());
736  break;
737  case kPdgLambda:
738  fHistPtYLambda->Fill(particle->Pt(), particle->Y());
739  break;
740  case kPdgKPlus:
741  fHistPtYKPl->Fill(particle->Pt(), particle->Y());
742  break;
743  case kPdgKMinus:
744  fHistPtYKMi->Fill(particle->Pt(), particle->Y());
745  break;
746  }
747 
748  // from here on, we are only intested in particles considered primaries in ALICE
749  if ((particle->GetPdgCode()== kPdgPi0 || particle->GetPdgCode()== kPdgEta) && hasMother){
750  if (TMath::Abs(motherParticle->GetPdgCode()) == kPdgK0Short ||
751  TMath::Abs(motherParticle->GetPdgCode()) == kPdgK0Long ||
752  TMath::Abs(motherParticle->GetPdgCode()) == kPdgKPlus ||
753  TMath::Abs(motherParticle->GetPdgCode()) == kPdgLambda ||
754  TMath::Abs(motherParticle->GetPdgCode()) == kPdgSigma0 ||
755  TMath::Abs(motherParticle->GetPdgCode()) == kPdgSigmaPlus ||
756  TMath::Abs(motherParticle->GetPdgCode()) == kPdgSigmaMinus ||
757  TMath::Abs(motherParticle->GetPdgCode()) == kPdgXi0 ||
758  TMath::Abs(motherParticle->GetPdgCode()) == kPdgXiMinus
759  )
760  continue;
761  }
762 
763  // just looking at pi0, etas, etaprims
764  if (particle->GetPdgCode()==kPdgPi0 || particle->GetPdgCode()==kPdgEta || particle->GetPdgCode() == kPdgEtaPrime){
765  if (particle->GetNDaughters() != 2) continue; // only the two particle decays
766  UChar_t acceptanceGamma[2] = {0,0};
767  Double_t energyGamma[2] = {0,0};
768  Bool_t allOK[2] = {kFALSE,kFALSE};
769 
770 
771  for(Int_t j=0;j<2;j++){
772  TParticle *daughter=fMCEvent->Particle(particle->GetDaughter(j));
773  if (!daughter) continue;
774 
775  // Is Daughter a Photon?
776  if(daughter->GetPdgCode() == 22) allOK[j] =kTRUE;
777  if(IsInPCMAcceptance(daughter)) SETBIT(acceptanceGamma[j], kPCMAcceptance);
778  if(IsInPHOSAcceptance(daughter)) SETBIT(acceptanceGamma[j], kPHOSAcceptance);
779  if(IsInEMCalAcceptance(daughter)) SETBIT(acceptanceGamma[j], kEMCALAcceptance);
780  energyGamma[j] = daughter->Energy();
781 
782 
783  }
784 
785  if (!(allOK[0] && allOK[1])) continue;
786 
787  Double_t alpha = (energyGamma[0]-energyGamma[1])/(energyGamma[0]+energyGamma[1]);
788 
789  if (particle->GetPdgCode()==kPdgPi0){
790  fHistPtYPi0GG->Fill(particle->Pt(), particle->Y());
791  if (TESTBIT(acceptanceGamma[0], kPCMAcceptance) && TESTBIT(acceptanceGamma[1], kPCMAcceptance)){
792  fHistPtYPi0GGPCMAcc->Fill(particle->Pt(), particle->Y());
793  fHistPtAlphaPi0GGPCMAcc->Fill(particle->Pt(), TMath::Abs(alpha));
794  }
795  if (TESTBIT(acceptanceGamma[0], kEMCALAcceptance) && TESTBIT(acceptanceGamma[1], kEMCALAcceptance)){
796  fHistPtYPi0GGEMCAcc->Fill(particle->Pt(), particle->Y());
797  fHistPtAlphaPi0GGEMCAcc->Fill(particle->Pt(), TMath::Abs(alpha));
798  }
799  if (TESTBIT(acceptanceGamma[0], kPHOSAcceptance) && TESTBIT(acceptanceGamma[1], kPHOSAcceptance)){
800  fHistPtYPi0GGPHOAcc->Fill(particle->Pt(), particle->Y());
801  fHistPtAlphaPi0GGPHOAcc->Fill(particle->Pt(), TMath::Abs(alpha));
802  }
803  if ( (TESTBIT(acceptanceGamma[0], kPCMAcceptance) && TESTBIT(acceptanceGamma[1], kEMCALAcceptance)) ||
804  (TESTBIT(acceptanceGamma[1], kPCMAcceptance) && TESTBIT(acceptanceGamma[0], kPCMAcceptance))
805  ){
806  fHistPtYPi0GGPCMEMCAcc->Fill(particle->Pt(), particle->Y());
807  if (!TESTBIT(acceptanceGamma[1], kEMCALAcceptance)) alpha = (energyGamma[1]-energyGamma[0])/(energyGamma[0]+energyGamma[1]);
808  fHistPtAlphaPi0GGPCMEMCAcc->Fill(particle->Pt(), alpha);
809  }
810  if ( (TESTBIT(acceptanceGamma[0], kPCMAcceptance) && TESTBIT(acceptanceGamma[1], kPHOSAcceptance)) ||
811  (TESTBIT(acceptanceGamma[1], kPCMAcceptance) && TESTBIT(acceptanceGamma[0], kPHOSAcceptance))
812  ){
813  fHistPtYPi0GGPCMPHOAcc->Fill(particle->Pt(), particle->Y());
814  if (!TESTBIT(acceptanceGamma[1], kPHOSAcceptance)) alpha = (energyGamma[1]-energyGamma[0])/(energyGamma[0]+energyGamma[1]);
815  fHistPtAlphaPi0GGPCMPHOAcc->Fill(particle->Pt(), alpha);
816  }
817  }
818  if (particle->GetPdgCode()==kPdgEta){
819  fHistPtYEtaGG->Fill(particle->Pt(), particle->Y());
820  if (TESTBIT(acceptanceGamma[0], kPCMAcceptance) && TESTBIT(acceptanceGamma[1], kPCMAcceptance)){
821  fHistPtYEtaGGPCMAcc->Fill(particle->Pt(), particle->Y());
822  fHistPtAlphaEtaGGPCMAcc->Fill(particle->Pt(), TMath::Abs(alpha));
823  }
824  if (TESTBIT(acceptanceGamma[0], kEMCALAcceptance) && TESTBIT(acceptanceGamma[1], kEMCALAcceptance)){
825  fHistPtYEtaGGEMCAcc->Fill(particle->Pt(), particle->Y());
826  fHistPtAlphaEtaGGEMCAcc->Fill(particle->Pt(), TMath::Abs(alpha));
827  }
828  if (TESTBIT(acceptanceGamma[0], kPHOSAcceptance) && TESTBIT(acceptanceGamma[1], kPHOSAcceptance)){
829  fHistPtYEtaGGPHOAcc->Fill(particle->Pt(), particle->Y());
830  fHistPtAlphaEtaGGPHOAcc->Fill(particle->Pt(), TMath::Abs(alpha));
831  }
832  if ( (TESTBIT(acceptanceGamma[0], kPCMAcceptance) && TESTBIT(acceptanceGamma[1], kEMCALAcceptance)) ||
833  (TESTBIT(acceptanceGamma[1], kPCMAcceptance) && TESTBIT(acceptanceGamma[0], kEMCALAcceptance))
834  ){
835  fHistPtYEtaGGPCMEMCAcc->Fill(particle->Pt(), particle->Y());
836  if (!TESTBIT(acceptanceGamma[1], kEMCALAcceptance)) alpha = (energyGamma[1]-energyGamma[0])/(energyGamma[0]+energyGamma[1]);
837  fHistPtAlphaEtaGGPCMEMCAcc->Fill(particle->Pt(), alpha);
838  }
839  if ( (TESTBIT(acceptanceGamma[0], kPCMAcceptance) && TESTBIT(acceptanceGamma[1], kPHOSAcceptance)) ||
840  (TESTBIT(acceptanceGamma[1], kPCMAcceptance) && TESTBIT(acceptanceGamma[0], kPHOSAcceptance))
841  ){
842  fHistPtYEtaGGPCMPHOAcc->Fill(particle->Pt(), particle->Y());
843  if (TESTBIT(!acceptanceGamma[1],kPHOSAcceptance)) alpha = (energyGamma[1]-energyGamma[0])/(energyGamma[0]+energyGamma[1]);
844  fHistPtAlphaEtaGGPCMPHOAcc->Fill(particle->Pt(), alpha);
845  }
846  }
847  if (particle->GetPdgCode()==kPdgEtaPrime){
848  fHistPtYEtaPrimeGG->Fill(particle->Pt(), particle->Y());
849  if (TESTBIT(acceptanceGamma[0], kPCMAcceptance) && TESTBIT(acceptanceGamma[1], kPCMAcceptance)){
850  fHistPtYEtaPrimeGGPCMAcc->Fill(particle->Pt(), particle->Y());
851  fHistPtAlphaEtaPrimeGGPCMAcc->Fill(particle->Pt(), TMath::Abs(alpha));
852  }
853  if (TESTBIT(acceptanceGamma[0], kEMCALAcceptance) && TESTBIT(acceptanceGamma[1], kEMCALAcceptance)){
854  fHistPtYEtaPrimeGGEMCAcc->Fill(particle->Pt(), particle->Y());
855  fHistPtAlphaEtaPrimeGGEMCAcc->Fill(particle->Pt(), TMath::Abs(alpha));
856  }
857  if (TESTBIT(acceptanceGamma[0], kPHOSAcceptance) && TESTBIT(acceptanceGamma[1], kPHOSAcceptance)){
858  fHistPtYEtaPrimeGGPHOAcc->Fill(particle->Pt(), particle->Y());
859  fHistPtAlphaEtaPrimeGGPHOAcc->Fill(particle->Pt(), TMath::Abs(alpha));
860  }
861  if ( (TESTBIT(acceptanceGamma[0], kPCMAcceptance) && TESTBIT(acceptanceGamma[1], kEMCALAcceptance)) ||
862  (TESTBIT(acceptanceGamma[1], kPCMAcceptance) && TESTBIT(acceptanceGamma[0], kEMCALAcceptance))
863  ){
864  fHistPtYEtaPrimeGGPCMEMCAcc->Fill(particle->Pt(), particle->Y());
865  if (!TESTBIT(acceptanceGamma[1], kEMCALAcceptance)) alpha = (energyGamma[1]-energyGamma[0])/(energyGamma[0]+energyGamma[1]);
866  fHistPtAlphaEtaPrimeGGPCMEMCAcc->Fill(particle->Pt(), alpha);
867  }
868  if ( (TESTBIT(acceptanceGamma[0], kPCMAcceptance) && TESTBIT(acceptanceGamma[1], kPHOSAcceptance)) ||
869  (TESTBIT(acceptanceGamma[1], kPCMAcceptance) && TESTBIT(acceptanceGamma[0], kPHOSAcceptance))
870  ){
871  fHistPtYEtaPrimeGGPCMPHOAcc->Fill(particle->Pt(), particle->Y());
872  if (TESTBIT(!acceptanceGamma[1],kPHOSAcceptance)) alpha = (energyGamma[1]-energyGamma[0])/(energyGamma[0]+energyGamma[1]);
873  fHistPtAlphaEtaPrimeGGPCMPHOAcc->Fill(particle->Pt(), alpha);
874  }
875  }
876  }
877 
878 
879  if(fIsK0 == 0) continue;
880  if( particle->GetPdgCode() == kPdgK0Short){
881  if (particle->GetNDaughters() != 2) continue;
882  //UChar_t acceptanceGamma[2] = {0,0};
883  Double_t energyPi0[2] = {0,0};
884  Bool_t allOK[2] = {kFALSE,kFALSE};
885  UChar_t gdAcceptanceGamma[4] = {0,0,0,0};
886  //Double_t gdEnergyGamma[4] = {0,0,0,0};
887  Bool_t allGDOK[4] = {kFALSE, kFALSE, kFALSE,kFALSE};
888  for(Int_t k=0;k<2;k++){
889  TParticle *daughter=fMCEvent->Particle(particle->GetDaughter(k));
890  if (!daughter) continue;
891 
892  // Is Daughter a pi0?
893  if (daughter->GetPdgCode() == kPdgPi0){
894  allOK[k] = kTRUE;
895  if(daughter->GetNDaughters() != 2) continue;
896  energyPi0[k] = daughter->Energy();
897  for(Int_t h=0;h<2;h++){
898  TParticle *granddaughter = fMCEvent->Particle(daughter->GetDaughter(k));
899  if(granddaughter->GetPdgCode() == 22) allGDOK[2*k + h] = kTRUE;
900  if(IsInPCMAcceptance(granddaughter)) SETBIT(gdAcceptanceGamma[2*k+h], kPCMAcceptance);
901  if(IsInEMCalAcceptance(granddaughter)) SETBIT(gdAcceptanceGamma[2*k+h], kEMCALAcceptance);
902  //gdEnergyGamma[2*k+h] = granddaughter->Energy();
903  }
904  }
905  }
906 
907  Double_t alpha_k0 = (energyPi0[0]-energyPi0[1])/(energyPi0[0]+energyPi0[1]);
908 
909  if(allOK[0] && allOK[1]){
910  fHistPtYPi0FromKGG->Fill(particle->Pt(), particle->Y());
911  fHistPtAlphaPi0FromKGG->Fill(particle->Pt(), alpha_k0);
912  }
913 
914  if (!(allGDOK[0] && allGDOK[1] && allGDOK[2] && allGDOK[3])) continue;
915 
916  if (TESTBIT(gdAcceptanceGamma[0], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[1], kPCMAcceptance)
917  && TESTBIT(gdAcceptanceGamma[2], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[3], kPCMAcceptance))
918  {
919  fHistPtYPi0FromKGGPCMAcc->Fill(particle->Pt(),particle->Y());
920  fHistPtAlphaPi0FromKGGPCMAcc->Fill(particle->Pt(), alpha_k0);
921  }
922 
923  if (TESTBIT(gdAcceptanceGamma[0], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[1], kEMCALAcceptance)
924  && TESTBIT(gdAcceptanceGamma[2], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[3], kEMCALAcceptance) )
925  {
926  fHistPtYPi0FromKGGEMCAcc->Fill(particle->Pt(),particle->Y());
927  fHistPtAlphaPi0FromKGGEMCAcc->Fill(particle->Pt(), alpha_k0);
928  }
929 
930 
931  if ((TESTBIT(gdAcceptanceGamma[0], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[1], kPCMAcceptance)
932  && TESTBIT(gdAcceptanceGamma[2], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[3], kPCMAcceptance)) ||
933  (TESTBIT(gdAcceptanceGamma[0], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[1], kEMCALAcceptance)
934  && TESTBIT(gdAcceptanceGamma[2], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[3], kPCMAcceptance)) ||
935  (TESTBIT(gdAcceptanceGamma[0], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[1], kPCMAcceptance)
936  && TESTBIT(gdAcceptanceGamma[2], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[3], kPCMAcceptance)) ||
937  (TESTBIT(gdAcceptanceGamma[0], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[1], kPCMAcceptance)
938  && TESTBIT(gdAcceptanceGamma[2], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[3], kEMCALAcceptance)))
939  {
940  fHistPtYPi0FromKGGPCMEMCAcc->Fill(particle->Pt(),particle->Y());
941  fHistPtAlphaPi0FromKGGPCMEMCAcc->Fill(particle->Pt(), alpha_k0);
942  }
943 
944  if ((TESTBIT(gdAcceptanceGamma[0], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[1], kEMCALAcceptance)
945  && TESTBIT(gdAcceptanceGamma[2], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[3], kEMCALAcceptance)) ||
946  (TESTBIT(gdAcceptanceGamma[0], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[1], kPCMAcceptance)
947  && TESTBIT(gdAcceptanceGamma[2], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[3], kEMCALAcceptance)) ||
948  (TESTBIT(gdAcceptanceGamma[0], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[1], kEMCALAcceptance)
949  && TESTBIT(gdAcceptanceGamma[2], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[3], kEMCALAcceptance)) ||
950  (TESTBIT(gdAcceptanceGamma[0], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[1], kEMCALAcceptance)
951  && TESTBIT(gdAcceptanceGamma[2], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[3], kPCMAcceptance)))
952  {
953  fHistPtYPi0FromKGGEMCPCMAcc->Fill(particle->Pt(),particle->Y());
954  fHistPtAlphaPi0FromKGGEMCPCMAcc->Fill(particle->Pt(), alpha_k0);
955  }
956 
957  if ((TESTBIT(gdAcceptanceGamma[0], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[1], kEMCALAcceptance) &&
958  TESTBIT(gdAcceptanceGamma[2], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[3], kPCMAcceptance))||
959  (TESTBIT(gdAcceptanceGamma[0], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[1], kPCMAcceptance) &&
960  TESTBIT(gdAcceptanceGamma[2], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[3], kEMCALAcceptance)))
961  {
962  fHistPtYPi0FromKGGEMCAccSamePi0->Fill(particle->Pt(),particle->Y());
963  fHistPtAlphaPi0FromKGGEMCAccSamePi0->Fill(particle->Pt(), alpha_k0);
964  }
965 
966  if ((TESTBIT(gdAcceptanceGamma[0], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[2], kEMCALAcceptance)&&
967  TESTBIT(gdAcceptanceGamma[1], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[3], kPCMAcceptance))||
968  (TESTBIT(gdAcceptanceGamma[0], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[3], kEMCALAcceptance)&&
969  TESTBIT(gdAcceptanceGamma[1], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[2], kPCMAcceptance))||
970  (TESTBIT(gdAcceptanceGamma[1], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[2], kEMCALAcceptance)&&
971  TESTBIT(gdAcceptanceGamma[0], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[3], kPCMAcceptance))||
972  (TESTBIT(gdAcceptanceGamma[1], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[3], kEMCALAcceptance)&&
973  TESTBIT(gdAcceptanceGamma[0], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[2], kPCMAcceptance)))
974  {
975  fHistPtYPi0FromKGGEMCAccDiffPi0->Fill(particle->Pt(),particle->Y());
976  fHistPtAlphaPi0FromKGGEMCAccDiffPi0->Fill(particle->Pt(), alpha_k0);
977  }
978  }
979  }
980 }
981 
982 //________________________________________________________________________
984  const Double_t kBoundaryEta = 0.900001;
985  if (part->Pt() > 0.050 && TMath::Abs(part->Eta()) < kBoundaryEta) return true;
986 
987  return false;
988 }
989 
990 //________________________________________________________________________
992  const Double_t kBoundaryEtaMin = -0.13;
993  const Double_t kBoundaryEtaMax = 0.13;
994  const Double_t kBoundaryPhiMin = 4.54;
995  const Double_t kBoundaryPhiMax = 5.59;
996  if (part->Pt() < 0.300) return false;
997  if (part->Eta() > kBoundaryEtaMax || part->Eta() < kBoundaryEtaMin) return false;
998  if (part->Phi() > kBoundaryPhiMax || part->Phi() < kBoundaryPhiMin) return false;
999  return true;
1000 }
1001 
1002 //________________________________________________________________________
1004  const Double_t kBoundaryEtaMin = -0.6687;
1005  const Double_t kBoundaryEtaMax = 0.66465;
1006  const Double_t kBoundaryPhiMin = 1.39626;
1007  const Double_t kBoundaryPhiMax = 3.15;
1008  if (part->Pt() < 0.400) return false;
1009  if (part->Eta() > kBoundaryEtaMax || part->Eta() < kBoundaryEtaMin) return false;
1010  if (part->Phi() > kBoundaryPhiMax || part->Phi() < kBoundaryPhiMin) return false;
1011  return true;
1012 }
1013 
1014 //________________________________________________________________________
1016 {
1017 
1018  //fOutputContainer->Print(); // Will crash on GRID
1019 }
1020 
1021 
1022 //_________________________________________________________________________________
1024  TAxis *axisafter = histoRebin->GetXaxis();
1025  Int_t bins = axisafter->GetNbins();
1026  Double_t from = axisafter->GetXmin();
1027  Double_t to = axisafter->GetXmax();
1028  Double_t *newbins = new Double_t[bins+1];
1029  newbins[0] = from;
1030  Double_t factor = TMath::Power(to/from, 1./bins);
1031  for(Int_t i=1; i<=bins; ++i) newbins[i] = factor * newbins[i-1];
1032  axisafter->Set(bins, newbins);
1033  delete [] newbins;
1034 }
1035 
1036 //_________________________________________________________________________________
1038  TAxis *axisafter = histoRebin->GetXaxis();
1039  Int_t bins = axisafter->GetNbins();
1040  Double_t from = axisafter->GetXmin();
1041  Double_t to = axisafter->GetXmax();
1042  Double_t *newbins = new Double_t[bins+1];
1043  newbins[0] = from;
1044  Double_t factor = TMath::Power(to/from, 1./bins);
1045  for(Int_t i=1; i<=bins; ++i) newbins[i] = factor * newbins[i-1];
1046  axisafter->Set(bins, newbins);
1047  delete [] newbins;
1048 }
TH2F * fHistPtYPi0FromKGGEMCAccDiffPi0
histo for Pi0 from K gamma gamma channel, acceptance by same pi0
TH2F * fHistPtYEtaGGPCMEMCAcc
histo for Etas gamma gamma channel, PHOS acceptance
TH2F * fHistPtYPi0FromKGGEMCAccSamePi0
histo for Pi0 from K gamma gamma channel, EMC-PCM acceptance
TH2F * fHistPtYEtaPrimeGGPCMPHOAcc
histo for EtaPrims gamma gamma channel, PCM-EMCal acceptance
TH2F * fHistPtAlphaEtaPrimeGGPCMPHOAcc
histo for Eta&#39;s gamma gamma channel, PCM-EMCal acceptance
double Double_t
Definition: External.C:58
TH2F * fHistPtAlphaPi0FromKGG
histo for Pi0 from K gamma gamma channel, mixed acceptance
Definition: External.C:236
TH2F * fHistPtAlphaPi0GGPHOAcc
histo for Pi0s gamma gamma channel, EMCal acceptance
TH2F * fHistPtYPi0FromKGGEMCPCMAcc
histo for Pi0 from K gamma gamma channel, PCM-EMC acceptance
TH2F * fHistPtAlphaEtaPrimeGGPCMAcc
histo for Pi0s gamma gamma channel, PCM-PHOS acceptance
TH2F * fHistPtAlphaEtaGGPCMAcc
histo for Etas gamma gamma channel, PCM-PHOS acceptance
virtual void Terminate(const Option_t *)
TH2F * fHistPtYPi0GGEMCAcc
histo for Pi0s gamma gamma channel, PCM acceptance
TH2F * fHistPtYDeltaMi
histo for Delta+
TH2F * fHistPtAlphaPi0FromKGGPCMEMCAcc
histo for Pi0 from K gamma gamma channel, EMC acceptance (Alpha)
TH2F * fHistPtAlphaEtaPrimeGGPHOAcc
histo for Eta&#39;s gamma gamma channel, EMCal acceptance
TH2F * fHistPtYPi0GGPCMAcc
histo for Pi0s gamma gamma channel
TH2F * fHistPtYEtaGGPCMPHOAcc
histo for Etas gamma gamma channel, PCM-EMCal acceptance
bool IsInPCMAcceptance(TParticle *part) const
TH2F * fHistPtAlphaEtaGGPCMEMCAcc
histo for Etas gamma gamma channel, PHOS acceptance
TH2F * fHistPtYEtaPrimeGGEMCAcc
histo for EtaPrims gamma gamma channel, PCM acceptance
TH2F * fHistPtAlphaPi0FromKGGPCMAcc
histo for Pi0 from K gamma gamma channel (Alpha)
TH2F * fHistPtYEtaGGPHOAcc
histo for Etas gamma gamma channel, EMCal acceptance
TH2F * fHistPtYEtaGG
histo for Pi0s gamma gamma channel, PCM-PHOS acceptance
TH2F * fHistPtYSigma0
histo for J/psi
TH2F * fHistPtAlphaEtaPrimeGGEMCAcc
histo for Eta&#39;s gamma gamma channel, PCM acceptance
TH2F * fHistPtYEtaPrimeGG
histo for Etas gamma gamma channel, PCM-PHOS acceptance
TH1F * fHistNEvents
Output container.
int Int_t
Definition: External.C:63
TH2F * fHistPtYDeltaPl
histo for Delta++
float Float_t
Definition: External.C:68
TH2F * fHistPtYPi0GGPCMEMCAcc
histo for Pi0s gamma gamma channel, PHOS acceptance
TH2F * fHistPtYPi0GG
histo for Pi-s from Ks
TH2F * fHistPtAlphaPi0GGPCMPHOAcc
histo for Pi0s gamma gamma channel, PCM-EMCal acceptance
TH2F * fHistPtYPi0GGPHOAcc
histo for Pi0s gamma gamma channel, EMCal acceptance
TH2F * fHistPtYEtaGGEMCAcc
histo for Etas gamma gamma channel, PCM acceptance
bool IsInEMCalAcceptance(TParticle *part) const
TH2F * fHistPtYPiMiFromK
histo for Pi+s form Ks
Definition: External.C:212
TH2F * fHistPtYRho0
histo for Omegas
TH2F * fHistPtAlphaPi0FromKGGEMCAccSamePi0
histo for Pi0 from K gamma gamma channel, EMC-PCM acceptance (Alpha)
TH2F * fHistPtAlphaPi0FromKGGEMCAcc
histo for Pi0 from K gamma gamma channel, PCM acceptance (Alpha)
TH2F * fHistPtAlphaEtaGGPCMPHOAcc
histo for Etas gamma gamma channel, PCM-EMCal acceptance
TH2F * fHistPtYPi0FromKGGEMCAcc
histo for Pi0 from K gamma gamma channel, PCM acceptance
TH2F * fHistPtYPi0GGPCMPHOAcc
histo for Pi0s gamma gamma channel, PCM-EMCal acceptance
TH2F * fHistPtYLambda
histo for Delta0
TH2F * fHistPtAlphaPi0GGPCMAcc
histo for Pi0s gamma gamma channel, PCM-PHOS acceptance
TH1D * fHistXSection
number of events histo
TH2F * fHistPtAlphaEtaPrimeGGPCMEMCAcc
histo for Eta&#39;s gamma gamma channel, PHOS acceptance
TH2F * fHistPtAlphaPi0GGPCMEMCAcc
histo for Pi0s gamma gamma channel, PHOS acceptance
TH2F * fHistPtYPi0FromK
histo for Pi0s from Lambdas
TH2F * fHistPtYDelta0
histo for Delta-
TH2F * fHistPtYEtaPrime
histo for Etas
Definition: External.C:220
TH2F * fHistPtYEtaPrimeGGPCMAcc
histo for Etas gamma gamma channel
TH2F * fHistPtYK0s
histo for Sigma0
TH2F * fHistPtYEtaPrimeGGPHOAcc
histo for EtaPrims gamma gamma channel, EMCal acceptance
TH2F * fHistPtAlphaPi0GGEMCAcc
histo for Pi0s gamma gamma channel, PCM acceptance
TH2F * fHistPtYPi0FromKGG
histo for Eta&#39;s gamma gamma channel, PCM-PHOS acceptance
TH2F * fHistPtYEtaGGPCMAcc
histo for Etas gamma gamma channel
TH2F * fHistPtYOmega
histo for EtaPrims
TH2F * fHistPtYPiPlFromK
histo for Pi0s from Ks
TH2F * fHistPtAlphaPi0FromKGGEMCAccDiffPi0
histo for Pi0 from K gamma gamma channel, acceptance by same pi0 (Alpha)
const char Option_t
Definition: External.C:48
bool IsInPHOSAcceptance(TParticle *part) const
bool Bool_t
Definition: External.C:53
TH2F * fHistPtAlphaPi0FromKGGEMCPCMAcc
histo for Pi0 from K gamma gamma channel, PCM-EMC acceptance (Alpha)
TH2F * fHistPtAlphaEtaGGEMCAcc
histo for Etas gamma gamma channel, PCM acceptance
TH2F * fHistPtAlphaEtaGGPHOAcc
histo for Etas gamma gamma channel, EMCal acceptance
Int_t fIsK0
histo for Pi0 from K gamma gamma channel, mixed acceptance (Alpha)
TH2F * fHistPtYPi0FromLambda
histo for Pi0s from Etas
TH2F * fHistPtYPi0FromKGGPCMAcc
histo for Pi0 from K gamma gamma channel
Definition: External.C:196
TH2F * fHistPtYPi0FromKGGPCMEMCAcc
histo for Pi0 from K gamma gamma channel, EMC acceptance
TH2F * fHistPtYEtaPrimeGGPCMEMCAcc
histo for EtaPrims gamma gamma channel, PHOS acceptance