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