1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
17 //_________________________________________________________________________
19 // Class for the electron identification.
20 // Clusters from EMCAL matched to tracks
21 // and kept in the AOD. Few histograms produced.
23 // -- Author: J.L. Klay (Cal Poly), M. Heinz (Yale)
24 //////////////////////////////////////////////////////////////////////////////
26 // --- ROOT system ---
28 #include <TParticle.h>
30 #include <TClonesArray.h>
31 #include <TObjString.h>
32 //#include <Riostream.h>
34 // --- Analysis system ---
35 #include "AliAnaElectron.h"
36 #include "AliCaloTrackReader.h"
37 #include "AliMCAnalysisUtils.h"
38 #include "AliAODCaloCluster.h"
39 #include "AliFidutialCut.h"
40 #include "AliAODTrack.h"
41 #include "AliAODPid.h"
42 #include "AliCaloPID.h"
43 #include "AliAODMCParticle.h"
45 #include "AliExternalTrackParam.h"
48 ClassImp(AliAnaElectron)
50 //____________________________________________________________________________
51 AliAnaElectron::AliAnaElectron()
52 : AliAnaPartCorrBaseClass(),fCalorimeter(""),
53 fpOverEmin(0.),fpOverEmax(0.),fResidualCut(0.),
54 fDrCut(0.),fPairDcaCut(0.),fDecayLenCut(0.),fImpactCut(0.),
55 fAssocPtCut(0.),fMassCut(0.),fSdcaCut(0.),fITSCut(0),
59 fh1pOverE(0),fh1dR(0),fh2EledEdx(0),fh2MatchdEdx(0),fh2dEtadPhi(0),
60 fh2dEtadPhiMatched(0),fh2dEtadPhiUnmatched(0),
61 fh2TrackPVsClusterE(0),fh2TrackPtVsClusterE(0),fh2TrackPhiVsClusterPhi(0),fh2TrackEtaVsClusterEta(0),
62 //Photonic electron checks
63 fh1OpeningAngle(0),fh1MinvPhoton(0),
65 fhPtElectron(0),fhPhiElectron(0),fhEtaElectron(0),
66 fhPtNPE(0),fhPhiNPE(0),fhEtaNPE(0),
67 fhPtPE(0),fhPhiPE(0),fhEtaPE(0),
68 fhPtConversion(0),fhPhiConversion(0),fhEtaConversion(0),
69 fhPtBottom(0),fhPhiBottom(0),fhEtaBottom(0),
70 fhPtCharm(0),fhPhiCharm(0),fhEtaCharm(0),
71 fhPtCFromB(0),fhPhiCFromB(0),fhEtaCFromB(0),
72 fhPtDalitz(0),fhPhiDalitz(0),fhEtaDalitz(0),
73 fhPtWDecay(0),fhPhiWDecay(0),fhEtaWDecay(0),
74 fhPtZDecay(0),fhPhiZDecay(0),fhEtaZDecay(0),
75 fhPtPrompt(0),fhPhiPrompt(0),fhEtaPrompt(0),
76 fhPtUnknown(0),fhPhiUnknown(0),fhEtaUnknown(0),
78 fhBtagCut1(0),fhBtagCut2(0),fhBtagCut3(0),
84 //Initialize parameters
89 //____________________________________________________________________________
90 AliAnaElectron::AliAnaElectron(const AliAnaElectron & g)
91 : AliAnaPartCorrBaseClass(g),fCalorimeter(g.fCalorimeter),
92 fpOverEmin(g.fpOverEmin),fpOverEmax(g.fpOverEmax),fResidualCut(g.fResidualCut),
93 fDrCut(g.fDrCut),fPairDcaCut(g.fPairDcaCut),fDecayLenCut(g.fDecayLenCut),fImpactCut(g.fImpactCut),
94 fAssocPtCut(g.fAssocPtCut),fMassCut(g.fMassCut),fSdcaCut(g.fSdcaCut),fITSCut(g.fITSCut),
95 fWriteNtuple(g.fWriteNtuple),
97 fEleNtuple(g.fEleNtuple),
98 fh1pOverE(g.fh1pOverE),fh1dR(g.fh1dR),
99 fh2EledEdx(g.fh2EledEdx),fh2MatchdEdx(g.fh2MatchdEdx),fh2dEtadPhi(g.fh2dEtadPhi),
100 fh2dEtadPhiMatched(g.fh2dEtadPhiMatched),fh2dEtadPhiUnmatched(g.fh2dEtadPhiUnmatched),
101 fh2TrackPVsClusterE(g.fh2TrackPVsClusterE),fh2TrackPtVsClusterE(g.fh2TrackPtVsClusterE),
102 fh2TrackPhiVsClusterPhi(g.fh2TrackPhiVsClusterPhi),fh2TrackEtaVsClusterEta(g.fh2TrackEtaVsClusterEta),
103 //Photonic electron checks
104 fh1OpeningAngle(g.fh1OpeningAngle),fh1MinvPhoton(g.fh1MinvPhoton),
106 fhPtElectron(g.fhPtElectron),fhPhiElectron(g.fhPhiElectron),fhEtaElectron(g.fhEtaElectron),
107 fhPtNPE(g.fhPtNPE),fhPhiNPE(g.fhPhiNPE),fhEtaNPE(g.fhEtaNPE),
108 fhPtPE(g.fhPtPE),fhPhiPE(g.fhPhiPE),fhEtaPE(g.fhEtaPE),
109 fhPtConversion(g.fhPtConversion),fhPhiConversion(g.fhPhiConversion),fhEtaConversion(g.fhEtaConversion),
110 fhPtBottom(g.fhPtBottom),fhPhiBottom(g.fhPhiBottom),fhEtaBottom(g.fhEtaBottom),
111 fhPtCharm(g.fhPtCharm),fhPhiCharm(g.fhPhiCharm),fhEtaCharm(g.fhEtaCharm),
112 fhPtCFromB(g.fhPtCFromB),fhPhiCFromB(g.fhPhiCFromB),fhEtaCFromB(g.fhEtaCFromB),
113 fhPtDalitz(g.fhPtDalitz),fhPhiDalitz(g.fhPhiDalitz),fhEtaDalitz(g.fhEtaDalitz),
114 fhPtWDecay(g.fhPtWDecay),fhPhiWDecay(g.fhPhiWDecay),fhEtaWDecay(g.fhEtaWDecay),
115 fhPtZDecay(g.fhPtZDecay),fhPhiZDecay(g.fhPhiZDecay),fhEtaZDecay(g.fhEtaZDecay),
116 fhPtPrompt(g.fhPtPrompt),fhPhiPrompt(g.fhPhiPrompt),fhEtaPrompt(g.fhEtaPrompt),
117 fhPtUnknown(g.fhPtUnknown),fhPhiUnknown(g.fhPhiUnknown),fhEtaUnknown(g.fhEtaUnknown),
119 fhBtagCut1(g.fhBtagCut1),fhBtagCut2(g.fhBtagCut2),fhBtagCut3(g.fhBtagCut3),
121 fMCEleNtuple(g.fMCEleNtuple)
127 //_________________________________________________________________________
128 AliAnaElectron & AliAnaElectron::operator = (const AliAnaElectron & g)
130 // assignment operator
132 if(&g == this) return *this;
133 fCalorimeter = g.fCalorimeter;
134 fpOverEmin = g.fpOverEmin;
135 fpOverEmax = g.fpOverEmax;
136 fResidualCut = g.fResidualCut;
138 fPairDcaCut = g.fPairDcaCut;
139 fDecayLenCut = g.fDecayLenCut;
140 fImpactCut = g.fImpactCut;
141 fAssocPtCut = g.fAssocPtCut;
142 fMassCut = g.fMassCut;
143 fSdcaCut = g.fSdcaCut;
145 fWriteNtuple = g.fWriteNtuple;
146 fEleNtuple = g.fEleNtuple;
147 fh1pOverE = g.fh1pOverE;
149 fh2EledEdx = g.fh2EledEdx;
150 fh2MatchdEdx = g.fh2MatchdEdx;
151 fh2dEtadPhi = g.fh2dEtadPhi;
152 fh2dEtadPhiMatched = g.fh2dEtadPhiMatched;
153 fh2dEtadPhiUnmatched = g.fh2dEtadPhiUnmatched;
154 fh2TrackPVsClusterE = g.fh2TrackPVsClusterE;
155 fh2TrackPtVsClusterE = g.fh2TrackPtVsClusterE;
156 fh2TrackPhiVsClusterPhi = g.fh2TrackPhiVsClusterPhi;
157 fh2TrackEtaVsClusterEta = g.fh2TrackEtaVsClusterEta;
158 fh1OpeningAngle = g.fh1OpeningAngle;
159 fh1MinvPhoton = g.fh1MinvPhoton;
160 fhPtElectron = g.fhPtElectron;
161 fhPhiElectron = g.fhPhiElectron;
162 fhEtaElectron = g.fhEtaElectron;
164 fhPhiNPE = g.fhPhiNPE;
165 fhEtaNPE = g.fhEtaNPE;
169 fhPtConversion = g.fhPtConversion;
170 fhPhiConversion = g.fhPhiConversion;
171 fhEtaConversion = g.fhEtaConversion;
172 fhPtBottom = g.fhPtBottom;
173 fhPhiBottom = g.fhPhiBottom;
174 fhEtaBottom = g.fhEtaBottom;
175 fhPtCharm = g.fhPtCharm;
176 fhPhiCharm = g.fhPhiCharm;
177 fhEtaCharm = g.fhEtaCharm;
178 fhPtCFromB = g.fhPtCFromB;
179 fhPhiCFromB = g.fhPhiCFromB;
180 fhEtaCFromB = g.fhEtaCFromB;
181 fhPtDalitz = g.fhPtDalitz;
182 fhPhiDalitz = g.fhPhiDalitz;
183 fhEtaDalitz = g.fhEtaDalitz;
184 fhPtWDecay = g.fhPtWDecay;
185 fhPhiWDecay = g.fhPhiWDecay;
186 fhEtaWDecay = g.fhEtaWDecay;
187 fhPtZDecay = g.fhPtZDecay;
188 fhPhiZDecay = g.fhPhiZDecay;
189 fhEtaZDecay = g.fhEtaZDecay;
190 fhPtPrompt = g.fhPtPrompt;
191 fhPhiPrompt = g.fhPhiPrompt;
192 fhEtaPrompt = g.fhEtaPrompt;
193 fhPtUnknown = g.fhPtUnknown;
194 fhPhiUnknown = g.fhPhiUnknown;
195 fhEtaUnknown = g.fhEtaUnknown;
196 fMCEleNtuple = g.fMCEleNtuple;
199 fhBtagCut1 = g.fhBtagCut1;
200 fhBtagCut2 = g.fhBtagCut2;
201 fhBtagCut3 = g.fhBtagCut3;
207 //____________________________________________________________________________
208 AliAnaElectron::~AliAnaElectron()
215 //________________________________________________________________________
216 TList * AliAnaElectron::GetCreateOutputObjects()
218 // Create histograms to be saved in output file and
219 // store them in outputContainer
220 TList * outputContainer = new TList() ;
221 outputContainer->SetName("ElectronHistos") ;
223 //created ele ntuple for further analysis
225 fEleNtuple = new TNtuple("EleNtuple","Electron Ntuple","tmctag:cmctag:pt:phi:eta:p:E:deta:dphi:nCells:dEdx:pidProb:impXY:impZ");
226 outputContainer->Add(fEleNtuple) ;
229 Int_t nptbins = GetHistoNPtBins();
230 Int_t nphibins = GetHistoNPhiBins();
231 Int_t netabins = GetHistoNEtaBins();
232 Float_t ptmax = GetHistoPtMax();
233 Float_t phimax = GetHistoPhiMax();
234 Float_t etamax = GetHistoEtaMax();
235 Float_t ptmin = GetHistoPtMin();
236 Float_t phimin = GetHistoPhiMin();
237 Float_t etamin = GetHistoEtaMin();
239 fh1pOverE = new TH1F("h1pOverE","EMCAL-TRACK matches p/E",100,0.,10.);
240 fh1dR = new TH1F("h1dR","EMCAL-TRACK matches dR",300, 0.,TMath::Pi());
241 fh2EledEdx = new TH2F("h2EledEdx","dE/dx vs. p for electrons",200,0.,50.,200,0.,400.);
242 fh2MatchdEdx = new TH2F("h2MatchdEdx","dE/dx vs. p for all matches",200,0.,50.,200,0.,400.);
243 fh2dEtadPhi = new TH2F("h2dEtadPhi","#Delta#eta vs. #Delta#phi for all track-cluster pairs",200,0.,1.4,300,0.,TMath::Pi());
244 fh2dEtadPhiMatched = new TH2F("h2dEtadPhiMatched","#Delta#eta vs. #Delta#phi for matched track-cluster pairs",200,0.,1.4,300,0.,TMath::Pi());
245 fh2dEtadPhiUnmatched = new TH2F("h2dEtadPhiUnmatched","#Delta#eta vs. #Delta#phi for unmatched track-cluster pairs",200,0.,1.4,300,0.,TMath::Pi());
247 fh2TrackPVsClusterE = new TH2F("h2TrackPVsClusterE","h2TrackPVsClusterE",nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
248 fh2TrackPtVsClusterE = new TH2F("h2TrackPtVsClusterE","h2TrackPtVsClusterE",nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
249 fh2TrackPhiVsClusterPhi = new TH2F("h2TrackPhiVsClusterPhi","h2TrackPhiVsClusterPhi",nphibins,phimin,phimax,nphibins,phimin,phimax);
250 fh2TrackEtaVsClusterEta = new TH2F("h2TrackEtaVsClusterEta","h2TrackEtaVsClusterEta",netabins,etamin,etamax,netabins,etamin,etamax);
252 outputContainer->Add(fh1pOverE) ;
253 outputContainer->Add(fh1dR) ;
254 outputContainer->Add(fh2EledEdx) ;
255 outputContainer->Add(fh2MatchdEdx) ;
256 outputContainer->Add(fh2dEtadPhi) ;
257 outputContainer->Add(fh2dEtadPhiMatched) ;
258 outputContainer->Add(fh2dEtadPhiUnmatched) ;
259 outputContainer->Add(fh2TrackPVsClusterE) ;
260 outputContainer->Add(fh2TrackPtVsClusterE) ;
261 outputContainer->Add(fh2TrackPhiVsClusterPhi) ;
262 outputContainer->Add(fh2TrackEtaVsClusterEta) ;
264 //photonic electron checks
265 fh1OpeningAngle = new TH1F("hOpeningAngle","Opening angle between electron pairs",100,0.,TMath::Pi());
266 fh1MinvPhoton = new TH1F("hMinvPhoton","Invariant mass of electron pairs",100,0.,2.);
268 outputContainer->Add(fh1OpeningAngle);
269 outputContainer->Add(fh1MinvPhoton);
271 fhPtElectron = new TH1F("hPtElectron","Electron pT",nptbins,ptmin,ptmax);
272 fhPhiElectron = new TH2F("hPhiElectron","Electron phi vs pT",nptbins,ptmin,ptmax,nphibins,phimin,phimax);
273 fhEtaElectron = new TH2F("hEtaElectron","Electron eta vs. eta",nptbins,ptmin,ptmax,netabins,etamin,etamax);
274 fhPtNPE = new TH1F("hPtNPE","Non-photonic Electron pT",nptbins,ptmin,ptmax);
275 fhPhiNPE = new TH2F("hPhiNPE","Non-photonic Electron phi vs pT",nptbins,ptmin,ptmax,nphibins,phimin,phimax);
276 fhEtaNPE = new TH2F("hEtaNPE","Non-photonic Electron eta vs. eta",nptbins,ptmin,ptmax,netabins,etamin,etamax);
277 fhPtPE = new TH1F("hPtPE","Photonic Electron pT",nptbins,ptmin,ptmax);
278 fhPhiPE = new TH2F("hPhiPE","Photonic Electron phi vs pT",nptbins,ptmin,ptmax,nphibins,phimin,phimax);
279 fhEtaPE = new TH2F("hEtaPE","Photonic Electron eta vs. eta",nptbins,ptmin,ptmax,netabins,etamin,etamax);
281 outputContainer->Add(fhPtElectron) ;
282 outputContainer->Add(fhPhiElectron) ;
283 outputContainer->Add(fhEtaElectron) ;
284 outputContainer->Add(fhPtNPE) ;
285 outputContainer->Add(fhPhiNPE) ;
286 outputContainer->Add(fhEtaNPE) ;
287 outputContainer->Add(fhPtPE) ;
288 outputContainer->Add(fhPhiPE) ;
289 outputContainer->Add(fhEtaPE) ;
292 fhBtagCut1 = new TH2F("hbtag_cut1","B-tag result cut1", 10,0,10 ,nptbins,ptmin,ptmax);
293 fhBtagCut2 = new TH2F("hbtag_cut2","B-tag result cut2", 10,0,10 ,nptbins,ptmin,ptmax);
294 fhBtagCut3 = new TH2F("hbtag_cut3","B-tag result cut3", 10,0,10 ,nptbins,ptmin,ptmax);
296 outputContainer->Add(fhBtagCut1) ;
297 outputContainer->Add(fhBtagCut2) ;
298 outputContainer->Add(fhBtagCut3) ;
302 fhPtConversion = new TH1F("hPtConversion","Conversion electron pT",nptbins,ptmin,ptmax);
303 fhPhiConversion = new TH2F("hPhiConversion","Conversion Electron phi vs pT",nptbins,ptmin,ptmax,nphibins,phimin,phimax);
304 fhEtaConversion = new TH2F("hEtaConversion","Conversion Electron eta vs. eta",nptbins,ptmin,ptmax,netabins,etamin,etamax);
305 fhPtBottom = new TH1F("hPtBottom","Bottom electron pT",nptbins,ptmin,ptmax);
306 fhPhiBottom = new TH2F("hPhiBottom","Bottom Electron phi vs pT",nptbins,ptmin,ptmax,nphibins,phimin,phimax);
307 fhEtaBottom = new TH2F("hEtaBottom","Bottom Electron eta vs. eta",nptbins,ptmin,ptmax,netabins,etamin,etamax);
308 fhPtCharm = new TH1F("hPtCharm","Charm electron pT",nptbins,ptmin,ptmax);
309 fhPhiCharm = new TH2F("hPhiCharm","Charm Electron phi vs pT",nptbins,ptmin,ptmax,nphibins,phimin,phimax);
310 fhEtaCharm = new TH2F("hEtaCharm","Charm Electron eta vs. eta",nptbins,ptmin,ptmax,netabins,etamin,etamax);
311 fhPtCFromB = new TH1F("hPtCFromB","Charm from Bottom electron pT",nptbins,ptmin,ptmax);
312 fhPhiCFromB = new TH2F("hPhiCFromB","Charm from Bottom Electron phi vs pT",nptbins,ptmin,ptmax,nphibins,phimin,phimax);
313 fhEtaCFromB = new TH2F("hEtaCFromB","Charm from Bottom Electron eta vs. eta",nptbins,ptmin,ptmax,netabins,etamin,etamax);
314 fhPtDalitz = new TH1F("hPtDalitz","Dalitz electron pT",nptbins,ptmin,ptmax);
315 fhPhiDalitz = new TH2F("hPhiDalitz","Dalitz Electron phi vs pT",nptbins,ptmin,ptmax,nphibins,phimin,phimax);
316 fhEtaDalitz = new TH2F("hEtaDalitz","Dalitz Electron eta vs. eta",nptbins,ptmin,ptmax,netabins,etamin,etamax);
317 fhPtWDecay = new TH1F("hPtWDecay","W-boson Electron pT",nptbins,ptmin,ptmax);
318 fhPhiWDecay = new TH2F("hPhiWDecay","W-boson electron phi vs pT",nptbins,ptmin,ptmax,nphibins,phimin,phimax);
319 fhEtaWDecay = new TH2F("hEtaWDecay","W-boson Electron eta vs. eta",nptbins,ptmin,ptmax,netabins,etamin,etamax);
320 fhPtZDecay = new TH1F("hPtZDecay","Z-boson electron pT",nptbins,ptmin,ptmax);
321 fhPhiZDecay = new TH2F("hPhiZDecay","Z-boson Electron phi vs pT",nptbins,ptmin,ptmax,nphibins,phimin,phimax);
322 fhEtaZDecay = new TH2F("hEtaZDecay","Z-boson Electron eta vs. eta",nptbins,ptmin,ptmax,netabins,etamin,etamax);
323 fhPtPrompt = new TH1F("hPtPrompt","Prompt electron pT",nptbins,ptmin,ptmax);
324 fhPhiPrompt = new TH2F("hPhiPrompt","Prompt Electron phi vs pT",nptbins,ptmin,ptmax,nphibins,phimin,phimax);
325 fhEtaPrompt = new TH2F("hEtaPrompt","Prompt Electron eta vs. eta",nptbins,ptmin,ptmax,netabins,etamin,etamax);
326 fhPtUnknown = new TH1F("hPtUnknown","Unknown electron pT",nptbins,ptmin,ptmax);
327 fhPhiUnknown = new TH2F("hPhiUnknown","Unknown Electron phi vs pT",nptbins,ptmin,ptmax,nphibins,phimin,phimax);
328 fhEtaUnknown = new TH2F("hEtaUnknown","Unknown Electron eta vs. eta",nptbins,ptmin,ptmax,netabins,etamin,etamax);
330 outputContainer->Add(fhPtConversion);
331 outputContainer->Add(fhPhiConversion);
332 outputContainer->Add(fhEtaConversion);
333 outputContainer->Add(fhPtBottom);
334 outputContainer->Add(fhPhiBottom);
335 outputContainer->Add(fhEtaBottom);
336 outputContainer->Add(fhPtCharm);
337 outputContainer->Add(fhPhiCharm);
338 outputContainer->Add(fhEtaCharm);
339 outputContainer->Add(fhPtCFromB);
340 outputContainer->Add(fhPhiCFromB);
341 outputContainer->Add(fhEtaCFromB);
342 outputContainer->Add(fhPtDalitz);
343 outputContainer->Add(fhPhiDalitz);
344 outputContainer->Add(fhEtaDalitz);
345 outputContainer->Add(fhPtWDecay);
346 outputContainer->Add(fhPhiWDecay);
347 outputContainer->Add(fhEtaWDecay);
348 outputContainer->Add(fhPtZDecay);
349 outputContainer->Add(fhPhiZDecay);
350 outputContainer->Add(fhEtaZDecay);
351 outputContainer->Add(fhPtPrompt);
352 outputContainer->Add(fhPhiPrompt);
353 outputContainer->Add(fhEtaPrompt);
354 outputContainer->Add(fhPtUnknown);
355 outputContainer->Add(fhPhiUnknown);
356 outputContainer->Add(fhEtaUnknown);
358 //created ele ntuple for further analysis
360 fMCEleNtuple = new TNtuple("MCEleNtuple","MC Electron Ntuple","mctag:pt:phi:eta:x:y:z");
361 outputContainer->Add(fMCEleNtuple) ;
366 //Save parameters used for analysis
367 TString parList ; //this will be list of parameters used for this analysis.
370 sprintf(onePar,"--- AliAnaElectron ---\n") ;
372 sprintf(onePar,"fCalorimeter: %s\n",fCalorimeter.Data()) ;
374 sprintf(onePar,"fpOverEmin: %f\n",fpOverEmin) ;
376 sprintf(onePar,"fpOverEmax: %f\n",fpOverEmax) ;
378 sprintf(onePar,"fResidualCut: %f\n",fResidualCut) ;
380 sprintf(onePar,"---Btagging\n");
382 sprintf(onePar,"max IP-cut (e,h): %f\n",fImpactCut);
384 sprintf(onePar,"min ITS-hits: %d\n",fITSCut);
386 sprintf(onePar,"max dR (e,h): %f\n",fDrCut);
388 sprintf(onePar,"max pairDCA: %f\n",fPairDcaCut);
390 sprintf(onePar,"max decaylength: %f\n",fDecayLenCut);
392 sprintf(onePar,"min Associated Pt: %f\n",fAssocPtCut);
395 //Get parameters set in base class.
396 parList += GetBaseParametersList() ;
398 //Get parameters set in FidutialCut class (not available yet)
399 //parlist += GetFidCut()->GetFidCutParametersList()
401 TObjString *oString= new TObjString(parList) ;
402 outputContainer->Add(oString);
404 return outputContainer ;
408 //____________________________________________________________________________
409 void AliAnaElectron::Init()
412 //do some initialization
413 if(fCalorimeter == "PHOS") {
414 printf("AliAnaElectron::Init() - !!STOP: You want to use PHOS in analysis but this is not (yet) supported!!\n!!Check the configuration file!!\n");
415 fCalorimeter = "EMCAL";
417 if(fCalorimeter == "EMCAL" && !GetReader()->IsEMCALSwitchedOn()){
418 printf("AliAnaElectron::Init() - !!STOP: You want to use EMCAL in analysis but it is not read!!\n!!Check the configuration file!!\n");
425 //____________________________________________________________________________
426 void AliAnaElectron::InitParameters()
429 //Initialize the parameters of the analysis.
430 SetOutputAODClassName("AliAODPWG4Particle");
431 SetOutputAODName("PWG4Particle");
433 AddToHistogramsName("AnaElectron_");
435 fCalorimeter = "EMCAL" ;
451 //__________________________________________________________________
452 void AliAnaElectron::MakeAnalysisFillAOD()
455 // Do analysis and fill aods with electron candidates
456 // These AODs will be used to do subsequent histogram filling
458 // Also fill some QA histograms
461 TObjArray *cl = new TObjArray();
463 //Get vertex for cluster momentum calculation
464 Double_t vertex[] = {-999.,-999.,-999.} ; //vertex ;
465 Double_t vertex2[] = {-999.,-999.,-999.} ; //vertex of second input AOD if exist;
466 if(GetReader()->GetDataType() != AliCaloTrackReader::kMC) {
467 GetReader()->GetVertex(vertex);
468 if(GetReader()->GetSecondInputAODTree()) GetReader()->GetSecondInputAODVertex(vertex2);
470 Double_t bfield = 0.;
471 if(GetReader()->GetDataType() != AliCaloTrackReader::kMC) bfield = GetReader()->GetBField();
473 //Select the calorimeter of the electron
474 if(fCalorimeter != "EMCAL") {
475 printf("This class not yet implemented for PHOS\n");
480 ////////////////////////////////////////////////
481 //Start from tracks and get associated clusters
482 ////////////////////////////////////////////////
483 if(!GetAODCTS() || GetAODCTS()->GetEntriesFast() == 0) return ;
484 Int_t ntracks = GetAODCTS()->GetEntriesFast();
486 printf("AliAnaElectron::MakeAnalysisFillAOD() - In CTS aod entries %d\n", ntracks);
488 //Unfortunately, AliAODTracks don't have associated EMCAL clusters.
489 //we have to redo track-matching, I guess
490 Int_t iCluster = -999;
491 Int_t bt = 0; //counter for event b-tags
493 for (Int_t itrk = 0; itrk < ntracks; itrk++) {////////////// track loop
494 iCluster = -999; //start with no match
495 AliAODTrack * track = (AliAODTrack*) (GetAODCTS()->At(itrk)) ;
496 AliAODPid* pid = (AliAODPid*) track->GetDetPid();
499 pid->GetEMCALPosition(emcpos);
501 pid->GetEMCALMomentum(emcmom);
503 TVector3 pos(emcpos[0],emcpos[1],emcpos[2]);
504 TVector3 mom(emcmom[0],emcmom[1],emcmom[2]);
505 Double_t tphi = pos.Phi();
506 Double_t teta = pos.Eta();
507 Double_t tmom = mom.Mag();
509 TLorentzVector mom2(mom,0.);
510 Bool_t in = GetFidutialCut()->IsInFidutialCut(mom2,fCalorimeter) ;
511 if(GetDebug() > 1) printf("AliAnaElectron::MakeAnalysisFillAOD() - Track pt %2.2f, phi %2.2f, eta %2.2f in fidutial cut %d\n",track->Pt(), track->Phi(), track->Eta(), in);
512 if(mom.Pt() > GetMinPt() && in) {
514 Double_t dEdx = pid->GetTPCsignal();
516 //NOTE: As of 02-Sep-2009, the XYZAtDCA methods of AOD do not
517 //work, but it is possible to get the position of a track at
518 //closest approach to the vertex from the GetPosition method
520 //track->XYZAtDCA(xyz);
521 Bool_t isNotDCA = track->GetPosition(xyz);
522 if(isNotDCA) printf("##Problem getting impact parameter!\n");
523 //printf("\tTRACK POSITION AT DCA: %2.2f,%2.2f,%2.2f\n",xyz[0],xyz[1],xyz[2]);
524 Float_t xy = TMath::Sqrt(xyz[0]*xyz[0]+xyz[1]*xyz[1]);
527 Int_t ntot = cl->GetEntriesFast();
529 Double_t pOverE = -999.;
531 Bool_t isElectron = kFALSE;
532 //For tracks in EMCAL acceptance, pair them with all clusters
533 //and fill the dEta vs dPhi for these pairs:
534 for(Int_t iclus = 0; iclus < ntot; iclus++) {
535 AliAODCaloCluster * clus = (AliAODCaloCluster*) (cl->At(iclus));
539 clus->GetPosition(x);
540 TVector3 cluspos(x[0],x[1],x[2]);
541 Double_t deta = teta - cluspos.Eta();
542 Double_t dphi = tphi - cluspos.Phi();
543 if(dphi > TMath::Pi()) dphi -= 2*TMath::Pi();
544 if(dphi < -TMath::Pi()) dphi += 2*TMath::Pi();
545 fh2dEtadPhi->Fill(deta,dphi);
546 fh2TrackPVsClusterE->Fill(clus->E(),track->P());
547 fh2TrackPtVsClusterE->Fill(clus->E(),track->Pt());
548 fh2TrackPhiVsClusterPhi->Fill(cluspos.Phi(),mom.Phi());
549 fh2TrackEtaVsClusterEta->Fill(cluspos.Eta(),mom.Eta());
551 res = sqrt(dphi*dphi + deta*deta);
553 fh2dEtadPhiMatched->Fill(deta,dphi);
555 /////////////////////////////////
556 //Perform electron cut analysis//
557 /////////////////////////////////
559 if(res < fResidualCut) {
566 //Input from second AOD?
568 if(GetReader()->GetAODCTSNormalInputEntries() <= itrk) input = 1;
569 tmctag = (Float_t)GetMCAnalysisUtils()->CheckOrigin(track->GetLabel(),GetReader(),input);
570 //Do you want the cluster or the track label?
572 if(GetReader()->GetAODEMCALNormalInputEntries() <= iclus) input = 1;
573 cmctag = (Float_t)GetMCAnalysisUtils()->CheckOrigin(clus->GetLabel(0),GetReader(),input);
577 fEleNtuple->Fill(tmctag,cmctag,track->Pt(),track->Phi(),track->Eta(),track->P(),clus->E(),deta,dphi,clus->GetNCells(),dEdx,track->GetMostProbablePID(),xy,z);
580 fh2MatchdEdx->Fill(track->P(),dEdx);
582 Double_t energy = clus->E();
583 if(energy > 0) pOverE = tmom/energy;
584 fh1pOverE->Fill(pOverE);
586 Int_t mult = clus->GetNCells();
587 if(mult < 2 && GetDebug() > 0) printf("Single digit cluster.\n");
589 //////////////////////////////
590 //Electron cuts happen here!//
591 //////////////////////////////
592 if(pOverE > fpOverEmin && pOverE < fpOverEmax) isElectron = kTRUE;
594 fh2dEtadPhiUnmatched->Fill(deta,dphi);
599 ///////////////////////////
600 //Fill AOD with electrons//
601 ///////////////////////////
605 if(GetDebug() > 1) printf("Found Electron - do b-tagging\n");
606 Int_t btag = GetBtag(track); bt += btag;
608 fh2EledEdx->Fill(track->P(),dEdx);
610 Double_t eMass = 0.511/1000; //mass in GeV
611 Double_t eleE = sqrt(track->P()*track->P() + eMass*eMass);
612 AliAODPWG4Particle tr = AliAODPWG4Particle(track->Px(),track->Py(),track->Pz(),eleE);
613 tr.SetLabel(track->GetLabel());
614 tr.SetCaloLabel(iCluster,-1); //sets the indices of the original caloclusters
615 tr.SetTrackLabel(track->GetID(),-1); //sets the indices of the original tracks
616 tr.SetDetector(fCalorimeter);
617 if(GetReader()->GetAODCTSNormalInputEntries() <= itrk) tr.SetInputFileIndex(1);
621 //Play with the MC stack if available
622 //Check origin of the candidates
625 //FIXME: Need to re-think this for track-oriented analysis
626 //JLK DO WE WANT TRACK TAG OR CLUSTER TAG?
627 tr.SetTag(GetMCAnalysisUtils()->CheckOrigin(tr.GetLabel(),GetReader(),tr.GetInputFileIndex()));
629 if(GetDebug() > 0) printf("AliAnaElectron::MakeAnalysisFillAOD() - Origin of candidate %d\n",tr.GetTag());
630 }//Work with stack also
634 if(GetDebug() > 1) printf("AliAnaElectron::MakeAnalysisFillAOD() - Electron selection cuts passed: pT %3.2f, pdg %d\n",tr.Pt(),tr.GetPdg());
636 }//pt, fiducial selection
639 //FIXME: Should we also check from the calocluster side, just in
642 if(GetDebug() > 1 && bt > 0) printf("AliAnaElectron::MakeAnalysisFillAOD() *** Event Btagged *** \n");
643 if(GetDebug() > 1) printf("AliAnaElectron::MakeAnalysisFillAOD() End fill AODs \n");
647 //__________________________________________________________________
648 void AliAnaElectron::MakeAnalysisFillHistograms()
650 //Do analysis and fill histograms
652 AliStack * stack = 0x0;
653 TParticle * primary = 0x0;
654 TClonesArray * mcparticles0 = 0x0;
655 TClonesArray * mcparticles1 = 0x0;
656 AliAODMCParticle * aodprimary = 0x0;
659 if(GetReader()->ReadStack()){
660 stack = GetMCStack() ;
663 printf("AliAnaElectron::MakeAnalysisFillHistograms() *** no stack ***: \n");
666 else if(GetReader()->ReadAODMCParticles()){
667 //Get the list of MC particles
668 mcparticles0 = GetReader()->GetAODMCParticles(0);
669 if(!mcparticles0 && GetDebug() > 0) {
670 printf("AliAnaElectron::MakeAnalysisFillHistograms() - Standard MCParticles not available!\n");
672 if(GetReader()->GetSecondInputAODTree()){
673 mcparticles1 = GetReader()->GetAODMCParticles(1);
674 if(!mcparticles1 && GetDebug() > 0) {
675 printf("AliAnaElectron::MakeAnalysisFillHistograms() - Second input MCParticles not available!\n");
682 //Loop on stored AOD electrons
683 Int_t naod = GetOutputAODBranch()->GetEntriesFast();
684 if(GetDebug() > 0) printf("AliAnaElectron::MakeAnalysisFillHistograms() - aod branch entries %d\n", naod);
686 for(Int_t iaod = 0; iaod < naod ; iaod++){
687 AliAODPWG4Particle* ele = (AliAODPWG4Particle*) (GetOutputAODBranch()->At(iaod));
688 Int_t pdg = ele->GetPdg();
691 printf("AliAnaElectron::MakeAnalysisFillHistograms() - PDG %d, MC TAG %d, Calorimeter %s\n", ele->GetPdg(),ele->GetTag(), (ele->GetDetector()).Data()) ;
693 if(pdg != AliCaloPID::kElectron) continue;
694 if(ele->GetDetector() != fCalorimeter) continue;
697 printf("AliAnaElectron::MakeAnalysisFillHistograms() - ID Electron: pt %f, phi %f, eta %f\n", ele->Pt(),ele->Phi(),ele->Eta()) ;
700 //Filter for photonic electrons based on opening angle and Minv
701 //cuts, also fill histograms
702 Bool_t photonic = kFALSE;
703 photonic = IsItPhotonic(ele);
705 //Fill electron histograms
706 Float_t ptele = ele->Pt();
707 Float_t phiele = ele->Phi();
708 Float_t etaele = ele->Eta();
710 fhPtElectron ->Fill(ptele);
711 fhPhiElectron ->Fill(ptele,phiele);
712 fhEtaElectron ->Fill(ptele,etaele);
716 fhPhiPE->Fill(ptele,phiele);
717 fhEtaPE->Fill(ptele,etaele);
719 fhPtNPE->Fill(ptele);
720 fhPhiNPE->Fill(ptele,phiele);
721 fhEtaNPE->Fill(ptele,etaele);
725 Int_t tag = ele->GetTag();
726 if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion)){
727 fhPtConversion ->Fill(ptele);
728 fhPhiConversion ->Fill(ptele,phiele);
729 fhEtaConversion ->Fill(ptele,etaele);
731 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEFromB))
733 printf("\t\tTAG VALUE = %d\n",tag);
734 fhPtBottom ->Fill(ptele);
735 fhPhiBottom ->Fill(ptele,phiele);
736 fhEtaBottom ->Fill(ptele,etaele);
738 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEFromC))
740 fhPtCharm ->Fill(ptele);
741 fhPhiCharm ->Fill(ptele,phiele);
742 fhEtaCharm ->Fill(ptele,etaele);
744 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEFromCFromB))
746 fhPtCFromB ->Fill(ptele);
747 fhPhiCFromB ->Fill(ptele,phiele);
748 fhEtaCFromB ->Fill(ptele,etaele);
750 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0Decay) || GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEtaDecay) || GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCOtherDecay))
752 fhPtDalitz ->Fill(ptele);
753 fhPhiDalitz ->Fill(ptele,phiele);
754 fhEtaDalitz ->Fill(ptele,etaele);
756 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCWDecay))
758 fhPtWDecay ->Fill(ptele);
759 fhPhiWDecay ->Fill(ptele,phiele);
760 fhEtaWDecay ->Fill(ptele,etaele);
762 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCZDecay))
764 fhPtZDecay ->Fill(ptele);
765 fhPhiZDecay ->Fill(ptele,phiele);
766 fhEtaZDecay ->Fill(ptele,etaele);
768 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron))
770 fhPtPrompt ->Fill(ptele);
771 fhPhiPrompt ->Fill(ptele,phiele);
772 fhEtaPrompt ->Fill(ptele,etaele);
775 fhPtUnknown ->Fill(ptele);
776 fhPhiUnknown ->Fill(ptele,phiele);
777 fhEtaUnknown ->Fill(ptele,etaele);
779 }//Histograms with MC
783 ////////////////////////////////////////////////////////
784 //Fill histograms of pure MC kinematics from the stack//
785 ////////////////////////////////////////////////////////
787 if(GetReader()->ReadStack()) {
788 for(Int_t ipart = 0; ipart < stack->GetNtrack(); ipart++) {
789 primary = stack->Particle(ipart);
790 Int_t pdgcode = primary->GetPdgCode();
791 //we only care about electrons
792 if(abs(pdgcode) != 11) continue;
793 //we only want TRACKABLE electrons (TPC 85-250cm)
794 if(primary->R() > 200.) continue;
795 //Ignore low pt electrons
796 if(primary->Pt() < 0.2) continue;
798 //find out what the ancestry of this electron is
801 mctag = GetMCAnalysisUtils()->CheckOrigin(ipart,GetReader(),input);
805 fMCEleNtuple->Fill(mctag,primary->Pt(),primary->Phi(),primary->Eta(),primary->Vx(),primary->Vy(),primary->Vz());
810 } else if(GetReader()->ReadAODMCParticles()) {
811 Int_t npart0 = mcparticles0->GetEntriesFast();
813 if(mcparticles1) npart1 = mcparticles1->GetEntriesFast();
814 Int_t npart = npart0+npart1;
815 for(Int_t ipart = 0; ipart < npart; ipart++) {
816 if(ipart < npart0) aodprimary = (AliAODMCParticle*)mcparticles0->At(ipart);
817 else aodprimary = (AliAODMCParticle*)mcparticles1->At(ipart-npart0);
819 printf("AliAnaElectron::MakeAnalysisFillHistograms() *** no primary ***: label %d \n", ipart);
822 Int_t pdgcode = aodprimary->GetPdgCode();
823 //we only care about electrons
824 if(abs(pdgcode) != 11) continue;
825 //we only want TRACKABLE electrons (TPC 85-250cm)
826 Double_t radius = TMath::Sqrt(aodprimary->Xv()*aodprimary->Xv() + aodprimary->Yv()*aodprimary->Yv());
827 if(radius > 200.) continue;
829 //find out what the ancestry of this electron is
833 if(ipart > npart0) { ival -= npart0; input = 1;}
834 mctag = GetMCAnalysisUtils()->CheckOrigin(ival,GetReader(),input);
838 fMCEleNtuple->Fill(mctag,aodprimary->Pt(),aodprimary->Phi(),aodprimary->Eta(),aodprimary->Xv(),aodprimary->Yv(),aodprimary->Zv());
843 } //pure MC kine histos
847 //__________________________________________________________________
848 Int_t AliAnaElectron::GetBtag(AliAODTrack * tr )
851 //UChar_t itsmap = tr->GetITSClusterMap();
853 //DON'T KNOW HOW TO USE THIS???
854 //if (itsmap < fITSCut) return 0;
857 //Note: 02-Sep-2009, Must use GetPosition, not XYZAtDCA
858 //Bool_t gotit = tr->XYZAtDCA(x);
859 Bool_t isNotDCA = tr->GetPosition(x);
860 if(isNotDCA) { printf("##Problem getting impact parameter!\n"); return 0; }
862 //Double_t d1 = TMath::Sqrt(x[0]*x[0] + x[1]*x[1]);
863 //if (TMath::Abs(d1) > fImpactCut ) return 0;
864 //if (TMath::Abs(x[2]) > fImpactCut ) return 0;
865 //printf("----- impact parameter: x=%f, y=%f, z=%f -------\n",x[0],x[1], x[2]);
871 for (int k2 =0; k2 < GetAODCTS()->GetEntriesFast() ; k2++) {
873 AliAODTrack* track2 = (AliAODTrack*) (GetAODCTS()->At(k2));
874 int id1 = tr->GetID();
875 int id2 = track2->GetID();
876 if(id1 == id2) continue;
880 //if (track2->GetITSclusters(0) < fITSCut) continue;
883 if(track2->Pt() < fAssocPtCut) continue;
885 Double_t dphi = tr->Phi() - track2->Phi();
886 Double_t deta = tr->Eta() - track2->Eta();
887 Double_t dr = sqrt(deta*deta + dphi*dphi);
889 if(dr > fDrCut) continue;
891 Double_t sDca1 = ComputeSignDca(tr, track2, 1.0);
892 if (sDca1 > fSdcaCut) nvtx1++;
893 Double_t sDca2 = ComputeSignDca(tr, track2, 1.5);
894 if (sDca2 > fSdcaCut) nvtx2++;
895 Double_t sDca3 = ComputeSignDca(tr, track2, 1.8);
896 if (sDca3 > fSdcaCut) nvtx3++;
898 } //loop over hadrons
900 if (nvtx1>0) printf("result1 of btagging: %d \n",nvtx1);
901 if (nvtx2>0) printf("result2 of btagging: %d \n",nvtx2);
902 if (nvtx3>0) printf("result3 of btagging: %d \n",nvtx3);
905 fhBtagCut1->Fill(nvtx1,tr->Pt());
906 fhBtagCut2->Fill(nvtx2,tr->Pt());
907 fhBtagCut3->Fill(nvtx3,tr->Pt());
912 //__________________________________________________________________
913 Double_t AliAnaElectron::ComputeSignDca(AliAODTrack *tr, AliAODTrack *tr2 , float masscut)
915 //Compute the signed dca between two tracks
916 //and return the result
918 Double_t signDca=-999;
919 if(GetDebug() > 2 ) printf(">>ComputeSdca:: track1 %d, track2 %d, masscut %f \n", tr->GetLabel(), tr2->GetLabel(), masscut);
921 //=====Now calculate DCA between both tracks=======
922 Double_t massE = 0.000511;
923 Double_t massK = 0.493677;
925 Double_t bfield = 5.; //kG
926 if(!GetReader()->GetDataType()== AliCaloTrackReader::kMC) bfield = GetReader()->GetBField();
928 Double_t vertex[] = {-999.,-999.,-999.} ; //vertex
929 Double_t vertex2[] = {-999.,-999.,-999.} ; //vertex of second input AOD if exist;
930 if(GetReader()->GetDataType() != AliCaloTrackReader::kMC) {
931 GetReader()->GetVertex(vertex);
932 if(GetReader()->GetSecondInputAODTree()) GetReader()->GetSecondInputAODVertex(vertex2);
935 //HERE CHECK WHICH VERTEX
936 TVector3 pv(vertex[0],vertex[1],vertex[2]) ;
937 if(GetDebug() > 5) printf(">>ComputeSdca:: primary vertex = %2.2f,%2.2f,%2.2f \n",vertex[0],vertex[1],vertex[2]) ;
939 AliExternalTrackParam *param1 = new AliExternalTrackParam(tr);
940 AliExternalTrackParam *param2 = new AliExternalTrackParam(tr2);
942 double xplane1=0; double xplane2=0;
943 double pairdca = param1->GetDCA(param2,bfield,xplane1,xplane2);
945 Int_t id1 = 0, id2 = 0;
946 AliESDv0 bvertex(*param1,id1,*param2,id2);
948 bvertex.GetXYZ(vx,vy,vz);
952 param1->PxPyPz(emom);
953 param2->PxPyPz(hmom);
954 TVector3 emomAtB(emom[0],emom[1],emom[2]);
955 TVector3 hmomAtB(hmom[0],hmom[1],hmom[2]);
956 TVector3 secvtxpt(vx,vy,vz);
957 TVector3 decayvector(0,0,0);
958 decayvector = secvtxpt - pv; //decay vector from PrimVtx
959 Double_t decaylength = decayvector.Mag();
962 printf(">>ComputeSdca:: mom1=%f, mom2=%f \n", emomAtB.Perp(), hmomAtB.Perp() );
963 printf(">>ComputeSdca:: pairDCA=%f, length=%f \n", pairdca,decaylength );
966 if (emomAtB.Mag()>0 && pairdca < fPairDcaCut && decaylength < fDecayLenCut ) {
967 TVector3 sumMom = emomAtB+hmomAtB;
968 Double_t ener1 = sqrt(pow(emomAtB.Mag(),2) + massE*massE);
969 Double_t ener2 = sqrt(pow(hmomAtB.Mag(),2) + massK*massK);
970 Double_t ener3 = sqrt(pow(hmomAtB.Mag(),2) + massE*massE);
971 Double_t mass = sqrt(pow((ener1+ener2),2) - pow(sumMom.Mag(),2));
972 Double_t massPhot = sqrt(pow((ener1+ener3),2) - pow(sumMom.Mag(),2));
973 if (mass > masscut && massPhot > 0.1) signDca = decayvector.Dot(emomAtB)/emomAtB.Mag();
974 if(GetDebug() > 0) printf("\t>>ComputeSdca:: mass=%f \n", mass);
975 if(GetDebug() > 0) printf("\t>>ComputeSdca:: sec vtx-signdca :%f\n",signDca);
985 //__________________________________________________________________
986 Bool_t AliAnaElectron::IsItPhotonic(AliAODPWG4Particle* const part) {
987 //Check if this is a photon. Change comment!!!
988 Bool_t itIS = kFALSE;
990 Double_t massE = 0.000511;
991 Double_t bfield = 5.; //kG
992 if(!GetReader()->GetDataType()== AliCaloTrackReader::kMC) bfield = GetReader()->GetBField();
994 Int_t trackId = part->GetTrackLabel(0);
995 AliAODTrack* track = (AliAODTrack*)GetAODCTS()->At(trackId);
997 AliExternalTrackParam *param1 = new AliExternalTrackParam(track);
999 //Loop on stored AOD electrons and compute the angle differences and Minv
1000 for (int k2 =0; k2 < GetOutputAODBranch()->GetEntriesFast() ; k2++) {
1001 AliAODPWG4Particle* part2 = (AliAODPWG4Particle*) GetOutputAODBranch()->At(k2);
1002 Int_t pdg = part2->GetPdg(); //Note: Are they stored as Abs or
1004 if(pdg != AliCaloPID::kElectron) continue;
1005 if(part2->GetDetector() != fCalorimeter) continue;
1007 //propagate to common vertex and check opening angle
1008 Int_t track2Id = part2->GetTrackLabel(0);
1009 AliExternalTrackParam *param2 = new AliExternalTrackParam((AliAODTrack*)GetAODCTS()->At(track2Id));
1010 Int_t id1 = 0, id2 = 0;
1011 AliESDv0 photonVtx(*param1,id1,*param2,id2);
1013 photonVtx.GetXYZ(vx,vy,vz);
1017 param1->PxPyPz(p1mom);
1018 param2->PxPyPz(p2mom);
1020 TVector3 p1momAtB(p1mom[0],p1mom[1],p1mom[2]);
1021 TVector3 p2momAtB(p2mom[0],p2mom[1],p2mom[2]);
1022 TVector3 sumMom = p1momAtB+p2momAtB;
1024 Double_t ener1 = sqrt(pow(p1momAtB.Mag(),2) + massE*massE);
1025 Double_t ener2 = sqrt(pow(p2momAtB.Mag(),2) + massE*massE);
1026 Double_t mass = sqrt(pow((ener1+ener2),2) - pow(sumMom.Mag(),2));
1028 Double_t dphi = p1momAtB.DeltaPhi(p2momAtB);
1029 fh1OpeningAngle->Fill(dphi);
1030 fh1MinvPhoton->Fill(mass);
1033 if(GetDebug() > 0) printf("######PROBABLY A PHOTON\n");
1047 //__________________________________________________________________
1048 void AliAnaElectron::Print(const Option_t * opt) const
1050 //Print some relevant parameters set for the analysis
1055 printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
1056 AliAnaPartCorrBaseClass::Print(" ");
1058 printf("Calorimeter = %s\n", fCalorimeter.Data()) ;
1059 printf("pOverE range = %f - %f\n",fpOverEmin,fpOverEmax);
1060 printf("residual cut = %f\n",fResidualCut);
1061 printf("---Btagging\n");
1062 printf("max IP-cut (e,h) = %f\n",fImpactCut);
1063 printf("min ITS-hits = %d\n",fITSCut);
1064 printf("max dR (e,h) = %f\n",fDrCut);
1065 printf("max pairDCA = %f\n",fPairDcaCut);
1066 printf("max decaylength = %f\n",fDecayLenCut);
1067 printf("min Associated Pt = %f\n",fAssocPtCut);
1072 //________________________________________________________________________
1073 void AliAnaElectron::ReadHistograms(TList* outputList)
1075 // Needed when Terminate is executed in distributed environment
1076 // Refill analysis histograms of this class with corresponding
1077 // histograms in output list.
1079 // Histograms of this analsys are kept in the same list as other
1080 // analysis, recover the position of
1081 // the first one and then add the next
1082 Int_t index = outputList->IndexOf(outputList->FindObject(GetAddedHistogramsStringToName()+"fh1pOverE"));
1084 //Read histograms, must be in the same order as in
1085 //GetCreateOutputObject.
1086 fh1pOverE = (TH1F *) outputList->At(index);
1087 fh1dR = (TH1F *) outputList->At(index++);
1088 fh2EledEdx = (TH2F *) outputList->At(index++);
1089 fh2MatchdEdx = (TH2F *) outputList->At(index++);
1093 //__________________________________________________________________
1094 void AliAnaElectron::Terminate(TList* outputList)
1097 //Do some plots to end
1098 //Recover histograms from output histograms list, needed for
1099 //distributed analysis.
1100 //ReadHistograms(outputList);
1102 printf(" AliAnaElectron::Terminate() *** %s Report: %d outputs\n", GetName(), outputList->GetEntries()) ;