AliPhysics  41af4b0 (41af4b0)
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  fHistPtYPi0FromEta(nullptr),
82  fHistPtYPi0FromLambda(nullptr),
83  fHistPtYPi0FromK(nullptr),
84  fHistPtYPiPlFromK(nullptr),
85  fHistPtYPiMiFromK(nullptr),
86  fHistPtYPi0GG(nullptr),
87  fHistPtYPi0GGPCMAcc(nullptr),
88  fHistPtYPi0GGEMCAcc(nullptr),
89  fHistPtYPi0GGPHOAcc(nullptr),
90  fHistPtYPi0GGPCMEMCAcc(nullptr),
91  fHistPtYPi0GGPCMPHOAcc(nullptr),
92  fHistPtAlphaPi0GGPCMAcc(nullptr),
93  fHistPtAlphaPi0GGEMCAcc(nullptr),
94  fHistPtAlphaPi0GGPHOAcc(nullptr),
95  fHistPtAlphaPi0GGPCMEMCAcc(nullptr),
96  fHistPtAlphaPi0GGPCMPHOAcc(nullptr),
97  fHistPtYEtaGG(nullptr),
98  fHistPtYEtaGGPCMAcc(nullptr),
99  fHistPtYEtaGGEMCAcc(nullptr),
100  fHistPtYEtaGGPHOAcc(nullptr),
101  fHistPtYEtaGGPCMEMCAcc(nullptr),
102  fHistPtYEtaGGPCMPHOAcc(nullptr),
103  fHistPtAlphaEtaGGPCMAcc(nullptr),
104  fHistPtAlphaEtaGGEMCAcc(nullptr),
105  fHistPtAlphaEtaGGPHOAcc(nullptr),
106  fHistPtAlphaEtaGGPCMEMCAcc(nullptr),
107  fHistPtAlphaEtaGGPCMPHOAcc(nullptr),
108  fHistPtYEtaPrimeGG(nullptr),
109  fHistPtYEtaPrimeGGPCMAcc(nullptr),
110  fHistPtYEtaPrimeGGEMCAcc(nullptr),
111  fHistPtYEtaPrimeGGPHOAcc(nullptr),
112  fHistPtYEtaPrimeGGPCMEMCAcc(nullptr),
113  fHistPtYEtaPrimeGGPCMPHOAcc(nullptr),
114  fHistPtAlphaEtaPrimeGGPCMAcc(nullptr),
115  fHistPtAlphaEtaPrimeGGEMCAcc(nullptr),
116  fHistPtAlphaEtaPrimeGGPHOAcc(nullptr),
117  fHistPtAlphaEtaPrimeGGPCMEMCAcc(nullptr),
118  fHistPtAlphaEtaPrimeGGPCMPHOAcc(nullptr),
119  fHistPtYPi0FromKGG(nullptr),
120  fHistPtYPi0FromKGGPCMAcc(nullptr),
121  fHistPtYPi0FromKGGEMCAcc(nullptr),
122  fHistPtYPi0FromKGGPCMEMCAcc(nullptr),
123  fHistPtYPi0FromKGGEMCPCMAcc(nullptr),
124  fHistPtYPi0FromKGGEMCAccSamePi0(nullptr),
125  fHistPtYPi0FromKGGEMCAccDiffPi0(nullptr),
126  fHistPtAlphaPi0FromKGG(nullptr),
127  fHistPtAlphaPi0FromKGGPCMAcc(nullptr),
128  fHistPtAlphaPi0FromKGGEMCAcc(nullptr),
129  fHistPtAlphaPi0FromKGGPCMEMCAcc(nullptr),
130  fHistPtAlphaPi0FromKGGEMCPCMAcc(nullptr),
131  fHistPtAlphaPi0FromKGGEMCAccSamePi0(nullptr),
132  fHistPtAlphaPi0FromKGGEMCAccDiffPi0(nullptr),
133  fIsK0(1),
134  fIsMC(1)
135 {
136 
137 }
138 
139 //________________________________________________________________________
141  AliAnalysisTaskSE(name),
142  fOutputContainer(nullptr),
143  fHistNEvents(nullptr),
144  fHistXSection(nullptr),
145  fHistPtHard(nullptr),
146  fHistPtYPi0(nullptr),
147  fHistPtYPiPl(nullptr),
148  fHistPtYPiMi(nullptr),
149  fHistPtYEta(nullptr),
150  fHistPtYEtaPrime(nullptr),
151  fHistPtYOmega(nullptr),
152  fHistPtYRho0(nullptr),
153  fHistPtYRhoPl(nullptr),
154  fHistPtYRhoMi(nullptr),
155  fHistPtYPhi(nullptr),
156  fHistPtYJPsi(nullptr),
157  fHistPtYSigma0(nullptr),
158  fHistPtYK0s(nullptr),
159  fHistPtYK0l(nullptr),
160  fHistPtYK0star(nullptr),
161  fHistPtYDeltaPlPl(nullptr),
162  fHistPtYDeltaPl(nullptr),
163  fHistPtYDeltaMi(nullptr),
164  fHistPtYDelta0(nullptr),
165  fHistPtYLambda(nullptr),
166  fHistPtYPi0FromEta(nullptr),
167  fHistPtYPi0FromLambda(nullptr),
168  fHistPtYPi0FromK(nullptr),
169  fHistPtYPiPlFromK(nullptr),
170  fHistPtYPiMiFromK(nullptr),
171  fHistPtYPi0GG(nullptr),
172  fHistPtYPi0GGPCMAcc(nullptr),
173  fHistPtYPi0GGEMCAcc(nullptr),
174  fHistPtYPi0GGPHOAcc(nullptr),
175  fHistPtYPi0GGPCMEMCAcc(nullptr),
176  fHistPtYPi0GGPCMPHOAcc(nullptr),
177  fHistPtAlphaPi0GGPCMAcc(nullptr),
178  fHistPtAlphaPi0GGEMCAcc(nullptr),
179  fHistPtAlphaPi0GGPHOAcc(nullptr),
180  fHistPtAlphaPi0GGPCMEMCAcc(nullptr),
181  fHistPtAlphaPi0GGPCMPHOAcc(nullptr),
182  fHistPtYEtaGG(nullptr),
183  fHistPtYEtaGGPCMAcc(nullptr),
184  fHistPtYEtaGGEMCAcc(nullptr),
185  fHistPtYEtaGGPHOAcc(nullptr),
186  fHistPtYEtaGGPCMEMCAcc(nullptr),
187  fHistPtYEtaGGPCMPHOAcc(nullptr),
188  fHistPtAlphaEtaGGPCMAcc(nullptr),
189  fHistPtAlphaEtaGGEMCAcc(nullptr),
190  fHistPtAlphaEtaGGPHOAcc(nullptr),
191  fHistPtAlphaEtaGGPCMEMCAcc(nullptr),
192  fHistPtAlphaEtaGGPCMPHOAcc(nullptr),
193  fHistPtYEtaPrimeGG(nullptr),
194  fHistPtYEtaPrimeGGPCMAcc(nullptr),
195  fHistPtYEtaPrimeGGEMCAcc(nullptr),
196  fHistPtYEtaPrimeGGPHOAcc(nullptr),
197  fHistPtYEtaPrimeGGPCMEMCAcc(nullptr),
198  fHistPtYEtaPrimeGGPCMPHOAcc(nullptr),
199  fHistPtAlphaEtaPrimeGGPCMAcc(nullptr),
200  fHistPtAlphaEtaPrimeGGEMCAcc(nullptr),
201  fHistPtAlphaEtaPrimeGGPHOAcc(nullptr),
202  fHistPtAlphaEtaPrimeGGPCMEMCAcc(nullptr),
203  fHistPtAlphaEtaPrimeGGPCMPHOAcc(nullptr),
204  fHistPtYPi0FromKGG(nullptr),
205  fHistPtYPi0FromKGGPCMAcc(nullptr),
206  fHistPtYPi0FromKGGEMCAcc(nullptr),
207  fHistPtYPi0FromKGGPCMEMCAcc(nullptr),
208  fHistPtYPi0FromKGGEMCPCMAcc(nullptr),
209  fHistPtYPi0FromKGGEMCAccSamePi0(nullptr),
210  fHistPtYPi0FromKGGEMCAccDiffPi0(nullptr),
211  fHistPtAlphaPi0FromKGG(nullptr),
212  fHistPtAlphaPi0FromKGGPCMAcc(nullptr),
213  fHistPtAlphaPi0FromKGGEMCAcc(nullptr),
214  fHistPtAlphaPi0FromKGGPCMEMCAcc(nullptr),
215  fHistPtAlphaPi0FromKGGEMCPCMAcc(nullptr),
216  fHistPtAlphaPi0FromKGGEMCAccSamePi0(nullptr),
217  fHistPtAlphaPi0FromKGGEMCAccDiffPi0(nullptr),
218  fIsK0(1),
219  fIsMC(1)
220 {
221  // Define output slots here
222  DefineOutput(1, TList::Class());
223 }
224 
226 {
227 
228 }
229 
230 //________________________________________________________________________
232 
233  // Create histograms
234  if(fOutputContainer != nullptr){
235  delete fOutputContainer;
236  fOutputContainer = nullptr;
237  }
238  if(fOutputContainer == nullptr){
239  fOutputContainer = new TList();
240  fOutputContainer->SetOwner(kTRUE);
241  }
242 
243  fHistNEvents = new TH1F("NEvents", "NEvents", 3, -0.5, 2.5);
244  fHistNEvents->Sumw2();
246 
247  fHistXSection = new TH1D("XSection", "XSection", 1000000, 0, 1e4);
248 
249  // SetLogBinningXTH1(fHistXSection);
250  fHistXSection->Sumw2();
252 
253  fHistPtHard = new TH1F("PtHard", "PtHard", 400, 0, 200);
254  fHistPtHard->Sumw2();
256 
257  fHistPtYPi0 = new TH2F("Pt_Y_Pi0","Pt_Y_Pi0", 1000,0, 100, 200, -1.0, 1.0);
258  fHistPtYPi0->Sumw2();
260 
261  fHistPtYPiPl = new TH2F("Pt_Y_PiPl","Pt_Y_PiPl", 1000,0, 100, 200, -1.0, 1.0);
262  fHistPtYPiPl->Sumw2();
264 
265  fHistPtYPiMi = new TH2F("Pt_Y_PiMi","Pt_Y_PiMi", 1000,0, 100, 200, -1.0, 1.0);
266  fHistPtYPiMi->Sumw2();
268 
269  fHistPtYEta = new TH2F("Pt_Y_Eta","Pt_Y_Eta", 1000,0, 100, 200, -1.0, 1.0);
270  fHistPtYEta->Sumw2();
272 
273  fHistPtYEtaPrime = new TH2F("Pt_Y_EtaPrime","Pt_Y_EtaPrime", 1000,0, 100, 200, -1.0, 1.0);
274  fHistPtYEtaPrime->Sumw2();
276 
277  fHistPtYOmega = new TH2F("Pt_Y_Omega","Pt_Y_Omega", 1000,0, 100, 200, -1.0, 1.0);
278  fHistPtYOmega->Sumw2();
280 
281  fHistPtYRho0 = new TH2F("Pt_Y_Rho0","Pt_Y_Rho0", 1000,0, 100, 200, -1.0, 1.0);
282  fHistPtYRho0->Sumw2();
284 
285  fHistPtYRhoPl = new TH2F("Pt_Y_RhoPl","Pt_Y_RhoPl", 1000,0, 100, 200, -1.0, 1.0);
286  fHistPtYRhoPl->Sumw2();
288 
289  fHistPtYRhoMi = new TH2F("Pt_Y_RhoMi","Pt_Y_RhoMi", 1000,0, 100, 200, -1.0, 1.0);
290  fHistPtYRhoMi->Sumw2();
292 
293  fHistPtYPhi = new TH2F("Pt_Y_Phi","Pt_Y_Phi", 1000,0, 100, 200, -1.0, 1.0);
294  fHistPtYPhi->Sumw2();
296 
297  fHistPtYJPsi = new TH2F("Pt_Y_JPsi","Pt_Y_JPsi", 1000,0, 100, 200, -1.0, 1.0);
298  fHistPtYJPsi->Sumw2();
300 
301  fHistPtYSigma0 = new TH2F("Pt_Y_Sigma0","Pt_Y_Sigma0", 1000,0, 100, 200, -1.0, 1.0);
302  fHistPtYSigma0->Sumw2();
304 
305  fHistPtYK0s = new TH2F("Pt_Y_K0s","Pt_Y_K0s", 1000,0, 100, 200, -1.0, 1.0);
306  fHistPtYK0s->Sumw2();
308 
309  fHistPtYK0l = new TH2F("Pt_Y_K0l","Pt_Y_K0l", 1000,0, 100, 200, -1.0, 1.0);
310  fHistPtYK0l->Sumw2();
312 
313  fHistPtYK0star = new TH2F("Pt_Y_K0star","Pt_Y_K0star", 1000,0, 100, 200, -1.0, 1.0);
314  fHistPtYK0star->Sumw2();
316 
317  fHistPtYDeltaPlPl = new TH2F("Pt_Y_DeltaPlPl","Pt_Y_DeltaPlPl", 1000,0, 100, 200, -1.0, 1.0);
318  fHistPtYDeltaPlPl->Sumw2();
320 
321  fHistPtYDeltaPl = new TH2F("Pt_Y_DeltaPl","Pt_Y_DeltaPl", 1000,0, 100, 200, -1.0, 1.0);
322  fHistPtYDeltaPl->Sumw2();
324 
325  fHistPtYDeltaMi = new TH2F("Pt_Y_DeltaMi","Pt_Y_DeltaMi", 1000,0, 100, 200, -1.0, 1.0);
326  fHistPtYDeltaMi->Sumw2();
328 
329  fHistPtYDelta0 = new TH2F("Pt_Y_Delta0","Pt_Y_Delta0", 1000,0, 100, 200, -1.0, 1.0);
330  fHistPtYDelta0->Sumw2();
332 
333  fHistPtYLambda = new TH2F("Pt_Y_Lambda","Pt_Y_Lambda", 1000,0, 100, 200, -1.0, 1.0);
334  fHistPtYLambda->Sumw2();
336 
337  fHistPtYPi0FromEta = new TH2F("Pt_Y_Pi0FromEta","Pt_Y_Pi0FromEta", 1000,0, 100, 200, -1.0, 1.0);
338  fHistPtYPi0FromEta->Sumw2();
340 
341  fHistPtYPi0FromLambda = new TH2F("Pt_Y_Pi0FromLambda","Pt_Y_Pi0FromLambda", 1000,0, 100, 200, -1.0, 1.0);
342  fHistPtYPi0FromLambda->Sumw2();
344 
345  fHistPtYPi0FromK = new TH2F("Pt_Y_Pi0FromK","Pt_Y_Pi0FromK", 1000,0, 100, 200, -1.0, 1.0);
346  fHistPtYPi0FromK->Sumw2();
348 
349  fHistPtYPiPlFromK = new TH2F("Pt_Y_PiPlFromK","Pt_Y_PiPlFromK", 1000,0, 100, 200, -1.0, 1.0);
350  fHistPtYPiPlFromK->Sumw2();
352 
353  fHistPtYPiMiFromK = new TH2F("Pt_Y_PiMiFromK","Pt_Y_PiMiFromK", 1000,0, 100, 200, -1.0, 1.0);
354  fHistPtYPiMiFromK->Sumw2();
356 
357 
358  fHistPtYPi0GG = new TH2F("Pt_Y_Pi0GG","Pt_Y_Pi0GG", 1000,0, 100, 200, -1.0, 1.0);
359  fHistPtYPi0GG->Sumw2();
361  fHistPtYPi0GGPCMAcc = new TH2F("Pt_Y_Pi0GGPCMAcc","Pt_Y_Pi0GGPCMAcc", 1000,0, 100, 200, -1.0, 1.0);
362  fHistPtYPi0GGPCMAcc->Sumw2();
364  fHistPtYPi0GGEMCAcc = new TH2F("Pt_Y_Pi0GGEMCAcc","Pt_Y_Pi0GGEMCAcc", 1000,0, 100, 200, -1.0, 1.0);
365  fHistPtYPi0GGEMCAcc->Sumw2();
367  fHistPtYPi0GGPHOAcc = new TH2F("Pt_Y_Pi0GGPHOAcc","Pt_Y_Pi0GGPHOAcc", 1000,0, 100, 200, -1.0, 1.0);
368  fHistPtYPi0GGPHOAcc->Sumw2();
370  fHistPtYPi0GGPCMEMCAcc = new TH2F("Pt_Y_Pi0GGPCMEMCAcc","Pt_Y_Pi0GGPCMEMCAcc", 1000,0, 100, 200, -1.0, 1.0);
371  fHistPtYPi0GGPCMEMCAcc->Sumw2();
373  fHistPtYPi0GGPCMPHOAcc = new TH2F("Pt_Y_Pi0GGPCMPHOAcc","Pt_Y_Pi0GGPCMPHOAcc", 1000,0, 100, 200, -1.0, 1.0);
374  fHistPtYPi0GGPCMPHOAcc->Sumw2();
376 
377  fHistPtYEtaGG = new TH2F("Pt_Y_EtaGG","Pt_Y_EtaGG", 1000,0, 100, 200, -1.0, 1.0);
378  fHistPtYEtaGG->Sumw2();
380  fHistPtYEtaGGPCMAcc = new TH2F("Pt_Y_EtaGGPCMAcc","Pt_Y_EtaGGPCMAcc", 1000,0, 100, 200, -1.0, 1.0);
381  fHistPtYEtaGGPCMAcc->Sumw2();
383  fHistPtYEtaGGEMCAcc = new TH2F("Pt_Y_EtaGGEMCAcc","Pt_Y_EtaGGEMCAcc", 1000,0, 100, 200, -1.0, 1.0);
384  fHistPtYEtaGGEMCAcc->Sumw2();
386  fHistPtYEtaGGPHOAcc = new TH2F("Pt_Y_EtaGGPHOAcc","Pt_Y_EtaGGPHOAcc", 1000,0, 100, 200, -1.0, 1.0);
387  fHistPtYEtaGGPHOAcc->Sumw2();
389  fHistPtYEtaGGPCMEMCAcc = new TH2F("Pt_Y_EtaGGPCMEMCAcc","Pt_Y_EtaGGPCMEMCAcc", 1000,0, 100, 200, -1.0, 1.0);
390  fHistPtYEtaGGPCMEMCAcc->Sumw2();
392  fHistPtYEtaGGPCMPHOAcc = new TH2F("Pt_Y_EtaGGPCMPHOAcc","Pt_Y_EtaGGPCMPHOAcc", 1000,0, 100, 200, -1.0, 1.0);
393  fHistPtYEtaGGPCMPHOAcc->Sumw2();
395 
396  fHistPtYEtaPrimeGG = new TH2F("Pt_Y_EtaPrimeGG","Pt_Y_EtaPrimeGG", 1000,0, 100, 200, -1.0, 1.0);
397  fHistPtYEtaPrimeGG->Sumw2();
399  fHistPtYEtaPrimeGGPCMAcc = new TH2F("Pt_Y_EtaPrimeGGPCMAcc","Pt_Y_EtaPrimeGGPCMAcc", 1000,0, 100, 200, -1.0, 1.0);
400  fHistPtYEtaPrimeGGPCMAcc->Sumw2();
402  fHistPtYEtaPrimeGGEMCAcc = new TH2F("Pt_Y_EtaPrimeGGEMCAcc","Pt_Y_EtaPrimeGGEMCAcc", 1000,0, 100, 200, -1.0, 1.0);
403  fHistPtYEtaPrimeGGEMCAcc->Sumw2();
405  fHistPtYEtaPrimeGGPHOAcc = new TH2F("Pt_Y_EtaPrimeGGPHOAcc","Pt_Y_EtaPrimeGGPHOAcc", 1000,0, 100, 200, -1.0, 1.0);
406  fHistPtYEtaPrimeGGPHOAcc->Sumw2();
408  fHistPtYEtaPrimeGGPCMEMCAcc = new TH2F("Pt_Y_EtaPrimeGGPCMEMCAcc","Pt_Y_EtaPrimeGGPCMEMCAcc", 1000,0, 100, 200, -1.0, 1.0);
411  fHistPtYEtaPrimeGGPCMPHOAcc = new TH2F("Pt_Y_EtaPrimeGGPCMPHOAcc","Pt_Y_EtaPrimeGGPCMPHOAcc", 1000,0, 100, 200, -1.0, 1.0);
414 
415  fHistPtAlphaPi0GGPCMAcc = new TH2F("Pt_Alpha_Pi0GGPCMAcc","Pt_Alpha_Pi0GGPCMAcc", 500,0.1, 50, 100, 0., 1.);
417  fHistPtAlphaPi0GGPCMAcc->Sumw2();
419  fHistPtAlphaPi0GGEMCAcc = new TH2F("Pt_Alpha_Pi0GGEMCAcc","Pt_Alpha_Pi0GGEMCAcc", 500,0.1, 50, 100, 0., 1.);
421  fHistPtAlphaPi0GGEMCAcc->Sumw2();
423  fHistPtAlphaPi0GGPHOAcc = new TH2F("Pt_Alpha_Pi0GGPHOAcc","Pt_Alpha_Pi0GGPHOAcc", 500,0.1, 50, 100, 0., 1.);
425  fHistPtAlphaPi0GGPHOAcc->Sumw2();
427  fHistPtAlphaPi0GGPCMEMCAcc = new TH2F("Pt_Alpha_Pi0GGPCMEMCAcc","Pt_Alpha_Pi0GGPCMEMCAcc", 500,0.1, 50, 200, -1., 1.);
431  fHistPtAlphaPi0GGPCMPHOAcc = new TH2F("Pt_Alpha_Pi0GGPCMPHOAcc","Pt_Alpha_Pi0GGPCMPHOAcc", 500,0.1, 50, 200, -1., 1.);
435 
436  fHistPtAlphaEtaGGPCMAcc = new TH2F("Pt_Alpha_EtaGGPCMAcc","Pt_Alpha_EtaGGPCMAcc", 500,0.1, 50, 100, 0., 1.);
438  fHistPtAlphaEtaGGPCMAcc->Sumw2();
440  fHistPtAlphaEtaGGEMCAcc = new TH2F("Pt_Alpha_EtaGGEMCAcc","Pt_Alpha_EtaGGEMCAcc", 500,0.1, 50, 100, 0., 1.);
442  fHistPtAlphaEtaGGEMCAcc->Sumw2();
444  fHistPtAlphaEtaGGPHOAcc = new TH2F("Pt_Alpha_EtaGGPHOAcc","Pt_Alpha_EtaGGPHOAcc", 500,0.1, 50, 100, 0., 1.);
446  fHistPtAlphaEtaGGPHOAcc->Sumw2();
448  fHistPtAlphaEtaGGPCMEMCAcc = new TH2F("Pt_Alpha_EtaGGPCMEMCAcc","Pt_Alpha_EtaGGPCMEMCAcc", 500,0.1, 50, 200, -1., 1.);
452  fHistPtAlphaEtaGGPCMPHOAcc = new TH2F("Pt_Alpha_EtaGGPCMPHOAcc","Pt_Alpha_EtaGGPCMPHOAcc", 500,0.1, 50, 200, -1., 1.);
456 
457  fHistPtAlphaEtaPrimeGGPCMAcc = new TH2F("Pt_Alpha_EtaPrimeGGPCMAcc","Pt_Alpha_EtaPrimeGGPCMAcc", 500,0.1, 50, 100, 0., 1.);
461  fHistPtAlphaEtaPrimeGGEMCAcc = new TH2F("Pt_Alpha_EtaPrimeGGEMCAcc","Pt_Alpha_EtaPrimeGGEMCAcc", 500,0.1, 50, 100, 0., 1.);
465  fHistPtAlphaEtaPrimeGGPHOAcc = new TH2F("Pt_Alpha_EtaPrimeGGPHOAcc","Pt_Alpha_EtaPrimeGGPHOAcc", 500,0.1, 50, 100, 0., 1.);
469  fHistPtAlphaEtaPrimeGGPCMEMCAcc = new TH2F("Pt_Alpha_EtaPrimeGGPCMEMCAcc","Pt_Alpha_EtaPrimeGGPCMEMCAcc", 500,0.1, 50, 200, -1., 1.);
473  fHistPtAlphaEtaPrimeGGPCMPHOAcc = new TH2F("Pt_Alpha_EtaPrimeGGPCMPHOAcc","Pt_Alpha_EtaPrimeGGPCMPHOAcc", 500,0.1, 50, 200, -1., 1.);
477 
478  if (fIsK0 == 1){
479  fHistPtYPi0FromKGG = new TH2F("Pt_Y_Pi0FromKGG","Pt_Y_Pi0FromKGG", 1000,0, 100, 200, -1.0, 1.0);
480  fHistPtYPi0FromKGG->Sumw2();
482  fHistPtYPi0FromKGGPCMAcc = new TH2F("Pt_Y_Pi0FromKGGPCMAcc","Pt_Y_Pi0FromKGGPCMAcc", 1000,0, 100, 200, -1.0, 1.0);
483  fHistPtYPi0FromKGGPCMAcc->Sumw2();
485  fHistPtYPi0FromKGGEMCAcc = new TH2F("Pt_Y_Pi0FromKGGEMCAcc","Pt_Y_Pi0FromKGGEMCAcc", 1000,0, 100, 200, -1.0, 1.0);
486  fHistPtYPi0FromKGGEMCAcc->Sumw2();
488  fHistPtYPi0FromKGGPCMEMCAcc = new TH2F("Pt_Y_Pi0FromKGGPCMEMCAcc","Pt_Y_Pi0FromKGGPCMEMCAcc", 1000,0, 100, 200, -1.0, 1.0);
491  fHistPtYPi0FromKGGEMCPCMAcc = new TH2F("Pt_Y_Pi0FromKGGEMCPCMAcc","Pt_Y_Pi0FromKGGEMCPCMAcc", 1000,0, 100, 200, -1.0, 1.0);
494  fHistPtYPi0FromKGGEMCAccSamePi0 = new TH2F("Pt_Y_Pi0FromKGGEMCAccSamePi0","Pt_Y_Pi0FromKGGEMCAccSamePi0", 1000,0, 100, 200, -1.0, 1.0);
497  fHistPtYPi0FromKGGEMCAccDiffPi0 = new TH2F("Pt_Y_Pi0FromKGGEMCAccDiffPi0","Pt_Y_Pi0FromKGGEMCAccDiffPi0", 1000,0, 100, 200, -1.0, 1.0);
500  fHistPtAlphaPi0FromKGG = new TH2F("Pt_Alpha_Pi0FromKGG","Pt_Alpha_Pi0FromKGG", 500,0.1, 50, 200, -1., 1.);
502  fHistPtAlphaPi0FromKGG->Sumw2();
504  fHistPtAlphaPi0FromKGGPCMAcc = new TH2F("Pt_Alpha_Pi0FromKGGPCMAcc","Pt_Alpha_Pi0FromKGGPCMAcc", 500,0.1, 50, 200, -1., 1.);
508  fHistPtAlphaPi0FromKGGEMCAcc = new TH2F("Pt_Alpha_Pi0FromKGGEMCAcc","Pt_Alpha_Pi0FromKGGEMCAcc", 500,0.1, 50, 200, -1., 1.);
512  fHistPtAlphaPi0FromKGGPCMEMCAcc = new TH2F("Pt_Alpha_Pi0FromKGGPCMEMCAcc","Pt_Alpha_Pi0FromKGGPCMEMCAcc", 500,0.1, 50, 200, -1., 1.);
516  fHistPtAlphaPi0FromKGGEMCPCMAcc = new TH2F("Pt_Alpha_Pi0FromKGGEMCPCMAcc","Pt_Alpha_Pi0FromKGGEMCPCMAcc", 500,0.1, 50, 200, -1., 1.);
520  fHistPtAlphaPi0FromKGGEMCAccSamePi0 = new TH2F("Pt_Alpha_Pi0FromKGGEMCAccSamePi0","Pt_Alpha_Pi0FromKGGEMCAccSamePi0", 500,0.1, 50, 200, -1., 1.);
524  fHistPtAlphaPi0FromKGGEMCAccDiffPi0 = new TH2F("Pt_Alpha_Pi0FromKGGEMCAccDiffPi0","Pt_Alpha_Pi0FromKGGEMCAccDiffPi0", 500,0.1, 50, 200, -1., 1.);
528  }
529 
530 
531 
532  PostData(1, fOutputContainer);
533 }
534 
535 //_____________________________________________________________________________
537 {
538 
539  fInputEvent = InputEvent();
540  // cout << "I found an Event" << endl;
541 
542  fMCEvent = MCEvent();
543  if(fMCEvent == nullptr) fIsMC = 0;
544  if (fIsMC==0) return;
545  // cout << "I found an MC header" << endl;
546 
547  const AliVVertex* primVtxMC = fMCEvent->GetPrimaryVertex();
548  Double_t mcProdVtxZ = primVtxMC->GetZ();
549 
550  if (TMath::Abs(mcProdVtxZ) < 10 ){
551  fHistNEvents->Fill(0);
552  } else {
553  fHistNEvents->Fill(1);
554  }
555 
556  AliGenEventHeader* mcEH = fMCEvent->GenEventHeader();
557  AliGenPythiaEventHeader *pyH = dynamic_cast<AliGenPythiaEventHeader*>(mcEH);
558  AliGenHijingEventHeader *hiH = 0;
559  AliGenDPMjetEventHeader *dpmH = 0;
560 
561  // it can be only one save some casts
562  // assuming PYTHIA and HIJING are the most likely ones...
563  if(!pyH){
564  hiH = dynamic_cast<AliGenHijingEventHeader*>(mcEH);
565  if(!hiH){
566  dpmH = dynamic_cast<AliGenDPMjetEventHeader*>(mcEH);
567  }
568  }
569 
570  // fetch the trials on a event by event basis, not from pyxsec.root otherwise
571  // we will get a problem when running on proof since Notify may be called
572  // more than once per file
573  // consider storing this information in the AOD output via AliAODHandler
574  Float_t ntrials = 0;
575  if (!pyH || !hiH || dpmH) {
576  AliGenCocktailEventHeader *ccEH = dynamic_cast<AliGenCocktailEventHeader *>(mcEH);
577  if (ccEH) {
578  TList *genHeaders = ccEH->GetHeaders();
579  for (int imch=0; imch<genHeaders->GetEntries(); imch++) {
580  if(!pyH)pyH = dynamic_cast<AliGenPythiaEventHeader*>(genHeaders->At(imch));
581  if(!hiH)hiH = dynamic_cast<AliGenHijingEventHeader*>(genHeaders->At(imch));
582  if(!dpmH)dpmH = dynamic_cast<AliGenDPMjetEventHeader*>(genHeaders->At(imch));
583  }
584  }
585  }
586 
587  // take the trials from the p+p event
588  if(hiH)ntrials = hiH->Trials();
589  if(dpmH)ntrials = dpmH->Trials();
590  if(pyH)ntrials = pyH->Trials();
591  if(ntrials)fHistNEvents->Fill(2,ntrials);
592 
593  Double_t xSection = 0;
594  Double_t ptHard = 0;
595  if (pyH) xSection = pyH->GetXsection();
596  if (pyH) ptHard = pyH->GetPtHard();
597  if (xSection) fHistXSection->Fill(xSection);
598  if (ptHard) fHistPtHard->Fill(ptHard);
599 
601 
602 
603  PostData(1, fOutputContainer);
604 }
605 
606 
607 //________________________________________________________________________
609 {
610  // Loop over all primary MC particle
611  for(Long_t i = 0; i < fMCEvent->GetNumberOfTracks(); i++) {
612  // fill primary histograms
613  TParticle* particle = nullptr;
614  particle = (TParticle *)fMCEvent->Particle(i);
615  if (!particle) continue;
616  Bool_t hasMother = kFALSE;
617  // cout << i << "\t"<< particle->GetMother(0) << endl;
618  if (particle->GetMother(0)>-1)
619  hasMother = kTRUE;
620  TParticle* motherParticle = nullptr;
621  if( hasMother )
622  motherParticle = (TParticle *)fMCEvent->Particle(particle->GetMother(0));
623  if (motherParticle)
624  hasMother = kTRUE;
625  else
626  hasMother = kFALSE;
627 
629  if(std::find(kAcceptPdgCodes.begin(), kAcceptPdgCodes.end(), TMath::Abs(particle->GetPdgCode())) == kAcceptPdgCodes.end()) continue; // species not supported
630 
631  if (!(TMath::Abs(particle->Energy()-particle->Pz())>0.)) continue;
632  Double_t yPre = (particle->Energy()+particle->Pz())/(particle->Energy()-particle->Pz());
633  // cout << i << "\t"<< particle->GetPdgCode() << "\t"<< particle->Pz() << "\t" << particle->Energy()<< "\t" << particle->Energy()-particle->Pz() << "\t"<< yPre << endl;
634  if( yPre <= 0 ) continue;
635 
636  Double_t y = 0.5*TMath::Log(yPre);
637 
638 
639  if (y > 1.000) continue;
640  switch(particle->GetPdgCode()){
641  case kPdgPi0:
642  fHistPtYPi0->Fill(particle->Pt(), particle->Y());
643  if (hasMother){
644  if (TMath::Abs(motherParticle->GetPdgCode()) == kPdgK0Short ||
645  TMath::Abs(motherParticle->GetPdgCode()) == kPdgK0Long ||
646  TMath::Abs(motherParticle->GetPdgCode()) == kPdgKPlus
647  )
648  fHistPtYPi0FromK->Fill(particle->Pt(), particle->Y());
649  if (TMath::Abs(motherParticle->GetPdgCode()) == kPdgLambda)
650  fHistPtYPi0FromLambda->Fill(particle->Pt(), particle->Y());
651  if (motherParticle->GetPdgCode() == kPdgEta)
652  fHistPtYPi0FromEta->Fill(particle->Pt(), particle->Y());
653  }
654  break;
655  case kPdgEta:
656  fHistPtYEta->Fill(particle->Pt(), particle->Y());
657  break;
658  case kPdgEtaPrime:
659  fHistPtYEtaPrime->Fill(particle->Pt(), particle->Y());
660  break;
661  case kPdgOmega:
662  fHistPtYOmega->Fill(particle->Pt(), particle->Y());
663  break;
664  case kPdgPiPlus:
665  fHistPtYPiPl->Fill(particle->Pt(), particle->Y());
666  if (hasMother){
667  if (TMath::Abs(motherParticle->GetPdgCode()) == kPdgK0Short ||
668  TMath::Abs(motherParticle->GetPdgCode()) == kPdgK0Long ||
669  TMath::Abs(motherParticle->GetPdgCode()) == kPdgKPlus
670  )
671  fHistPtYPiPlFromK->Fill(particle->Pt(), particle->Y());
672  }
673  break;
674  case kPdgPiMinus:
675  fHistPtYPiMi->Fill(particle->Pt(), particle->Y());
676  if (hasMother){
677  if (TMath::Abs(motherParticle->GetPdgCode()) == kPdgK0Short ||
678  TMath::Abs(motherParticle->GetPdgCode()) == kPdgK0Long ||
679  TMath::Abs(motherParticle->GetPdgCode()) == kPdgKPlus
680  )
681  fHistPtYPiMiFromK->Fill(particle->Pt(), particle->Y());
682  }
683  break;
684  case kPdgRho0:
685  fHistPtYRho0->Fill(particle->Pt(), particle->Y());
686  break;
687  case kPdgRhoPlus:
688  fHistPtYRhoPl->Fill(particle->Pt(), particle->Y());
689  break;
690  case kPdgRhoMinus:
691  fHistPtYRhoMi->Fill(particle->Pt(), particle->Y());
692  break;
693  case kPdgPhi:
694  fHistPtYPhi->Fill(particle->Pt(), particle->Y());
695  break;
696  case kPdgJPsi:
697  fHistPtYJPsi->Fill(particle->Pt(), particle->Y());
698  break;
699  case 3212:
700  fHistPtYSigma0->Fill(particle->Pt(), particle->Y());
701  break;
702  case kPdgK0Short:
703  fHistPtYK0s->Fill(particle->Pt(), particle->Y());
704  break;
705  case kPdgK0Long:
706  fHistPtYK0l->Fill(particle->Pt(), particle->Y());
707  break;
708  case kPdgKStar:
709  fHistPtYK0star->Fill(particle->Pt(), particle->Y());
710  break;
711  case kPdgDeltaPlusPlus:
712  fHistPtYDeltaPlPl->Fill(particle->Pt(), particle->Y());
713  break;
714  case kPdgDeltaPlus:
715  fHistPtYDeltaPl->Fill(particle->Pt(), particle->Y());
716  break;
717  case kPdgDeltaMinus:
718  fHistPtYDeltaMi->Fill(particle->Pt(), particle->Y());
719  break;
720  case kPdgDelta0:
721  fHistPtYDelta0->Fill(particle->Pt(), particle->Y());
722  break;
723  case kPdgLambda:
724  fHistPtYLambda->Fill(particle->Pt(), particle->Y());
725  break;
726  }
727 
728  // from here on, we are only intested in particles considered primaries in ALICE
729  if ((particle->GetPdgCode()== kPdgPi0 || particle->GetPdgCode()== kPdgEta) && hasMother){
730  if (TMath::Abs(motherParticle->GetPdgCode()) == kPdgK0Short ||
731  TMath::Abs(motherParticle->GetPdgCode()) == kPdgK0Long ||
732  TMath::Abs(motherParticle->GetPdgCode()) == kPdgKPlus ||
733  TMath::Abs(motherParticle->GetPdgCode()) == kPdgLambda ||
734  TMath::Abs(motherParticle->GetPdgCode()) == kPdgSigma0 ||
735  TMath::Abs(motherParticle->GetPdgCode()) == kPdgSigmaPlus ||
736  TMath::Abs(motherParticle->GetPdgCode()) == kPdgSigmaMinus ||
737  TMath::Abs(motherParticle->GetPdgCode()) == kPdgXi0 ||
738  TMath::Abs(motherParticle->GetPdgCode()) == kPdgXiMinus
739  )
740  continue;
741  }
742 
743  // just looking at pi0, etas, etaprims
744  if (particle->GetPdgCode()==kPdgPi0 || particle->GetPdgCode()==kPdgEta || particle->GetPdgCode() == kPdgEtaPrime){
745  if (particle->GetNDaughters() != 2) continue; // only the two particle decays
746  UChar_t acceptanceGamma[2] = {0,0};
747  Double_t energyGamma[2] = {0,0};
748  Bool_t allOK[2] = {kFALSE,kFALSE};
749 
750 
751  for(Int_t j=0;j<2;j++){
752  TParticle *daughter=fMCEvent->Particle(particle->GetDaughter(j));
753  if (!daughter) continue;
754 
755  // Is Daughter a Photon?
756  if(daughter->GetPdgCode() == 22) allOK[j] =kTRUE;
757  if(IsInPCMAcceptance(daughter)) SETBIT(acceptanceGamma[j], kPCMAcceptance);
758  if(IsInPHOSAcceptance(daughter)) SETBIT(acceptanceGamma[j], kPHOSAcceptance);
759  if(IsInEMCalAcceptance(daughter)) SETBIT(acceptanceGamma[j], kEMCALAcceptance);
760  energyGamma[j] = daughter->Energy();
761 
762 
763  }
764 
765  if (!(allOK[0] && allOK[1])) continue;
766 
767  Double_t alpha = (energyGamma[0]-energyGamma[1])/(energyGamma[0]+energyGamma[1]);
768 
769  if (particle->GetPdgCode()==kPdgPi0){
770  fHistPtYPi0GG->Fill(particle->Pt(), particle->Y());
771  if (TESTBIT(acceptanceGamma[0], kPCMAcceptance) && TESTBIT(acceptanceGamma[1], kPCMAcceptance)){
772  fHistPtYPi0GGPCMAcc->Fill(particle->Pt(), particle->Y());
773  fHistPtAlphaPi0GGPCMAcc->Fill(particle->Pt(), TMath::Abs(alpha));
774  }
775  if (TESTBIT(acceptanceGamma[0], kEMCALAcceptance) && TESTBIT(acceptanceGamma[1], kEMCALAcceptance)){
776  fHistPtYPi0GGEMCAcc->Fill(particle->Pt(), particle->Y());
777  fHistPtAlphaPi0GGEMCAcc->Fill(particle->Pt(), TMath::Abs(alpha));
778  }
779  if (TESTBIT(acceptanceGamma[0], kPHOSAcceptance) && TESTBIT(acceptanceGamma[1], kPHOSAcceptance)){
780  fHistPtYPi0GGPHOAcc->Fill(particle->Pt(), particle->Y());
781  fHistPtAlphaPi0GGPHOAcc->Fill(particle->Pt(), TMath::Abs(alpha));
782  }
783  if ( (TESTBIT(acceptanceGamma[0], kPCMAcceptance) && TESTBIT(acceptanceGamma[1], kEMCALAcceptance)) ||
784  (TESTBIT(acceptanceGamma[1], kPCMAcceptance) && TESTBIT(acceptanceGamma[0], kPCMAcceptance))
785  ){
786  fHistPtYPi0GGPCMEMCAcc->Fill(particle->Pt(), particle->Y());
787  if (!TESTBIT(acceptanceGamma[1], kEMCALAcceptance)) alpha = (energyGamma[1]-energyGamma[0])/(energyGamma[0]+energyGamma[1]);
788  fHistPtAlphaPi0GGPCMEMCAcc->Fill(particle->Pt(), alpha);
789  }
790  if ( (TESTBIT(acceptanceGamma[0], kPCMAcceptance) && TESTBIT(acceptanceGamma[1], kPHOSAcceptance)) ||
791  (TESTBIT(acceptanceGamma[1], kPCMAcceptance) && TESTBIT(acceptanceGamma[0], kPHOSAcceptance))
792  ){
793  fHistPtYPi0GGPCMPHOAcc->Fill(particle->Pt(), particle->Y());
794  if (!TESTBIT(acceptanceGamma[1], kPHOSAcceptance)) alpha = (energyGamma[1]-energyGamma[0])/(energyGamma[0]+energyGamma[1]);
795  fHistPtAlphaPi0GGPCMPHOAcc->Fill(particle->Pt(), alpha);
796  }
797  }
798  if (particle->GetPdgCode()==kPdgEta){
799  fHistPtYEtaGG->Fill(particle->Pt(), particle->Y());
800  if (TESTBIT(acceptanceGamma[0], kPCMAcceptance) && TESTBIT(acceptanceGamma[1], kPCMAcceptance)){
801  fHistPtYEtaGGPCMAcc->Fill(particle->Pt(), particle->Y());
802  fHistPtAlphaEtaGGPCMAcc->Fill(particle->Pt(), TMath::Abs(alpha));
803  }
804  if (TESTBIT(acceptanceGamma[0], kEMCALAcceptance) && TESTBIT(acceptanceGamma[1], kEMCALAcceptance)){
805  fHistPtYEtaGGEMCAcc->Fill(particle->Pt(), particle->Y());
806  fHistPtAlphaEtaGGEMCAcc->Fill(particle->Pt(), TMath::Abs(alpha));
807  }
808  if (TESTBIT(acceptanceGamma[0], kPHOSAcceptance) && TESTBIT(acceptanceGamma[1], kPHOSAcceptance)){
809  fHistPtYEtaGGPHOAcc->Fill(particle->Pt(), particle->Y());
810  fHistPtAlphaEtaGGPHOAcc->Fill(particle->Pt(), TMath::Abs(alpha));
811  }
812  if ( (TESTBIT(acceptanceGamma[0], kPCMAcceptance) && TESTBIT(acceptanceGamma[1], kEMCALAcceptance)) ||
813  (TESTBIT(acceptanceGamma[1], kPCMAcceptance) && TESTBIT(acceptanceGamma[0], kEMCALAcceptance))
814  ){
815  fHistPtYEtaGGPCMEMCAcc->Fill(particle->Pt(), particle->Y());
816  if (!TESTBIT(acceptanceGamma[1], kEMCALAcceptance)) alpha = (energyGamma[1]-energyGamma[0])/(energyGamma[0]+energyGamma[1]);
817  fHistPtAlphaEtaGGPCMEMCAcc->Fill(particle->Pt(), alpha);
818  }
819  if ( (TESTBIT(acceptanceGamma[0], kPCMAcceptance) && TESTBIT(acceptanceGamma[1], kPHOSAcceptance)) ||
820  (TESTBIT(acceptanceGamma[1], kPCMAcceptance) && TESTBIT(acceptanceGamma[0], kPHOSAcceptance))
821  ){
822  fHistPtYEtaGGPCMPHOAcc->Fill(particle->Pt(), particle->Y());
823  if (TESTBIT(!acceptanceGamma[1],kPHOSAcceptance)) alpha = (energyGamma[1]-energyGamma[0])/(energyGamma[0]+energyGamma[1]);
824  fHistPtAlphaEtaGGPCMPHOAcc->Fill(particle->Pt(), alpha);
825  }
826  }
827  if (particle->GetPdgCode()==kPdgEtaPrime){
828  fHistPtYEtaPrimeGG->Fill(particle->Pt(), particle->Y());
829  if (TESTBIT(acceptanceGamma[0], kPCMAcceptance) && TESTBIT(acceptanceGamma[1], kPCMAcceptance)){
830  fHistPtYEtaPrimeGGPCMAcc->Fill(particle->Pt(), particle->Y());
831  fHistPtAlphaEtaPrimeGGPCMAcc->Fill(particle->Pt(), TMath::Abs(alpha));
832  }
833  if (TESTBIT(acceptanceGamma[0], kEMCALAcceptance) && TESTBIT(acceptanceGamma[1], kEMCALAcceptance)){
834  fHistPtYEtaPrimeGGEMCAcc->Fill(particle->Pt(), particle->Y());
835  fHistPtAlphaEtaPrimeGGEMCAcc->Fill(particle->Pt(), TMath::Abs(alpha));
836  }
837  if (TESTBIT(acceptanceGamma[0], kPHOSAcceptance) && TESTBIT(acceptanceGamma[1], kPHOSAcceptance)){
838  fHistPtYEtaPrimeGGPHOAcc->Fill(particle->Pt(), particle->Y());
839  fHistPtAlphaEtaPrimeGGPHOAcc->Fill(particle->Pt(), TMath::Abs(alpha));
840  }
841  if ( (TESTBIT(acceptanceGamma[0], kPCMAcceptance) && TESTBIT(acceptanceGamma[1], kEMCALAcceptance)) ||
842  (TESTBIT(acceptanceGamma[1], kPCMAcceptance) && TESTBIT(acceptanceGamma[0], kEMCALAcceptance))
843  ){
844  fHistPtYEtaPrimeGGPCMEMCAcc->Fill(particle->Pt(), particle->Y());
845  if (!TESTBIT(acceptanceGamma[1], kEMCALAcceptance)) alpha = (energyGamma[1]-energyGamma[0])/(energyGamma[0]+energyGamma[1]);
846  fHistPtAlphaEtaPrimeGGPCMEMCAcc->Fill(particle->Pt(), alpha);
847  }
848  if ( (TESTBIT(acceptanceGamma[0], kPCMAcceptance) && TESTBIT(acceptanceGamma[1], kPHOSAcceptance)) ||
849  (TESTBIT(acceptanceGamma[1], kPCMAcceptance) && TESTBIT(acceptanceGamma[0], kPHOSAcceptance))
850  ){
851  fHistPtYEtaPrimeGGPCMPHOAcc->Fill(particle->Pt(), particle->Y());
852  if (TESTBIT(!acceptanceGamma[1],kPHOSAcceptance)) alpha = (energyGamma[1]-energyGamma[0])/(energyGamma[0]+energyGamma[1]);
853  fHistPtAlphaEtaPrimeGGPCMPHOAcc->Fill(particle->Pt(), alpha);
854  }
855  }
856  }
857 
858 
859  if(fIsK0 == 0) continue;
860  if( particle->GetPdgCode() == kPdgK0Short){
861  if (particle->GetNDaughters() != 2) continue;
862  //UChar_t acceptanceGamma[2] = {0,0};
863  Double_t energyPi0[2] = {0,0};
864  Bool_t allOK[2] = {kFALSE,kFALSE};
865  UChar_t gdAcceptanceGamma[4] = {0,0,0,0};
866  //Double_t gdEnergyGamma[4] = {0,0,0,0};
867  Bool_t allGDOK[4] = {kFALSE, kFALSE, kFALSE,kFALSE};
868  for(Int_t k=0;k<2;k++){
869  TParticle *daughter=fMCEvent->Particle(particle->GetDaughter(k));
870  if (!daughter) continue;
871 
872  // Is Daughter a pi0?
873  if (daughter->GetPdgCode() == kPdgPi0){
874  allOK[k] = kTRUE;
875  if(daughter->GetNDaughters() != 2) continue;
876  energyPi0[k] = daughter->Energy();
877  for(Int_t h=0;h<2;h++){
878  TParticle *granddaughter = fMCEvent->Particle(daughter->GetDaughter(k));
879  if(granddaughter->GetPdgCode() == 22) allGDOK[2*k + h] = kTRUE;
880  if(IsInPCMAcceptance(granddaughter)) SETBIT(gdAcceptanceGamma[2*k+h], kPCMAcceptance);
881  if(IsInEMCalAcceptance(granddaughter)) SETBIT(gdAcceptanceGamma[2*k+h], kEMCALAcceptance);
882  //gdEnergyGamma[2*k+h] = granddaughter->Energy();
883  }
884  }
885  }
886 
887  Double_t alpha_k0 = (energyPi0[0]-energyPi0[1])/(energyPi0[0]+energyPi0[1]);
888 
889  if(allOK[0] && allOK[1]){
890  fHistPtYPi0FromKGG->Fill(particle->Pt(), particle->Y());
891  fHistPtAlphaPi0FromKGG->Fill(particle->Pt(), alpha_k0);
892  }
893 
894  if (!(allGDOK[0] && allGDOK[1] && allGDOK[2] && allGDOK[3])) continue;
895 
896  if (TESTBIT(gdAcceptanceGamma[0], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[1], kPCMAcceptance)
897  && TESTBIT(gdAcceptanceGamma[2], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[3], kPCMAcceptance))
898  {
899  fHistPtYPi0FromKGGPCMAcc->Fill(particle->Pt(),particle->Y());
900  fHistPtAlphaPi0FromKGGPCMAcc->Fill(particle->Pt(), alpha_k0);
901  }
902 
903  if (TESTBIT(gdAcceptanceGamma[0], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[1], kEMCALAcceptance)
904  && TESTBIT(gdAcceptanceGamma[2], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[3], kEMCALAcceptance) )
905  {
906  fHistPtYPi0FromKGGEMCAcc->Fill(particle->Pt(),particle->Y());
907  fHistPtAlphaPi0FromKGGEMCAcc->Fill(particle->Pt(), alpha_k0);
908  }
909 
910 
911  if ((TESTBIT(gdAcceptanceGamma[0], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[1], kPCMAcceptance)
912  && TESTBIT(gdAcceptanceGamma[2], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[3], kPCMAcceptance)) ||
913  (TESTBIT(gdAcceptanceGamma[0], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[1], kEMCALAcceptance)
914  && TESTBIT(gdAcceptanceGamma[2], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[3], kPCMAcceptance)) ||
915  (TESTBIT(gdAcceptanceGamma[0], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[1], kPCMAcceptance)
916  && TESTBIT(gdAcceptanceGamma[2], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[3], kPCMAcceptance)) ||
917  (TESTBIT(gdAcceptanceGamma[0], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[1], kPCMAcceptance)
918  && TESTBIT(gdAcceptanceGamma[2], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[3], kEMCALAcceptance)))
919  {
920  fHistPtYPi0FromKGGPCMEMCAcc->Fill(particle->Pt(),particle->Y());
921  fHistPtAlphaPi0FromKGGPCMEMCAcc->Fill(particle->Pt(), alpha_k0);
922  }
923 
924  if ((TESTBIT(gdAcceptanceGamma[0], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[1], kEMCALAcceptance)
925  && TESTBIT(gdAcceptanceGamma[2], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[3], kEMCALAcceptance)) ||
926  (TESTBIT(gdAcceptanceGamma[0], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[1], kPCMAcceptance)
927  && TESTBIT(gdAcceptanceGamma[2], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[3], kEMCALAcceptance)) ||
928  (TESTBIT(gdAcceptanceGamma[0], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[1], kEMCALAcceptance)
929  && TESTBIT(gdAcceptanceGamma[2], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[3], kEMCALAcceptance)) ||
930  (TESTBIT(gdAcceptanceGamma[0], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[1], kEMCALAcceptance)
931  && TESTBIT(gdAcceptanceGamma[2], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[3], kPCMAcceptance)))
932  {
933  fHistPtYPi0FromKGGEMCPCMAcc->Fill(particle->Pt(),particle->Y());
934  fHistPtAlphaPi0FromKGGEMCPCMAcc->Fill(particle->Pt(), alpha_k0);
935  }
936 
937  if ((TESTBIT(gdAcceptanceGamma[0], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[1], kEMCALAcceptance) &&
938  TESTBIT(gdAcceptanceGamma[2], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[3], kPCMAcceptance))||
939  (TESTBIT(gdAcceptanceGamma[0], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[1], kPCMAcceptance) &&
940  TESTBIT(gdAcceptanceGamma[2], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[3], kEMCALAcceptance)))
941  {
942  fHistPtYPi0FromKGGEMCAccSamePi0->Fill(particle->Pt(),particle->Y());
943  fHistPtAlphaPi0FromKGGEMCAccSamePi0->Fill(particle->Pt(), alpha_k0);
944  }
945 
946  if ((TESTBIT(gdAcceptanceGamma[0], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[2], kEMCALAcceptance)&&
947  TESTBIT(gdAcceptanceGamma[1], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[3], kPCMAcceptance))||
948  (TESTBIT(gdAcceptanceGamma[0], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[3], kEMCALAcceptance)&&
949  TESTBIT(gdAcceptanceGamma[1], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[2], kPCMAcceptance))||
950  (TESTBIT(gdAcceptanceGamma[1], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[2], kEMCALAcceptance)&&
951  TESTBIT(gdAcceptanceGamma[0], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[3], kPCMAcceptance))||
952  (TESTBIT(gdAcceptanceGamma[1], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[3], kEMCALAcceptance)&&
953  TESTBIT(gdAcceptanceGamma[0], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[2], kPCMAcceptance)))
954  {
955  fHistPtYPi0FromKGGEMCAccDiffPi0->Fill(particle->Pt(),particle->Y());
956  fHistPtAlphaPi0FromKGGEMCAccDiffPi0->Fill(particle->Pt(), alpha_k0);
957  }
958  }
959  }
960 }
961 
962 //________________________________________________________________________
964  const Double_t kBoundaryEta = 0.900001;
965  if (part->Pt() > 0.050 && TMath::Abs(part->Eta()) < kBoundaryEta) return true;
966 
967  return false;
968 }
969 
970 //________________________________________________________________________
972  const Double_t kBoundaryEtaMin = -0.13;
973  const Double_t kBoundaryEtaMax = 0.13;
974  const Double_t kBoundaryPhiMin = 4.54;
975  const Double_t kBoundaryPhiMax = 5.59;
976  if (part->Pt() < 0.300) return false;
977  if (part->Eta() > kBoundaryEtaMax || part->Eta() < kBoundaryEtaMin) return false;
978  if (part->Phi() > kBoundaryPhiMax || part->Phi() < kBoundaryPhiMin) return false;
979  return true;
980 }
981 
982 //________________________________________________________________________
984  const Double_t kBoundaryEtaMin = -0.6687;
985  const Double_t kBoundaryEtaMax = 0.66465;
986  const Double_t kBoundaryPhiMin = 1.39626;
987  const Double_t kBoundaryPhiMax = 3.15;
988  if (part->Pt() < 0.400) return false;
989  if (part->Eta() > kBoundaryEtaMax || part->Eta() < kBoundaryEtaMin) return false;
990  if (part->Phi() > kBoundaryPhiMax || part->Phi() < kBoundaryPhiMin) return false;
991  return true;
992 }
993 
994 //________________________________________________________________________
996 {
997 
998  //fOutputContainer->Print(); // Will crash on GRID
999 }
1000 
1001 
1002 //_________________________________________________________________________________
1004  TAxis *axisafter = histoRebin->GetXaxis();
1005  Int_t bins = axisafter->GetNbins();
1006  Double_t from = axisafter->GetXmin();
1007  Double_t to = axisafter->GetXmax();
1008  Double_t *newbins = new Double_t[bins+1];
1009  newbins[0] = from;
1010  Double_t factor = TMath::Power(to/from, 1./bins);
1011  for(Int_t i=1; i<=bins; ++i) newbins[i] = factor * newbins[i-1];
1012  axisafter->Set(bins, newbins);
1013  delete [] newbins;
1014 }
1015 
1016 //_________________________________________________________________________________
1018  TAxis *axisafter = histoRebin->GetXaxis();
1019  Int_t bins = axisafter->GetNbins();
1020  Double_t from = axisafter->GetXmin();
1021  Double_t to = axisafter->GetXmax();
1022  Double_t *newbins = new Double_t[bins+1];
1023  newbins[0] = from;
1024  Double_t factor = TMath::Power(to/from, 1./bins);
1025  for(Int_t i=1; i<=bins; ++i) newbins[i] = factor * newbins[i-1];
1026  axisafter->Set(bins, newbins);
1027  delete [] newbins;
1028 }
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
TH2F * fHistPtYPi0FromEta
histo for Lambda
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