AliPhysics  d565ceb (d565ceb)
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  fHistPtYEtaPrim(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  fHistPtYEtaPrimGG(nullptr),
109  fHistPtYEtaPrimGGPCMAcc(nullptr),
110  fHistPtYEtaPrimGGEMCAcc(nullptr),
111  fHistPtYEtaPrimGGPHOAcc(nullptr),
112  fHistPtYEtaPrimGGPCMEMCAcc(nullptr),
113  fHistPtYEtaPrimGGPCMPHOAcc(nullptr),
114  fHistPtYPi0FromKGG(nullptr),
115  fHistPtYPi0FromKGGPCMAcc(nullptr),
116  fHistPtYPi0FromKGGEMCAcc(nullptr),
117  fHistPtYPi0FromKGGPCMEMCAcc(nullptr),
118  fHistPtYPi0FromKGGEMCPCMAcc(nullptr),
119  fHistPtYPi0FromKGGEMCAccSamePi0(nullptr),
120  fHistPtYPi0FromKGGEMCAccDiffPi0(nullptr),
121  fHistPtAlphaPi0FromKGG(nullptr),
122  fHistPtAlphaPi0FromKGGPCMAcc(nullptr),
123  fHistPtAlphaPi0FromKGGEMCAcc(nullptr),
124  fHistPtAlphaPi0FromKGGPCMEMCAcc(nullptr),
125  fHistPtAlphaPi0FromKGGEMCPCMAcc(nullptr),
126  fHistPtAlphaPi0FromKGGEMCAccSamePi0(nullptr),
127  fHistPtAlphaPi0FromKGGEMCAccDiffPi0(nullptr),
128  fIsK0(1),
129  fIsMC(1)
130 {
131 
132 }
133 
134 //________________________________________________________________________
136  AliAnalysisTaskSE(name),
137  fOutputContainer(nullptr),
138  fHistNEvents(nullptr),
139  fHistXSection(nullptr),
140  fHistPtHard(nullptr),
141  fHistPtYPi0(nullptr),
142  fHistPtYPiPl(nullptr),
143  fHistPtYPiMi(nullptr),
144  fHistPtYEta(nullptr),
145  fHistPtYEtaPrim(nullptr),
146  fHistPtYOmega(nullptr),
147  fHistPtYRho0(nullptr),
148  fHistPtYRhoPl(nullptr),
149  fHistPtYRhoMi(nullptr),
150  fHistPtYPhi(nullptr),
151  fHistPtYJPsi(nullptr),
152  fHistPtYSigma0(nullptr),
153  fHistPtYK0s(nullptr),
154  fHistPtYK0l(nullptr),
155  fHistPtYK0star(nullptr),
156  fHistPtYDeltaPlPl(nullptr),
157  fHistPtYDeltaPl(nullptr),
158  fHistPtYDeltaMi(nullptr),
159  fHistPtYDelta0(nullptr),
160  fHistPtYLambda(nullptr),
161  fHistPtYPi0FromEta(nullptr),
162  fHistPtYPi0FromLambda(nullptr),
163  fHistPtYPi0FromK(nullptr),
164  fHistPtYPiPlFromK(nullptr),
165  fHistPtYPiMiFromK(nullptr),
166  fHistPtYPi0GG(nullptr),
167  fHistPtYPi0GGPCMAcc(nullptr),
168  fHistPtYPi0GGEMCAcc(nullptr),
169  fHistPtYPi0GGPHOAcc(nullptr),
170  fHistPtYPi0GGPCMEMCAcc(nullptr),
171  fHistPtYPi0GGPCMPHOAcc(nullptr),
172  fHistPtAlphaPi0GGPCMAcc(nullptr),
173  fHistPtAlphaPi0GGEMCAcc(nullptr),
174  fHistPtAlphaPi0GGPHOAcc(nullptr),
175  fHistPtAlphaPi0GGPCMEMCAcc(nullptr),
176  fHistPtAlphaPi0GGPCMPHOAcc(nullptr),
177  fHistPtYEtaGG(nullptr),
178  fHistPtYEtaGGPCMAcc(nullptr),
179  fHistPtYEtaGGEMCAcc(nullptr),
180  fHistPtYEtaGGPHOAcc(nullptr),
181  fHistPtYEtaGGPCMEMCAcc(nullptr),
182  fHistPtYEtaGGPCMPHOAcc(nullptr),
183  fHistPtAlphaEtaGGPCMAcc(nullptr),
184  fHistPtAlphaEtaGGEMCAcc(nullptr),
185  fHistPtAlphaEtaGGPHOAcc(nullptr),
186  fHistPtAlphaEtaGGPCMEMCAcc(nullptr),
187  fHistPtAlphaEtaGGPCMPHOAcc(nullptr),
188  fHistPtYEtaPrimGG(nullptr),
189  fHistPtYEtaPrimGGPCMAcc(nullptr),
190  fHistPtYEtaPrimGGEMCAcc(nullptr),
191  fHistPtYEtaPrimGGPHOAcc(nullptr),
192  fHistPtYEtaPrimGGPCMEMCAcc(nullptr),
193  fHistPtYEtaPrimGGPCMPHOAcc(nullptr),
194  fHistPtYPi0FromKGG(nullptr),
195  fHistPtYPi0FromKGGPCMAcc(nullptr),
196  fHistPtYPi0FromKGGEMCAcc(nullptr),
197  fHistPtYPi0FromKGGPCMEMCAcc(nullptr),
198  fHistPtYPi0FromKGGEMCPCMAcc(nullptr),
199  fHistPtYPi0FromKGGEMCAccSamePi0(nullptr),
200  fHistPtYPi0FromKGGEMCAccDiffPi0(nullptr),
201  fHistPtAlphaPi0FromKGG(nullptr),
202  fHistPtAlphaPi0FromKGGPCMAcc(nullptr),
203  fHistPtAlphaPi0FromKGGEMCAcc(nullptr),
204  fHistPtAlphaPi0FromKGGPCMEMCAcc(nullptr),
205  fHistPtAlphaPi0FromKGGEMCPCMAcc(nullptr),
206  fHistPtAlphaPi0FromKGGEMCAccSamePi0(nullptr),
207  fHistPtAlphaPi0FromKGGEMCAccDiffPi0(nullptr),
208  fIsK0(1),
209  fIsMC(1)
210 {
211  // Define output slots here
212  DefineOutput(1, TList::Class());
213 }
214 
216 {
217 
218 }
219 
220 //________________________________________________________________________
222 
223  // Create histograms
224  if(fOutputContainer != nullptr){
225  delete fOutputContainer;
226  fOutputContainer = nullptr;
227  }
228  if(fOutputContainer == nullptr){
229  fOutputContainer = new TList();
230  fOutputContainer->SetOwner(kTRUE);
231  }
232 
233  fHistNEvents = new TH1F("NEvents", "NEvents", 3, -0.5, 2.5);
234  fHistNEvents->Sumw2();
236 
237  fHistXSection = new TH1D("XSection", "XSection", 1000000, 0, 1e4);
238 
239  // SetLogBinningXTH1(fHistXSection);
240  fHistXSection->Sumw2();
242 
243  fHistPtHard = new TH1F("PtHard", "PtHard", 400, 0, 200);
244  fHistPtHard->Sumw2();
246 
247  fHistPtYPi0 = new TH2F("Pt_Y_Pi0","Pt_Y_Pi0", 1000,0, 100, 200, -1.0, 1.0);
248  fHistPtYPi0->Sumw2();
250 
251  fHistPtYPiPl = new TH2F("Pt_Y_PiPl","Pt_Y_PiPl", 1000,0, 100, 200, -1.0, 1.0);
252  fHistPtYPiPl->Sumw2();
254 
255  fHistPtYPiMi = new TH2F("Pt_Y_PiMi","Pt_Y_PiMi", 1000,0, 100, 200, -1.0, 1.0);
256  fHistPtYPiMi->Sumw2();
258 
259  fHistPtYEta = new TH2F("Pt_Y_Eta","Pt_Y_Eta", 1000,0, 100, 200, -1.0, 1.0);
260  fHistPtYEta->Sumw2();
262 
263  fHistPtYEtaPrim = new TH2F("Pt_Y_EtaPrim","Pt_Y_EtaPrim", 1000,0, 100, 200, -1.0, 1.0);
264  fHistPtYEtaPrim->Sumw2();
266 
267  fHistPtYOmega = new TH2F("Pt_Y_Omega","Pt_Y_Omega", 1000,0, 100, 200, -1.0, 1.0);
268  fHistPtYOmega->Sumw2();
270 
271  fHistPtYRho0 = new TH2F("Pt_Y_Rho0","Pt_Y_Rho0", 1000,0, 100, 200, -1.0, 1.0);
272  fHistPtYRho0->Sumw2();
274 
275  fHistPtYRhoPl = new TH2F("Pt_Y_RhoPl","Pt_Y_RhoPl", 1000,0, 100, 200, -1.0, 1.0);
276  fHistPtYRhoPl->Sumw2();
278 
279  fHistPtYRhoMi = new TH2F("Pt_Y_RhoMi","Pt_Y_RhoMi", 1000,0, 100, 200, -1.0, 1.0);
280  fHistPtYRhoMi->Sumw2();
282 
283  fHistPtYPhi = new TH2F("Pt_Y_Phi","Pt_Y_Phi", 1000,0, 100, 200, -1.0, 1.0);
284  fHistPtYPhi->Sumw2();
286 
287  fHistPtYJPsi = new TH2F("Pt_Y_JPsi","Pt_Y_JPsi", 1000,0, 100, 200, -1.0, 1.0);
288  fHistPtYJPsi->Sumw2();
290 
291  fHistPtYSigma0 = new TH2F("Pt_Y_Sigma0","Pt_Y_Sigma0", 1000,0, 100, 200, -1.0, 1.0);
292  fHistPtYSigma0->Sumw2();
294 
295  fHistPtYK0s = new TH2F("Pt_Y_K0s","Pt_Y_K0s", 1000,0, 100, 200, -1.0, 1.0);
296  fHistPtYK0s->Sumw2();
298 
299  fHistPtYK0l = new TH2F("Pt_Y_K0l","Pt_Y_K0l", 1000,0, 100, 200, -1.0, 1.0);
300  fHistPtYK0l->Sumw2();
302 
303  fHistPtYK0star = new TH2F("Pt_Y_K0star","Pt_Y_K0star", 1000,0, 100, 200, -1.0, 1.0);
304  fHistPtYK0star->Sumw2();
306 
307  fHistPtYDeltaPlPl = new TH2F("Pt_Y_DeltaPlPl","Pt_Y_DeltaPlPl", 1000,0, 100, 200, -1.0, 1.0);
308  fHistPtYDeltaPlPl->Sumw2();
310 
311  fHistPtYDeltaPl = new TH2F("Pt_Y_DeltaPl","Pt_Y_DeltaPl", 1000,0, 100, 200, -1.0, 1.0);
312  fHistPtYDeltaPl->Sumw2();
314 
315  fHistPtYDeltaMi = new TH2F("Pt_Y_DeltaMi","Pt_Y_DeltaMi", 1000,0, 100, 200, -1.0, 1.0);
316  fHistPtYDeltaMi->Sumw2();
318 
319  fHistPtYDelta0 = new TH2F("Pt_Y_Delta0","Pt_Y_Delta0", 1000,0, 100, 200, -1.0, 1.0);
320  fHistPtYDelta0->Sumw2();
322 
323  fHistPtYLambda = new TH2F("Pt_Y_Lambda","Pt_Y_Lambda", 1000,0, 100, 200, -1.0, 1.0);
324  fHistPtYLambda->Sumw2();
326 
327  fHistPtYPi0FromEta = new TH2F("Pt_Y_Pi0FromEta","Pt_Y_Pi0FromEta", 1000,0, 100, 200, -1.0, 1.0);
328  fHistPtYPi0FromEta->Sumw2();
330 
331  fHistPtYPi0FromLambda = new TH2F("Pt_Y_Pi0FromLambda","Pt_Y_Pi0FromLambda", 1000,0, 100, 200, -1.0, 1.0);
332  fHistPtYPi0FromLambda->Sumw2();
334 
335  fHistPtYPi0FromK = new TH2F("Pt_Y_Pi0FromK","Pt_Y_Pi0FromK", 1000,0, 100, 200, -1.0, 1.0);
336  fHistPtYPi0FromK->Sumw2();
338 
339  fHistPtYPiPlFromK = new TH2F("Pt_Y_PiPlFromK","Pt_Y_PiPlFromK", 1000,0, 100, 200, -1.0, 1.0);
340  fHistPtYPiPlFromK->Sumw2();
342 
343  fHistPtYPiMiFromK = new TH2F("Pt_Y_PiMiFromK","Pt_Y_PiMiFromK", 1000,0, 100, 200, -1.0, 1.0);
344  fHistPtYPiMiFromK->Sumw2();
346 
347 
348  fHistPtYPi0GG = new TH2F("Pt_Y_Pi0GG","Pt_Y_Pi0GG", 1000,0, 100, 200, -1.0, 1.0);
349  fHistPtYPi0GG->Sumw2();
351  fHistPtYPi0GGPCMAcc = new TH2F("Pt_Y_Pi0GGPCMAcc","Pt_Y_Pi0GGPCMAcc", 1000,0, 100, 200, -1.0, 1.0);
352  fHistPtYPi0GGPCMAcc->Sumw2();
354  fHistPtYPi0GGEMCAcc = new TH2F("Pt_Y_Pi0GGEMCAcc","Pt_Y_Pi0GGEMCAcc", 1000,0, 100, 200, -1.0, 1.0);
355  fHistPtYPi0GGEMCAcc->Sumw2();
357  fHistPtYPi0GGPHOAcc = new TH2F("Pt_Y_Pi0GGPHOAcc","Pt_Y_Pi0GGPHOAcc", 1000,0, 100, 200, -1.0, 1.0);
358  fHistPtYPi0GGPHOAcc->Sumw2();
360  fHistPtYPi0GGPCMEMCAcc = new TH2F("Pt_Y_Pi0GGPCMEMCAcc","Pt_Y_Pi0GGPCMEMCAcc", 1000,0, 100, 200, -1.0, 1.0);
361  fHistPtYPi0GGPCMEMCAcc->Sumw2();
363  fHistPtYPi0GGPCMPHOAcc = new TH2F("Pt_Y_Pi0GGPCMPHOAcc","Pt_Y_Pi0GGPCMPHOAcc", 1000,0, 100, 200, -1.0, 1.0);
364  fHistPtYPi0GGPCMPHOAcc->Sumw2();
366 
367  fHistPtYEtaGG = new TH2F("Pt_Y_EtaGG","Pt_Y_EtaGG", 1000,0, 100, 200, -1.0, 1.0);
368  fHistPtYEtaGG->Sumw2();
370  fHistPtYEtaGGPCMAcc = new TH2F("Pt_Y_EtaGGPCMAcc","Pt_Y_EtaGGPCMAcc", 1000,0, 100, 200, -1.0, 1.0);
371  fHistPtYEtaGGPCMAcc->Sumw2();
373  fHistPtYEtaGGEMCAcc = new TH2F("Pt_Y_EtaGGEMCAcc","Pt_Y_EtaGGEMCAcc", 1000,0, 100, 200, -1.0, 1.0);
374  fHistPtYEtaGGEMCAcc->Sumw2();
376  fHistPtYEtaGGPHOAcc = new TH2F("Pt_Y_EtaGGPHOAcc","Pt_Y_EtaGGPHOAcc", 1000,0, 100, 200, -1.0, 1.0);
377  fHistPtYEtaGGPHOAcc->Sumw2();
379  fHistPtYEtaGGPCMEMCAcc = new TH2F("Pt_Y_EtaGGPCMEMCAcc","Pt_Y_EtaGGPCMEMCAcc", 1000,0, 100, 200, -1.0, 1.0);
380  fHistPtYEtaGGPCMEMCAcc->Sumw2();
382  fHistPtYEtaGGPCMPHOAcc = new TH2F("Pt_Y_EtaGGPCMPHOAcc","Pt_Y_EtaGGPCMPHOAcc", 1000,0, 100, 200, -1.0, 1.0);
383  fHistPtYEtaGGPCMPHOAcc->Sumw2();
385 
386  fHistPtYEtaPrimGG = new TH2F("Pt_Y_EtaPrimGG","Pt_Y_EtaPrimGG", 1000,0, 100, 200, -1.0, 1.0);
387  fHistPtYEtaPrimGG->Sumw2();
389  fHistPtYEtaPrimGGPCMAcc = new TH2F("Pt_Y_EtaPrimGGPCMAcc","Pt_Y_EtaPrimGGPCMAcc", 1000,0, 100, 200, -1.0, 1.0);
390  fHistPtYEtaPrimGGPCMAcc->Sumw2();
392  fHistPtYEtaPrimGGEMCAcc = new TH2F("Pt_Y_EtaPrimGGEMCAcc","Pt_Y_EtaPrimGGEMCAcc", 1000,0, 100, 200, -1.0, 1.0);
393  fHistPtYEtaPrimGGEMCAcc->Sumw2();
395  fHistPtYEtaPrimGGPHOAcc = new TH2F("Pt_Y_EtaPrimGGPHOAcc","Pt_Y_EtaPrimGGPHOAcc", 1000,0, 100, 200, -1.0, 1.0);
396  fHistPtYEtaPrimGGPHOAcc->Sumw2();
398  fHistPtYEtaPrimGGPCMEMCAcc = new TH2F("Pt_Y_EtaPrimGGPCMEMCAcc","Pt_Y_EtaPrimGGPCMEMCAcc", 1000,0, 100, 200, -1.0, 1.0);
401  fHistPtYEtaPrimGGPCMPHOAcc = new TH2F("Pt_Y_EtaPrimGGPCMPHOAcc","Pt_Y_EtaPrimGGPCMPHOAcc", 1000,0, 100, 200, -1.0, 1.0);
404 
405  fHistPtAlphaPi0GGPCMAcc = new TH2F("Pt_Alpha_Pi0GGPCMAcc","Pt_Alpha_Pi0GGPCMAcc", 500,0.1, 50, 100, 0., 1.);
407  fHistPtAlphaPi0GGPCMAcc->Sumw2();
409  fHistPtAlphaPi0GGEMCAcc = new TH2F("Pt_Alpha_Pi0GGEMCAcc","Pt_Alpha_Pi0GGEMCAcc", 500,0.1, 50, 100, 0., 1.);
411  fHistPtAlphaPi0GGEMCAcc->Sumw2();
413  fHistPtAlphaPi0GGPHOAcc = new TH2F("Pt_Alpha_Pi0GGPHOAcc","Pt_Alpha_Pi0GGPHOAcc", 500,0.1, 50, 100, 0., 1.);
415  fHistPtAlphaPi0GGPHOAcc->Sumw2();
417  fHistPtAlphaPi0GGPCMEMCAcc = new TH2F("Pt_Alpha_Pi0GGPCMEMCAcc","Pt_Alpha_Pi0GGPCMEMCAcc", 500,0.1, 50, 200, -1., 1.);
421  fHistPtAlphaPi0GGPCMPHOAcc = new TH2F("Pt_Alpha_Pi0GGPCMPHOAcc","Pt_Alpha_Pi0GGPCMPHOAcc", 500,0.1, 50, 200, -1., 1.);
425 
426  fHistPtAlphaEtaGGPCMAcc = new TH2F("Pt_Alpha_EtaGGPCMAcc","Pt_Alpha_EtaGGPCMAcc", 500,0.1, 50, 100, 0., 1.);
428  fHistPtAlphaEtaGGPCMAcc->Sumw2();
430  fHistPtAlphaEtaGGEMCAcc = new TH2F("Pt_Alpha_EtaGGEMCAcc","Pt_Alpha_EtaGGEMCAcc", 500,0.1, 50, 100, 0., 1.);
432  fHistPtAlphaEtaGGEMCAcc->Sumw2();
434  fHistPtAlphaEtaGGPHOAcc = new TH2F("Pt_Alpha_EtaGGPHOAcc","Pt_Alpha_EtaGGPHOAcc", 500,0.1, 50, 100, 0., 1.);
436  fHistPtAlphaEtaGGPHOAcc->Sumw2();
438  fHistPtAlphaEtaGGPCMEMCAcc = new TH2F("Pt_Alpha_EtaGGPCMEMCAcc","Pt_Alpha_EtaGGPCMEMCAcc", 500,0.1, 50, 200, -1., 1.);
442  fHistPtAlphaEtaGGPCMPHOAcc = new TH2F("Pt_Alpha_EtaGGPCMPHOAcc","Pt_Alpha_EtaGGPCMPHOAcc", 500,0.1, 50, 200, -1., 1.);
446 
447  if (fIsK0 == 1){
448  fHistPtYPi0FromKGG = new TH2F("Pt_Y_Pi0FromKGG","Pt_Y_Pi0FromKGG", 1000,0, 100, 200, -1.0, 1.0);
449  fHistPtYPi0FromKGG->Sumw2();
451  fHistPtYPi0FromKGGPCMAcc = new TH2F("Pt_Y_Pi0FromKGGPCMAcc","Pt_Y_Pi0FromKGGPCMAcc", 1000,0, 100, 200, -1.0, 1.0);
452  fHistPtYPi0FromKGGPCMAcc->Sumw2();
454  fHistPtYPi0FromKGGEMCAcc = new TH2F("Pt_Y_Pi0FromKGGEMCAcc","Pt_Y_Pi0FromKGGEMCAcc", 1000,0, 100, 200, -1.0, 1.0);
455  fHistPtYPi0FromKGGEMCAcc->Sumw2();
457  fHistPtYPi0FromKGGPCMEMCAcc = new TH2F("Pt_Y_Pi0FromKGGPCMEMCAcc","Pt_Y_Pi0FromKGGPCMEMCAcc", 1000,0, 100, 200, -1.0, 1.0);
460  fHistPtYPi0FromKGGEMCPCMAcc = new TH2F("Pt_Y_Pi0FromKGGEMCPCMAcc","Pt_Y_Pi0FromKGGEMCPCMAcc", 1000,0, 100, 200, -1.0, 1.0);
463  fHistPtYPi0FromKGGEMCAccSamePi0 = new TH2F("Pt_Y_Pi0FromKGGEMCAccSamePi0","Pt_Y_Pi0FromKGGEMCAccSamePi0", 1000,0, 100, 200, -1.0, 1.0);
466  fHistPtYPi0FromKGGEMCAccDiffPi0 = new TH2F("Pt_Y_Pi0FromKGGEMCAccDiffPi0","Pt_Y_Pi0FromKGGEMCAccDiffPi0", 1000,0, 100, 200, -1.0, 1.0);
469  fHistPtAlphaPi0FromKGG = new TH2F("Pt_Alpha_Pi0FromKGG","Pt_Alpha_Pi0FromKGG", 500,0.1, 50, 200, -1., 1.);
471  fHistPtAlphaPi0FromKGG->Sumw2();
473  fHistPtAlphaPi0FromKGGPCMAcc = new TH2F("Pt_Alpha_Pi0FromKGGPCMAcc","Pt_Alpha_Pi0FromKGGPCMAcc", 500,0.1, 50, 200, -1., 1.);
477  fHistPtAlphaPi0FromKGGEMCAcc = new TH2F("Pt_Alpha_Pi0FromKGGEMCAcc","Pt_Alpha_Pi0FromKGGEMCAcc", 500,0.1, 50, 200, -1., 1.);
481  fHistPtAlphaPi0FromKGGPCMEMCAcc = new TH2F("Pt_Alpha_Pi0FromKGGPCMEMCAcc","Pt_Alpha_Pi0FromKGGPCMEMCAcc", 500,0.1, 50, 200, -1., 1.);
485  fHistPtAlphaPi0FromKGGEMCPCMAcc = new TH2F("Pt_Alpha_Pi0FromKGGEMCPCMAcc","Pt_Alpha_Pi0FromKGGEMCPCMAcc", 500,0.1, 50, 200, -1., 1.);
489  fHistPtAlphaPi0FromKGGEMCAccSamePi0 = new TH2F("Pt_Alpha_Pi0FromKGGEMCAccSamePi0","Pt_Alpha_Pi0FromKGGEMCAccSamePi0", 500,0.1, 50, 200, -1., 1.);
493  fHistPtAlphaPi0FromKGGEMCAccDiffPi0 = new TH2F("Pt_Alpha_Pi0FromKGGEMCAccDiffPi0","Pt_Alpha_Pi0FromKGGEMCAccDiffPi0", 500,0.1, 50, 200, -1., 1.);
497  }
498 
499 
500 
501  PostData(1, fOutputContainer);
502 }
503 
504 //_____________________________________________________________________________
506 {
507 
508  fInputEvent = InputEvent();
509  // cout << "I found an Event" << endl;
510 
511  fMCEvent = MCEvent();
512  if(fMCEvent == nullptr) fIsMC = 0;
513  if (fIsMC==0) return;
514  // cout << "I found an MC header" << endl;
515 
516  const AliVVertex* primVtxMC = fMCEvent->GetPrimaryVertex();
517  Double_t mcProdVtxZ = primVtxMC->GetZ();
518 
519  if (TMath::Abs(mcProdVtxZ) < 10 ){
520  fHistNEvents->Fill(0);
521  } else {
522  fHistNEvents->Fill(1);
523  }
524 
525  AliGenEventHeader* mcEH = fMCEvent->GenEventHeader();
526  AliGenPythiaEventHeader *pyH = dynamic_cast<AliGenPythiaEventHeader*>(mcEH);
527  AliGenHijingEventHeader *hiH = 0;
528  AliGenDPMjetEventHeader *dpmH = 0;
529 
530  // it can be only one save some casts
531  // assuming PYTHIA and HIJING are the most likely ones...
532  if(!pyH){
533  hiH = dynamic_cast<AliGenHijingEventHeader*>(mcEH);
534  if(!hiH){
535  dpmH = dynamic_cast<AliGenDPMjetEventHeader*>(mcEH);
536  }
537  }
538 
539  // fetch the trials on a event by event basis, not from pyxsec.root otherwise
540  // we will get a problem when running on proof since Notify may be called
541  // more than once per file
542  // consider storing this information in the AOD output via AliAODHandler
543  Float_t ntrials = 0;
544  if (!pyH || !hiH || dpmH) {
545  AliGenCocktailEventHeader *ccEH = dynamic_cast<AliGenCocktailEventHeader *>(mcEH);
546  if (ccEH) {
547  TList *genHeaders = ccEH->GetHeaders();
548  for (int imch=0; imch<genHeaders->GetEntries(); imch++) {
549  if(!pyH)pyH = dynamic_cast<AliGenPythiaEventHeader*>(genHeaders->At(imch));
550  if(!hiH)hiH = dynamic_cast<AliGenHijingEventHeader*>(genHeaders->At(imch));
551  if(!dpmH)dpmH = dynamic_cast<AliGenDPMjetEventHeader*>(genHeaders->At(imch));
552  }
553  }
554  }
555 
556  // take the trials from the p+p event
557  if(hiH)ntrials = hiH->Trials();
558  if(dpmH)ntrials = dpmH->Trials();
559  if(pyH)ntrials = pyH->Trials();
560  if(ntrials)fHistNEvents->Fill(2,ntrials);
561 
562  Double_t xSection = 0;
563  Double_t ptHard = 0;
564  if (pyH) xSection = pyH->GetXsection();
565  if (pyH) ptHard = pyH->GetPtHard();
566  if (xSection) fHistXSection->Fill(xSection);
567  if (ptHard) fHistPtHard->Fill(ptHard);
568 
570 
571 
572  PostData(1, fOutputContainer);
573 }
574 
575 
576 //________________________________________________________________________
578 {
579  // Loop over all primary MC particle
580  for(Long_t i = 0; i < fMCEvent->GetNumberOfTracks(); i++) {
581  // fill primary histograms
582  TParticle* particle = nullptr;
583  particle = (TParticle *)fMCEvent->Particle(i);
584  if (!particle) continue;
585  Bool_t hasMother = kFALSE;
586  // cout << i << "\t"<< particle->GetMother(0) << endl;
587  if (particle->GetMother(0)>-1)
588  hasMother = kTRUE;
589  TParticle* motherParticle = nullptr;
590  if( hasMother )
591  motherParticle = (TParticle *)fMCEvent->Particle(particle->GetMother(0));
592  if (motherParticle)
593  hasMother = kTRUE;
594  else
595  hasMother = kFALSE;
596 
598  if(std::find(kAcceptPdgCodes.begin(), kAcceptPdgCodes.end(), TMath::Abs(particle->GetPdgCode())) == kAcceptPdgCodes.end()) continue; // species not supported
599 
600  if (!(TMath::Abs(particle->Energy()-particle->Pz())>0.)) continue;
601  Double_t yPre = (particle->Energy()+particle->Pz())/(particle->Energy()-particle->Pz());
602  // cout << i << "\t"<< particle->GetPdgCode() << "\t"<< particle->Pz() << "\t" << particle->Energy()<< "\t" << particle->Energy()-particle->Pz() << "\t"<< yPre << endl;
603  if( yPre <= 0 ) continue;
604 
605  Double_t y = 0.5*TMath::Log(yPre);
606 
607 
608  if (y > 1.000) continue;
609  switch(particle->GetPdgCode()){
610  case kPdgPi0:
611  fHistPtYPi0->Fill(particle->Pt(), particle->Y());
612  if (hasMother){
613  if (TMath::Abs(motherParticle->GetPdgCode()) == kPdgK0Short ||
614  TMath::Abs(motherParticle->GetPdgCode()) == kPdgK0Long ||
615  TMath::Abs(motherParticle->GetPdgCode()) == kPdgKPlus
616  )
617  fHistPtYPi0FromK->Fill(particle->Pt(), particle->Y());
618  if (TMath::Abs(motherParticle->GetPdgCode()) == kPdgLambda)
619  fHistPtYPi0FromLambda->Fill(particle->Pt(), particle->Y());
620  if (motherParticle->GetPdgCode() == kPdgEta)
621  fHistPtYPi0FromEta->Fill(particle->Pt(), particle->Y());
622  }
623  break;
624  case kPdgEta:
625  fHistPtYEta->Fill(particle->Pt(), particle->Y());
626  break;
627  case kPdgEtaPrime:
628  fHistPtYEtaPrim->Fill(particle->Pt(), particle->Y());
629  break;
630  case kPdgOmega:
631  fHistPtYOmega->Fill(particle->Pt(), particle->Y());
632  break;
633  case kPdgPiPlus:
634  fHistPtYPiPl->Fill(particle->Pt(), particle->Y());
635  if (hasMother){
636  if (TMath::Abs(motherParticle->GetPdgCode()) == kPdgK0Short ||
637  TMath::Abs(motherParticle->GetPdgCode()) == kPdgK0Long ||
638  TMath::Abs(motherParticle->GetPdgCode()) == kPdgKPlus
639  )
640  fHistPtYPiPlFromK->Fill(particle->Pt(), particle->Y());
641  }
642  break;
643  case kPdgPiMinus:
644  fHistPtYPiMi->Fill(particle->Pt(), particle->Y());
645  if (hasMother){
646  if (TMath::Abs(motherParticle->GetPdgCode()) == kPdgK0Short ||
647  TMath::Abs(motherParticle->GetPdgCode()) == kPdgK0Long ||
648  TMath::Abs(motherParticle->GetPdgCode()) == kPdgKPlus
649  )
650  fHistPtYPiMiFromK->Fill(particle->Pt(), particle->Y());
651  }
652  break;
653  case kPdgRho0:
654  fHistPtYRho0->Fill(particle->Pt(), particle->Y());
655  break;
656  case kPdgRhoPlus:
657  fHistPtYRhoPl->Fill(particle->Pt(), particle->Y());
658  break;
659  case kPdgRhoMinus:
660  fHistPtYRhoMi->Fill(particle->Pt(), particle->Y());
661  break;
662  case kPdgPhi:
663  fHistPtYPhi->Fill(particle->Pt(), particle->Y());
664  break;
665  case kPdgJPsi:
666  fHistPtYJPsi->Fill(particle->Pt(), particle->Y());
667  break;
668  case 3212:
669  fHistPtYSigma0->Fill(particle->Pt(), particle->Y());
670  break;
671  case kPdgK0Short:
672  fHistPtYK0s->Fill(particle->Pt(), particle->Y());
673  break;
674  case kPdgK0Long:
675  fHistPtYK0l->Fill(particle->Pt(), particle->Y());
676  break;
677  case kPdgKStar:
678  fHistPtYK0star->Fill(particle->Pt(), particle->Y());
679  break;
680  case kPdgDeltaPlusPlus:
681  fHistPtYDeltaPlPl->Fill(particle->Pt(), particle->Y());
682  break;
683  case kPdgDeltaPlus:
684  fHistPtYDeltaPl->Fill(particle->Pt(), particle->Y());
685  break;
686  case kPdgDeltaMinus:
687  fHistPtYDeltaMi->Fill(particle->Pt(), particle->Y());
688  break;
689  case kPdgDelta0:
690  fHistPtYDelta0->Fill(particle->Pt(), particle->Y());
691  break;
692  case kPdgLambda:
693  fHistPtYLambda->Fill(particle->Pt(), particle->Y());
694  break;
695  }
696 
697  // from here on, we are only intested in particles considered primaries in ALICE
698  if ((particle->GetPdgCode()== kPdgPi0 || particle->GetPdgCode()== kPdgEta) && hasMother){
699  if (TMath::Abs(motherParticle->GetPdgCode()) == kPdgK0Short ||
700  TMath::Abs(motherParticle->GetPdgCode()) == kPdgK0Long ||
701  TMath::Abs(motherParticle->GetPdgCode()) == kPdgKPlus ||
702  TMath::Abs(motherParticle->GetPdgCode()) == kPdgLambda ||
703  TMath::Abs(motherParticle->GetPdgCode()) == kPdgSigma0 ||
704  TMath::Abs(motherParticle->GetPdgCode()) == kPdgSigmaPlus ||
705  TMath::Abs(motherParticle->GetPdgCode()) == kPdgSigmaMinus ||
706  TMath::Abs(motherParticle->GetPdgCode()) == kPdgXi0 ||
707  TMath::Abs(motherParticle->GetPdgCode()) == kPdgXiMinus
708  )
709  continue;
710  }
711 
712  // just looking at pi0, etas, etaprims
713  if (particle->GetPdgCode()==kPdgPi0 || particle->GetPdgCode()==kPdgEta || particle->GetPdgCode() == kPdgEtaPrime){
714  if (particle->GetNDaughters() != 2) continue; // only the two particle decays
715  UChar_t acceptanceGamma[2] = {0,0};
716  Double_t energyGamma[2] = {0,0};
717  Bool_t allOK[2] = {kFALSE,kFALSE};
718 
719 
720  for(Int_t j=0;j<2;j++){
721  TParticle *daughter=fMCEvent->Particle(particle->GetDaughter(j));
722  if (!daughter) continue;
723 
724  // Is Daughter a Photon?
725  if(daughter->GetPdgCode() == 22) allOK[j] =kTRUE;
726  if(IsInPCMAcceptance(daughter)) SETBIT(acceptanceGamma[j], kPCMAcceptance);
727  if(IsInPHOSAcceptance(daughter)) SETBIT(acceptanceGamma[j], kPHOSAcceptance);
728  if(IsInEMCalAcceptance(daughter)) SETBIT(acceptanceGamma[j], kEMCALAcceptance);
729  energyGamma[j] = daughter->Energy();
730 
731 
732  }
733 
734  if (!(allOK[0] && allOK[1])) continue;
735 
736  Double_t alpha = (energyGamma[0]-energyGamma[1])/(energyGamma[0]+energyGamma[1]);
737 
738  if (particle->GetPdgCode()==kPdgPi0){
739  fHistPtYPi0GG->Fill(particle->Pt(), particle->Y());
740  if (TESTBIT(acceptanceGamma[0], kPCMAcceptance) && TESTBIT(acceptanceGamma[1], kPCMAcceptance)){
741  fHistPtYPi0GGPCMAcc->Fill(particle->Pt(), particle->Y());
742  fHistPtAlphaPi0GGPCMAcc->Fill(particle->Pt(), TMath::Abs(alpha));
743  }
744  if (TESTBIT(acceptanceGamma[0], kEMCALAcceptance) && TESTBIT(acceptanceGamma[1], kEMCALAcceptance)){
745  fHistPtYPi0GGEMCAcc->Fill(particle->Pt(), particle->Y());
746  fHistPtAlphaPi0GGEMCAcc->Fill(particle->Pt(), TMath::Abs(alpha));
747  }
748  if (TESTBIT(acceptanceGamma[0], kPHOSAcceptance) && TESTBIT(acceptanceGamma[1], kPHOSAcceptance)){
749  fHistPtYPi0GGPHOAcc->Fill(particle->Pt(), particle->Y());
750  fHistPtAlphaPi0GGPHOAcc->Fill(particle->Pt(), TMath::Abs(alpha));
751  }
752  if ( (TESTBIT(acceptanceGamma[0], kPCMAcceptance) && TESTBIT(acceptanceGamma[1], kEMCALAcceptance)) ||
753  (TESTBIT(acceptanceGamma[1], kPCMAcceptance) && TESTBIT(acceptanceGamma[0], kPCMAcceptance))
754  ){
755  fHistPtYPi0GGPCMEMCAcc->Fill(particle->Pt(), particle->Y());
756  if (!TESTBIT(acceptanceGamma[1], kEMCALAcceptance)) alpha = (energyGamma[1]-energyGamma[0])/(energyGamma[0]+energyGamma[1]);
757  fHistPtAlphaPi0GGPCMEMCAcc->Fill(particle->Pt(), alpha);
758  }
759  if ( (TESTBIT(acceptanceGamma[0], kPCMAcceptance) && TESTBIT(acceptanceGamma[1], kPHOSAcceptance)) ||
760  (TESTBIT(acceptanceGamma[1], kPCMAcceptance) && TESTBIT(acceptanceGamma[0], kPHOSAcceptance))
761  ){
762  fHistPtYPi0GGPCMPHOAcc->Fill(particle->Pt(), particle->Y());
763  if (!TESTBIT(acceptanceGamma[1], kPHOSAcceptance)) alpha = (energyGamma[1]-energyGamma[0])/(energyGamma[0]+energyGamma[1]);
764  fHistPtAlphaPi0GGPCMPHOAcc->Fill(particle->Pt(), alpha);
765  }
766  }
767  if (particle->GetPdgCode()==kPdgEta){
768  fHistPtYEtaGG->Fill(particle->Pt(), particle->Y());
769  if (TESTBIT(acceptanceGamma[0], kPCMAcceptance) && TESTBIT(acceptanceGamma[1], kPCMAcceptance)){
770  fHistPtYEtaGGPCMAcc->Fill(particle->Pt(), particle->Y());
771  fHistPtAlphaEtaGGPCMAcc->Fill(particle->Pt(), TMath::Abs(alpha));
772  }
773  if (TESTBIT(acceptanceGamma[0], kEMCALAcceptance) && TESTBIT(acceptanceGamma[1], kEMCALAcceptance)){
774  fHistPtYEtaGGEMCAcc->Fill(particle->Pt(), particle->Y());
775  fHistPtAlphaEtaGGEMCAcc->Fill(particle->Pt(), TMath::Abs(alpha));
776  }
777  if (TESTBIT(acceptanceGamma[0], kPHOSAcceptance) && TESTBIT(acceptanceGamma[1], kPHOSAcceptance)){
778  fHistPtYEtaGGPHOAcc->Fill(particle->Pt(), particle->Y());
779  fHistPtAlphaEtaGGPHOAcc->Fill(particle->Pt(), TMath::Abs(alpha));
780  }
781  if ( (TESTBIT(acceptanceGamma[0], kPCMAcceptance) && TESTBIT(acceptanceGamma[1], kEMCALAcceptance)) ||
782  (TESTBIT(acceptanceGamma[1], kPCMAcceptance) && TESTBIT(acceptanceGamma[0], kEMCALAcceptance))
783  ){
784  fHistPtYEtaGGPCMEMCAcc->Fill(particle->Pt(), particle->Y());
785  if (!TESTBIT(acceptanceGamma[1], kEMCALAcceptance)) alpha = (energyGamma[1]-energyGamma[0])/(energyGamma[0]+energyGamma[1]);
786  fHistPtAlphaEtaGGPCMEMCAcc->Fill(particle->Pt(), alpha);
787  }
788  if ( (TESTBIT(acceptanceGamma[0], kPCMAcceptance) && TESTBIT(acceptanceGamma[1], kPHOSAcceptance)) ||
789  (TESTBIT(acceptanceGamma[1], kPCMAcceptance) && TESTBIT(acceptanceGamma[0], kPHOSAcceptance))
790  ){
791  fHistPtYEtaGGPCMPHOAcc->Fill(particle->Pt(), particle->Y());
792  if (TESTBIT(!acceptanceGamma[1],kPHOSAcceptance)) alpha = (energyGamma[1]-energyGamma[0])/(energyGamma[0]+energyGamma[1]);
793  fHistPtAlphaEtaGGPCMPHOAcc->Fill(particle->Pt(), alpha);
794  }
795  }
796  if (particle->GetPdgCode()==kPdgEtaPrime){
797  fHistPtYEtaPrimGG->Fill(particle->Pt(), particle->Y());
798  if (TESTBIT(acceptanceGamma[0], kPCMAcceptance) && TESTBIT(acceptanceGamma[1], kPCMAcceptance))
799  fHistPtYEtaPrimGGPCMAcc->Fill(particle->Pt(), particle->Y());
800  if (TESTBIT(acceptanceGamma[0], kEMCALAcceptance) && TESTBIT(acceptanceGamma[1], kEMCALAcceptance))
801  fHistPtYEtaPrimGGEMCAcc->Fill(particle->Pt(), particle->Y());
802  if (TESTBIT(acceptanceGamma[0], kPHOSAcceptance) && TESTBIT(acceptanceGamma[1], kPHOSAcceptance))
803  fHistPtYEtaPrimGGPHOAcc->Fill(particle->Pt(), particle->Y());
804  if ( (TESTBIT(acceptanceGamma[0], kPCMAcceptance) && TESTBIT(acceptanceGamma[1], kEMCALAcceptance)) ||
805  (TESTBIT(acceptanceGamma[1], kPCMAcceptance) && TESTBIT(acceptanceGamma[0], kEMCALAcceptance))
806  )
807  fHistPtYEtaPrimGGPCMEMCAcc->Fill(particle->Pt(), particle->Y());
808  if ( (TESTBIT(acceptanceGamma[0], kPCMAcceptance) && TESTBIT(acceptanceGamma[1], kPHOSAcceptance)) ||
809  (TESTBIT(acceptanceGamma[1], kPCMAcceptance) && TESTBIT(acceptanceGamma[0], kPHOSAcceptance))
810  )
811  fHistPtYEtaPrimGGPCMPHOAcc->Fill(particle->Pt(), particle->Y());
812  }
813  }
814 
815 
816  if(fIsK0 == 0) continue;
817  if( particle->GetPdgCode() == kPdgK0Short){
818  if (particle->GetNDaughters() != 2) continue;
819  //UChar_t acceptanceGamma[2] = {0,0};
820  Double_t energyPi0[2] = {0,0};
821  Bool_t allOK[2] = {kFALSE,kFALSE};
822  UChar_t gdAcceptanceGamma[4] = {0,0,0,0};
823  //Double_t gdEnergyGamma[4] = {0,0,0,0};
824  Bool_t allGDOK[4] = {kFALSE, kFALSE, kFALSE,kFALSE};
825  for(Int_t k=0;k<2;k++){
826  TParticle *daughter=fMCEvent->Particle(particle->GetDaughter(k));
827  if (!daughter) continue;
828 
829  // Is Daughter a pi0?
830  if (daughter->GetPdgCode() == kPdgPi0){
831  allOK[k] = kTRUE;
832  if(daughter->GetNDaughters() != 2) continue;
833  energyPi0[k] = daughter->Energy();
834  for(Int_t h=0;h<2;h++){
835  TParticle *granddaughter = fMCEvent->Particle(daughter->GetDaughter(k));
836  if(granddaughter->GetPdgCode() == 22) allGDOK[2*k + h] = kTRUE;
837  if(IsInPCMAcceptance(granddaughter)) SETBIT(gdAcceptanceGamma[2*k+h], kPCMAcceptance);
838  if(IsInEMCalAcceptance(granddaughter)) SETBIT(gdAcceptanceGamma[2*k+h], kEMCALAcceptance);
839  //gdEnergyGamma[2*k+h] = granddaughter->Energy();
840  }
841  }
842  }
843 
844  Double_t alpha_k0 = (energyPi0[0]-energyPi0[1])/(energyPi0[0]+energyPi0[1]);
845 
846  if(allOK[0] && allOK[1]){
847  fHistPtYPi0FromKGG->Fill(particle->Pt(), particle->Y());
848  fHistPtAlphaPi0FromKGG->Fill(particle->Pt(), alpha_k0);
849  }
850 
851  if (!(allGDOK[0] && allGDOK[1] && allGDOK[2] && allGDOK[3])) continue;
852 
853  if (TESTBIT(gdAcceptanceGamma[0], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[1], kPCMAcceptance)
854  && TESTBIT(gdAcceptanceGamma[2], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[3], kPCMAcceptance))
855  {
856  fHistPtYPi0FromKGGPCMAcc->Fill(particle->Pt(),particle->Y());
857  fHistPtAlphaPi0FromKGGPCMAcc->Fill(particle->Pt(), alpha_k0);
858  }
859 
860  if (TESTBIT(gdAcceptanceGamma[0], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[1], kEMCALAcceptance)
861  && TESTBIT(gdAcceptanceGamma[2], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[3], kEMCALAcceptance) )
862  {
863  fHistPtYPi0FromKGGEMCAcc->Fill(particle->Pt(),particle->Y());
864  fHistPtAlphaPi0FromKGGEMCAcc->Fill(particle->Pt(), alpha_k0);
865  }
866 
867 
868  if ((TESTBIT(gdAcceptanceGamma[0], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[1], kPCMAcceptance)
869  && TESTBIT(gdAcceptanceGamma[2], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[3], kPCMAcceptance)) ||
870  (TESTBIT(gdAcceptanceGamma[0], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[1], kEMCALAcceptance)
871  && TESTBIT(gdAcceptanceGamma[2], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[3], kPCMAcceptance)) ||
872  (TESTBIT(gdAcceptanceGamma[0], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[1], kPCMAcceptance)
873  && TESTBIT(gdAcceptanceGamma[2], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[3], kPCMAcceptance)) ||
874  (TESTBIT(gdAcceptanceGamma[0], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[1], kPCMAcceptance)
875  && TESTBIT(gdAcceptanceGamma[2], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[3], kEMCALAcceptance)))
876  {
877  fHistPtYPi0FromKGGPCMEMCAcc->Fill(particle->Pt(),particle->Y());
878  fHistPtAlphaPi0FromKGGPCMEMCAcc->Fill(particle->Pt(), alpha_k0);
879  }
880 
881  if ((TESTBIT(gdAcceptanceGamma[0], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[1], kEMCALAcceptance)
882  && TESTBIT(gdAcceptanceGamma[2], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[3], kEMCALAcceptance)) ||
883  (TESTBIT(gdAcceptanceGamma[0], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[1], kPCMAcceptance)
884  && TESTBIT(gdAcceptanceGamma[2], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[3], kEMCALAcceptance)) ||
885  (TESTBIT(gdAcceptanceGamma[0], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[1], kEMCALAcceptance)
886  && TESTBIT(gdAcceptanceGamma[2], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[3], kEMCALAcceptance)) ||
887  (TESTBIT(gdAcceptanceGamma[0], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[1], kEMCALAcceptance)
888  && TESTBIT(gdAcceptanceGamma[2], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[3], kPCMAcceptance)))
889  {
890  fHistPtYPi0FromKGGEMCPCMAcc->Fill(particle->Pt(),particle->Y());
891  fHistPtAlphaPi0FromKGGEMCPCMAcc->Fill(particle->Pt(), alpha_k0);
892  }
893 
894  if ((TESTBIT(gdAcceptanceGamma[0], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[1], kEMCALAcceptance) &&
895  TESTBIT(gdAcceptanceGamma[2], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[3], kPCMAcceptance))||
896  (TESTBIT(gdAcceptanceGamma[0], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[1], kPCMAcceptance) &&
897  TESTBIT(gdAcceptanceGamma[2], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[3], kEMCALAcceptance)))
898  {
899  fHistPtYPi0FromKGGEMCAccSamePi0->Fill(particle->Pt(),particle->Y());
900  fHistPtAlphaPi0FromKGGEMCAccSamePi0->Fill(particle->Pt(), alpha_k0);
901  }
902 
903  if ((TESTBIT(gdAcceptanceGamma[0], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[2], kEMCALAcceptance)&&
904  TESTBIT(gdAcceptanceGamma[1], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[3], kPCMAcceptance))||
905  (TESTBIT(gdAcceptanceGamma[0], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[3], kEMCALAcceptance)&&
906  TESTBIT(gdAcceptanceGamma[1], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[2], kPCMAcceptance))||
907  (TESTBIT(gdAcceptanceGamma[1], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[2], kEMCALAcceptance)&&
908  TESTBIT(gdAcceptanceGamma[0], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[3], kPCMAcceptance))||
909  (TESTBIT(gdAcceptanceGamma[1], kEMCALAcceptance) && TESTBIT(gdAcceptanceGamma[3], kEMCALAcceptance)&&
910  TESTBIT(gdAcceptanceGamma[0], kPCMAcceptance) && TESTBIT(gdAcceptanceGamma[2], kPCMAcceptance)))
911  {
912  fHistPtYPi0FromKGGEMCAccDiffPi0->Fill(particle->Pt(),particle->Y());
913  fHistPtAlphaPi0FromKGGEMCAccDiffPi0->Fill(particle->Pt(), alpha_k0);
914  }
915  }
916  }
917 }
918 
919 //________________________________________________________________________
921  const Double_t kBoundaryEta = 0.900001;
922  if (part->Pt() > 0.050 && TMath::Abs(part->Eta()) < kBoundaryEta) return true;
923 
924  return false;
925 }
926 
927 //________________________________________________________________________
929  const Double_t kBoundaryEtaMin = -0.13;
930  const Double_t kBoundaryEtaMax = 0.13;
931  const Double_t kBoundaryPhiMin = 4.54;
932  const Double_t kBoundaryPhiMax = 5.59;
933  if (part->Pt() < 0.300) return false;
934  if (part->Eta() > kBoundaryEtaMax || part->Eta() < kBoundaryEtaMin) return false;
935  if (part->Phi() > kBoundaryPhiMax || part->Phi() < kBoundaryPhiMin) return false;
936  return true;
937 }
938 
939 //________________________________________________________________________
941  const Double_t kBoundaryEtaMin = -0.6687;
942  const Double_t kBoundaryEtaMax = 0.66465;
943  const Double_t kBoundaryPhiMin = 1.39626;
944  const Double_t kBoundaryPhiMax = 3.15;
945  if (part->Pt() < 0.400) return false;
946  if (part->Eta() > kBoundaryEtaMax || part->Eta() < kBoundaryEtaMin) return false;
947  if (part->Phi() > kBoundaryPhiMax || part->Phi() < kBoundaryPhiMin) return false;
948  return true;
949 }
950 
951 //________________________________________________________________________
953 {
954 
955  //fOutputContainer->Print(); // Will crash on GRID
956 }
957 
958 
959 //_________________________________________________________________________________
961  TAxis *axisafter = histoRebin->GetXaxis();
962  Int_t bins = axisafter->GetNbins();
963  Double_t from = axisafter->GetXmin();
964  Double_t to = axisafter->GetXmax();
965  Double_t *newbins = new Double_t[bins+1];
966  newbins[0] = from;
967  Double_t factor = TMath::Power(to/from, 1./bins);
968  for(Int_t i=1; i<=bins; ++i) newbins[i] = factor * newbins[i-1];
969  axisafter->Set(bins, newbins);
970  delete [] newbins;
971 }
972 
973 //_________________________________________________________________________________
975  TAxis *axisafter = histoRebin->GetXaxis();
976  Int_t bins = axisafter->GetNbins();
977  Double_t from = axisafter->GetXmin();
978  Double_t to = axisafter->GetXmax();
979  Double_t *newbins = new Double_t[bins+1];
980  newbins[0] = from;
981  Double_t factor = TMath::Power(to/from, 1./bins);
982  for(Int_t i=1; i<=bins; ++i) newbins[i] = factor * newbins[i-1];
983  axisafter->Set(bins, newbins);
984  delete [] newbins;
985 }
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
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 * fHistPtAlphaEtaGGPCMAcc
histo for Etas gamma gamma channel, PCM-PHOS acceptance
TH2F * fHistPtYEtaPrimGGPCMEMCAcc
histo for EtaPrims gamma gamma channel, 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 * 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 * 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
TString part
use mixed event to constrain combinatorial background
Definition: InvMassFit.C:52
TH2F * fHistPtYSigma0
histo for J/psi
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 * fHistPtYEtaPrimGGPCMPHOAcc
histo for EtaPrims gamma gamma channel, PCM-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 * fHistPtYEtaPrimGGPHOAcc
histo for EtaPrims gamma gamma channel, EMCal 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 * fHistPtAlphaPi0GGPCMEMCAcc
histo for Pi0s gamma gamma channel, PHOS acceptance
TH2F * fHistPtYPi0FromK
histo for Pi0s from Lambdas
TH2F * fHistPtYDelta0
histo for Delta-
TH2F * fHistPtYEtaPrimGG
histo for Etas gamma gamma channel, PCM-PHOS acceptance
TH2F * fHistPtYEtaPrimGGEMCAcc
histo for EtaPrims gamma gamma channel, PCM acceptance
Definition: External.C:220
TH2F * fHistPtYK0s
histo for Sigma0
TH2F * fHistPtAlphaPi0GGEMCAcc
histo for Pi0s gamma gamma channel, PCM acceptance
TH2F * fHistPtYPi0FromKGG
histo for Pi0s 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 * fHistPtYEtaPrimGGPCMAcc
histo for Etas gamma gamma channel
TH2F * fHistPtYPi0FromEta
histo for Lambda
Definition: External.C:196
TH2F * fHistPtYPi0FromKGGPCMEMCAcc
histo for Pi0 from K gamma gamma channel, EMC acceptance