]>
Commit | Line | Data |
---|---|---|
a3aebfff | 1 | /************************************************************************** |
1c5acb87 | 2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | /* $Id: AliAnaPhoton.cxx 28688 2008-09-11 15:04:07Z gconesab $ */ | |
16 | ||
17 | //_________________________________________________________________________ | |
18 | // | |
19 | // Class for the photon identification. | |
20 | // Clusters from calorimeters are identified as photons | |
21 | // and kept in the AOD. Few histograms produced. | |
22 | // | |
23 | // -- Author: Gustavo Conesa (LNF-INFN) | |
24 | ////////////////////////////////////////////////////////////////////////////// | |
25 | ||
26 | ||
27 | // --- ROOT system --- | |
28 | #include <TH2F.h> | |
477d6cee | 29 | #include <TClonesArray.h> |
30 | #include <TObjString.h> | |
31 | //#include <Riostream.h> | |
123fc3bd | 32 | #include "TParticle.h" |
1c5acb87 | 33 | |
34 | // --- Analysis system --- | |
35 | #include "AliAnaPhoton.h" | |
36 | #include "AliCaloTrackReader.h" | |
123fc3bd | 37 | #include "AliStack.h" |
1c5acb87 | 38 | #include "AliCaloPID.h" |
6639984f | 39 | #include "AliMCAnalysisUtils.h" |
477d6cee | 40 | #include "AliFidutialCut.h" |
41 | #include "AliAODCaloCluster.h" | |
591cc579 | 42 | #include "AliAODMCParticle.h" |
1c5acb87 | 43 | |
44 | ClassImp(AliAnaPhoton) | |
45 | ||
46 | //____________________________________________________________________________ | |
47 | AliAnaPhoton::AliAnaPhoton() : | |
48 | AliAnaPartCorrBaseClass(), fCalorimeter(""), | |
a3aebfff | 49 | fMinDist(0.),fMinDist2(0.),fMinDist3(0.),fRejectTrackMatch(0), |
50 | fhPtPhoton(0),fhPhiPhoton(0),fhEtaPhoton(0), | |
7175a03a | 51 | //MC |
123fc3bd | 52 | fhDeltaE(0), fhDeltaPt(0),fhRatioE(0), fhRatioPt(0),fh2E(0),fh2Pt(0), |
591cc579 | 53 | fhPtMCPhoton(0),fhPhiMCPhoton(0),fhEtaMCPhoton(0), |
1c5acb87 | 54 | fhPtPrompt(0),fhPhiPrompt(0),fhEtaPrompt(0), |
55 | fhPtFragmentation(0),fhPhiFragmentation(0),fhEtaFragmentation(0), | |
6639984f | 56 | fhPtISR(0),fhPhiISR(0),fhEtaISR(0), |
1c5acb87 | 57 | fhPtPi0Decay(0),fhPhiPi0Decay(0),fhEtaPi0Decay(0), |
58 | fhPtOtherDecay(0),fhPhiOtherDecay(0),fhEtaOtherDecay(0), | |
59 | fhPtConversion(0),fhPhiConversion(0),fhEtaConversion(0), | |
60 | fhPtUnknown(0),fhPhiUnknown(0),fhEtaUnknown(0) | |
61 | { | |
62 | //default ctor | |
63 | ||
64 | //Initialize parameters | |
65 | InitParameters(); | |
66 | ||
67 | } | |
68 | ||
69 | //____________________________________________________________________________ | |
70 | AliAnaPhoton::AliAnaPhoton(const AliAnaPhoton & g) : | |
71 | AliAnaPartCorrBaseClass(g), fCalorimeter(g.fCalorimeter), | |
72 | fMinDist(g.fMinDist),fMinDist2(g.fMinDist2), fMinDist3(g.fMinDist3), | |
a3aebfff | 73 | fRejectTrackMatch(g.fRejectTrackMatch), |
1c5acb87 | 74 | fhPtPhoton(g.fhPtPhoton),fhPhiPhoton(g.fhPhiPhoton),fhEtaPhoton(g.fhEtaPhoton), |
75 | //MC | |
123fc3bd | 76 | fhDeltaE(g.fhDeltaE), fhDeltaPt(g.fhDeltaPt), |
77 | fhRatioE(g.fhRatioE), fhRatioPt(g.fhRatioPt), | |
78 | fh2E(g.fh2E), fh2Pt(g.fh2Pt), | |
591cc579 | 79 | fhPtMCPhoton(g.fhPtMCPhoton),fhPhiMCPhoton(g.fhPhiMCPhoton),fhEtaMCPhoton(g.fhEtaMCPhoton), |
1c5acb87 | 80 | fhPtPrompt(g.fhPtPrompt),fhPhiPrompt(g.fhPhiPrompt),fhEtaPrompt(g.fhEtaPrompt), |
81 | fhPtFragmentation(g.fhPtFragmentation),fhPhiFragmentation(g.fhPhiFragmentation),fhEtaFragmentation(g.fhEtaFragmentation), | |
6639984f | 82 | fhPtISR(g.fhPtISR),fhPhiISR(g.fhPhiISR),fhEtaISR(g.fhEtaISR), |
1c5acb87 | 83 | fhPtPi0Decay(g.fhPtPi0Decay),fhPhiPi0Decay(g.fhPhiPi0Decay),fhEtaPi0Decay(g.fhEtaPi0Decay), |
84 | fhPtOtherDecay(g.fhPtOtherDecay),fhPhiOtherDecay(g.fhPhiOtherDecay),fhEtaOtherDecay(g.fhEtaOtherDecay), | |
85 | fhPtConversion(g. fhPtConversion),fhPhiConversion(g.fhPhiConversion),fhEtaConversion(g.fhEtaConversion), | |
6639984f | 86 | fhPtUnknown(g.fhPtUnknown),fhPhiUnknown(g.fhPhiUnknown),fhEtaUnknown(g.fhEtaUnknown) |
87 | ||
1c5acb87 | 88 | { |
89 | // cpy ctor | |
90 | ||
91 | } | |
92 | ||
93 | //_________________________________________________________________________ | |
94 | AliAnaPhoton & AliAnaPhoton::operator = (const AliAnaPhoton & g) | |
95 | { | |
96 | // assignment operator | |
97 | ||
98 | if(&g == this) return *this; | |
99 | ||
100 | fCalorimeter = g.fCalorimeter ; | |
101 | fMinDist = g.fMinDist; | |
102 | fMinDist2 = g.fMinDist2; | |
103 | fMinDist3 = g.fMinDist3; | |
a3aebfff | 104 | fRejectTrackMatch = g.fRejectTrackMatch; |
105 | ||
6639984f | 106 | fhPtPhoton = g.fhPtPhoton ; |
1c5acb87 | 107 | fhPhiPhoton = g.fhPhiPhoton ; |
108 | fhEtaPhoton = g.fhEtaPhoton ; | |
123fc3bd | 109 | |
110 | fhDeltaE = g.fhDeltaE; | |
111 | fhDeltaPt = g.fhDeltaPt; | |
112 | fhRatioE = g.fhRatioE; | |
113 | fhRatioPt = g.fhRatioPt; | |
114 | fh2E = g.fh2E; | |
115 | fh2Pt = g.fh2Pt; | |
1c5acb87 | 116 | |
591cc579 | 117 | fhPtMCPhoton = g.fhPtMCPhoton ; |
118 | fhPhiMCPhoton = g.fhPhiMCPhoton ; | |
119 | fhEtaMCPhoton = g.fhEtaMCPhoton ; | |
6639984f | 120 | fhPtPrompt = g.fhPtPrompt; |
1c5acb87 | 121 | fhPhiPrompt = g.fhPhiPrompt; |
122 | fhEtaPrompt = g.fhEtaPrompt; | |
6639984f | 123 | fhPtFragmentation = g.fhPtFragmentation; |
1c5acb87 | 124 | fhPhiFragmentation = g.fhPhiFragmentation; |
125 | fhEtaFragmentation = g.fhEtaFragmentation; | |
6639984f | 126 | fhPtISR = g.fhPtISR; |
127 | fhPhiISR = g.fhPhiISR; | |
128 | fhEtaISR = g.fhEtaISR; | |
129 | fhPtPi0Decay = g.fhPtPi0Decay; | |
1c5acb87 | 130 | fhPhiPi0Decay = g.fhPhiPi0Decay; |
131 | fhEtaPi0Decay = g.fhEtaPi0Decay; | |
6639984f | 132 | fhPtOtherDecay = g.fhPtOtherDecay; |
1c5acb87 | 133 | fhPhiOtherDecay = g.fhPhiOtherDecay; |
134 | fhEtaOtherDecay = g.fhEtaOtherDecay; | |
6639984f | 135 | fhPtConversion = g. fhPtConversion; |
1c5acb87 | 136 | fhPhiConversion = g.fhPhiConversion; |
137 | fhEtaConversion = g.fhEtaConversion; | |
6639984f | 138 | fhPtUnknown = g.fhPtUnknown; |
1c5acb87 | 139 | fhPhiUnknown = g.fhPhiUnknown; |
140 | fhEtaUnknown = g.fhEtaUnknown; | |
141 | ||
142 | return *this; | |
143 | ||
144 | } | |
145 | ||
146 | //____________________________________________________________________________ | |
147 | AliAnaPhoton::~AliAnaPhoton() | |
148 | { | |
149 | //dtor | |
150 | ||
151 | } | |
152 | ||
153 | ||
154 | //________________________________________________________________________ | |
155 | TList * AliAnaPhoton::GetCreateOutputObjects() | |
156 | { | |
477d6cee | 157 | // Create histograms to be saved in output file and |
158 | // store them in outputContainer | |
159 | TList * outputContainer = new TList() ; | |
160 | outputContainer->SetName("PhotonHistos") ; | |
161 | ||
162 | Int_t nptbins = GetHistoNPtBins(); | |
163 | Int_t nphibins = GetHistoNPhiBins(); | |
164 | Int_t netabins = GetHistoNEtaBins(); | |
165 | Float_t ptmax = GetHistoPtMax(); | |
166 | Float_t phimax = GetHistoPhiMax(); | |
167 | Float_t etamax = GetHistoEtaMax(); | |
168 | Float_t ptmin = GetHistoPtMin(); | |
169 | Float_t phimin = GetHistoPhiMin(); | |
170 | Float_t etamin = GetHistoEtaMin(); | |
171 | ||
172 | //Histograms of highest Photon identified in Event | |
173 | fhPtPhoton = new TH1F("hPtPhoton","Number of #gamma over calorimeter",nptbins,ptmin,ptmax); | |
174 | fhPtPhoton->SetYTitle("N"); | |
175 | fhPtPhoton->SetXTitle("p_{T #gamma}(GeV/c)"); | |
176 | outputContainer->Add(fhPtPhoton) ; | |
177 | ||
178 | fhPhiPhoton = new TH2F | |
179 | ("hPhiPhoton","#phi_{#gamma}",nptbins,ptmin,ptmax,nphibins,phimin,phimax); | |
180 | fhPhiPhoton->SetYTitle("#phi"); | |
181 | fhPhiPhoton->SetXTitle("p_{T #gamma} (GeV/c)"); | |
182 | outputContainer->Add(fhPhiPhoton) ; | |
183 | ||
184 | fhEtaPhoton = new TH2F | |
185 | ("hEtaPhoton","#phi_{#gamma}",nptbins,ptmin,ptmax,netabins,etamin,etamax); | |
186 | fhEtaPhoton->SetYTitle("#eta"); | |
187 | fhEtaPhoton->SetXTitle("p_{T #gamma} (GeV/c)"); | |
188 | outputContainer->Add(fhEtaPhoton) ; | |
189 | ||
190 | if(IsDataMC()){ | |
123fc3bd | 191 | fhDeltaE = new TH1F ("hDeltaE","MC - Reco E ", 200,-50,50); |
192 | fhDeltaE->SetXTitle("#Delta E (GeV)"); | |
193 | outputContainer->Add(fhDeltaE); | |
194 | ||
195 | fhDeltaPt = new TH1F ("hDeltaPt","MC - Reco p_{T} ", 200,-50,50); | |
196 | fhDeltaPt->SetXTitle("#Delta p_{T} (GeV/c)"); | |
197 | outputContainer->Add(fhDeltaPt); | |
198 | ||
199 | fhRatioE = new TH1F ("hRatioE","Reco/MC E ", 200,0,2); | |
200 | fhRatioE->SetXTitle("E_{reco}/E_{gen}"); | |
201 | outputContainer->Add(fhRatioE); | |
477d6cee | 202 | |
123fc3bd | 203 | fhRatioPt = new TH1F ("hRatioPt","Reco/MC p_{T} ", 200,0,2); |
204 | fhRatioPt->SetXTitle("p_{T, reco}/p_{T, gen}"); | |
205 | outputContainer->Add(fhRatioPt); | |
206 | ||
207 | fh2E = new TH2F ("h2E","E distribution, reconstructed vs generated", nptbins,ptmin,ptmax,nptbins,ptmin,ptmax); | |
41e886c8 | 208 | fh2E->SetXTitle("E_{rec} (GeV)"); |
209 | fh2E->SetYTitle("E_{gen} (GeV)"); | |
123fc3bd | 210 | outputContainer->Add(fh2E); |
211 | ||
212 | fh2Pt = new TH2F ("h2Pt","p_T distribution, reconstructed vs generated", nptbins,ptmin,ptmax,nptbins,ptmin,ptmax); | |
41e886c8 | 213 | fh2Pt->SetXTitle("p_{T,rec} (GeV/c)"); |
214 | fh2Pt->SetYTitle("p_{T,gen} (GeV/c)"); | |
123fc3bd | 215 | outputContainer->Add(fh2Pt); |
216 | ||
591cc579 | 217 | fhPtMCPhoton = new TH1F("hPtMCPhoton","Number of #gamma over calorimeter",nptbins,ptmin,ptmax); |
218 | fhPtMCPhoton->SetYTitle("N"); | |
219 | fhPtMCPhoton->SetXTitle("p_{T #gamma}(GeV/c)"); | |
220 | outputContainer->Add(fhPtMCPhoton) ; | |
221 | ||
222 | fhPhiMCPhoton = new TH2F | |
223 | ("hPhiMCPhoton","#phi_{#gamma}",nptbins,ptmin,ptmax,nphibins,phimin,phimax); | |
224 | fhPhiMCPhoton->SetYTitle("#phi"); | |
225 | fhPhiMCPhoton->SetXTitle("p_{T #gamma} (GeV/c)"); | |
226 | outputContainer->Add(fhPhiMCPhoton) ; | |
227 | ||
228 | fhEtaMCPhoton = new TH2F | |
229 | ("hEtaMCPhoton","#phi_{#gamma}",nptbins,ptmin,ptmax,netabins,etamin,etamax); | |
230 | fhEtaMCPhoton->SetYTitle("#eta"); | |
231 | fhEtaMCPhoton->SetXTitle("p_{T #gamma} (GeV/c)"); | |
232 | outputContainer->Add(fhEtaMCPhoton) ; | |
233 | ||
234 | fhPtPrompt = new TH1F("hPtMCPrompt","Number of prompt #gamma over calorimeter",nptbins,ptmin,ptmax); | |
477d6cee | 235 | fhPtPrompt->SetYTitle("N"); |
236 | fhPtPrompt->SetXTitle("p_{T #gamma}(GeV/c)"); | |
237 | outputContainer->Add(fhPtPrompt) ; | |
238 | ||
239 | fhPhiPrompt = new TH2F | |
a3aebfff | 240 | ("hPhiMCPrompt","#phi_{#gamma}",nptbins,ptmin,ptmax,nphibins,phimin,phimax); |
477d6cee | 241 | fhPhiPrompt->SetYTitle("#phi"); |
242 | fhPhiPrompt->SetXTitle("p_{T #gamma} (GeV/c)"); | |
243 | outputContainer->Add(fhPhiPrompt) ; | |
244 | ||
245 | fhEtaPrompt = new TH2F | |
a3aebfff | 246 | ("hEtaMCPrompt","#phi_{#gamma}",nptbins,ptmin,ptmax,netabins,etamin,etamax); |
477d6cee | 247 | fhEtaPrompt->SetYTitle("#eta"); |
248 | fhEtaPrompt->SetXTitle("p_{T #gamma} (GeV/c)"); | |
249 | outputContainer->Add(fhEtaPrompt) ; | |
250 | ||
591cc579 | 251 | fhPtFragmentation = new TH1F("hPtMCFragmentation","Number of fragmentation #gamma over calorimeter",nptbins,ptmin,ptmax); |
477d6cee | 252 | fhPtFragmentation->SetYTitle("N"); |
253 | fhPtFragmentation->SetXTitle("p_{T #gamma}(GeV/c)"); | |
254 | outputContainer->Add(fhPtFragmentation) ; | |
255 | ||
256 | fhPhiFragmentation = new TH2F | |
a3aebfff | 257 | ("hPhiMCFragmentation","#phi_{#gamma}",nptbins,ptmin,ptmax,nphibins,phimin,phimax); |
477d6cee | 258 | fhPhiFragmentation->SetYTitle("#phi"); |
259 | fhPhiFragmentation->SetXTitle("p_{T #gamma} (GeV/c)"); | |
260 | outputContainer->Add(fhPhiFragmentation) ; | |
261 | ||
262 | fhEtaFragmentation = new TH2F | |
a3aebfff | 263 | ("hEtaMCFragmentation","#phi_{#gamma}",nptbins,ptmin,ptmax,netabins,etamin,etamax); |
477d6cee | 264 | fhEtaFragmentation->SetYTitle("#eta"); |
265 | fhEtaFragmentation->SetXTitle("p_{T #gamma} (GeV/c)"); | |
266 | outputContainer->Add(fhEtaFragmentation) ; | |
267 | ||
a3aebfff | 268 | fhPtISR = new TH1F("hPtMCISR","Number of initial state radiation #gamma over calorimeter",nptbins,ptmin,ptmax); |
477d6cee | 269 | fhPtISR->SetYTitle("N"); |
270 | fhPtISR->SetXTitle("p_{T #gamma}(GeV/c)"); | |
271 | outputContainer->Add(fhPtISR) ; | |
272 | ||
273 | fhPhiISR = new TH2F | |
a3aebfff | 274 | ("hPhiMCISR","#phi_{#gamma} initial state radiation",nptbins,ptmin,ptmax,nphibins,phimin,phimax); |
477d6cee | 275 | fhPhiISR->SetYTitle("#phi"); |
276 | fhPhiISR->SetXTitle("p_{T #gamma} (GeV/c)"); | |
277 | outputContainer->Add(fhPhiISR) ; | |
278 | ||
279 | fhEtaISR = new TH2F | |
a3aebfff | 280 | ("hEtaMCISR","#phi_{#gamma} initial state radiation",nptbins,ptmin,ptmax,netabins,etamin,etamax); |
477d6cee | 281 | fhEtaISR->SetYTitle("#eta"); |
282 | fhEtaISR->SetXTitle("p_{T #gamma} (GeV/c)"); | |
283 | outputContainer->Add(fhEtaISR) ; | |
284 | ||
591cc579 | 285 | fhPtPi0Decay = new TH1F("hPtMCPi0Decay","Number of #gamma over calorimeter",nptbins,ptmin,ptmax); |
477d6cee | 286 | fhPtPi0Decay->SetYTitle("N"); |
287 | fhPtPi0Decay->SetXTitle("p_{T #gamma}(GeV/c)"); | |
288 | outputContainer->Add(fhPtPi0Decay) ; | |
289 | ||
290 | fhPhiPi0Decay = new TH2F | |
a3aebfff | 291 | ("hPhiMCPi0Decay","#phi_{#gamma}",nptbins,ptmin,ptmax,nphibins,phimin,phimax); |
477d6cee | 292 | fhPhiPi0Decay->SetYTitle("#phi"); |
293 | fhPhiPi0Decay->SetXTitle("p_{T #gamma} (GeV/c)"); | |
294 | outputContainer->Add(fhPhiPi0Decay) ; | |
295 | ||
296 | fhEtaPi0Decay = new TH2F | |
a3aebfff | 297 | ("hEtaMCPi0Decay","#phi_{#gamma}",nptbins,ptmin,ptmax,netabins,etamin,etamax); |
477d6cee | 298 | fhEtaPi0Decay->SetYTitle("#eta"); |
299 | fhEtaPi0Decay->SetXTitle("p_{T #gamma} (GeV/c)"); | |
300 | outputContainer->Add(fhEtaPi0Decay) ; | |
301 | ||
a3aebfff | 302 | fhPtOtherDecay = new TH1F("hPtMCOtherDecay","Number of #gamma over calorimeter",nptbins,ptmin,ptmax); |
477d6cee | 303 | fhPtOtherDecay->SetYTitle("N"); |
304 | fhPtOtherDecay->SetXTitle("p_{T #gamma}(GeV/c)"); | |
305 | outputContainer->Add(fhPtOtherDecay) ; | |
306 | ||
307 | fhPhiOtherDecay = new TH2F | |
a3aebfff | 308 | ("hPhiMCOtherDecay","#phi_{#gamma}",nptbins,ptmin,ptmax,nphibins,phimin,phimax); |
477d6cee | 309 | fhPhiOtherDecay->SetYTitle("#phi"); |
310 | fhPhiOtherDecay->SetXTitle("p_{T #gamma} (GeV/c)"); | |
311 | outputContainer->Add(fhPhiOtherDecay) ; | |
312 | ||
313 | fhEtaOtherDecay = new TH2F | |
a3aebfff | 314 | ("hEtaMCOtherDecay","#phi_{#gamma}",nptbins,ptmin,ptmax,netabins,etamin,etamax); |
477d6cee | 315 | fhEtaOtherDecay->SetYTitle("#eta"); |
316 | fhEtaOtherDecay->SetXTitle("p_{T #gamma} (GeV/c)"); | |
317 | outputContainer->Add(fhEtaOtherDecay) ; | |
318 | ||
a3aebfff | 319 | fhPtConversion = new TH1F("hPtMCConversion","Number of #gamma over calorimeter",nptbins,ptmin,ptmax); |
477d6cee | 320 | fhPtConversion->SetYTitle("N"); |
321 | fhPtConversion->SetXTitle("p_{T #gamma}(GeV/c)"); | |
322 | outputContainer->Add(fhPtConversion) ; | |
323 | ||
324 | fhPhiConversion = new TH2F | |
a3aebfff | 325 | ("hPhiMCConversion","#phi_{#gamma}",nptbins,ptmin,ptmax,nphibins,phimin,phimax); |
477d6cee | 326 | fhPhiConversion->SetYTitle("#phi"); |
327 | fhPhiConversion->SetXTitle("p_{T #gamma} (GeV/c)"); | |
328 | outputContainer->Add(fhPhiConversion) ; | |
329 | ||
330 | fhEtaConversion = new TH2F | |
a3aebfff | 331 | ("hEtaMCConversion","#phi_{#gamma}",nptbins,ptmin,ptmax,netabins,etamin,etamax); |
477d6cee | 332 | fhEtaConversion->SetYTitle("#eta"); |
333 | fhEtaConversion->SetXTitle("p_{T #gamma} (GeV/c)"); | |
334 | outputContainer->Add(fhEtaConversion) ; | |
335 | ||
a3aebfff | 336 | fhPtUnknown = new TH1F("hPtMCUnknown","Number of #gamma over calorimeter",nptbins,ptmin,ptmax); |
477d6cee | 337 | fhPtUnknown->SetYTitle("N"); |
338 | fhPtUnknown->SetXTitle("p_{T #gamma}(GeV/c)"); | |
339 | outputContainer->Add(fhPtUnknown) ; | |
340 | ||
341 | fhPhiUnknown = new TH2F | |
a3aebfff | 342 | ("hPhiMCUnknown","#phi_{#gamma}",nptbins,ptmin,ptmax,nphibins,phimin,phimax); |
477d6cee | 343 | fhPhiUnknown->SetYTitle("#phi"); |
344 | fhPhiUnknown->SetXTitle("p_{T #gamma} (GeV/c)"); | |
345 | outputContainer->Add(fhPhiUnknown) ; | |
346 | ||
347 | fhEtaUnknown = new TH2F | |
a3aebfff | 348 | ("hEtaMCUnknown","#phi_{#gamma}",nptbins,ptmin,ptmax,netabins,etamin,etamax); |
477d6cee | 349 | fhEtaUnknown->SetYTitle("#eta"); |
350 | fhEtaUnknown->SetXTitle("p_{T #gamma} (GeV/c)"); | |
351 | outputContainer->Add(fhEtaUnknown) ; | |
a3aebfff | 352 | |
477d6cee | 353 | }//Histos with MC |
354 | ||
355 | //Save parameters used for analysis | |
356 | TString parList ; //this will be list of parameters used for this analysis. | |
357 | char onePar[255] ; | |
358 | ||
359 | sprintf(onePar,"--- AliAnaPhoton ---\n") ; | |
360 | parList+=onePar ; | |
361 | sprintf(onePar,"Calorimeter: %s\n",fCalorimeter.Data()) ; | |
362 | parList+=onePar ; | |
363 | sprintf(onePar,"fMinDist =%2.2f (Minimal distance to bad channel to accept cluster) \n",fMinDist) ; | |
364 | parList+=onePar ; | |
365 | sprintf(onePar,"fMinDist2=%2.2f (Cuts on Minimal distance to study acceptance evaluation) \n",fMinDist2) ; | |
366 | parList+=onePar ; | |
367 | sprintf(onePar,"fMinDist3=%2.2f (One more cut on distance used for acceptance-efficiency study) \n",fMinDist3) ; | |
368 | parList+=onePar ; | |
a3aebfff | 369 | sprintf(onePar,"fRejectTrackMatch: %d\n",fRejectTrackMatch) ; |
370 | parList+=onePar ; | |
477d6cee | 371 | |
372 | //Get parameters set in base class. | |
373 | parList += GetBaseParametersList() ; | |
374 | ||
375 | //Get parameters set in PID class. | |
376 | parList += GetCaloPID()->GetPIDParametersList() ; | |
377 | ||
378 | //Get parameters set in FidutialCut class (not available yet) | |
379 | //parlist += GetFidCut()->GetFidCutParametersList() | |
380 | ||
381 | TObjString *oString= new TObjString(parList) ; | |
382 | outputContainer->Add(oString); | |
383 | ||
384 | return outputContainer ; | |
385 | ||
1c5acb87 | 386 | } |
387 | ||
6639984f | 388 | //____________________________________________________________________________ |
389 | void AliAnaPhoton::Init() | |
390 | { | |
391 | ||
392 | //Init | |
393 | //Do some checks | |
394 | if(fCalorimeter == "PHOS" && !GetReader()->IsPHOSSwitchedOn()){ | |
591cc579 | 395 | printf("AliAnaPhoton::Init() - !!STOP: You want to use PHOS in analysis but it is not read!! \n!!Check the configuration file!!\n"); |
6639984f | 396 | abort(); |
397 | } | |
398 | else if(fCalorimeter == "EMCAL" && !GetReader()->IsEMCALSwitchedOn()){ | |
591cc579 | 399 | printf("AliAnaPhoton::Init() - !!STOP: You want to use EMCAL in analysis but it is not read!! \n!!Check the configuration file!!\n"); |
6639984f | 400 | abort(); |
401 | } | |
402 | ||
403 | } | |
404 | ||
405 | ||
1c5acb87 | 406 | //____________________________________________________________________________ |
407 | void AliAnaPhoton::InitParameters() | |
408 | { | |
409 | ||
410 | //Initialize the parameters of the analysis. | |
411 | SetOutputAODClassName("AliAODPWG4Particle"); | |
a3aebfff | 412 | SetOutputAODName("PWG4Particle"); |
413 | ||
414 | AddToHistogramsName("AnaPhoton_"); | |
415 | ||
1c5acb87 | 416 | fCalorimeter = "PHOS" ; |
417 | fMinDist = 2.; | |
418 | fMinDist2 = 4.; | |
419 | fMinDist3 = 5.; | |
a3aebfff | 420 | fRejectTrackMatch = kTRUE ; |
1c5acb87 | 421 | } |
422 | ||
423 | //__________________________________________________________________ | |
424 | void AliAnaPhoton::MakeAnalysisFillAOD() | |
425 | { | |
477d6cee | 426 | //Do analysis and fill aods |
427 | //Search for photons in fCalorimeter | |
591cc579 | 428 | TObjArray * pl = new TObjArray(); |
477d6cee | 429 | |
430 | //Get vertex for photon momentum calculation | |
431 | Double_t vertex[]={0,0,0} ; //vertex ; | |
432 | if(!GetReader()->GetDataType()== AliCaloTrackReader::kMC) GetReader()->GetVertex(vertex); | |
433 | //Select the Calorimeter of the photon | |
434 | if(fCalorimeter == "PHOS") | |
435 | pl = GetAODPHOS(); | |
436 | else if (fCalorimeter == "EMCAL") | |
437 | pl = GetAODEMCAL(); | |
438 | ||
439 | //Fill AODCaloClusters and AODParticle with PHOS aods | |
440 | TLorentzVector mom ; | |
441 | ||
442 | for(Int_t icalo = 0; icalo < pl->GetEntriesFast(); icalo++){ | |
443 | AliAODCaloCluster * calo = (AliAODCaloCluster*) (pl->At(icalo)); | |
444 | //Cluster selection, not charged, with photon id and in fidutial cut | |
445 | //Get Momentum vector, | |
446 | calo->GetMomentum(mom,vertex);//Assume that come from vertex in straight line | |
447 | //If too small or big pt, skip it | |
448 | if(mom.Pt() < GetMinPt() || mom.Pt() > GetMaxPt() ) continue ; | |
591cc579 | 449 | |
450 | //printf("AliAnaPhoton::Current Event %d; Current File Name : %s, E %f, pT %f, Ecl %f\n",GetReader()->GetEventNumber(),(GetReader()->GetCurrentFileName()).Data(), mom.E(), mom.Pt(),calo->E()); | |
451 | ||
477d6cee | 452 | //Check acceptance selection |
453 | if(IsFidutialCutOn()){ | |
454 | Bool_t in = GetFidutialCut()->IsInFidutialCut(mom,fCalorimeter) ; | |
455 | if(! in ) continue ; | |
456 | } | |
591cc579 | 457 | |
591cc579 | 458 | |
459 | //Create AOD for analysis | |
477d6cee | 460 | AliAODPWG4Particle aodph = AliAODPWG4Particle(mom); |
591cc579 | 461 | Int_t label = calo->GetLabel(0); |
591cc579 | 462 | aodph.SetLabel(label); |
7cd4e982 | 463 | //Input from second AOD? |
464 | if (fCalorimeter == "EMCAL" && GetReader()->GetAODEMCALNormalInputEntries() <= icalo) aodph.SetInputFileIndex(1); | |
465 | else if(fCalorimeter == "PHOS" && GetReader()->GetAODPHOSNormalInputEntries() <= icalo) aodph.SetInputFileIndex(1); | |
466 | ||
477d6cee | 467 | //printf("Index %d, Id %d\n",icalo, calo->GetID()); |
468 | //Set the indeces of the original caloclusters | |
469 | aodph.SetCaloLabel(calo->GetID(),-1); | |
470 | aodph.SetDetector(fCalorimeter); | |
471 | if(GetDebug() > 1) | |
a3aebfff | 472 | printf("AliAnaPhoton::MakeAnalysisFillAOD() - Min pt cut and fidutial cut passed: pt %3.2f, phi %2.2f, eta %1.2f\n",aodph.Pt(),aodph.Phi(),aodph.Eta()); |
477d6cee | 473 | |
474 | //Check Distance to Bad channel, set bit. | |
475 | Double_t distBad=calo->GetDistToBadChannel() ; //Distance to bad channel | |
476 | if(distBad < 0.) distBad=9999. ; //workout strange convension dist = -1. ; | |
477 | if(distBad < fMinDist) //In bad channel (PHOS cristal size 2.2x2.2 cm) | |
478 | continue ; | |
479 | ||
a3aebfff | 480 | if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillAOD() - Bad channel cut passed %4.2f\n",distBad); |
477d6cee | 481 | |
482 | if(distBad > fMinDist3) aodph.SetDistToBad(2) ; | |
483 | else if(distBad > fMinDist2) aodph.SetDistToBad(1) ; | |
484 | else aodph.SetDistToBad(0) ; | |
485 | ||
486 | //Check PID | |
487 | //PID selection or bit setting | |
488 | if(GetReader()->GetDataType() == AliCaloTrackReader::kMC){ | |
489 | //Get most probable PID, check PID weights (in MC this option is mandatory) | |
490 | aodph.SetPdg(GetCaloPID()->GetPdg(fCalorimeter,calo->PID(),mom.E()));//PID with weights | |
a3aebfff | 491 | if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillAOD() - PDG of identified particle %d\n",aodph.GetPdg()); |
477d6cee | 492 | //If primary is not photon, skip it. |
493 | if(aodph.GetPdg() != AliCaloPID::kPhoton) continue ; | |
494 | } | |
495 | else if(IsCaloPIDOn()){ | |
496 | //Skip matched clusters with tracks | |
a3aebfff | 497 | if(fRejectTrackMatch && calo->GetNTracksMatched() > 0) continue ; |
477d6cee | 498 | |
499 | //Get most probable PID, 2 options check PID weights | |
500 | //or redo PID, recommended option for EMCal. | |
501 | if(!IsCaloPIDRecalculationOn()) | |
502 | aodph.SetPdg(GetCaloPID()->GetPdg(fCalorimeter,calo->PID(),mom.E()));//PID with weights | |
503 | else | |
504 | aodph.SetPdg(GetCaloPID()->GetPdg(fCalorimeter,mom,calo));//PID recalculated | |
505 | ||
a3aebfff | 506 | if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillAOD() - PDG of identified particle %d\n",aodph.GetPdg()); |
477d6cee | 507 | |
508 | //If cluster does not pass pid, not photon, skip it. | |
509 | if(aodph.GetPdg() != AliCaloPID::kPhoton) continue ; | |
510 | ||
511 | } | |
512 | else{ | |
513 | //Set PID bits for later selection (AliAnaPi0 for example) | |
514 | //GetPDG already called in SetPIDBits. | |
515 | GetCaloPID()->SetPIDBits(fCalorimeter,calo,&aodph); | |
a3aebfff | 516 | if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillAOD() - PID Bits set \n"); |
477d6cee | 517 | } |
518 | ||
a3aebfff | 519 | if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillAOD() - Photon selection cuts passed: pT %3.2f, pdg %d\n",aodph.Pt(), aodph.GetPdg()); |
477d6cee | 520 | |
521 | //Play with the MC stack if available | |
522 | //Check origin of the candidates | |
523 | if(IsDataMC()){ | |
591cc579 | 524 | |
7cd4e982 | 525 | aodph.SetTag(GetMCAnalysisUtils()->CheckOrigin(calo->GetLabel(0),GetReader(), aodph.GetInputFileIndex())); |
591cc579 | 526 | if(GetDebug() > 0) printf("AliAnaPhoton::MakeAnalysisFillAOD() - Origin of candidate, bit map %d\n",aodph.GetTag()); |
477d6cee | 527 | }//Work with stack also |
528 | ||
529 | //Add AOD with photon object to aod branch | |
530 | AddAODParticle(aodph); | |
531 | ||
532 | }//loop | |
533 | ||
a3aebfff | 534 | if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillAOD() End fill AODs \n"); |
477d6cee | 535 | |
1c5acb87 | 536 | } |
537 | ||
538 | //__________________________________________________________________ | |
539 | void AliAnaPhoton::MakeAnalysisFillHistograms() | |
540 | { | |
123fc3bd | 541 | //Do analysis and fill histograms |
542 | ||
591cc579 | 543 | // Access MC information in stack if requested, check that it exists. |
544 | AliStack * stack = 0x0; | |
545 | TParticle * primary = 0x0; | |
546 | TClonesArray * mcparticles0 = 0x0; | |
547 | TClonesArray * mcparticles1 = 0x0; | |
548 | AliAODMCParticle * aodprimary = 0x0; | |
549 | if(IsDataMC()){ | |
550 | ||
551 | if(GetReader()->ReadStack()){ | |
552 | stack = GetMCStack() ; | |
553 | if(!stack) { | |
554 | printf("AliAnaPhoton::MakeAnalysisFillHistograms() - Stack not available, is the MC handler called? STOP\n"); | |
555 | abort(); | |
556 | } | |
557 | ||
558 | } | |
559 | else if(GetReader()->ReadAODMCParticles()){ | |
560 | ||
561 | //Get the list of MC particles | |
562 | mcparticles0 = GetReader()->GetAODMCParticles(0); | |
563 | if(!mcparticles0 && GetDebug() > 0) { | |
564 | printf("AliAnaPhoton::MakeAnalysisFillHistograms() - Standard MCParticles not available!\n"); | |
565 | } | |
566 | if(GetReader()->GetSecondInputAODTree()){ | |
567 | mcparticles1 = GetReader()->GetAODMCParticles(1); | |
568 | if(!mcparticles1 && GetDebug() > 0) { | |
569 | printf("AliAnaPhoton::MakeAnalysisFillHistograms() - Second input MCParticles not available!\n"); | |
570 | } | |
571 | } | |
572 | ||
573 | } | |
574 | }// is data and MC | |
575 | ||
123fc3bd | 576 | //Loop on stored AOD photons |
577 | Int_t naod = GetOutputAODBranch()->GetEntriesFast(); | |
578 | if(GetDebug() > 0) printf("AliAnaPhoton::MakeAnalysisFillHistograms() - aod branch entries %d\n", naod); | |
579 | ||
580 | for(Int_t iaod = 0; iaod < naod ; iaod++){ | |
477d6cee | 581 | AliAODPWG4Particle* ph = (AliAODPWG4Particle*) (GetOutputAODBranch()->At(iaod)); |
582 | Int_t pdg = ph->GetPdg(); | |
583 | ||
584 | if(GetDebug() > 3) | |
a3aebfff | 585 | printf("AliAnaPhoton::MakeAnalysisFillHistograms() - PDG %d, MC TAG %d, Calorimeter %s\n", ph->GetPdg(),ph->GetTag(), (ph->GetDetector()).Data()) ; |
477d6cee | 586 | |
587 | //If PID used, fill histos with photons in Calorimeter fCalorimeter | |
123fc3bd | 588 | if(IsCaloPIDOn() && pdg != AliCaloPID::kPhoton) continue; |
477d6cee | 589 | if(ph->GetDetector() != fCalorimeter) continue; |
590 | ||
591cc579 | 591 | if(GetDebug() > 2) |
a3aebfff | 592 | printf("AliAnaPhoton::MakeAnalysisFillHistograms() - ID Photon: pt %f, phi %f, eta %f\n", ph->Pt(),ph->Phi(),ph->Eta()) ; |
477d6cee | 593 | |
594 | //Fill photon histograms | |
123fc3bd | 595 | Float_t ptcluster = ph->Pt(); |
477d6cee | 596 | Float_t phicluster = ph->Phi(); |
597 | Float_t etacluster = ph->Eta(); | |
123fc3bd | 598 | Float_t ecluster = ph->E(); |
599 | ||
600 | fhPtPhoton ->Fill(ptcluster); | |
477d6cee | 601 | fhPhiPhoton ->Fill(ptcluster,phicluster); |
602 | fhEtaPhoton ->Fill(ptcluster,etacluster); | |
123fc3bd | 603 | |
591cc579 | 604 | //Play with the MC data if available |
477d6cee | 605 | if(IsDataMC()){ |
123fc3bd | 606 | |
477d6cee | 607 | Int_t tag =ph->GetTag(); |
591cc579 | 608 | |
609 | if( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton)) | |
610 | { | |
611 | fhPtMCPhoton ->Fill(ptcluster); | |
612 | fhPhiMCPhoton ->Fill(ptcluster,phicluster); | |
613 | fhEtaMCPhoton ->Fill(ptcluster,etacluster); | |
614 | ||
615 | if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion)) | |
616 | { | |
617 | fhPtConversion ->Fill(ptcluster); | |
618 | fhPhiConversion ->Fill(ptcluster,phicluster); | |
619 | fhEtaConversion ->Fill(ptcluster,etacluster); | |
620 | } | |
621 | ||
622 | if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPrompt)){ | |
623 | fhPtPrompt ->Fill(ptcluster); | |
624 | fhPhiPrompt ->Fill(ptcluster,phicluster); | |
625 | fhEtaPrompt ->Fill(ptcluster,etacluster); | |
626 | } | |
627 | else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCFragmentation)) | |
628 | { | |
629 | fhPtFragmentation ->Fill(ptcluster); | |
630 | fhPhiFragmentation ->Fill(ptcluster,phicluster); | |
631 | fhEtaFragmentation ->Fill(ptcluster,etacluster); | |
632 | } | |
633 | else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCISR)) | |
634 | { | |
635 | fhPtISR ->Fill(ptcluster); | |
636 | fhPhiISR ->Fill(ptcluster,phicluster); | |
637 | fhEtaISR ->Fill(ptcluster,etacluster); | |
638 | } | |
639 | else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0Decay)) | |
640 | { | |
641 | fhPtPi0Decay ->Fill(ptcluster); | |
642 | fhPhiPi0Decay ->Fill(ptcluster,phicluster); | |
643 | fhEtaPi0Decay ->Fill(ptcluster,etacluster); | |
644 | } | |
645 | else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEtaDecay) || GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCOtherDecay)) | |
646 | { | |
647 | fhPtOtherDecay ->Fill(ptcluster); | |
648 | fhPhiOtherDecay ->Fill(ptcluster,phicluster); | |
649 | fhEtaOtherDecay ->Fill(ptcluster,etacluster); | |
650 | } | |
651 | } | |
477d6cee | 652 | else{ |
591cc579 | 653 | fhPtUnknown ->Fill(ptcluster); |
654 | fhPhiUnknown ->Fill(ptcluster,phicluster); | |
655 | fhEtaUnknown ->Fill(ptcluster,etacluster); | |
656 | ||
657 | // printf(" AliAnaPhoton::MakeAnalysisFillHistograms() - Label %d, pT %2.3f Unknown, bits set: ", | |
658 | // ph->GetLabel(),ph->Pt()); | |
659 | // for(Int_t i = 0; i < 20; i++) { | |
660 | // if(GetMCAnalysisUtils()->CheckTagBit(tag,i)) printf(" %d, ",i); | |
661 | // } | |
662 | // printf("\n"); | |
663 | ||
477d6cee | 664 | } |
591cc579 | 665 | |
123fc3bd | 666 | |
591cc579 | 667 | // Access MC information in stack if requested, check that it exists. |
123fc3bd | 668 | Int_t label =ph->GetLabel(); |
669 | if(label < 0) { | |
670 | printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() *** bad label ***: label %d \n", label); | |
671 | continue; | |
672 | } | |
673 | ||
591cc579 | 674 | Float_t eprim = 0; |
675 | Float_t ptprim = 0; | |
676 | if(GetReader()->ReadStack()){ | |
677 | ||
678 | if(label >= stack->GetNtrack()) { | |
679 | if(GetDebug() > 2) printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() *** large label ***: label %d, n tracks %d \n", label, stack->GetNtrack()); | |
680 | continue ; | |
681 | } | |
682 | ||
683 | primary = stack->Particle(label); | |
684 | if(!primary){ | |
685 | printf("AliAnaPhoton::MakeAnalysisFillHistograms() *** no primary ***: label %d \n", label); | |
686 | continue; | |
687 | } | |
688 | eprim = primary->Energy(); | |
689 | ptprim = primary->Pt(); | |
123fc3bd | 690 | |
123fc3bd | 691 | } |
591cc579 | 692 | else if(GetReader()->ReadAODMCParticles()){ |
693 | //Check which is the input | |
7cd4e982 | 694 | if(ph->GetInputFileIndex() == 0){ |
591cc579 | 695 | if(!mcparticles0) continue; |
696 | if(label >= mcparticles0->GetEntriesFast()) { | |
697 | if(GetDebug() > 2) printf("AliAnaPhoton::MakeAnalysisFillHistograms() *** large label ***: label %d, n tracks %d \n", | |
698 | label, mcparticles0->GetEntriesFast()); | |
699 | continue ; | |
700 | } | |
701 | //Get the particle | |
702 | aodprimary = (AliAODMCParticle*) mcparticles0->At(label); | |
703 | ||
704 | } | |
705 | else {//Second input | |
706 | if(!mcparticles1) continue; | |
591cc579 | 707 | if(label >= mcparticles1->GetEntriesFast()) { |
708 | if(GetDebug() > 2) printf("AliAnaPhoton::MakeAnalysisFillHistograms() *** large label ***: label %d, n tracks %d \n", | |
709 | label, mcparticles1->GetEntriesFast()); | |
710 | continue ; | |
711 | } | |
712 | //Get the particle | |
713 | aodprimary = (AliAODMCParticle*) mcparticles1->At(label); | |
714 | ||
715 | }//second input | |
716 | ||
717 | if(!aodprimary){ | |
718 | printf("AliAnaPhoton::MakeAnalysisFillHistograms() *** no primary ***: label %d \n", label); | |
719 | continue; | |
720 | } | |
721 | ||
722 | eprim = aodprimary->E(); | |
723 | ptprim = aodprimary->Pt(); | |
123fc3bd | 724 | |
591cc579 | 725 | } |
726 | ||
41e886c8 | 727 | fh2E ->Fill(ecluster, eprim); |
728 | fh2Pt ->Fill(ptcluster, ptprim); | |
591cc579 | 729 | fhDeltaE ->Fill(eprim-ecluster); |
730 | fhDeltaPt->Fill(ptprim-ptcluster); | |
731 | if(eprim > 0) fhRatioE ->Fill(ecluster/eprim); | |
732 | if(ptprim > 0) fhRatioPt ->Fill(ptcluster/ptprim); | |
123fc3bd | 733 | |
477d6cee | 734 | }//Histograms with MC |
735 | ||
736 | }// aod loop | |
737 | ||
1c5acb87 | 738 | } |
739 | ||
740 | ||
741 | //__________________________________________________________________ | |
742 | void AliAnaPhoton::Print(const Option_t * opt) const | |
743 | { | |
477d6cee | 744 | //Print some relevant parameters set for the analysis |
745 | ||
746 | if(! opt) | |
747 | return; | |
748 | ||
749 | printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ; | |
750 | AliAnaPartCorrBaseClass::Print(" "); | |
a3aebfff | 751 | |
477d6cee | 752 | printf("Calorimeter = %s\n", fCalorimeter.Data()) ; |
753 | printf("Min Distance to Bad Channel = %2.1f\n",fMinDist); | |
754 | printf("Min Distance to Bad Channel 2 = %2.1f\n",fMinDist2); | |
755 | printf("Min Distance to Bad Channel 3 = %2.1f\n",fMinDist3); | |
a3aebfff | 756 | printf("Reject clusters with a track matched = %d\n",fRejectTrackMatch); |
757 | ||
477d6cee | 758 | printf(" \n") ; |
1c5acb87 | 759 | |
760 | } |