3 #include "AliAnalysisTaskEMCALIsoPhoton.h"
11 #include <THnSparse.h>
12 #include <TLorentzVector.h>
15 #include "AliAnalysisManager.h"
16 #include "AliAnalysisTask.h"
17 #include "AliEMCALGeometry.h"
18 #include "AliEMCALRecoUtils.h"
19 #include "AliESDCaloCells.h"
20 #include "AliESDCaloCluster.h"
21 #include "AliESDEvent.h"
22 #include "AliESDHeader.h"
23 #include "AliESDInputHandler.h"
24 #include "AliESDUtils.h"
25 #include "AliESDtrack.h"
26 #include "AliESDtrackCuts.h"
27 #include "AliAODEvent.h"
28 #include "AliAODTrack.h"
29 #include "AliMCEvent.h"
30 #include "AliMCEventHandler.h"
32 #include "AliVEvent.h"
33 #include "AliVTrack.h"
34 #include "AliV0vertexer.h"
35 #include "AliVCluster.h"
36 #include "AliOADBContainer.h"
42 ClassImp(AliAnalysisTaskEMCALIsoPhoton)
44 //________________________________________________________________________
45 AliAnalysisTaskEMCALIsoPhoton::AliAnalysisTaskEMCALIsoPhoton() :
55 fGeoName("EMCAL_COMPLETEV1"),
72 fImportGeometryFromFile(0),
73 fImportGeometryFilePath(""),
80 fClusIdFromTracks(""),
81 fCpvFromTrack(kFALSE),
84 fPtBinHighEdge(99.75),
85 fRemMatchClus(kFALSE),
102 fMCDirPhotonPtEtaPhi(0),
103 fMCIsoDirPhotonPtEtaPhi(0),
104 fMCDirPhotonPtEtIso(0),
114 fMcPtInConeBGnoUE(0),
115 fMcPtInConeSBGnoUE(0),
116 fMcPtInConeTrBGnoUE(0),
117 fMcPtInConeTrSBGnoUE(0),
118 fMcPtInConeMcPhoPt(0),
120 fAllIsoNoUeEtMcGamma(0),
121 fMCDirPhotonPtEtaPhiNoClus(0),
133 fEmcClusEClusCuts(0),
144 // Default constructor.
145 for(Int_t i = 0; i < 12; i++) fGeomMatrix[i] = 0;
148 //________________________________________________________________________
149 AliAnalysisTaskEMCALIsoPhoton::AliAnalysisTaskEMCALIsoPhoton(const char *name) :
150 AliAnalysisTaskSE(name),
159 fGeoName("EMCAL_COMPLETEV1"),
176 fImportGeometryFromFile(0),
177 fImportGeometryFilePath(""),
184 fClusIdFromTracks(""),
185 fCpvFromTrack(kFALSE),
187 fPtBinLowEdge(-0.25),
188 fPtBinHighEdge(99.75),
189 fRemMatchClus(kFALSE),
206 fMCDirPhotonPtEtaPhi(0),
207 fMCIsoDirPhotonPtEtaPhi(0),
208 fMCDirPhotonPtEtIso(0),
218 fMcPtInConeBGnoUE(0),
219 fMcPtInConeSBGnoUE(0),
220 fMcPtInConeTrBGnoUE(0),
221 fMcPtInConeTrSBGnoUE(0),
222 fMcPtInConeMcPhoPt(0),
224 fAllIsoNoUeEtMcGamma(0),
225 fMCDirPhotonPtEtaPhiNoClus(0),
237 fEmcClusEClusCuts(0),
250 // Define input and output slots here
251 // Input slot #0 works with a TChain
252 DefineInput(0, TChain::Class());
253 // Output slot #0 id reserved by the base class for AOD
254 // Output slot #1 writes into a TH1 container
255 DefineOutput(1, TList::Class());
256 DefineOutput(2, TList::Class());
259 //________________________________________________________________________
260 void AliAnalysisTaskEMCALIsoPhoton::UserCreateOutputObjects()
262 // Create histograms, called once.
264 fESDClusters = new TObjArray();
265 fSelPrimTracks = new TObjArray();
268 fOutputList = new TList();
269 fOutputList->SetOwner();// Container cleans up all histos (avoids leaks in merging)
271 fGeom = AliEMCALGeometry::GetInstance(fGeoName.Data());
272 fOADBContainer = new AliOADBContainer("AliEMCALgeo");
273 fOADBContainer->InitFromFile(Form("$ALICE_ROOT/OADB/EMCAL/EMCALlocal2master.root"),"AliEMCALgeo");
275 fEvtSel = new TH1F("hEvtSel","Event selection counter (0=all trg, 1=pvz cut) ;evt cut ;dN/dcut}",2,0,2);
276 fOutputList->Add(fEvtSel);
278 fNClusEt10 = new TH1F("hNClusEt10","# of cluster with E_{T}>10 per event;E;",101,-0.5,100.5);
279 fOutputList->Add(fNClusEt10);
281 fRecoPV = new TH1F("hRecoPV","Prim. vert. reconstruction (yes or no);reco (0=no, 1=yes) ;",2,-0.5,1.5);
282 fOutputList->Add(fRecoPV);
284 fPVtxZ = new TH1F("hPVtxZ","primary vertex Z before cut;prim-vz(cm) ;",200,-100,100);
285 fOutputList->Add(fPVtxZ);
287 fTrMultDist = new TH1F("fTrMultDist","track multiplicity;tracks/event;#events",200,0.5,200.5);
288 fOutputList->Add(fTrMultDist);
290 fClusEtCPVSBGISO = new TH2F("hClusEtCPVSBGISO","ISO^{TRK+EMC} vs. E_{T}^{clus} (after CPV and 0.1<#lambda_{0}^{2}<0.3;E_{T}^{clus} [GeV];ISO^{TRK+EMC} [GeV]",fNBinsPt, fPtBinLowEdge,fPtBinHighEdge,1000,0,100);
291 fClusEtCPVSBGISO->Sumw2();
292 fOutputList->Add(fClusEtCPVSBGISO);
294 fClusEtCPVBGISO = new TH2F("hClusEtCPVBGISO","ISO^{TRK+EMC} vs. E_{T}^{clus} (after CPV and 0.5<#lambda_{0}^{2}<2.0;E_{T}^{clus} [GeV];ISO^{TRK+EMC} [GeV]",fNBinsPt, fPtBinLowEdge,fPtBinHighEdge,1000,0,100);
295 fClusEtCPVBGISO->Sumw2();
296 fOutputList->Add(fClusEtCPVBGISO);
298 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);
299 fMCDirPhotonPtEtaPhi->Sumw2();
300 fOutputList->Add(fMCDirPhotonPtEtaPhi);
302 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);
303 fMCIsoDirPhotonPtEtaPhi->Sumw2();
304 fOutputList->Add(fMCIsoDirPhotonPtEtaPhi);
306 fMCDirPhotonPtEtIso = new TH2F("hMCDirPhotonPtEtIso",Form("photon (gq->#gammaq @MC) p_{T}, E_{T}^{ISO} (R=%1.1f);GeV/c;E_{T}^{ISO} GeV/c",fIsoConeR),100,-0.5,99.5,20,-0.25,9.75);
307 fMCDirPhotonPtEtIso->Sumw2();
308 fOutputList->Add(fMCDirPhotonPtEtIso);
311 fDecayPhotonPtMC = new TH1F("hDecayPhotonPtMC","decay photon p_{T};GeV/c;dN/dp_{T} (c GeV^{-1})",fNBinsPt, fPtBinLowEdge,fPtBinHighEdge);
312 fDecayPhotonPtMC->Sumw2();
313 fOutputList->Add(fDecayPhotonPtMC);
315 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);
316 fOutputList->Add(fCellAbsIdVsAmpl);
318 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);
319 fOutputList->Add(fNClusHighClusE);
321 fHigherPtConeM02 = new TH2F("hHigherPtConeM02","#lambda_{0}^{2} vs. in-cone-p_{T}^{max};p_{T}^{max} (GeV/c, in the cone);#lambda_{0}^{2}",fNBinsPt, fPtBinLowEdge,fPtBinHighEdge,400,0,4);
322 fOutputList->Add(fHigherPtConeM02);
324 fClusEtMcPt = new TH2F("hClusEtMcPt","E_{T}^{clus} vs. p_{T}^{mc}; p_{T}^{mc};E_{T}^{clus}",500,0,100,500,0,100);
325 fOutputList->Add(fClusEtMcPt);
327 fClusMcDetaDphi = new TH2F("hClusMcDetaDphi","#Delta#phi vs. #Delta#eta (reco-mc);#Delta#eta;#Delta#phi",100,-.7,.7,100,-.7,.7);
328 fOutputList->Add(fClusMcDetaDphi);
330 fNClusPerPho = new TH2F("hNClusPerPho","Number of clusters per prompt photon;p_{T}^{MC};N_{clus}",500,0,100,11,-0.5,10.5);
331 fOutputList->Add(fNClusPerPho);
333 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);
334 fOutputList->Add(fMcPtInConeBG);
336 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);
337 fOutputList->Add(fMcPtInConeSBG);
339 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);
340 fOutputList->Add(fMcPtInConeBGnoUE);
342 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);
343 fOutputList->Add(fMcPtInConeSBGnoUE);
345 fMcPtInConeTrBGnoUE = new TH2F("hMcPtInConeTrBGnoUE","#sum_{in-cone}p_{T}^{mc-primaries} vs. ISO^{TRK} (BG template);ISO^{TRK} (GeV);#sum_{in-cone}p_{T}^{mc-primaries}",600,-10,50,1000,0,100);
346 fOutputList->Add(fMcPtInConeTrBGnoUE);
348 fMcPtInConeTrSBGnoUE = new TH2F("hMcPtInConeTrSBGnoUE","#sum_{in-cone}p_{T}^{mc-primaries} vs. ISO^{TRK} (SBG range);ISO^{TRK} (GeV);#sum_{in-cone}p_{T}^{mc-primaries}",600,-10,50,1000,0,100);
349 fOutputList->Add(fMcPtInConeTrSBGnoUE);
351 fMcPtInConeMcPhoPt = new TH2F("hMcPtInConeMcPhoPt","#sum_{in-cone}p_{T}^{mc-primaries} vs. prompt photon p_{T};p_{T}^{mc-#gamma} (GeV);#sum_{in-cone}p_{T}^{mc-primaries}",fNBinsPt, fPtBinLowEdge,fPtBinHighEdge,200,-0.25,99.75);
352 fOutputList->Add(fMcPtInConeMcPhoPt);
354 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);",fNBinsPt, fPtBinLowEdge,fPtBinHighEdge,600,-10,50);
355 fOutputList->Add(fAllIsoEtMcGamma);
357 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);",fNBinsPt, fPtBinLowEdge,fPtBinHighEdge,600,-10,50);
358 fOutputList->Add(fAllIsoNoUeEtMcGamma);
361 fMCDirPhotonPtEtaPhiNoClus = new TH3F("hMCDirPhotonPhiEtaNoClus","p_{T}, #eta and #phi of prompt photons with no reco clusters;p_{T};#eta;#phi",fNBinsPt, fPtBinLowEdge,fPtBinHighEdge,154,-0.77,0.77,130,1.38,3.20);
362 fOutputList->Add(fMCDirPhotonPtEtaPhiNoClus);
364 Int_t nEt=fNBinsPt*5, 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;
365 Int_t bins[] = {nEt, nM02, nCeIso, nTrIso, nAllIso, nCeIsoNoUE, nAllIsoNoUE, nTrClDphi, nTrClDeta,nClEta,nClPhi,nTime,nMult,nPhoMcPt};
366 fNDimensions = sizeof(bins)/sizeof(Int_t);
367 const Int_t ndims = fNDimensions;
368 Double_t xmin[] = { fPtBinLowEdge, 0., -10., -10., -10., -10., -10., -0.1,-0.05, -0.7, 1.4,-0.15e-06,-0.5,-0.5};
369 Double_t xmax[] = { fPtBinHighEdge, 4., 190., 190., 190., 190., 190., 0.1, 0.05, 0.7, 3.192, 0.15e-06,99.5,99.5};
370 if(fPeriod.Contains("11h")){
373 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);
374 fOutputList->Add(fHnOutput);
377 fQAList = new TList();
378 fQAList->SetOwner();// Container cleans up all histos (avoids leaks in merging)
380 fNTracks = new TH1F("hNTracks","# of selected tracks;n-tracks;counts",120,-0.5,119.5);
382 fQAList->Add(fNTracks);
384 fEmcNCells = new TH1F("fEmcNCells",";n/event;count",120,-0.5,119.5);
386 fQAList->Add(fEmcNCells);
387 fEmcNClus = new TH1F("fEmcNClus",";n/event;count",120,-0.5,119.5);
389 fQAList->Add(fEmcNClus);
390 fEmcNClusCut = new TH1F("fEmcNClusCut",";n/event;count",120,-0.5,119.5);
391 fEmcNClusCut->Sumw2();
392 fQAList->Add(fEmcNClusCut);
393 fNTracksECut = new TH1F("fNTracksECut",";n/event;count",120,-0.5,119.5);
394 fNTracksECut->Sumw2();
395 fQAList->Add(fNTracksECut);
396 fEmcNCellsCut = new TH1F("fEmcNCellsCut",";n/event;count",120,-0.5,119.5);
397 fEmcNCellsCut->Sumw2();
398 fQAList->Add(fEmcNCellsCut);
399 fEmcClusETM1 = new TH1F("fEmcClusETM1","(method clus->GetTrackDx,z);GeV;counts",fNBinsPt, fPtBinLowEdge,fPtBinHighEdge);
400 fEmcClusETM1->Sumw2();
401 fQAList->Add(fEmcClusETM1);
402 fEmcClusETM2 = new TH1F("fEmcClusETM2","(method track->GetEMCALcluster());GeV;counts",fNBinsPt, fPtBinLowEdge,fPtBinHighEdge);
403 fEmcClusETM2->Sumw2();
404 fQAList->Add(fEmcClusETM2);
405 fEmcClusNotExo = new TH1F("fEmcClusNotExo","exotics removed;GeV;counts",fNBinsPt, fPtBinLowEdge,fPtBinHighEdge);
406 fEmcClusNotExo->Sumw2();
407 fQAList->Add(fEmcClusNotExo);
408 fEmcClusEPhi = new TH2F("fEmcClusEPhi",";GeV;#phi",fNBinsPt, fPtBinLowEdge,fPtBinHighEdge,63,0,6.3);
409 fEmcClusEPhi->Sumw2();
410 fQAList->Add(fEmcClusEPhi);
411 fEmcClusEPhiCut = new TH2F("fEmcClusEPhiCut",";GeV;#phi",fNBinsPt, fPtBinLowEdge,fPtBinHighEdge,63,0,6.3);
412 fEmcClusEPhiCut->Sumw2();
413 fQAList->Add(fEmcClusEPhiCut);
414 fEmcClusEEta = new TH2F("fEmcClusEEta",";GeV;#eta",fNBinsPt, fPtBinLowEdge,fPtBinHighEdge,19,-0.9,0.9);
415 fEmcClusEEta->Sumw2();
416 fQAList->Add(fEmcClusEEta);
417 fEmcClusEEtaCut = new TH2F("fEmcClusEEtaCut",";GeV;#eta",fNBinsPt, fPtBinLowEdge,fPtBinHighEdge,18,-0.9,0.9);
418 fEmcClusEEtaCut->Sumw2();
419 fQAList->Add(fEmcClusEEtaCut);
420 fTrackPtPhi = new TH2F("fTrackPtPhi",";p_{T} [GeV/c];#phi",fNBinsPt, fPtBinLowEdge,fPtBinHighEdge,63,0,6.3);
421 fTrackPtPhi->Sumw2();
422 fQAList->Add(fTrackPtPhi);
423 fTrackPtPhiCut = new TH2F("fTrackPtPhiCut",";p_{T} [GeV/c];#phi",fNBinsPt, fPtBinLowEdge,fPtBinHighEdge,63,0,6.3);
424 fTrackPtPhiCut->Sumw2();
425 fQAList->Add(fTrackPtPhiCut);
426 fTrackPtEta = new TH2F("fTrackPtEta",";p_{T} [GeV/c];#eta",fNBinsPt, fPtBinLowEdge,fPtBinHighEdge,18,-0.9,0.9);
427 fTrackPtEta->Sumw2();
428 fQAList->Add(fTrackPtEta);
429 fTrackPtEtaCut = new TH2F("fTrackPtEtaCut",";p_{T} [GeV/c];#eta",fNBinsPt, fPtBinLowEdge,fPtBinHighEdge,18,-0.9,0.9);
430 fTrackPtEtaCut->Sumw2();
431 fQAList->Add(fTrackPtEtaCut);
432 fEmcClusEClusCuts = new TH2F("fEmcClusEClusCuts",";GeV;cut",fNBinsPt, fPtBinLowEdge,fPtBinHighEdge,fNCuts,-0.5,fNCuts-0.5);
433 fEmcClusEClusCuts->Sumw2();
434 fQAList->Add(fEmcClusEClusCuts);
436 fMaxCellEPhi = new TH2F("fMaxCellEPhi","Most energetic cell in event; GeV;#phi",fNBinsPt, fPtBinLowEdge,fPtBinHighEdge,63,0,6.3);
437 fMaxCellEPhi->Sumw2();
438 fQAList->Add(fMaxCellEPhi);
440 PostData(1, fOutputList);
441 PostData(2, fQAList);
444 //________________________________________________________________________
445 void AliAnalysisTaskEMCALIsoPhoton::UserExec(Option_t *)
447 // Main loop, called for each event.
452 // event trigger selection
453 Bool_t isSelected = 0;
454 if(fPeriod.Contains("11a")){
455 if(fTrigBit.Contains("kEMC"))
456 isSelected = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & AliVEvent::kEMC1);
458 isSelected = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & AliVEvent::kMB);
461 if(fTrigBit.Contains("kEMC"))
462 isSelected = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & AliVEvent::kEMC7);
464 if(fTrigBit.Contains("kMB"))
465 isSelected = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & AliVEvent::kMB);
467 isSelected = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & AliVEvent::kINT7);
469 if(fPeriod.Contains("11h")){
470 if(fTrigBit.Contains("kAny"))
471 isSelected = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & AliVEvent::kAny);
472 if(fTrigBit.Contains("kAnyINT"))
473 isSelected = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & AliVEvent::kAnyINT);
478 printf("isSelected = %d, fIsMC=%d\n", isSelected, fIsMc);
482 TTree *tree = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->GetTree();
483 TFile *file = (TFile*)tree->GetCurrentFile();
484 TString filename = file->GetName();
485 if(!filename.Contains(fPathStrOpt.Data()))
488 fVEvent = (AliVEvent*)InputEvent();
490 printf("ERROR: event not available\n");
493 Int_t runnumber = InputEvent()->GetRunNumber() ;
495 printf("run number = %d\n",runnumber);
497 fESD = dynamic_cast<AliESDEvent*>(fVEvent);
499 fAOD = dynamic_cast<AliAODEvent*>(fVEvent);
501 printf("ERROR: Invalid type of event!!!\n");
505 printf("AOD EVENT!\n");
510 printf("event is ok,\n run number=%d\n",runnumber);
513 AliVVertex *pv = (AliVVertex*)fVEvent->GetPrimaryVertex();
514 Bool_t pvStatus = kTRUE;
516 AliESDVertex *esdv = (AliESDVertex*)fESD->GetPrimaryVertex();
517 pvStatus = esdv->GetStatus();
520 AliAODVertex *aodv = (AliAODVertex*)fAOD->GetPrimaryVertex();
521 pvStatus = aodv->GetStatus();
529 fPVtxZ->Fill(pv->GetZ());
530 if(TMath::Abs(pv->GetZ())>10)
533 printf("passed vertex cut\n");
537 fTracks = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject("Tracks"));
539 fTracks = dynamic_cast<TClonesArray*>(fAOD->GetTracks());
542 AliError("Track array in event is NULL!");
544 printf("returning due to not finding tracks!\n");
547 // Track loop to fill a pT spectrum
548 const Int_t Ntracks = fTracks->GetEntriesFast();
549 for (Int_t iTracks = 0; iTracks < Ntracks; ++iTracks) {
550 // for (Int_t iTracks = 0; iTracks < fESD->GetNumberOfTracks(); iTracks++) {
551 //AliESDtrack* track = (AliESDtrack*)fESD->GetTrack(iTracks);
552 AliVTrack *track = (AliVTrack*)fTracks->At(iTracks);
555 AliAODTrack *aodTrack = dynamic_cast<AliAODTrack*>(track);
556 AliESDtrack *esdTrack = dynamic_cast<AliESDtrack*>(track);
558 if(esdTrack->GetEMCALcluster()>0)
559 fClusIdFromTracks.Append(Form("%d ",esdTrack->GetEMCALcluster()));
560 if (fPrTrCuts && fPrTrCuts->IsSelected(track)){
561 fSelPrimTracks->Add(track);
565 if (fSelHybrid && !aodTrack->IsHybridGlobalConstrainedGlobal())
567 if(!fSelHybrid && !aodTrack->TestFilterBit(fFilterBit))
569 fSelPrimTracks->Add(track);
570 /*if(fTrackMaxPt<track->Pt())
571 fTrackMaxPt = track->Pt();*/
575 TObjArray *matEMCAL=(TObjArray*)fOADBContainer->GetObject(runnumber,"EmcalMatrices");
576 for(Int_t mod=0; mod < (fGeom->GetEMCGeometry())->GetNumberOfSuperModules(); mod++){
577 if(fGeoName=="EMCAL_FIRSTYEARV1" && mod>3)
580 fGeom->SetMisalMatrix(fESD->GetEMCALMatrix(mod), mod);
582 // if(fVEvent->GetEMCALMatrix(mod))
583 fGeomMatrix[mod] = (TGeoHMatrix*) matEMCAL->At(mod);
584 fGeom->SetMisalMatrix(fGeomMatrix[mod] , mod);
588 AliESDtrackCuts *fTrackCuts = new AliESDtrackCuts();
589 fTrackMult = fTrackCuts->GetReferenceMultiplicity(fESD);//kTrackletsITSTPC ,0.5);
591 printf("ESD Track mult= %d\n",fTrackMult);
594 fTrackMult = Ntracks;
596 printf("AOD Track mult= %d\n",fTrackMult);
598 fTrMultDist->Fill(fTrackMult);
601 TList *l = fESD->GetList();
602 fESDClusters = dynamic_cast<TClonesArray*>(l->FindObject("CaloClusters"));
603 fESDCells = fESD->GetEMCALCells();
605 printf("ESD cluster mult= %d\n",fESDClusters->GetEntriesFast());
608 fAODClusters = dynamic_cast<TClonesArray*>(fAOD->GetCaloClusters());
609 fAODCells = fAOD->GetEMCALCells();
611 printf("AOD cluster mult= %d\n",fAODClusters->GetEntriesFast());
615 fMCEvent = MCEvent();
618 std::cout<<"MCevent exists\n";
619 fStack = (AliStack*)fMCEvent->Stack();
623 std::cout<<"ERROR: NO MC EVENT!!!!!!\n";
628 printf("passed calling of FollowGamma\n");
631 printf("passed calling of FillClusHists\n");
634 printf("passed calling of FillMcHists\n");
638 printf("passed calling of FillQA\n");
640 fESDClusters->Clear();*/
641 fSelPrimTracks->Clear();
644 fClusIdFromTracks = "";
646 PostData(1, fOutputList);
647 PostData(2, fQAList);
650 //________________________________________________________________________
651 void AliAnalysisTaskEMCALIsoPhoton::FillClusHists()
654 printf("Inside FillClusHists()....\n");
655 // Fill cluster histograms.
656 TObjArray *clusters = fESDClusters;
659 clusters = fAODClusters;
661 printf("ESD clusters empty...");
665 printf(" and AOD clusters as well!!!\n");
671 const Int_t nclus = clusters->GetEntries();
675 printf("Inside FillClusHists and there are %d clusters\n",nclus);
679 for(Int_t ic=0;ic<nclus;ic++){
681 AliVCluster *c = static_cast<AliVCluster*>(clusters->At(ic));
688 if(fCpvFromTrack && fClusIdFromTracks.Contains(Form("%d",ic)))
693 Double_t Emax = GetMaxCellEnergy( c, id);
695 printf("cluster max cell E=%1.1f",Emax);
696 Float_t clsPos[3] = {0,0,0};
697 c->GetPosition(clsPos);
698 TVector3 clsVec(clsPos);
699 Double_t Et = c->E()*TMath::Sin(clsVec.Theta());
701 printf("\tcluster eta=%1.1f,phi=%1.1f,E=%1.1f\n",clsVec.Eta(),clsVec.Phi(),c->E());
704 Float_t ceiso, cephiband, cecore;
705 Float_t triso, trphiband, trcore;
706 Float_t alliso, allphiband;//, allcore;
707 Float_t phibandArea = (1.4 - 2*fIsoConeR)*2*fIsoConeR;
708 Float_t netConeArea = TMath::Pi()*(fIsoConeR*fIsoConeR - 0.04*0.04);
709 GetCeIso(clsVec, id, ceiso, cephiband, cecore);
710 GetTrIso(clsVec, triso, trphiband, trcore);
711 Double_t dr = TMath::Sqrt(c->GetTrackDx()*c->GetTrackDx() + c->GetTrackDz()*c->GetTrackDz());
712 if(Et>10 && Et<15 && dr>0.025){
713 fHigherPtConeM02->Fill(fHigherPtCone,c->GetM02());
715 printf("\t\tHigher track pt inside the cone: %1.1f GeV/c; M02=%1.2f\n",fHigherPtCone,c->GetM02());
717 alliso = ceiso + triso;
718 allphiband = cephiband + trphiband;
719 //allcore = cecore + trcore;
720 Float_t ceisoue = cephiband/phibandArea*netConeArea;
721 Float_t trisoue = trphiband/phibandArea*netConeArea;
722 Float_t allisoue = allphiband/phibandArea*netConeArea;
723 Float_t mcptsum = GetMcPtSumInCone(clsVec.Eta(), clsVec.Phi(),fIsoConeR);
725 printf("\t alliso=%1.1f, Et=%1.1f=-=-=-=-=\n",alliso,Et);
726 if(c->GetM02()>0.5 && c->GetM02()<2.0){
727 fMcPtInConeBG->Fill(alliso-allisoue, mcptsum);
728 fMcPtInConeBGnoUE->Fill(alliso, mcptsum);
729 fMcPtInConeTrBGnoUE->Fill(triso, mcptsum);
731 if(c->GetM02()>0.1 && c->GetM02()<0.3 && dr>0.03){
732 fMcPtInConeSBG->Fill(alliso-allisoue, mcptsum);
733 fMcPtInConeSBGnoUE->Fill(alliso, mcptsum);
734 fMcPtInConeTrSBGnoUE->Fill(triso, mcptsum);
735 if(fMcIdFamily.Contains((Form("%d",c->GetLabel())))){
736 fAllIsoEtMcGamma->Fill(Et, alliso-cecore-allisoue);
737 fAllIsoNoUeEtMcGamma->Fill(Et, alliso-cecore);
740 Bool_t isCPV = kFALSE;
741 if(TMath::Abs(c->GetTrackDx())<0.03 && TMath::Abs(c->GetTrackDz())<0.02)
743 if(c->GetM02()>0.1 && c->GetM02()<0.3 && isCPV)
744 fClusEtCPVSBGISO->Fill(Et,alliso - trcore);
745 if(c->GetM02()>0.5 && c->GetM02()<2.0 && isCPV)
746 fClusEtCPVSBGISO->Fill(Et,alliso - trcore);
747 const Int_t ndims = fNDimensions;
748 Double_t outputValues[ndims];
750 ptmc = GetClusSource(c);
753 outputValues[0] = Et;
754 outputValues[1] = c->GetM02();
755 outputValues[2] = ceiso/*cecore*/-ceisoue;
756 outputValues[3] = triso-trisoue;
757 outputValues[4] = alliso/*cecore*/-allisoue - trcore;
758 outputValues[5] = ceiso;
759 outputValues[6] = alliso - trcore;
761 printf("track-cluster dphi=%1.3f, deta=%1.3f\n",c->GetTrackDx(),c->GetTrackDz());
762 if(TMath::Abs(c->GetTrackDx())<0.1)
763 outputValues[7] = c->GetTrackDx();
765 outputValues[7] = 0.099*c->GetTrackDx()/TMath::Abs(c->GetTrackDx());
766 if(TMath::Abs(c->GetTrackDz())<0.05)
767 outputValues[8] = c->GetTrackDz();
769 outputValues[8] = 0.049*c->GetTrackDz()/TMath::Abs(c->GetTrackDz());
770 outputValues[9] = clsVec.Eta();
771 outputValues[10] = clsVec.Phi();
773 outputValues[11] = fESDCells->GetCellTime(id);
775 outputValues[11] = fAODCells->GetCellTime(id);
776 outputValues[12] = fTrackMult;
777 outputValues[13] = ptmc;
778 fHnOutput->Fill(outputValues);
782 fNClusHighClusE->Fill(maxE,nclus);
784 fNClusEt10->Fill(nclus10);
785 fNClusPerPho->Fill(fDirPhoPt,fNClusForDirPho);
788 //________________________________________________________________________
789 void AliAnalysisTaskEMCALIsoPhoton::GetCeIso(TVector3 vec, Int_t maxid, Float_t &iso, Float_t &phiband, Float_t &core)
791 // Get cell isolation.
792 AliVCaloCells *cells = fESDCells;
796 printf("ESD cells empty...");
800 printf(" and AOD cells are empty as well!!!\n");
804 TObjArray *clusters = fESDClusters;
806 clusters = fAODClusters;
811 const Int_t nclus = clusters->GetEntries();
812 //const Int_t ncells = cells->GetNumberOfCells();
816 Float_t etacl = vec.Eta();
817 Float_t phicl = vec.Phi();
818 Float_t maxtcl = cells->GetCellTime(maxid);
820 phicl+=TMath::TwoPi();
822 Float_t eta=-1, phi=-1;
823 for(int icell=0;icell<ncells;icell++){
824 absid = TMath::Abs(cells->GetCellNumber(icell));
825 Float_t celltime = cells->GetCellTime(absid);
826 //if(TMath::Abs(celltime)>2e-8 && (!fIsMc))
827 if(TMath::Abs(celltime-maxtcl)>2e-8 )
831 fGeom->EtaPhiFromIndex(absid,eta,phi);
832 Float_t dphi = TMath::Abs(phi-phicl);
833 Float_t deta = TMath::Abs(eta-etacl);
834 Float_t R = TMath::Sqrt(deta*deta + dphi*dphi);*/
835 for(int ic=0;ic<nclus;ic++){
836 AliVCluster *c = static_cast<AliVCluster*>(clusters->At(ic));
841 if(c->E()<fMinIsoClusE)
844 GetMaxCellEnergy( c, id);
845 Double_t maxct = cells->GetCellTime(id);
846 if(TMath::Abs(maxtcl-maxct)>2.5e-9 && (!fIsMc))
848 Float_t clsPos[3] = {0,0,0};
849 c->GetPosition(clsPos);
851 Double_t Et = c->E()*TMath::Sin(cv.Theta());
852 Float_t dphi = TMath::Abs(cv.Phi()-phicl);
853 Float_t deta = TMath::Abs(cv.Eta()-etacl);
854 Float_t R = TMath::Sqrt(deta*deta + dphi*dphi);
859 Double_t matchedpt = GetTrackMatchedPt(c->GetTrackMatchedIndex());
860 if(matchedpt>0 && fRemMatchClus)
862 Double_t nEt = TMath::Max(Et-matchedpt, 0.0);
864 printf("nEt=%1.1f\n",nEt);
882 //________________________________________________________________________
883 void AliAnalysisTaskEMCALIsoPhoton::GetTrIso(TVector3 vec, Float_t &iso, Float_t &phiband, Float_t &core)
885 // Get track isolation.
890 const Int_t ntracks = fSelPrimTracks->GetEntries();
894 Double_t etacl = vec.Eta();
895 Double_t phicl = vec.Phi();
897 phicl+=TMath::TwoPi();
898 for(int itrack=0;itrack<ntracks;itrack++){
899 AliVTrack *track = static_cast<AliVTrack*> (fSelPrimTracks->At(itrack));
902 Double_t dphi = TMath::Abs(track->Phi()-phicl);
903 Double_t deta = TMath::Abs(track->Eta()-etacl);
904 Double_t R = TMath::Sqrt(deta*deta + dphi*dphi);
905 Double_t pt = track->Pt();
909 totiso += track->Pt();
918 totband += track->Pt();
926 //________________________________________________________________________
927 Double_t AliAnalysisTaskEMCALIsoPhoton::GetCrossEnergy(const AliVCluster *cluster, Short_t &idmax)
929 // Calculate the energy of cross cells around the leading cell.
931 AliVCaloCells *cells = 0;
950 Double_t crossEnergy = 0;
952 fGeom->GetCellIndex(idmax,iSupMod,iTower,iIphi,iIeta);
953 fGeom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,iIphi, iIeta,iphis,ietas);
955 Int_t ncells = cluster->GetNCells();
956 for (Int_t i=0; i<ncells; i++) {
957 Int_t cellAbsId = cluster->GetCellAbsId(i);
958 fGeom->GetCellIndex(cellAbsId,iSupMod,iTower,iIphi,iIeta);
959 fGeom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,iIphi, iIeta,iphi,ieta);
960 Int_t aphidiff = TMath::Abs(iphi-iphis);
963 Int_t aetadiff = TMath::Abs(ieta-ietas);
966 if ( (aphidiff==1 && aetadiff==0) ||
967 (aphidiff==0 && aetadiff==1) ) {
968 crossEnergy += cells->GetCellAmplitude(cellAbsId);
975 //________________________________________________________________________
976 Double_t AliAnalysisTaskEMCALIsoPhoton ::GetMaxCellEnergy(const AliVCluster *cluster, Short_t &id) const
978 // Get maximum energy of attached cell.
982 AliVCaloCells *cells = 0;
990 Int_t ncells = cluster->GetNCells();
991 for (Int_t i=0; i<ncells; i++) {
992 Double_t e = cells->GetCellAmplitude(TMath::Abs(cluster->GetCellAbsId(i)));
995 id = cluster->GetCellAbsId(i);
1001 //________________________________________________________________________
1002 void AliAnalysisTaskEMCALIsoPhoton ::FillMcHists()
1006 Int_t nTracks = fStack->GetNtrack();
1008 printf("Inside FillMcHists and there are %d mcparts\n",nTracks);
1009 for(Int_t iTrack=0;iTrack<nTracks;iTrack++){
1010 TParticle *mcp = static_cast<TParticle*>(fStack->Particle(iTrack));
1013 Int_t pdg = mcp->GetPdgCode();
1016 if(TMath::Abs(mcp->Eta())>0.7 ||mcp->Phi()<1.4 || mcp->Phi()>3.2)
1018 Int_t imom = mcp->GetMother(0);
1019 if(imom<0 || imom>nTracks)
1021 TParticle *mcmom = static_cast<TParticle*>(fStack->Particle(imom));
1024 Int_t pdgMom = mcmom->GetPdgCode();
1025 Double_t mcphi = mcp->Phi();
1026 Double_t mceta = mcp->Eta();
1027 if((imom==6 || imom==7) && pdgMom==22) {
1028 fMCDirPhotonPtEtaPhi->Fill(mcp->Pt(),mcp->Eta(),mcp->Phi());
1029 Float_t ptsum = GetMcPtSumInCone(mcp->Eta(), mcp->Phi(), fIsoConeR);
1030 fMcPtInConeMcPhoPt->Fill(mcp->Pt(),ptsum);
1032 fMCIsoDirPhotonPtEtaPhi->Fill(mcp->Pt(),mcp->Eta(),mcp->Phi());
1033 if(mcphi<(3.14-fIsoConeR) && mcphi>(1.4+fIsoConeR) && TMath::Abs(mceta)<(0.7-fIsoConeR))
1034 fMCDirPhotonPtEtIso->Fill(mcp->Pt(),ptsum);
1035 if(fNClusForDirPho==0)
1036 fMCDirPhotonPtEtaPhiNoClus->Fill(mcp->Pt(),mcp->Eta(),mcp->Phi());
1038 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());
1039 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());
1043 if(TMath::Abs(pdgMom)>100 && TMath::Abs(pdgMom)<1000)
1044 fDecayPhotonPtMC->Fill(mcp->Pt());
1048 //________________________________________________________________________
1049 Float_t AliAnalysisTaskEMCALIsoPhoton::GetClusSource(const AliVCluster *c)
1055 Int_t nmcp = fStack->GetNtrack();
1056 Int_t clabel = c->GetLabel();
1057 if(fDebug && fMcIdFamily.Contains(Form("%d",clabel)))
1058 printf("\n\t ==== Label %d is a descendent of the prompt photon ====\n\n",clabel);
1059 if(!fMcIdFamily.Contains(Form("%d",clabel)))
1062 TString partonposstr = (TSubString)fMcIdFamily.operator()(0,1);
1063 Int_t partonpos = partonposstr.Atoi();
1065 printf("\t^^^^ parton position = %d ^^^^\n",partonpos);
1066 if(clabel<0 || clabel>nmcp)
1068 Float_t clsPos[3] = {0,0,0};
1069 c->GetPosition(clsPos);
1070 TVector3 clsVec(clsPos);
1071 Double_t Et = c->E()*TMath::Sin(clsVec.Theta());
1072 TParticle *mcp = static_cast<TParticle*>(fStack->Particle(partonpos));
1076 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);
1078 Int_t lab1 = mcp->GetFirstDaughter();
1079 if(lab1<0 || lab1>nmcp)
1081 TParticle *mcd = static_cast<TParticle*>(fStack->Particle(lab1));
1085 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);
1086 if(mcd->GetPdgCode()==22){
1087 fClusEtMcPt->Fill(mcd->Pt(), Et);
1088 fClusMcDetaDphi->Fill(clsVec.Eta() - mcd->Eta(), clsVec.Phi() - mcd->Phi());
1091 printf("Warning: daughter of photon parton is not a photon\n");
1096 //________________________________________________________________________
1097 void AliAnalysisTaskEMCALIsoPhoton::FollowGamma()
1102 TParticle *mcp = static_cast<TParticle*>(fStack->Particle(selfid));
1105 if(mcp->GetPdgCode()!=22){
1106 mcp = static_cast<TParticle*>(fStack->Particle(++selfid));
1110 Int_t daug0f = mcp->GetFirstDaughter();
1111 Int_t daug0l = mcp->GetLastDaughter();
1112 Int_t nd0 = daug0l - daug0f;
1114 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);
1115 fMcIdFamily = Form("%d,",selfid);
1116 GetDaughtersInfo(daug0f,daug0l, selfid,"");
1118 printf("\t---- end of the prompt gamma's family tree ----\n\n");
1119 printf("Family id string = %s,\n\n",fMcIdFamily.Data());
1121 TParticle *md = static_cast<TParticle*>(fStack->Particle(daug0f));
1124 fDirPhoPt = md->Pt();
1126 //________________________________________________________________________
1127 void AliAnalysisTaskEMCALIsoPhoton::GetDaughtersInfo(int firstd, int lastd, int selfid, const char *inputind)
1129 int nmcp = fStack->GetNtrack();
1130 if(firstd<0 || firstd>nmcp)
1132 if(lastd<0 || lastd>nmcp)
1135 printf("WARNING: First daughter > last (%d,%d)\n",firstd,lastd);
1138 TString indenter = Form("\t%s",inputind);
1139 TParticle *dp = 0x0;
1141 printf("\t%s--- Daughters of particle %d ---\n", indenter.Data(), selfid);
1142 for(int id=firstd; id<lastd+1; id++){
1143 dp = static_cast<TParticle*>(fStack->Particle(id));
1146 Int_t dfd = dp->GetFirstDaughter();
1147 Int_t dld = dp->GetLastDaughter();
1148 Int_t dnd = dld - dfd + 1;
1149 Float_t vr = TMath::Sqrt(dp->Vx()*dp->Vx()+dp->Vy()*dp->Vy());
1151 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);
1152 fMcIdFamily += Form("%d,",id);
1153 GetDaughtersInfo(dfd,dld,id,indenter.Data());
1157 //________________________________________________________________________
1158 Float_t AliAnalysisTaskEMCALIsoPhoton::GetMcPtSumInCone(Float_t etaclus, Float_t phiclus, Float_t R)
1163 printf("Inside GetMcPtSumInCone!!\n");
1164 Int_t nTracks = fStack->GetNtrack();
1166 TString addpartlabels = "";
1167 for(Int_t iTrack=9;iTrack<nTracks;iTrack++){
1168 TParticle *mcp = static_cast<TParticle*>(fStack->Particle(iTrack));
1171 Int_t status = mcp->GetStatusCode();
1174 Float_t mcvr = TMath::Sqrt(mcp->Vx()*mcp->Vx()+ mcp->Vy()* mcp->Vy() + mcp->Vz()*mcp->Vz());
1179 printf(" >>>> mcp Rho, Vx, Vy, Vz = %1.1f,%1.1f,%1.1f,%1.1f.......\n",mcp->Rho(),mcp->Vx(), mcp->Vy(),mcp->Vz());
1181 Float_t dphi = mcp->Phi() - phiclus;
1182 Float_t deta = mcp->Eta() - etaclus;
1183 if(fDebug && TMath::Abs(dphi)<0.01)
1184 printf(" >>>> mcphi = %1.1f, mceta = %1.1f\n>>>> dphi = %1.1f, deta = %1.1f\n", mcp->Phi(), mcp->Eta(),dphi,deta);
1186 if(deta>R || dphi>R)
1188 Float_t dR = TMath::Sqrt(dphi*dphi + deta*deta);
1191 addpartlabels += Form("%d,",iTrack);
1198 //________________________________________________________________________
1199 void AliAnalysisTaskEMCALIsoPhoton::FillQA()
1202 TObjArray *clusters = fESDClusters;
1203 //"none", "exotic", "exo+cpv1", "exo+cpv1+time", "exo+cpv1+time+m02"),
1205 clusters = fAODClusters;
1207 printf("ESD clusters empty...");
1211 printf(" and AOD clusters as well!!!\n");
1216 const int ntracks = fSelPrimTracks->GetEntriesFast();
1217 const int ncells = fNCells50;//fESDCells->GetNumberOfCells();
1218 const Int_t nclus = clusters->GetEntries();
1219 fNTracks->Fill(ntracks);
1220 fEmcNCells->Fill(ncells);
1221 fEmcNClus->Fill(nclus);
1222 if(fMaxEClus>fECut){
1223 fNTracksECut->Fill(ntracks);
1224 fEmcNCellsCut->Fill(ncells);
1225 fEmcNClusCut->Fill(nclus);
1227 for(int it=0;it<ntracks;it++){
1228 AliVTrack *t = (AliVTrack*)fSelPrimTracks->At(it);
1231 fTrackPtPhi->Fill(t->Pt(),t->Phi());
1232 fTrackPtEta->Fill(t->Pt(),t->Eta());
1233 if(fMaxEClus>fECut){
1234 fTrackPtPhiCut->Fill(t->Pt(), t->Phi());
1235 fTrackPtEtaCut->Fill(t->Pt(), t->Eta());
1238 for(int ic=0;ic<nclus;ic++){
1239 AliVCluster *c = dynamic_cast<AliVCluster*>(clusters->At(ic));
1240 //AliESDCaloCluster *c = (AliESDCaloCluster*)clusters->At(ic);
1245 Float_t clsPos[3] = {0,0,0};
1246 c->GetPosition(clsPos);
1247 TVector3 clsVec(clsPos);
1248 Double_t cphi = clsVec.Phi();
1249 Double_t ceta = clsVec.Eta();
1251 GetMaxCellEnergy( c, id);
1252 fEmcClusEClusCuts->Fill(c->E(),0);
1253 fEmcClusEPhi->Fill(c->E(), cphi);
1254 fEmcClusEEta->Fill(c->E(), ceta);
1255 if(fMaxEClus>fECut){
1256 fEmcClusEPhiCut->Fill(c->E(), cphi);
1257 fEmcClusEEtaCut->Fill(c->E(), ceta);
1261 maxt = fESDCells->GetCellTime(id);
1263 maxt = fAODCells->GetCellTime(id);
1266 fEmcClusNotExo->Fill(c->E());
1267 fEmcClusEClusCuts->Fill(c->E(),1);
1268 if(fClusIdFromTracks.Contains(Form("%d",ic)))
1269 fEmcClusETM2->Fill(c->E());
1270 if(TMath::Abs(c->GetTrackDx())<0.03 && TMath::Abs(c->GetTrackDz())<0.02){
1271 fEmcClusETM1->Fill(c->E());
1274 fEmcClusEClusCuts->Fill(c->E(),2);
1275 if(TMath::Abs(maxt)>30e-9)
1277 fEmcClusEClusCuts->Fill(c->E(),3);
1279 fEmcClusEClusCuts->Fill(c->E(),4);
1282 //________________________________________________________________________
1283 Double_t AliAnalysisTaskEMCALIsoPhoton::GetTrackMatchedPt(Int_t matchIndex)
1288 if(matchIndex<0 || matchIndex>fTracks->GetEntries()){
1290 printf("track-matched index out of track array range!!!\n");
1293 AliVTrack* track = static_cast<AliVTrack*>(fTracks->At(matchIndex));
1296 printf("track-matched pointer does not exist!!!\n");
1302 if(!fPrTrCuts->IsSelected(track))
1308 //________________________________________________________________________
1309 void AliAnalysisTaskEMCALIsoPhoton::LoopOnCells()
1311 AliVCaloCells *cells = 0;
1318 Double_t maxphi = -10;
1319 Int_t ncells = cells->GetNumberOfCells();
1321 for (Int_t i=0; i<ncells; i++) {
1322 Short_t absid = TMath::Abs(cells->GetCellNumber(i));
1323 Double_t e = cells->GetCellAmplitude(absid);
1328 fGeom->EtaPhiFromIndex(absid,eta,phi);
1334 fMaxCellEPhi->Fill(maxe,maxphi);
1337 //________________________________________________________________________
1338 bool AliAnalysisTaskEMCALIsoPhoton::IsExotic(AliVCluster *c)
1342 Double_t Emax = GetMaxCellEnergy( c, id);
1343 Double_t Ecross = GetCrossEnergy( c, id);
1344 if((1-Ecross/Emax)>fExoticCut)
1348 //________________________________________________________________________
1349 void AliAnalysisTaskEMCALIsoPhoton::Terminate(Option_t *)
1351 // Called once at the end of the query.