]>
Commit | Line | Data |
---|---|---|
bd092f0f | 1 | // $Id$ |
30159e6f | 2 | |
bd092f0f | 3 | #include "AliAnalysisTaskEMCALIsoPhoton.h" |
30159e6f | 4 | |
bd092f0f | 5 | #include <TCanvas.h> |
6 | #include <TChain.h> | |
7 | #include <TFile.h> | |
8 | #include <TH1F.h> | |
9 | #include <TH2F.h> | |
caaf99d3 | 10 | #include <TH3F.h> |
965c985f | 11 | #include <THnSparse.h> |
bd092f0f | 12 | #include <TLorentzVector.h> |
a62631a9 | 13 | #include <TList.h> |
bd092f0f | 14 | |
15 | #include "AliAnalysisManager.h" | |
16 | #include "AliAnalysisTask.h" | |
17 | #include "AliEMCALGeometry.h" | |
18 | #include "AliEMCALRecoUtils.h" | |
19 | #include "AliESDCaloCells.h" | |
20 | #include "AliESDCaloCluster.h" | |
30159e6f | 21 | #include "AliESDEvent.h" |
22 | #include "AliESDHeader.h" | |
30159e6f | 23 | #include "AliESDInputHandler.h" |
bd092f0f | 24 | #include "AliESDUtils.h" |
30159e6f | 25 | #include "AliESDtrack.h" |
26 | #include "AliESDtrackCuts.h" | |
2e20efe5 | 27 | #include "AliAODEvent.h" |
28 | #include "AliAODTrack.h" | |
bd092f0f | 29 | #include "AliMCEvent.h" |
30 | #include "AliMCEventHandler.h" | |
31 | #include "AliStack.h" | |
2e20efe5 | 32 | #include "AliVEvent.h" |
33 | #include "AliVTrack.h" | |
30159e6f | 34 | #include "AliV0vertexer.h" |
30159e6f | 35 | #include "AliVCluster.h" |
822c9944 | 36 | #include "AliOADBContainer.h" |
30159e6f | 37 | |
c2aad3ae | 38 | #include <iostream> |
39 | using std::cout; | |
40 | using std::endl; | |
41 | ||
30159e6f | 42 | ClassImp(AliAnalysisTaskEMCALIsoPhoton) |
43 | ||
44 | //________________________________________________________________________ | |
bd092f0f | 45 | AliAnalysisTaskEMCALIsoPhoton::AliAnalysisTaskEMCALIsoPhoton() : |
46 | AliAnalysisTaskSE(), | |
2e20efe5 | 47 | fESDClusters(0), |
48 | fAODClusters(0), | |
bd092f0f | 49 | fSelPrimTracks(0), |
3f4073ba | 50 | fTracks(0), |
2e20efe5 | 51 | fESDCells(0), |
52 | fAODCells(0), | |
bd092f0f | 53 | fPrTrCuts(0), |
54 | fGeom(0x0), | |
9148fa89 | 55 | fGeoName("EMCAL_COMPLETEV1"), |
4d4ce2d2 | 56 | fOADBContainer(0), |
9148fa89 | 57 | fPeriod("LHC11c"), |
58 | fTrigBit("kEMC7"), | |
59 | fIsTrain(0), | |
c7bb0b43 | 60 | fIsMc(0), |
ecd47673 | 61 | fDebug(0), |
f3843637 | 62 | fPathStrOpt("/"), |
9148fa89 | 63 | fExoticCut(0.97), |
64 | fIsoConeR(0.4), | |
965c985f | 65 | fNDimensions(7), |
66 | fECut(3.), | |
16a4050e | 67 | fTrackMult(0), |
f507c09b | 68 | fMcIdFamily(""), |
69 | fNClusForDirPho(0), | |
70 | fDirPhoPt(0), | |
f9e2362a | 71 | fHigherPtCone(0), |
26a8db0f | 72 | fImportGeometryFromFile(0), |
73 | fImportGeometryFilePath(""), | |
2b7205ad | 74 | fMaxPtTrack(0), |
75 | fMaxEClus(0), | |
112eb594 | 76 | fNCells50(0), |
48aab590 | 77 | fFilterBit(0), |
98a8397b | 78 | fSelHybrid(kFALSE), |
fe617021 | 79 | fFillQA(kFALSE), |
ed39f27f | 80 | fClusIdFromTracks(""), |
1c764315 | 81 | fCpvFromTrack(kFALSE), |
bd092f0f | 82 | fESD(0), |
2e20efe5 | 83 | fAOD(0), |
85b52a52 | 84 | fVEvent(0), |
c7bb0b43 | 85 | fMCEvent(0), |
86 | fStack(0), | |
bd092f0f | 87 | fOutputList(0), |
88 | fEvtSel(0), | |
0b21f686 | 89 | fNClusEt10(0), |
cc57d293 | 90 | fRecoPV(0), |
f507c09b | 91 | fPVtxZ(0), |
92 | fTrMultDist(0), | |
caaf99d3 | 93 | fMCDirPhotonPtEtaPhi(0), |
e53ab710 | 94 | fMCIsoDirPhotonPtEtaPhi(0), |
c7bb0b43 | 95 | fDecayPhotonPtMC(0), |
bd092f0f | 96 | fCellAbsIdVsAmpl(0), |
16a4050e | 97 | fNClusHighClusE(0), |
f9e2362a | 98 | fHigherPtConeM02(0), |
f507c09b | 99 | fClusEtMcPt(0), |
100 | fClusMcDetaDphi(0), | |
101 | fNClusPerPho(0), | |
f912f9a9 | 102 | fMcPtInConeBG(0), |
103 | fMcPtInConeSBG(0), | |
104 | fMcPtInConeBGnoUE(0), | |
105 | fMcPtInConeSBGnoUE(0), | |
81f2660f | 106 | fAllIsoEtMcGamma(0), |
107 | fAllIsoNoUeEtMcGamma(0), | |
092ceec8 | 108 | fMCDirPhotonPtEtaPhiNoClus(0), |
2b7205ad | 109 | fHnOutput(0), |
110 | fQAList(0), | |
111 | fNTracks(0), | |
112 | fEmcNCells(0), | |
113 | fEmcNClus(0), | |
114 | fEmcNClusCut(0), | |
115 | fNTracksECut(0), | |
116 | fEmcNCellsCut(0), | |
ed39f27f | 117 | fEmcClusETM1(0), |
118 | fEmcClusETM2(0), | |
e4ba80ad | 119 | fEmcClusEPhi(0), |
120 | fEmcClusEPhiCut(0), | |
121 | fEmcClusEEta(0), | |
122 | fEmcClusEEtaCut(0), | |
123 | fTrackPtPhi(0), | |
124 | fTrackPtPhiCut(0), | |
125 | fTrackPtEta(0), | |
3ae97198 | 126 | fTrackPtEtaCut(0), |
127 | fMaxCellEPhi(0) | |
bd092f0f | 128 | { |
129 | // Default constructor. | |
26a8db0f | 130 | for(Int_t i = 0; i < 12; i++) fGeomMatrix[i] = 0; |
bd092f0f | 131 | } |
132 | ||
133 | //________________________________________________________________________ | |
134 | AliAnalysisTaskEMCALIsoPhoton::AliAnalysisTaskEMCALIsoPhoton(const char *name) : | |
135 | AliAnalysisTaskSE(name), | |
2e20efe5 | 136 | fESDClusters(0), |
137 | fAODClusters(0), | |
30159e6f | 138 | fSelPrimTracks(0), |
3f4073ba | 139 | fTracks(0), |
2e20efe5 | 140 | fESDCells(0), |
141 | fAODCells(0), | |
30159e6f | 142 | fPrTrCuts(0), |
143 | fGeom(0x0), | |
144 | fGeoName("EMCAL_COMPLETEV1"), | |
4d4ce2d2 | 145 | fOADBContainer(0), |
30159e6f | 146 | fPeriod("LHC11c"), |
751194e8 | 147 | fTrigBit("kEMC7"), |
30159e6f | 148 | fIsTrain(0), |
c7bb0b43 | 149 | fIsMc(0), |
ecd47673 | 150 | fDebug(0), |
f3843637 | 151 | fPathStrOpt("/"), |
30159e6f | 152 | fExoticCut(0.97), |
153 | fIsoConeR(0.4), | |
965c985f | 154 | fNDimensions(7), |
155 | fECut(3.), | |
16a4050e | 156 | fTrackMult(0), |
f507c09b | 157 | fMcIdFamily(""), |
158 | fNClusForDirPho(0), | |
159 | fDirPhoPt(0), | |
f9e2362a | 160 | fHigherPtCone(0), |
26a8db0f | 161 | fImportGeometryFromFile(0), |
162 | fImportGeometryFilePath(""), | |
2b7205ad | 163 | fMaxPtTrack(0), |
164 | fMaxEClus(0), | |
112eb594 | 165 | fNCells50(0), |
48aab590 | 166 | fFilterBit(0), |
98a8397b | 167 | fSelHybrid(kFALSE), |
fe617021 | 168 | fFillQA(kFALSE), |
ed39f27f | 169 | fClusIdFromTracks(""), |
1c764315 | 170 | fCpvFromTrack(kFALSE), |
30159e6f | 171 | fESD(0), |
2e20efe5 | 172 | fAOD(0), |
85b52a52 | 173 | fVEvent(0), |
c7bb0b43 | 174 | fMCEvent(0), |
175 | fStack(0), | |
30159e6f | 176 | fOutputList(0), |
30159e6f | 177 | fEvtSel(0), |
0b21f686 | 178 | fNClusEt10(0), |
cc57d293 | 179 | fRecoPV(0), |
bd092f0f | 180 | fPVtxZ(0), |
f507c09b | 181 | fTrMultDist(0), |
caaf99d3 | 182 | fMCDirPhotonPtEtaPhi(0), |
e53ab710 | 183 | fMCIsoDirPhotonPtEtaPhi(0), |
c7bb0b43 | 184 | fDecayPhotonPtMC(0), |
185 | fCellAbsIdVsAmpl(0), | |
bd092f0f | 186 | fNClusHighClusE(0), |
f9e2362a | 187 | fHigherPtConeM02(0), |
f507c09b | 188 | fClusEtMcPt(0), |
189 | fClusMcDetaDphi(0), | |
190 | fNClusPerPho(0), | |
f912f9a9 | 191 | fMcPtInConeBG(0), |
192 | fMcPtInConeSBG(0), | |
193 | fMcPtInConeBGnoUE(0), | |
194 | fMcPtInConeSBGnoUE(0), | |
81f2660f | 195 | fAllIsoEtMcGamma(0), |
196 | fAllIsoNoUeEtMcGamma(0), | |
092ceec8 | 197 | fMCDirPhotonPtEtaPhiNoClus(0), |
2b7205ad | 198 | fHnOutput(0), |
199 | fQAList(0), | |
200 | fNTracks(0), | |
201 | fEmcNCells(0), | |
202 | fEmcNClus(0), | |
203 | fEmcNClusCut(0), | |
204 | fNTracksECut(0), | |
205 | fEmcNCellsCut(0), | |
ed39f27f | 206 | fEmcClusETM1(0), |
207 | fEmcClusETM2(0), | |
e4ba80ad | 208 | fEmcClusEPhi(0), |
209 | fEmcClusEPhiCut(0), | |
210 | fEmcClusEEta(0), | |
211 | fEmcClusEEtaCut(0), | |
212 | fTrackPtPhi(0), | |
213 | fTrackPtPhiCut(0), | |
214 | fTrackPtEta(0), | |
3ae97198 | 215 | fTrackPtEtaCut(0), |
216 | fMaxCellEPhi(0) | |
30159e6f | 217 | { |
218 | // Constructor | |
219 | ||
220 | // Define input and output slots here | |
221 | // Input slot #0 works with a TChain | |
222 | DefineInput(0, TChain::Class()); | |
223 | // Output slot #0 id reserved by the base class for AOD | |
224 | // Output slot #1 writes into a TH1 container | |
225 | DefineOutput(1, TList::Class()); | |
2b7205ad | 226 | DefineOutput(2, TList::Class()); |
30159e6f | 227 | } |
bd092f0f | 228 | |
30159e6f | 229 | //________________________________________________________________________ |
230 | void AliAnalysisTaskEMCALIsoPhoton::UserCreateOutputObjects() | |
231 | { | |
bd092f0f | 232 | // Create histograms, called once. |
30159e6f | 233 | |
2e20efe5 | 234 | fESDClusters = new TObjArray(); |
30159e6f | 235 | fSelPrimTracks = new TObjArray(); |
236 | ||
237 | ||
238 | fOutputList = new TList(); | |
a62631a9 | 239 | fOutputList->SetOwner();// Container cleans up all histos (avoids leaks in merging) |
30159e6f | 240 | |
f507c09b | 241 | fGeom = AliEMCALGeometry::GetInstance(fGeoName.Data()); |
4d4ce2d2 | 242 | fOADBContainer = new AliOADBContainer("AliEMCALgeo"); |
243 | fOADBContainer->InitFromFile(Form("$ALICE_ROOT/OADB/EMCAL/EMCALlocal2master.root"),"AliEMCALgeo"); | |
244 | ||
30159e6f | 245 | fEvtSel = new TH1F("hEvtSel","Event selection counter (0=all trg, 1=pvz cut) ;evt cut ;dN/dcut}",2,0,2); |
246 | fOutputList->Add(fEvtSel); | |
0b21f686 | 247 | |
248 | fNClusEt10 = new TH1F("hNClusEt10","# of cluster with E_{T}>10 per event;E;",101,-0.5,100.5); | |
249 | fOutputList->Add(fNClusEt10); | |
30159e6f | 250 | |
cc57d293 | 251 | fRecoPV = new TH1F("hRecoPV","Prim. vert. reconstruction (yes or no);reco (0=no, 1=yes) ;",2,-0.5,1.5); |
252 | fOutputList->Add(fRecoPV); | |
253 | ||
30159e6f | 254 | fPVtxZ = new TH1F("hPVtxZ","primary vertex Z before cut;prim-vz(cm) ;",200,-100,100); |
255 | fOutputList->Add(fPVtxZ); | |
c7bb0b43 | 256 | |
f507c09b | 257 | fTrMultDist = new TH1F("fTrMultDist","track multiplicity;tracks/event;#events",200,0.5,200.5); |
258 | fOutputList->Add(fTrMultDist); | |
259 | ||
12fbd6e8 | 260 | fMCDirPhotonPtEtaPhi = new TH3F("hMCDirPhotonPtEtaPhi","photon (gq->#gammaq) p_{T}, #eta, #phi;GeV/c;#eta;#phi",100,-0.5,99.5,154,-0.77,0.77,130,1.38,3.20); |
caaf99d3 | 261 | fMCDirPhotonPtEtaPhi->Sumw2(); |
262 | fOutputList->Add(fMCDirPhotonPtEtaPhi); | |
c7bb0b43 | 263 | |
12fbd6e8 | 264 | fMCIsoDirPhotonPtEtaPhi = new TH3F("hMCIsoDirPhotonPtEtaPhi","photon (gq->#gammaq, isolated@MC) p_{T}, #eta, #phi;GeV/c;#eta;#phi",100,-0.5,99.5,154,-0.77,0.77,130,1.38,3.20); |
e53ab710 | 265 | fMCIsoDirPhotonPtEtaPhi->Sumw2(); |
266 | fOutputList->Add(fMCIsoDirPhotonPtEtaPhi); | |
267 | ||
c7bb0b43 | 268 | fDecayPhotonPtMC = new TH1F("hDecayPhotonPtMC","decay photon p_{T};GeV/c;dN/dp_{T} (c GeV^{-1})",1000,0,100); |
269 | fDecayPhotonPtMC->Sumw2(); | |
270 | fOutputList->Add(fDecayPhotonPtMC); | |
271 | ||
30159e6f | 272 | fCellAbsIdVsAmpl = new TH2F("hCellAbsIdVsAmpl","cell abs id vs cell amplitude (energy);E (GeV);ID",200,0,100,24*48*10,-0.5,24*48*10-0.5); |
a62631a9 | 273 | fOutputList->Add(fCellAbsIdVsAmpl); |
30159e6f | 274 | |
275 | fNClusHighClusE = new TH2F("hNClusHighClusE","total number of clusters vs. highest clus energy in the event;E (GeV);NClus",200,0,100,301,-0.5,300.5); | |
276 | fOutputList->Add(fNClusHighClusE); | |
277 | ||
f9e2362a | 278 | fHigherPtConeM02 = new TH2F("hHigherPtConeM02","#lambda_{0}^{2} vs. in-cone-p_{T}^{max};p_{T}^{max} (GeV/c, in the cone);#lambda_{0}^{2}",1000,0,100,400,0,4); |
279 | fOutputList->Add(fHigherPtConeM02); | |
280 | ||
f507c09b | 281 | fClusEtMcPt = new TH2F("hClusEtMcPt","E_{T}^{clus} vs. p_{T}^{mc}; p_{T}^{mc};E_{T}^{clus}",500,0,100,500,0,100); |
282 | fOutputList->Add(fClusEtMcPt); | |
283 | ||
284 | fClusMcDetaDphi = new TH2F("hClusMcDetaDphi","#Delta#phi vs. #Delta#eta (reco-mc);#Delta#eta;#Delta#phi",100,-.7,.7,100,-.7,.7); | |
285 | fOutputList->Add(fClusMcDetaDphi); | |
286 | ||
287 | fNClusPerPho = new TH2F("hNClusPerPho","Number of clusters per prompt photon;p_{T}^{MC};N_{clus}",500,0,100,11,-0.5,10.5); | |
288 | fOutputList->Add(fNClusPerPho); | |
289 | ||
d4f449df | 290 | fMcPtInConeBG = new TH2F("hMcPtInConeBG","#sum_{in-cone}p_{T}^{mc-primaries} vs. ISO^{TRK+EMC} (BG template);ISO^{TRK+EMC} (GeV);#sum_{in-cone}p_{T}^{mc-primaries}",600,-10,50,1000,0,100); |
f912f9a9 | 291 | fOutputList->Add(fMcPtInConeBG); |
292 | ||
d4f449df | 293 | fMcPtInConeSBG = new TH2F("hMcPtInConeSBG","#sum_{in-cone}p_{T}^{mc-primaries} vs. ISO^{TRK+EMC} (SBG range);ISO^{TRK+EMC} (GeV);#sum_{in-cone}p_{T}^{mc-primaries}",600,-10,50,1000,0,100); |
f912f9a9 | 294 | fOutputList->Add(fMcPtInConeSBG); |
295 | ||
d4f449df | 296 | fMcPtInConeBGnoUE = new TH2F("hMcPtInConeBGnoUE","#sum_{in-cone}p_{T}^{mc-primaries} vs. ISO^{TRK+EMC} (BG template);ISO^{TRK+EMC} (GeV);#sum_{in-cone}p_{T}^{mc-primaries}",600,-10,50,1000,0,100); |
f912f9a9 | 297 | fOutputList->Add(fMcPtInConeBGnoUE); |
298 | ||
d4f449df | 299 | fMcPtInConeSBGnoUE = new TH2F("hMcPtInConeSBGnoUE","#sum_{in-cone}p_{T}^{mc-primaries} vs. ISO^{TRK+EMC} (SBG range);ISO^{TRK+EMC} (GeV);#sum_{in-cone}p_{T}^{mc-primaries}",600,-10,50,1000,0,100); |
f912f9a9 | 300 | fOutputList->Add(fMcPtInConeSBGnoUE); |
301 | ||
81f2660f | 302 | fAllIsoEtMcGamma = new TH2F("hAllIsoEtMcGammaE","ISO^{TRK+EMC} vs. E_{T}^{clus} for clusters comming from a MC prompt #gamma; E_{T}^{clus} (GeV);ISO^{TRK+EMC} (GeV);",1000,0,100,600,-10,50); |
303 | fOutputList->Add(fAllIsoEtMcGamma); | |
304 | ||
305 | fAllIsoNoUeEtMcGamma = new TH2F("hAllIsoNoUeEtMcGammaE","ISO^{TRK+EMC}_{noue} vs. E_{T}^{clus} for clusters comming from a MC prompt #gamma; E_{T}^{clus} (GeV);ISO^{TRK+EMC}_{noue} (GeV);",1000,0,100,600,-10,50); | |
306 | fOutputList->Add(fAllIsoNoUeEtMcGamma); | |
307 | ||
f912f9a9 | 308 | |
092ceec8 | 309 | fMCDirPhotonPtEtaPhiNoClus = new TH3F("hMCDirPhotonPhiEtaNoClus","p_{T}, #eta and #phi of prompt photons with no reco clusters;p_{T};#eta;#phi",1000,0,100,154,-0.77,0.77,130,1.38,3.20); |
310 | fOutputList->Add(fMCDirPhotonPtEtaPhiNoClus); | |
f507c09b | 311 | |
84898d7b | 312 | Int_t nEt=1000, nM02=400, nCeIso=1000, nTrIso=1000, nAllIso=1000, nCeIsoNoUE=1000, nAllIsoNoUE=1000, nTrClDphi=200, nTrClDeta=100, nClEta=140, nClPhi=128, nTime=60, nMult=100, nPhoMcPt=100; |
f507c09b | 313 | Int_t bins[] = {nEt, nM02, nCeIso, nTrIso, nAllIso, nCeIsoNoUE, nAllIsoNoUE, nTrClDphi, nTrClDeta,nClEta,nClPhi,nTime,nMult,nPhoMcPt}; |
c1f18270 | 314 | fNDimensions = sizeof(bins)/sizeof(Int_t); |
315 | const Int_t ndims = fNDimensions; | |
84898d7b | 316 | Double_t xmin[] = { -0.5, 0., -10., -10., -10., -10., -10., -0.1,-0.05, -0.7, 1.4,-0.15e-06,-0.5,-0.5}; |
317 | Double_t xmax[] = { 99.5, 4., 190., 190., 190., 190., 190., 0.1, 0.05, 0.7, 3.192, 0.15e-06,99.5,99.5}; | |
80c98845 | 318 | if(fPeriod.Contains("11h")){ |
319 | xmax[12]=3999.5; | |
320 | } | |
f507c09b | 321 | fHnOutput = new THnSparseF("fHnOutput","Output matrix: E_{T},M02,CeIso,TrIso,AllIso, CeIsoNoUESub, AllIsoNoUESub, d#phi_{trk},d#eta_{trk},#eta_{clus},#phi_{clus},T_{max},mult,mc-p_{T}^{#gamma}", ndims, bins, xmin, xmax); |
965c985f | 322 | fOutputList->Add(fHnOutput); |
323 | ||
2b7205ad | 324 | //QA outputs |
325 | fQAList = new TList(); | |
326 | fQAList->SetOwner();// Container cleans up all histos (avoids leaks in merging) | |
965c985f | 327 | |
2b7205ad | 328 | fNTracks = new TH1F("hNTracks","# of selected tracks;n-tracks;counts",120,-0.5,119.5); |
329 | fNTracks->Sumw2(); | |
330 | fQAList->Add(fNTracks); | |
331 | ||
332 | fEmcNCells = new TH1F("fEmcNCells",";n/event;count",120,-0.5,119.5); | |
333 | fEmcNCells->Sumw2(); | |
334 | fQAList->Add(fEmcNCells); | |
335 | fEmcNClus = new TH1F("fEmcNClus",";n/event;count",120,-0.5,119.5); | |
336 | fEmcNClus->Sumw2(); | |
337 | fQAList->Add(fEmcNClus); | |
338 | fEmcNClusCut = new TH1F("fEmcNClusCut",";n/event;count",120,-0.5,119.5); | |
339 | fEmcNClusCut->Sumw2(); | |
340 | fQAList->Add(fEmcNClusCut); | |
341 | fNTracksECut = new TH1F("fNTracksECut",";n/event;count",120,-0.5,119.5); | |
342 | fNTracksECut->Sumw2(); | |
343 | fQAList->Add(fNTracksECut); | |
344 | fEmcNCellsCut = new TH1F("fEmcNCellsCut",";n/event;count",120,-0.5,119.5); | |
345 | fEmcNCellsCut->Sumw2(); | |
346 | fQAList->Add(fEmcNCellsCut); | |
ed39f27f | 347 | fEmcClusETM1 = new TH1F("fEmcClusETM1","(method clus->GetTrackDx,z);GeV;counts",100,-0.25,49.75); |
348 | fEmcClusETM1->Sumw2(); | |
349 | fQAList->Add(fEmcClusETM1); | |
350 | fEmcClusETM2 = new TH1F("fEmcClusETM2","(method track->GetEMCALcluster());GeV;counts",100,-0.25,49.75); | |
351 | fEmcClusETM2->Sumw2(); | |
352 | fQAList->Add(fEmcClusETM2); | |
e4ba80ad | 353 | fEmcClusEPhi = new TH2F("fEmcClusEPhi",";GeV;#phi",100,-0.25,49.75,63,0,6.3); |
354 | fEmcClusEPhi->Sumw2(); | |
355 | fQAList->Add(fEmcClusEPhi); | |
356 | fEmcClusEPhiCut = new TH2F("fEmcClusEPhiCut",";GeV;#phi",100,-0.25,49.75,63,0,6.3); | |
357 | fEmcClusEPhiCut->Sumw2(); | |
358 | fQAList->Add(fEmcClusEPhiCut); | |
359 | fEmcClusEEta = new TH2F("fEmcClusEEta",";GeV;#eta",100,-0.25,49.75,19,-0.9,0.9); | |
360 | fEmcClusEEta->Sumw2(); | |
361 | fQAList->Add(fEmcClusEEta); | |
362 | fEmcClusEEtaCut = new TH2F("fEmcClusEEtaCut",";GeV;#eta",100,-0.25,49.75,18,-0.9,0.9); | |
363 | fEmcClusEEtaCut->Sumw2(); | |
364 | fQAList->Add(fEmcClusEEtaCut); | |
365 | fTrackPtPhi = new TH2F("fTrackPtPhi",";p_{T} [GeV/c];#phi",100,-0.25,49.75,63,0,6.3); | |
366 | fTrackPtPhi->Sumw2(); | |
367 | fQAList->Add(fTrackPtPhi); | |
368 | fTrackPtPhiCut = new TH2F("fTrackPtPhiCut",";p_{T} [GeV/c];#phi",100,-0.25,49.75,63,0,6.3); | |
369 | fTrackPtPhiCut->Sumw2(); | |
370 | fQAList->Add(fTrackPtPhiCut); | |
371 | fTrackPtEta = new TH2F("fTrackPtEta",";p_{T} [GeV/c];#eta",100,-0.25,49.75,18,-0.9,0.9); | |
372 | fTrackPtEta->Sumw2(); | |
373 | fQAList->Add(fTrackPtEta); | |
374 | fTrackPtEtaCut = new TH2F("fTrackPtEtaCut",";p_{T} [GeV/c];#eta",100,-0.25,49.75,18,-0.9,0.9); | |
375 | fTrackPtEtaCut->Sumw2(); | |
376 | fQAList->Add(fTrackPtEtaCut); | |
965c985f | 377 | |
3ae97198 | 378 | |
379 | fMaxCellEPhi = new TH2F("fMaxCellEPhi","Most energetic cell in event; GeV;#phi",100,-0.25,49.75,63,0,6.3); | |
380 | fMaxCellEPhi->Sumw2(); | |
381 | fQAList->Add(fMaxCellEPhi); | |
382 | ||
30159e6f | 383 | PostData(1, fOutputList); |
2b7205ad | 384 | PostData(2, fQAList); |
30159e6f | 385 | } |
386 | ||
387 | //________________________________________________________________________ | |
388 | void AliAnalysisTaskEMCALIsoPhoton::UserExec(Option_t *) | |
389 | { | |
bd092f0f | 390 | // Main loop, called for each event. |
2e20efe5 | 391 | fESDClusters = 0; |
392 | fESDCells = 0; | |
393 | fAODClusters = 0; | |
394 | fAODCells = 0; | |
bd092f0f | 395 | // event trigger selection |
30159e6f | 396 | Bool_t isSelected = 0; |
751194e8 | 397 | if(fPeriod.Contains("11a")){ |
398 | if(fTrigBit.Contains("kEMC")) | |
399 | isSelected = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & AliVEvent::kEMC1); | |
400 | else | |
401 | isSelected = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & AliVEvent::kMB); | |
402 | } | |
403 | else{ | |
404 | if(fTrigBit.Contains("kEMC")) | |
405 | isSelected = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & AliVEvent::kEMC7); | |
406 | else | |
f507c09b | 407 | if(fTrigBit.Contains("kMB")) |
408 | isSelected = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & AliVEvent::kMB); | |
409 | else | |
410 | isSelected = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & AliVEvent::kINT7); | |
751194e8 | 411 | } |
80c98845 | 412 | if(fPeriod.Contains("11h")){ |
413 | if(fTrigBit.Contains("kAny")) | |
414 | isSelected = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & AliVEvent::kAny); | |
415 | if(fTrigBit.Contains("kAnyINT")) | |
416 | isSelected = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & AliVEvent::kAnyINT); | |
417 | } | |
c7bb0b43 | 418 | if(fIsMc) |
419 | isSelected = kTRUE; | |
ecd47673 | 420 | if(fDebug) |
421 | printf("isSelected = %d, fIsMC=%d\n", isSelected, fIsMc); | |
30159e6f | 422 | if(!isSelected ) |
423 | return; | |
f3843637 | 424 | if(fIsMc){ |
425 | TTree *tree = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->GetTree(); | |
426 | TFile *file = (TFile*)tree->GetCurrentFile(); | |
427 | TString filename = file->GetName(); | |
428 | if(!filename.Contains(fPathStrOpt.Data())) | |
429 | return; | |
430 | } | |
85b52a52 | 431 | fVEvent = (AliVEvent*)InputEvent(); |
432 | if (!fVEvent) { | |
2e20efe5 | 433 | printf("ERROR: event not available\n"); |
30159e6f | 434 | return; |
435 | } | |
822c9944 | 436 | Int_t runnumber = InputEvent()->GetRunNumber() ; |
7a7744db | 437 | if(fDebug) |
438 | printf("run number = %d\n",runnumber); | |
439 | ||
85b52a52 | 440 | fESD = dynamic_cast<AliESDEvent*>(fVEvent); |
7a7744db | 441 | if(!fESD){ |
85b52a52 | 442 | fAOD = dynamic_cast<AliAODEvent*>(fVEvent); |
7a7744db | 443 | if(!fAOD){ |
444 | printf("ERROR: Invalid type of event!!!\n"); | |
445 | return; | |
446 | } | |
447 | else if(fDebug) | |
448 | printf("AOD EVENT!\n"); | |
449 | } | |
30159e6f | 450 | |
451 | fEvtSel->Fill(0); | |
ecd47673 | 452 | if(fDebug) |
26a8db0f | 453 | printf("event is ok,\n run number=%d\n",runnumber); |
454 | ||
30159e6f | 455 | |
85b52a52 | 456 | AliVVertex *pv = (AliVVertex*)fVEvent->GetPrimaryVertex(); |
2e20efe5 | 457 | Bool_t pvStatus = kTRUE; |
458 | if(fESD){ | |
459 | AliESDVertex *esdv = (AliESDVertex*)fESD->GetPrimaryVertex(); | |
460 | pvStatus = esdv->GetStatus(); | |
461 | } | |
d1582697 | 462 | if(!pv) |
30159e6f | 463 | return; |
2e20efe5 | 464 | if(!pvStatus) |
d1582697 | 465 | fRecoPV->Fill(0); |
cc57d293 | 466 | else |
467 | fRecoPV->Fill(1); | |
30159e6f | 468 | fPVtxZ->Fill(pv->GetZ()); |
469 | if(TMath::Abs(pv->GetZ())>15) | |
470 | return; | |
ecd47673 | 471 | if(fDebug) |
472 | printf("passed vertex cut\n"); | |
30159e6f | 473 | |
474 | fEvtSel->Fill(1); | |
2e20efe5 | 475 | if(fESD) |
476 | fTracks = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject("Tracks")); | |
477 | if(fAOD) | |
478 | fTracks = dynamic_cast<TClonesArray*>(fAOD->GetTracks()); | |
bd092f0f | 479 | |
06a28959 | 480 | if(!fTracks){ |
481 | AliError("Track array in event is NULL!"); | |
2e20efe5 | 482 | if(fDebug) |
483 | printf("returning due to not finding tracks!\n"); | |
06a28959 | 484 | return; |
485 | } | |
30159e6f | 486 | // Track loop to fill a pT spectrum |
3f4073ba | 487 | const Int_t Ntracks = fTracks->GetEntriesFast(); |
488 | for (Int_t iTracks = 0; iTracks < Ntracks; ++iTracks) { | |
489 | // for (Int_t iTracks = 0; iTracks < fESD->GetNumberOfTracks(); iTracks++) { | |
490 | //AliESDtrack* track = (AliESDtrack*)fESD->GetTrack(iTracks); | |
2e20efe5 | 491 | AliVTrack *track = (AliVTrack*)fTracks->At(iTracks); |
30159e6f | 492 | if (!track) |
493 | continue; | |
2e20efe5 | 494 | AliAODTrack *aodTrack = dynamic_cast<AliAODTrack*>(track); |
495 | AliESDtrack *esdTrack = dynamic_cast<AliESDtrack*>(track); | |
ed39f27f | 496 | if(esdTrack){ |
497 | if(esdTrack->GetEMCALcluster()>0) | |
498 | fClusIdFromTracks.Append(Form("%d ",esdTrack->GetEMCALcluster())); | |
499 | if (fPrTrCuts && fPrTrCuts->IsSelected(track)){ | |
500 | fSelPrimTracks->Add(track); | |
501 | } | |
30159e6f | 502 | } |
2b7205ad | 503 | else if(aodTrack){ |
98a8397b | 504 | if (fSelHybrid && !aodTrack->IsHybridGlobalConstrainedGlobal()) |
dcd3dca1 | 505 | continue ; |
98a8397b | 506 | if(!fSelHybrid && !aodTrack->TestFilterBit(fFilterBit)) |
507 | continue; | |
2e20efe5 | 508 | fSelPrimTracks->Add(track); |
2b7205ad | 509 | /*if(fTrackMaxPt<track->Pt()) |
510 | fTrackMaxPt = track->Pt();*/ | |
511 | } | |
bd092f0f | 512 | } |
513 | ||
4d4ce2d2 | 514 | TObjArray *matEMCAL=(TObjArray*)fOADBContainer->GetObject(runnumber,"EmcalMatrices"); |
822c9944 | 515 | for(Int_t mod=0; mod < (fGeom->GetEMCGeometry())->GetNumberOfSuperModules(); mod++){ |
516 | if(fGeoName=="EMCAL_FIRSTYEARV1" && mod>3) | |
517 | break; | |
518 | /*if(fESD) | |
519 | fGeom->SetMisalMatrix(fESD->GetEMCALMatrix(mod), mod); | |
520 | else*/ | |
85b52a52 | 521 | // if(fVEvent->GetEMCALMatrix(mod)) |
822c9944 | 522 | fGeomMatrix[mod] = (TGeoHMatrix*) matEMCAL->At(mod); |
523 | fGeom->SetMisalMatrix(fGeomMatrix[mod] , mod); | |
30159e6f | 524 | } |
4d4ce2d2 | 525 | |
2e20efe5 | 526 | if(fESD){ |
527 | AliESDtrackCuts *fTrackCuts = new AliESDtrackCuts(); | |
528 | fTrackMult = fTrackCuts->GetReferenceMultiplicity(fESD);//kTrackletsITSTPC ,0.5); | |
529 | if(fDebug) | |
530 | printf("ESD Track mult= %d\n",fTrackMult); | |
531 | } | |
532 | else if(fAOD){ | |
533 | fTrackMult = Ntracks; | |
534 | if(fDebug) | |
535 | printf("AOD Track mult= %d\n",fTrackMult); | |
536 | } | |
f507c09b | 537 | fTrMultDist->Fill(fTrackMult); |
16a4050e | 538 | |
2e20efe5 | 539 | if(fESD){ |
540 | TList *l = fESD->GetList(); | |
541 | fESDClusters = dynamic_cast<TClonesArray*>(l->FindObject("CaloClusters")); | |
542 | fESDCells = fESD->GetEMCALCells(); | |
543 | if(fDebug) | |
544 | printf("ESD cluster mult= %d\n",fESDClusters->GetEntriesFast()); | |
545 | } | |
546 | else if(fAOD){ | |
547 | fAODClusters = dynamic_cast<TClonesArray*>(fAOD->GetCaloClusters()); | |
548 | fAODCells = fAOD->GetEMCALCells(); | |
549 | if(fDebug) | |
550 | printf("AOD cluster mult= %d\n",fAODClusters->GetEntriesFast()); | |
551 | } | |
30159e6f | 552 | |
c7bb0b43 | 553 | |
554 | fMCEvent = MCEvent(); | |
ecd47673 | 555 | if(fMCEvent){ |
556 | if(fDebug) | |
ec9ab86b | 557 | std::cout<<"MCevent exists\n"; |
c7bb0b43 | 558 | fStack = (AliStack*)fMCEvent->Stack(); |
ecd47673 | 559 | } |
560 | else{ | |
561 | if(fDebug) | |
ec9ab86b | 562 | std::cout<<"ERROR: NO MC EVENT!!!!!!\n"; |
ecd47673 | 563 | } |
112eb594 | 564 | LoopOnCells(); |
f507c09b | 565 | FollowGamma(); |
566 | if(fDebug) | |
567 | printf("passed calling of FollowGamma\n"); | |
568 | FillClusHists(); | |
569 | if(fDebug) | |
570 | printf("passed calling of FillClusHists\n"); | |
63e40cb8 | 571 | FillMcHists(); |
ecd47673 | 572 | if(fDebug) |
573 | printf("passed calling of FillMcHists\n"); | |
fe617021 | 574 | if(fFillQA) |
ab031886 | 575 | FillQA(); |
2b7205ad | 576 | if(fDebug) |
577 | printf("passed calling of FillQA\n"); | |
2e20efe5 | 578 | /*if(fESD) |
579 | fESDClusters->Clear();*/ | |
f507c09b | 580 | fSelPrimTracks->Clear(); |
581 | fNClusForDirPho = 0; | |
112eb594 | 582 | fNCells50 = 0; |
ed39f27f | 583 | fClusIdFromTracks = ""; |
c7bb0b43 | 584 | |
30159e6f | 585 | PostData(1, fOutputList); |
2b7205ad | 586 | PostData(2, fQAList); |
30159e6f | 587 | } |
bd092f0f | 588 | |
30159e6f | 589 | //________________________________________________________________________ |
590 | void AliAnalysisTaskEMCALIsoPhoton::FillClusHists() | |
591 | { | |
2e20efe5 | 592 | if(fDebug) |
593 | printf("Inside FillClusHists()....\n"); | |
bd092f0f | 594 | // Fill cluster histograms. |
2e20efe5 | 595 | TObjArray *clusters = fESDClusters; |
bd092f0f | 596 | |
2e20efe5 | 597 | if (!clusters){ |
598 | clusters = fAODClusters; | |
599 | if(fDebug) | |
600 | printf("ESD clusters empty..."); | |
601 | } | |
602 | if (!clusters){ | |
603 | if(fDebug) | |
604 | printf(" and AOD clusters as well!!!\n"); | |
30159e6f | 605 | return; |
2e20efe5 | 606 | } |
607 | if(fDebug) | |
608 | printf("\n"); | |
609 | ||
610 | const Int_t nclus = clusters->GetEntries(); | |
30159e6f | 611 | if(nclus==0) |
612 | return; | |
ecd47673 | 613 | if(fDebug) |
614 | printf("Inside FillClusHists and there are %d clusters\n",nclus); | |
e681d9ce | 615 | Double_t maxE = 0; |
0b21f686 | 616 | Int_t nclus10 = 0; |
f507c09b | 617 | Double_t ptmc=-1; |
30159e6f | 618 | for(Int_t ic=0;ic<nclus;ic++){ |
619 | maxE=0; | |
2e20efe5 | 620 | AliVCluster *c = static_cast<AliVCluster*>(clusters->At(ic)); |
30159e6f | 621 | if(!c) |
622 | continue; | |
623 | if(!c->IsEMCAL()) | |
624 | continue; | |
965c985f | 625 | if(c->E()<fECut) |
626 | continue; | |
1c764315 | 627 | if(fCpvFromTrack && fClusIdFromTracks.Contains(Form("%d",ic))) |
628 | continue; | |
30159e6f | 629 | Short_t id; |
630 | Double_t Emax = GetMaxCellEnergy( c, id); | |
631 | Double_t Ecross = GetCrossEnergy( c, id); | |
632 | if((1-Ecross/Emax)>fExoticCut) | |
633 | continue; | |
634 | Float_t clsPos[3] = {0,0,0}; | |
635 | c->GetPosition(clsPos); | |
636 | TVector3 clsVec(clsPos); | |
3dc2825e | 637 | Double_t Et = c->E()*TMath::Sin(clsVec.Theta()); |
f507c09b | 638 | if(fDebug) |
639 | printf("\tcluster eta=%1.1f,phi=%1.1f,E=%1.1f\n",clsVec.Eta(),clsVec.Phi(),c->E()); | |
0b21f686 | 640 | if(Et>10) |
641 | nclus10++; | |
30159e6f | 642 | Float_t ceiso, cephiband, cecore; |
643 | Float_t triso, trphiband, trcore; | |
644 | Float_t alliso, allphiband, allcore; | |
645 | Float_t phibandArea = (1.4 - 2*fIsoConeR)*2*fIsoConeR; | |
646 | Float_t netConeArea = TMath::Pi()*(fIsoConeR*fIsoConeR - 0.04*0.04); | |
f224025f | 647 | GetCeIso(clsVec, id, ceiso, cephiband, cecore); |
30159e6f | 648 | GetTrIso(clsVec, triso, trphiband, trcore); |
f9e2362a | 649 | Double_t dr = TMath::Sqrt(c->GetTrackDx()*c->GetTrackDx() + c->GetTrackDz()*c->GetTrackDz()); |
650 | if(Et>10 && Et<15 && dr>0.025){ | |
651 | fHigherPtConeM02->Fill(fHigherPtCone,c->GetM02()); | |
652 | if(fDebug) | |
653 | printf("\t\tHigher track pt inside the cone: %1.1f GeV/c; M02=%1.2f\n",fHigherPtCone,c->GetM02()); | |
654 | } | |
30159e6f | 655 | alliso = ceiso + triso; |
656 | allphiband = cephiband + trphiband; | |
657 | allcore = cecore + trcore; | |
658 | Float_t ceisoue = cephiband/phibandArea*netConeArea; | |
659 | Float_t trisoue = trphiband/phibandArea*netConeArea; | |
660 | Float_t allisoue = allphiband/phibandArea*netConeArea; | |
f912f9a9 | 661 | Float_t mcptsum = GetMcPtSumInCone(clsVec.Eta(), clsVec.Phi(),fIsoConeR); |
662 | if(fDebug && Et>10) | |
663 | printf("\t alliso=%1.1f, Et=%1.1f=-=-=-=-=\n",alliso,Et); | |
664 | if(c->GetM02()>0.5 && c->GetM02()<2.0){ | |
665 | fMcPtInConeBG->Fill(alliso-Et-allisoue, mcptsum); | |
666 | fMcPtInConeBGnoUE->Fill(alliso-Et, mcptsum); | |
667 | } | |
b16ded35 | 668 | if(c->GetM02()>0.1 && c->GetM02()<0.3 && dr>0.03){ |
f912f9a9 | 669 | fMcPtInConeSBG->Fill(alliso-Et-allisoue, mcptsum); |
670 | fMcPtInConeSBGnoUE->Fill(alliso-Et, mcptsum); | |
81f2660f | 671 | if(fMcIdFamily.Contains((Form("%d",c->GetLabel())))){ |
672df96f | 672 | fAllIsoEtMcGamma->Fill(Et, alliso-/*Et*/cecore-allisoue); |
673 | fAllIsoNoUeEtMcGamma->Fill(Et, alliso-/*Et*/cecore); | |
81f2660f | 674 | } |
f912f9a9 | 675 | } |
965c985f | 676 | const Int_t ndims = fNDimensions; |
677 | Double_t outputValues[ndims]; | |
e53ab710 | 678 | if(mcptsum<2) |
679 | ptmc = GetClusSource(c); | |
680 | else | |
681 | ptmc = -0.1; | |
965c985f | 682 | outputValues[0] = Et; |
683 | outputValues[1] = c->GetM02(); | |
1c86c72c | 684 | outputValues[2] = ceiso/*cecore*/-ceisoue; |
965c985f | 685 | outputValues[3] = triso-trisoue; |
1c86c72c | 686 | outputValues[4] = alliso/*cecore*/-allisoue - trcore; |
687 | outputValues[5] = ceiso; | |
688 | outputValues[6] = alliso - trcore; | |
717bb45b | 689 | outputValues[7] = c->GetTrackDx(); |
690 | outputValues[8] = c->GetTrackDz(); | |
691 | outputValues[9] = clsVec.Eta(); | |
692 | outputValues[10] = clsVec.Phi(); | |
2e20efe5 | 693 | if(fESDCells) |
694 | outputValues[11] = fESDCells->GetCellTime(id); | |
695 | else if(fAODCells) | |
696 | outputValues[11] = fAODCells->GetCellTime(id); | |
16a4050e | 697 | outputValues[12] = fTrackMult; |
f507c09b | 698 | outputValues[13] = ptmc; |
965c985f | 699 | fHnOutput->Fill(outputValues); |
30159e6f | 700 | if(c->E()>maxE) |
701 | maxE = c->E(); | |
702 | } | |
703 | fNClusHighClusE->Fill(maxE,nclus); | |
ee3d9c10 | 704 | fMaxEClus = maxE; |
0b21f686 | 705 | fNClusEt10->Fill(nclus10); |
f507c09b | 706 | fNClusPerPho->Fill(fDirPhoPt,fNClusForDirPho); |
30159e6f | 707 | } |
bd092f0f | 708 | |
30159e6f | 709 | //________________________________________________________________________ |
f224025f | 710 | void AliAnalysisTaskEMCALIsoPhoton::GetCeIso(TVector3 vec, Int_t maxid, Float_t &iso, Float_t &phiband, Float_t &core) |
30159e6f | 711 | { |
bd092f0f | 712 | // Get cell isolation. |
2e20efe5 | 713 | AliVCaloCells *cells = fESDCells; |
1c86c72c | 714 | if (!cells){ |
2e20efe5 | 715 | cells = fAODCells; |
1c86c72c | 716 | if(fDebug) |
717 | printf("ESD cells empty..."); | |
718 | } | |
719 | if (!cells){ | |
720 | if(fDebug) | |
721 | printf(" and AOD cells are empty as well!!!\n"); | |
30159e6f | 722 | return; |
1c86c72c | 723 | } |
2e20efe5 | 724 | |
1c86c72c | 725 | TObjArray *clusters = fESDClusters; |
726 | if (!clusters) | |
727 | clusters = fAODClusters; | |
728 | if (!clusters) | |
729 | return; | |
730 | ||
731 | ||
732 | const Int_t nclus = clusters->GetEntries(); | |
733 | //const Int_t ncells = cells->GetNumberOfCells(); | |
30159e6f | 734 | Float_t totiso=0; |
735 | Float_t totband=0; | |
736 | Float_t totcore=0; | |
737 | Float_t etacl = vec.Eta(); | |
738 | Float_t phicl = vec.Phi(); | |
2e20efe5 | 739 | Float_t maxtcl = cells->GetCellTime(maxid); |
30159e6f | 740 | if(phicl<0) |
741 | phicl+=TMath::TwoPi(); | |
1c86c72c | 742 | /*Int_t absid = -1; |
30159e6f | 743 | Float_t eta=-1, phi=-1; |
744 | for(int icell=0;icell<ncells;icell++){ | |
2e20efe5 | 745 | absid = TMath::Abs(cells->GetCellNumber(icell)); |
746 | Float_t celltime = cells->GetCellTime(absid); | |
f224025f | 747 | //if(TMath::Abs(celltime)>2e-8 && (!fIsMc)) |
748 | if(TMath::Abs(celltime-maxtcl)>2e-8 ) | |
c3f33463 | 749 | continue; |
30159e6f | 750 | if(!fGeom) |
751 | return; | |
752 | fGeom->EtaPhiFromIndex(absid,eta,phi); | |
753 | Float_t dphi = TMath::Abs(phi-phicl); | |
754 | Float_t deta = TMath::Abs(eta-etacl); | |
1c86c72c | 755 | Float_t R = TMath::Sqrt(deta*deta + dphi*dphi);*/ |
756 | for(int ic=0;ic<nclus;ic++){ | |
757 | AliVCluster *c = static_cast<AliVCluster*>(clusters->At(ic)); | |
758 | if(!c) | |
759 | continue; | |
760 | if(!c->IsEMCAL()) | |
761 | continue; | |
762 | Short_t id; | |
2280356c | 763 | GetMaxCellEnergy( c, id); |
1c86c72c | 764 | Double_t maxct = cells->GetCellTime(id); |
765 | if(TMath::Abs(maxtcl-maxct)>2.5e-9) | |
766 | continue; | |
767 | Float_t clsPos[3] = {0,0,0}; | |
768 | c->GetPosition(clsPos); | |
769 | TVector3 cv(clsPos); | |
770 | Double_t Et = c->E()*TMath::Sin(cv.Theta()); | |
771 | Float_t dphi = TMath::Abs(cv.Phi()-phicl); | |
772 | Float_t deta = TMath::Abs(cv.Eta()-etacl); | |
30159e6f | 773 | Float_t R = TMath::Sqrt(deta*deta + dphi*dphi); |
1c86c72c | 774 | if(R<0.007) |
775 | continue; | |
22814624 | 776 | if(maxid==id) |
777 | continue; | |
1c86c72c | 778 | Double_t matchedpt = GetTrackMatchedPt(c->GetTrackMatchedIndex()); |
779 | Double_t nEt = TMath::Max(Et-matchedpt, 0.0); | |
780 | if(nEt<0) | |
781 | printf("nEt=%1.1f\n",nEt); | |
30159e6f | 782 | if(R<fIsoConeR){ |
1c86c72c | 783 | totiso += nEt; |
30159e6f | 784 | if(R<0.04) |
1c86c72c | 785 | totcore += nEt; |
30159e6f | 786 | } |
787 | else{ | |
788 | if(dphi>fIsoConeR) | |
789 | continue; | |
790 | if(deta<fIsoConeR) | |
791 | continue; | |
1c86c72c | 792 | totband += nEt; |
30159e6f | 793 | } |
794 | } | |
795 | iso = totiso; | |
796 | phiband = totband; | |
797 | core = totcore; | |
798 | } | |
799 | //________________________________________________________________________ | |
800 | void AliAnalysisTaskEMCALIsoPhoton::GetTrIso(TVector3 vec, Float_t &iso, Float_t &phiband, Float_t &core) | |
801 | { | |
bd092f0f | 802 | // Get track isolation. |
803 | ||
30159e6f | 804 | if(!fSelPrimTracks) |
805 | return; | |
f9e2362a | 806 | fHigherPtCone = 0; |
30159e6f | 807 | const Int_t ntracks = fSelPrimTracks->GetEntries(); |
808 | Double_t totiso=0; | |
809 | Double_t totband=0; | |
810 | Double_t totcore=0; | |
811 | Double_t etacl = vec.Eta(); | |
812 | Double_t phicl = vec.Phi(); | |
813 | if(phicl<0) | |
814 | phicl+=TMath::TwoPi(); | |
815 | for(int itrack=0;itrack<ntracks;itrack++){ | |
3f4073ba | 816 | AliVTrack *track = static_cast<AliVTrack*> (fSelPrimTracks->At(itrack)); |
30159e6f | 817 | if(!track) |
818 | continue; | |
819 | Double_t dphi = TMath::Abs(track->Phi()-phicl); | |
820 | Double_t deta = TMath::Abs(track->Eta()-etacl); | |
821 | Double_t R = TMath::Sqrt(deta*deta + dphi*dphi); | |
822 | Double_t pt = track->Pt(); | |
f9e2362a | 823 | if(pt>fHigherPtCone) |
824 | fHigherPtCone = pt; | |
30159e6f | 825 | if(R<fIsoConeR){ |
826 | totiso += track->Pt(); | |
827 | if(R<0.04) | |
828 | totcore += pt; | |
829 | } | |
830 | else{ | |
831 | if(dphi>fIsoConeR) | |
832 | continue; | |
833 | if(deta<fIsoConeR) | |
834 | continue; | |
835 | totband += track->Pt(); | |
836 | } | |
837 | } | |
838 | iso = totiso; | |
839 | phiband = totband; | |
840 | core = totcore; | |
841 | } | |
bd092f0f | 842 | |
30159e6f | 843 | //________________________________________________________________________ |
844 | Double_t AliAnalysisTaskEMCALIsoPhoton::GetCrossEnergy(const AliVCluster *cluster, Short_t &idmax) | |
845 | { | |
846 | // Calculate the energy of cross cells around the leading cell. | |
847 | ||
848 | AliVCaloCells *cells = 0; | |
2e20efe5 | 849 | cells = fESDCells; |
850 | if (!cells) | |
851 | cells = fAODCells; | |
30159e6f | 852 | if (!cells) |
853 | return 0; | |
854 | ||
30159e6f | 855 | if (!fGeom) |
856 | return 0; | |
857 | ||
858 | Int_t iSupMod = -1; | |
859 | Int_t iTower = -1; | |
860 | Int_t iIphi = -1; | |
861 | Int_t iIeta = -1; | |
862 | Int_t iphi = -1; | |
863 | Int_t ieta = -1; | |
864 | Int_t iphis = -1; | |
865 | Int_t ietas = -1; | |
866 | ||
867 | Double_t crossEnergy = 0; | |
868 | ||
869 | fGeom->GetCellIndex(idmax,iSupMod,iTower,iIphi,iIeta); | |
870 | fGeom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,iIphi, iIeta,iphis,ietas); | |
871 | ||
872 | Int_t ncells = cluster->GetNCells(); | |
873 | for (Int_t i=0; i<ncells; i++) { | |
874 | Int_t cellAbsId = cluster->GetCellAbsId(i); | |
875 | fGeom->GetCellIndex(cellAbsId,iSupMod,iTower,iIphi,iIeta); | |
876 | fGeom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,iIphi, iIeta,iphi,ieta); | |
877 | Int_t aphidiff = TMath::Abs(iphi-iphis); | |
878 | if (aphidiff>1) | |
879 | continue; | |
880 | Int_t aetadiff = TMath::Abs(ieta-ietas); | |
881 | if (aetadiff>1) | |
882 | continue; | |
883 | if ( (aphidiff==1 && aetadiff==0) || | |
884 | (aphidiff==0 && aetadiff==1) ) { | |
885 | crossEnergy += cells->GetCellAmplitude(cellAbsId); | |
886 | } | |
887 | } | |
888 | ||
889 | return crossEnergy; | |
890 | } | |
891 | ||
30159e6f | 892 | //________________________________________________________________________ |
893 | Double_t AliAnalysisTaskEMCALIsoPhoton ::GetMaxCellEnergy(const AliVCluster *cluster, Short_t &id) const | |
894 | { | |
895 | // Get maximum energy of attached cell. | |
896 | ||
897 | id = -1; | |
898 | ||
899 | AliVCaloCells *cells = 0; | |
2e20efe5 | 900 | cells = fESDCells; |
30159e6f | 901 | if (!cells) |
2e20efe5 | 902 | cells = fAODCells; |
903 | if(!cells) | |
30159e6f | 904 | return 0; |
905 | ||
906 | Double_t maxe = 0; | |
907 | Int_t ncells = cluster->GetNCells(); | |
908 | for (Int_t i=0; i<ncells; i++) { | |
909 | Double_t e = cells->GetCellAmplitude(TMath::Abs(cluster->GetCellAbsId(i))); | |
910 | if (e>maxe) { | |
911 | maxe = e; | |
912 | id = cluster->GetCellAbsId(i); | |
913 | } | |
914 | } | |
915 | return maxe; | |
916 | } | |
bd092f0f | 917 | |
c7bb0b43 | 918 | //________________________________________________________________________ |
919 | void AliAnalysisTaskEMCALIsoPhoton ::FillMcHists() | |
920 | { | |
921 | if(!fStack) | |
922 | return; | |
923 | Int_t nTracks = fStack->GetNtrack(); | |
ecd47673 | 924 | if(fDebug) |
925 | printf("Inside FillMcHists and there are %d mcparts\n",nTracks); | |
c7bb0b43 | 926 | for(Int_t iTrack=0;iTrack<nTracks;iTrack++){ |
927 | TParticle *mcp = static_cast<TParticle*>(fStack->Particle(iTrack)); | |
928 | if(!mcp) | |
929 | continue; | |
930 | Int_t pdg = mcp->GetPdgCode(); | |
931 | if(pdg!=22) | |
932 | continue; | |
f2acdbe9 | 933 | if(TMath::Abs(mcp->Eta())>0.7 ||mcp->Phi()<1.4 || mcp->Phi()>3.2) |
934 | continue; | |
c7bb0b43 | 935 | Int_t imom = mcp->GetMother(0); |
936 | if(imom<0 || imom>nTracks) | |
937 | continue; | |
938 | TParticle *mcmom = static_cast<TParticle*>(fStack->Particle(imom)); | |
939 | if(!mcmom) | |
940 | continue; | |
941 | Int_t pdgMom = mcmom->GetPdgCode(); | |
ec9ab86b | 942 | if((imom==6 || imom==7) && pdgMom==22) { |
caaf99d3 | 943 | fMCDirPhotonPtEtaPhi->Fill(mcp->Pt(),mcp->Eta(),mcp->Phi()); |
ca03dc51 | 944 | Float_t ptsum = GetMcPtSumInCone(mcp->Eta(), mcp->Phi(), fIsoConeR); |
e53ab710 | 945 | if(ptsum<2) |
946 | fMCIsoDirPhotonPtEtaPhi->Fill(mcp->Pt(),mcp->Eta(),mcp->Phi()); | |
f507c09b | 947 | if(fNClusForDirPho==0) |
092ceec8 | 948 | fMCDirPhotonPtEtaPhiNoClus->Fill(mcp->Pt(),mcp->Eta(),mcp->Phi()); |
40c4f1bf | 949 | if(fDebug){ |
f2acdbe9 | 950 | printf("Found \"photonic\" parton at position %d, with pt=%1.1f, eta=%1.1f and phi=%1.1f, and status=%d,\n",imom,mcmom->Pt(), mcmom->Eta(), mcmom->Phi(), mcmom->GetStatusCode()); |
40c4f1bf | 951 | printf("with a final photon at position %d, with pt=%1.1f, eta=%1.1f and phi=%1.1f, and status=%d\n",iTrack,mcp->Pt(), mcp->Eta(), mcp->Phi(),mcp->GetStatusCode()); |
952 | } | |
f2acdbe9 | 953 | } |
c7bb0b43 | 954 | else{ |
955 | if(TMath::Abs(pdgMom)>100 && TMath::Abs(pdgMom)<1000) | |
956 | fDecayPhotonPtMC->Fill(mcp->Pt()); | |
957 | } | |
958 | } | |
959 | } | |
30159e6f | 960 | //________________________________________________________________________ |
f507c09b | 961 | Float_t AliAnalysisTaskEMCALIsoPhoton::GetClusSource(const AliVCluster *c) |
962 | { | |
963 | if(!c) | |
84898d7b | 964 | return -0.1; |
f507c09b | 965 | if(!fStack) |
84898d7b | 966 | return -0.1; |
f507c09b | 967 | Int_t nmcp = fStack->GetNtrack(); |
968 | Int_t clabel = c->GetLabel(); | |
969 | if(fDebug && fMcIdFamily.Contains(Form("%d",clabel))) | |
970 | printf("\n\t ==== Label %d is a descendent of the prompt photon ====\n\n",clabel); | |
971 | if(!fMcIdFamily.Contains(Form("%d",clabel))) | |
84898d7b | 972 | return -0.1; |
f507c09b | 973 | fNClusForDirPho++; |
974 | TString partonposstr = (TSubString)fMcIdFamily.operator()(0,1); | |
975 | Int_t partonpos = partonposstr.Atoi(); | |
976 | if(fDebug) | |
977 | printf("\t^^^^ parton position = %d ^^^^\n",partonpos); | |
978 | if(clabel<0 || clabel>nmcp) | |
2cd24808 | 979 | return -0.1; |
f507c09b | 980 | Float_t clsPos[3] = {0,0,0}; |
981 | c->GetPosition(clsPos); | |
982 | TVector3 clsVec(clsPos); | |
983 | Double_t Et = c->E()*TMath::Sin(clsVec.Theta()); | |
984 | TParticle *mcp = static_cast<TParticle*>(fStack->Particle(partonpos)); | |
985 | if(!mcp) | |
84898d7b | 986 | return -0.1; |
f507c09b | 987 | if(fDebug){ |
988 | printf("\tclus mc truth eta=%1.1f,phi=%1.1f,E=%1.1f, pdgcode=%d, stackpos=%d\n",mcp->Eta(),mcp->Phi(),mcp->Energy(),mcp->GetPdgCode(),clabel); | |
989 | } | |
990 | Int_t lab1 = mcp->GetFirstDaughter(); | |
991 | if(lab1<0 || lab1>nmcp) | |
84898d7b | 992 | return -0.1; |
f507c09b | 993 | TParticle *mcd = static_cast<TParticle*>(fStack->Particle(lab1)); |
994 | if(!mcd) | |
84898d7b | 995 | return -0.1; |
f507c09b | 996 | if(fDebug) |
997 | printf("\t\tmom mc truth eta=%1.1f,phi=%1.1f,E=%1.1f, pdgcode=%d, stackpos=%d\n",mcd->Eta(),mcd->Phi(),mcd->Energy(),mcd->GetPdgCode(),lab1); | |
998 | if(mcd->GetPdgCode()==22){ | |
999 | fClusEtMcPt->Fill(mcd->Pt(), Et); | |
1000 | fClusMcDetaDphi->Fill(clsVec.Eta() - mcd->Eta(), clsVec.Phi() - mcd->Phi()); | |
1001 | } | |
1002 | else{ | |
1003 | printf("Warning: daughter of photon parton is not a photon\n"); | |
84898d7b | 1004 | return -0.1; |
f507c09b | 1005 | } |
1006 | return fDirPhoPt; | |
1007 | } | |
1008 | //________________________________________________________________________ | |
1009 | void AliAnalysisTaskEMCALIsoPhoton::FollowGamma() | |
1010 | { | |
1011 | if(!fStack) | |
1012 | return; | |
1013 | Int_t selfid = 6; | |
1014 | TParticle *mcp = static_cast<TParticle*>(fStack->Particle(selfid)); | |
1015 | if(!mcp) | |
1016 | return; | |
1017 | if(mcp->GetPdgCode()!=22){ | |
1018 | mcp = static_cast<TParticle*>(fStack->Particle(++selfid)); | |
1019 | if(!mcp) | |
1020 | return; | |
1021 | } | |
1022 | Int_t daug0f = mcp->GetFirstDaughter(); | |
1023 | Int_t daug0l = mcp->GetLastDaughter(); | |
1024 | Int_t nd0 = daug0l - daug0f; | |
1025 | if(fDebug) | |
1026 | printf("\n\tGenerated gamma (%d) eta=%1.1f,phi=%1.1f,E=%1.1f, pdgcode=%d, n-daug=%d\n",selfid,mcp->Eta(),mcp->Phi(),mcp->Energy(),mcp->GetPdgCode(),nd0+1); | |
1027 | fMcIdFamily = Form("%d,",selfid); | |
1028 | GetDaughtersInfo(daug0f,daug0l, selfid,""); | |
1029 | if(fDebug){ | |
1030 | printf("\t---- end of the prompt gamma's family tree ----\n\n"); | |
1031 | printf("Family id string = %s,\n\n",fMcIdFamily.Data()); | |
1032 | } | |
1033 | TParticle *md = static_cast<TParticle*>(fStack->Particle(daug0f)); | |
1034 | if(!md) | |
1035 | return; | |
1036 | fDirPhoPt = md->Pt(); | |
1037 | } | |
1038 | //________________________________________________________________________ | |
22ad7981 | 1039 | void AliAnalysisTaskEMCALIsoPhoton::GetDaughtersInfo(int firstd, int lastd, int selfid, const char *inputind) |
f507c09b | 1040 | { |
1041 | int nmcp = fStack->GetNtrack(); | |
1042 | if(firstd<0 || firstd>nmcp) | |
1043 | return; | |
1044 | if(lastd<0 || lastd>nmcp) | |
1045 | return; | |
1046 | if(firstd>lastd){ | |
1047 | printf("WARNING: First daughter > last (%d,%d)\n",firstd,lastd); | |
1048 | return; | |
1049 | } | |
1050 | TString indenter = Form("\t%s",inputind); | |
1051 | TParticle *dp = 0x0; | |
1052 | if(fDebug) | |
1053 | printf("\t%s--- Daughters of particle %d ---\n", indenter.Data(), selfid); | |
1054 | for(int id=firstd; id<lastd+1; id++){ | |
1055 | dp = static_cast<TParticle*>(fStack->Particle(id)); | |
1056 | if(!dp) | |
1057 | continue; | |
1058 | Int_t dfd = dp->GetFirstDaughter(); | |
1059 | Int_t dld = dp->GetLastDaughter(); | |
1060 | Int_t dnd = dld - dfd + 1; | |
1061 | Float_t vr = TMath::Sqrt(dp->Vx()*dp->Vx()+dp->Vy()*dp->Vy()); | |
1062 | if(fDebug) | |
1063 | printf("\t%sParticle daughter(%d) eta=%1.1f,phi=%1.1f,E=%1.1f, vR=%1.1f, pdgcode=%d, n-daug=%d(%d,%d)\n", indenter.Data(),id, dp->Eta(), dp->Phi(), dp->Energy(), vr, dp->GetPdgCode(), dnd, dfd, dld); | |
1064 | fMcIdFamily += Form("%d,",id); | |
1065 | GetDaughtersInfo(dfd,dld,id,indenter.Data()); | |
1066 | } | |
1067 | } | |
f912f9a9 | 1068 | |
1069 | //________________________________________________________________________ | |
1070 | Float_t AliAnalysisTaskEMCALIsoPhoton::GetMcPtSumInCone(Float_t etaclus, Float_t phiclus, Float_t R) | |
1071 | { | |
1072 | if(!fStack) | |
1073 | return 0; | |
1074 | if(fDebug) | |
1075 | printf("Inside GetMcPtSumInCone!!\n"); | |
1076 | Int_t nTracks = fStack->GetNtrack(); | |
1077 | Float_t ptsum = 0; | |
672df96f | 1078 | TString addpartlabels = ""; |
e53ab710 | 1079 | for(Int_t iTrack=8;iTrack<nTracks;iTrack++){ |
f912f9a9 | 1080 | TParticle *mcp = static_cast<TParticle*>(fStack->Particle(iTrack)); |
1081 | if(!mcp) | |
1082 | continue; | |
e53ab710 | 1083 | Int_t status = mcp->GetStatusCode(); |
1084 | if(status!=1) | |
1085 | continue; | |
1086 | Float_t mcvr = TMath::Sqrt(mcp->Vx()*mcp->Vx()+ mcp->Vy()* mcp->Vy() + mcp->Vz()*mcp->Vz()); | |
1087 | if(mcvr>1) | |
f912f9a9 | 1088 | continue; |
1089 | else { | |
1090 | if(fDebug) | |
1091 | printf(" >>>> mcp Rho, Vx, Vy, Vz = %1.1f,%1.1f,%1.1f,%1.1f.......\n",mcp->Rho(),mcp->Vx(), mcp->Vy(),mcp->Vz()); | |
1092 | } | |
1093 | Float_t dphi = mcp->Phi() - phiclus; | |
1094 | Float_t deta = mcp->Eta() - etaclus; | |
1095 | if(fDebug) | |
1096 | printf(" >>>> mcphi = %1.1f, mceta = %1.1f\n>>>> dphi = %1.1f, deta = %1.1f\n", mcp->Phi(), mcp->Eta(),dphi,deta); | |
e53ab710 | 1097 | if(deta>R || dphi>R) |
f912f9a9 | 1098 | continue; |
1099 | Float_t dR = TMath::Sqrt(dphi*dphi + deta*deta); | |
1100 | if(dR>R) | |
1101 | continue; | |
672df96f | 1102 | addpartlabels += Form("%d,",iTrack); |
e53ab710 | 1103 | if(mcp->Pt()<0.2) |
1104 | continue; | |
f912f9a9 | 1105 | ptsum += mcp->Pt(); |
1106 | } | |
1107 | return ptsum; | |
1108 | } | |
f507c09b | 1109 | //________________________________________________________________________ |
2b7205ad | 1110 | void AliAnalysisTaskEMCALIsoPhoton::FillQA() |
1111 | { | |
85b52a52 | 1112 | |
1113 | TObjArray *clusters = fESDClusters; | |
1114 | ||
1115 | if (!clusters){ | |
1116 | clusters = fAODClusters; | |
1117 | if(fDebug) | |
1118 | printf("ESD clusters empty..."); | |
1119 | } | |
1120 | if (!clusters){ | |
1121 | if(fDebug) | |
1122 | printf(" and AOD clusters as well!!!\n"); | |
1123 | return; | |
1124 | } | |
2b7205ad | 1125 | if(!fSelPrimTracks) |
1126 | return; | |
1127 | const int ntracks = fSelPrimTracks->GetEntriesFast(); | |
112eb594 | 1128 | const int ncells = fNCells50;//fESDCells->GetNumberOfCells(); |
85b52a52 | 1129 | const Int_t nclus = clusters->GetEntries(); |
2b7205ad | 1130 | |
1131 | fNTracks->Fill(ntracks); | |
1132 | fEmcNCells->Fill(ncells); | |
1133 | fEmcNClus->Fill(nclus); | |
1134 | if(fMaxEClus>fECut){ | |
1135 | fNTracksECut->Fill(ntracks); | |
1136 | fEmcNCellsCut->Fill(ncells); | |
1137 | fEmcNClusCut->Fill(nclus); | |
1138 | } | |
1139 | for(int it=0;it<ntracks;it++){ | |
1140 | AliVTrack *t = (AliVTrack*)fSelPrimTracks->At(it); | |
1141 | if(!t) | |
1142 | continue; | |
e4ba80ad | 1143 | fTrackPtPhi->Fill(t->Pt(),t->Phi()); |
1144 | fTrackPtEta->Fill(t->Pt(),t->Eta()); | |
1145 | if(fMaxEClus>fECut){ | |
1146 | fTrackPtPhiCut->Fill(t->Pt(), t->Phi()); | |
1147 | fTrackPtEtaCut->Fill(t->Pt(), t->Eta()); | |
1148 | } | |
2b7205ad | 1149 | } |
1150 | for(int ic=0;ic<nclus;ic++){ | |
85b52a52 | 1151 | AliVCluster *c = dynamic_cast<AliVCluster*>(clusters->At(ic)); |
1152 | //AliESDCaloCluster *c = (AliESDCaloCluster*)clusters->At(ic); | |
2b7205ad | 1153 | if(!c) |
1154 | continue; | |
3ae97198 | 1155 | if(!c->IsEMCAL()) |
1156 | continue; | |
e4ba80ad | 1157 | Float_t clsPos[3] = {0,0,0}; |
1158 | c->GetPosition(clsPos); | |
1159 | TVector3 clsVec(clsPos); | |
1160 | Double_t cphi = clsVec.Phi(); | |
1161 | Double_t ceta = clsVec.Eta(); | |
ed39f27f | 1162 | if(TMath::Abs(c->GetTrackDx())<0.03 && TMath::Abs(c->GetTrackDz())<0.02) |
1163 | fEmcClusETM1->Fill(c->E()); | |
1164 | if(fClusIdFromTracks.Contains(Form("%d",ic))) | |
1165 | fEmcClusETM2->Fill(c->E()); | |
e4ba80ad | 1166 | fEmcClusEPhi->Fill(c->E(), cphi); |
1167 | fEmcClusEEta->Fill(c->E(), ceta); | |
1168 | if(fMaxEClus>fECut){ | |
1169 | fEmcClusEPhiCut->Fill(c->E(), cphi); | |
1170 | fEmcClusEEtaCut->Fill(c->E(), ceta); | |
1171 | } | |
2b7205ad | 1172 | } |
1173 | } | |
1174 | //________________________________________________________________________ | |
1c86c72c | 1175 | Double_t AliAnalysisTaskEMCALIsoPhoton::GetTrackMatchedPt(Int_t matchIndex) |
1176 | { | |
1177 | Double_t pt = 0; | |
1178 | if(!fTracks) | |
1179 | return pt; | |
1180 | if(matchIndex<0 || matchIndex>fTracks->GetEntries()){ | |
1181 | if(fDebug) | |
1182 | printf("track-matched index out of track array range!!!\n"); | |
1183 | return pt; | |
1184 | } | |
1185 | AliVTrack* track = static_cast<AliVTrack*>(fTracks->At(matchIndex)); | |
1186 | if(!track){ | |
1187 | if(fDebug) | |
1188 | printf("track-matched pointer does not exist!!!\n"); | |
1189 | return pt; | |
1190 | } | |
1191 | if(fESD){ | |
1192 | if(!fPrTrCuts) | |
1193 | return pt; | |
1194 | if(!fPrTrCuts->IsSelected(track)) | |
1195 | return pt; | |
1196 | pt = track->Pt(); | |
1197 | } | |
1198 | return pt; | |
1199 | } | |
1200 | //________________________________________________________________________ | |
112eb594 | 1201 | void AliAnalysisTaskEMCALIsoPhoton::LoopOnCells() |
1202 | { | |
1203 | AliVCaloCells *cells = 0; | |
1204 | cells = fESDCells; | |
1205 | if (!cells) | |
1206 | cells = fAODCells; | |
1207 | if(!cells) | |
1208 | return; | |
3ae97198 | 1209 | Double_t maxe = 0; |
1210 | Double_t maxphi = -10; | |
112eb594 | 1211 | Int_t ncells = cells->GetNumberOfCells(); |
3ae97198 | 1212 | Double_t eta,phi; |
112eb594 | 1213 | for (Int_t i=0; i<ncells; i++) { |
1214 | Short_t absid = TMath::Abs(cells->GetCellNumber(i)); | |
1215 | Double_t e = cells->GetCellAmplitude(absid); | |
1216 | if(e>0.05) | |
1217 | fNCells50++; | |
3ae97198 | 1218 | else |
1219 | continue; | |
1220 | fGeom->EtaPhiFromIndex(absid,eta,phi); | |
1221 | if(maxe<e){ | |
1222 | maxe = e; | |
1223 | maxphi = phi; | |
1224 | } | |
112eb594 | 1225 | } |
3ae97198 | 1226 | fMaxCellEPhi->Fill(maxe,maxphi); |
112eb594 | 1227 | |
1228 | } | |
1229 | //________________________________________________________________________ | |
30159e6f | 1230 | void AliAnalysisTaskEMCALIsoPhoton::Terminate(Option_t *) |
1231 | { | |
bd092f0f | 1232 | // Called once at the end of the query. |
30159e6f | 1233 | } |