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 is 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 // Task for Heavy Flavour Electron-Hadron DeltaPhi Correlation //
20 // Non-Photonic Electron identified with Invariant mass //
21 // analysis methos in function SelectPhotonicElectron //
22 // DeltaPhi calculated in function ElectronHadCorrel //
24 // Author: Deepa Thomas (Utrecht University) //
26 ////////////////////////////////////////////////////////////////////////
33 #include "THnSparse.h"
34 #include "TLorentzVector.h"
38 #include "AliAnalysisTask.h"
39 #include "AliAnalysisManager.h"
42 #include "AliESDEvent.h"
43 #include "AliESDHandler.h"
44 #include "AliAODEvent.h"
45 #include "AliAODHandler.h"
47 #include "AliAnalysisTaskElecHadronCorrel.h"
48 #include "TGeoGlobalMagField.h"
50 #include "AliAnalysisTaskSE.h"
51 #include "TRefArray.h"
53 #include "AliESDInputHandler.h"
54 #include "AliESDpid.h"
55 #include "AliESDtrackCuts.h"
56 #include "AliPhysicsSelection.h"
57 #include "AliESDCaloCluster.h"
58 #include "AliAODCaloCluster.h"
59 #include "AliESDCaloTrigger.h"
60 #include "AliEMCALRecoUtils.h"
61 #include "AliEMCALGeometry.h"
62 #include "AliGeomManager.h"
64 #include "TGeoManager.h"
68 //#include "AliEventPoolManager.h"
70 #include "AliCentrality.h"
71 //#include "AliEMCALTrack.h"
72 //#include "AliEMCALTracker.h"
75 #include "AliKFParticle.h"
76 #include "AliKFVertex.h"
79 #include "AliPIDResponse.h"
80 #include "AliHFEcontainer.h"
81 #include "AliHFEcuts.h"
82 #include "AliHFEpid.h"
83 #include "AliHFEpidBase.h"
84 #include "AliHFEpidQAmanager.h"
85 #include "AliHFEtools.h"
86 #include "AliCFContainer.h"
87 #include "AliCFManager.h"
89 ClassImp(AliAnalysisTaskElecHadronCorrel)
90 //ClassImp(AliehDPhiBasicParticle)
91 //________________________________________________________________________
92 AliAnalysisTaskElecHadronCorrel::AliAnalysisTaskElecHadronCorrel(const char *name)
93 : AliAnalysisTaskSE(name)
97 ,fTrackCuts1(new AliESDtrackCuts)
98 ,fTrackCuts2(new AliESDtrackCuts)
100 ,fIdentifiedAsOutInz(kFALSE)
101 ,fPassTheEventCut(kFALSE)
102 ,fRejectKinkMother(kFALSE)
107 ,fOpeningAngleCut(0.1)
112 ,fkCentralityMethod(0)
125 */ ,fSemiIncElecDphi(0)
126 ,fSemiIncElecDphi1(0)
127 ,fSemiIncElecDphi2(0)
128 ,fSemiIncElecDphi3(0)
129 ,fSemiIncElecDphi4(0)
135 ,fInclusiveElecDphi(0)
136 ,fInclusiveElecDphi1(0)
137 ,fInclusiveElecDphi2(0)
138 ,fInclusiveElecDphi3(0)
139 ,fInclusiveElecDphi4(0)
150 ,fDphiULSMassLowNoPartner(0)
151 ,fDphiULSMassLowNoPartner1(0)
152 ,fDphiULSMassLowNoPartner2(0)
153 ,fDphiULSMassLowNoPartner3(0)
154 ,fDphiULSMassLowNoPartner4(0)
155 ,fDphiLSMassLowNoPartner(0)
156 ,fDphiLSMassLowNoPartner1(0)
157 ,fDphiLSMassLowNoPartner2(0)
158 ,fDphiLSMassLowNoPartner3(0)
159 ,fDphiLSMassLowNoPartner4(0)
165 // ,fTrackPtBefTrkCuts(0)
166 // ,fTrackPtAftTrkCuts(0)
190 // ,fElecPhiTPCEovP(0)
192 ,fHadronPhiTPChalf(0)
201 /* ,fNoMixedEvents(0)
204 ,fMixedIncElecDphi(0)
205 ,fMixedIncElecDphi1(0)
206 ,fMixedIncElecDphi2(0)
207 ,fMixedPhotElecDphi(0)
208 ,fMixedPhotElecDphi1(0)
209 ,fMixedPhotElecDphi2(0)
210 ,fMixedSemiIncElecDphi(0)
211 ,fMixedSemiIncElecDphi1(0)
212 ,fMixedSemiIncElecDphi2(0)
213 ,fMixedDphiULSMassLow(0)
214 ,fMixedDphiULSMassLow1(0)
215 ,fMixedDphiULSMassLow2(0)
216 ,fMixedDphiLSMassLow(0)
217 ,fMixedDphiLSMassLow1(0)
218 ,fMixedDphiLSMassLow2(0)
227 ,fCentralityNoPass(0)
228 // ,fSparseElectron(0)
229 // ,fvalueElectron(0)
233 fPID = new AliHFEpid("hfePid");
234 // fvalueElectron = new Double_t[8];
236 // Define input and output slots here
237 // Input slot #0 works with a TChain
238 DefineInput(0, TChain::Class());
239 // Output slot #0 id reserved by the base class for AOD
240 // Output slot #1 writes into a TH1 container
241 // DefineOutput(1, TH1I::Class());
242 DefineOutput(1, TList::Class());
243 // DefineOutput(3, TTree::Class());
246 //________________________________________________________________________
247 AliAnalysisTaskElecHadronCorrel::AliAnalysisTaskElecHadronCorrel()
248 : AliAnalysisTaskSE("DefaultAnalysis_AliAnalysisElecHadCorrel")
252 ,fTrackCuts1(new AliESDtrackCuts)
253 ,fTrackCuts2(new AliESDtrackCuts)
255 ,fIdentifiedAsOutInz(kFALSE)
256 ,fPassTheEventCut(kFALSE)
257 ,fRejectKinkMother(kFALSE)
262 ,fOpeningAngleCut(0.1)
267 ,fkCentralityMethod(0)
280 */ ,fSemiIncElecDphi(0)
281 ,fSemiIncElecDphi1(0)
282 ,fSemiIncElecDphi2(0)
283 ,fSemiIncElecDphi3(0)
284 ,fSemiIncElecDphi4(0)
290 ,fInclusiveElecDphi(0)
291 ,fInclusiveElecDphi1(0)
292 ,fInclusiveElecDphi2(0)
293 ,fInclusiveElecDphi3(0)
294 ,fInclusiveElecDphi4(0)
305 ,fDphiULSMassLowNoPartner(0)
306 ,fDphiULSMassLowNoPartner1(0)
307 ,fDphiULSMassLowNoPartner2(0)
308 ,fDphiULSMassLowNoPartner3(0)
309 ,fDphiULSMassLowNoPartner4(0)
310 ,fDphiLSMassLowNoPartner(0)
311 ,fDphiLSMassLowNoPartner1(0)
312 ,fDphiLSMassLowNoPartner2(0)
313 ,fDphiLSMassLowNoPartner3(0)
314 ,fDphiLSMassLowNoPartner4(0)
320 // ,fTrackPtBefTrkCuts(0)
321 // ,fTrackPtAftTrkCuts(0)
345 // ,fElecPhiTPCEovP(0)
347 ,fHadronPhiTPChalf(0)
356 /* ,fNoMixedEvents(0)
359 ,fMixedIncElecDphi(0)
360 ,fMixedIncElecDphi1(0)
361 ,fMixedIncElecDphi2(0)
362 ,fMixedPhotElecDphi(0)
363 ,fMixedPhotElecDphi1(0)
364 ,fMixedPhotElecDphi2(0)
365 ,fMixedSemiIncElecDphi(0)
366 ,fMixedSemiIncElecDphi1(0)
367 ,fMixedSemiIncElecDphi2(0)
368 ,fMixedDphiULSMassLow(0)
369 ,fMixedDphiULSMassLow1(0)
370 ,fMixedDphiULSMassLow2(0)
371 ,fMixedDphiLSMassLow(0)
372 ,fMixedDphiLSMassLow1(0)
373 ,fMixedDphiLSMassLow2(0)
382 ,fCentralityNoPass(0)
383 // ,fSparseElectron(0)
384 // ,fvalueElectron(0)
386 //Default constructor
387 fPID = new AliHFEpid("hfePid");
388 // fvalueElectron = new Double_t[8];
391 // Define input and output slots here
392 // Input slot #0 works with a TChain
393 DefineInput(0, TChain::Class());
394 // Output slot #0 id reserved by the base class for AOD
395 // Output slot #1 writes into a TH1 container
396 // DefineOutput(1, TH1I::Class());
397 DefineOutput(1, TList::Class());
398 //DefineOutput(3, TTree::Class());
400 //_________________________________________
402 AliAnalysisTaskElecHadronCorrel::~AliAnalysisTaskElecHadronCorrel()
413 // delete fSparseElectron;
414 // delete []fvalueElectron;
416 //_________________________________________
418 void AliAnalysisTaskElecHadronCorrel::UserExec(Option_t*)
421 //Called for each event
423 // create pointer to event
424 fESD = dynamic_cast<AliESDEvent*>(InputEvent());
426 printf("ERROR: fESD not available\n");
431 AliError("HFE cuts not available");
435 //---------------CENTRALITY SELECTION-----------------------
436 /* SetCentralityParameters(0., 10., "V0M");
437 Bool_t pass = kFALSE; //to select centrality
438 CheckCentrality(fESD,pass);
442 if(!fPID->IsInitialized()){
443 // Initialize PID with the given run number
444 AliWarning("PID not initialised, get from Run no");
445 fPID->InitializePID(fESD->GetRunNumber());
448 //-------trigger selection
449 UInt_t res = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
453 // if( (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & AliVEvent::kFastOnly) )
456 if(!(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & (AliVEvent::kCentral))) return;
458 AliCentrality *fCentrality = (AliCentrality*)fESD->GetCentrality();
460 Float_t centvalue = fCentrality->GetCentralityPercentile("V0M");
461 fcentrality->Fill(centvalue);
462 if(centvalue<0 || centvalue>10) return;
464 Int_t fNOtrks = fESD->GetNumberOfTracks();
465 const AliESDVertex *pVtx = fESD->GetPrimaryVertex();
467 Double_t pVtxZ = -999;
468 pVtxZ = pVtx->GetZ();
471 // if(!fCFM->CheckEventCuts(AliHFEcuts::kEventStepReconstructed, fESD)) return;
473 if(TMath::Abs(pVtxZ)>10) return;
476 if(fNOtrks<2) return;
478 AliPIDResponse *pidResponse = fInputHandler->GetPIDResponse();
480 AliDebug(1, "Using default PID Response");
481 pidResponse = AliHFEtools::GetDefaultPID(kFALSE, fInputEvent->IsA() == AliAODEvent::Class());
484 fPID->SetPIDResponse(pidResponse);
486 fCFM->SetRecEventInfo(fESD);
489 AliEventPool* pool = fPoolMgr->GetEventPool(centvalue, pVtxZ); // Get the buffer associated with the current centrality and z-vtx
491 AliFatal(Form("No pool found for centrality = %f, zVtx = %f", centvalue, pVtxZ));
495 for (Int_t iTracks = 0; iTracks < fESD->GetNumberOfTracks(); iTracks++) {
496 AliESDtrack* track = fESD->GetTrack(iTracks);
498 printf("ERROR: Could not receive track %d\n", iTracks);
502 if(track->Pt()<1) continue;
504 // fTrackPtBefTrkCuts->Fill(track->Pt());
506 // RecKine: ITSTPC cuts
507 if(!ProcessCutStep(AliHFEcuts::kStepRecKineITSTPC, track)) continue;
510 if(fRejectKinkMother) { // Quick and dirty fix to reject both kink mothers and daughters
511 if(track->GetKinkIndex(0) != 0) continue;
515 if(!ProcessCutStep(AliHFEcuts::kStepRecPrim, track)) continue;
517 // HFE cuts: TPC PID cleanup
518 if(!ProcessCutStep(AliHFEcuts::kStepHFEcutsTPC, track)) continue;
520 // fTrackHFEcuts->Fill(track->Phi());
522 //track phi distribution for diff ITS layer hit
523 // if(track->HasPointOnITSLayer(0)) fTrakPhiSPD1->Fill(track->Phi());
524 // if(track->HasPointOnITSLayer(1)) fTrakPhiSPD2->Fill(track->Phi());
527 // if(track->HasPointOnITSLayer(0) || track->HasPointOnITSLayer(1)) fTrakPhiSPDOr->Fill(track->Phi());
528 // if(track->HasPointOnITSLayer(0) && track->HasPointOnITSLayer(1)) fTrakPhiSPDAnd->Fill(track->Phi());
530 // HFEcuts: ITS layers cuts
531 if(!ProcessCutStep(AliHFEcuts::kStepHFEcutsITS, track)) continue;
533 // fTrackHFEcutsITS->Fill(track->Phi());
535 // fTrackPtAftTrkCuts->Fill(track->Pt());
537 Double_t fClsE = -999, p = -999, fEovP=-999, pt = -999, dEdx=-999, fTPCnSigma=0;
540 dEdx = track->GetTPCsignal();
541 fTPCnSigma = fPID->GetPIDResponse() ? fPID->GetPIDResponse()->NumberOfSigmasTPC(track, AliPID::kElectron) : 1000;
544 if(fTPCnSigma >= -2 && fTPCnSigma <= 2){
545 // fElecPhiTPC->Fill(track->Phi());
549 if(track->Eta() < -0.7 || track->Eta() > 0.7) continue;
551 // Track extrapolation to EMCAL
552 Int_t fClsId = track->GetEMCALcluster();
553 if(fClsId <0) continue;
554 AliESDCaloCluster *cluster = fESD->GetCaloCluster(fClsId);
555 if(TMath::Abs(cluster->GetTrackDx())>0.05 || TMath::Abs(cluster->GetTrackDz())>0.05) continue;
556 // fdEdxBef->Fill(p,dEdx);
557 fTPCnsigma->Fill(p,fTPCnSigma);
560 fClsE = cluster->E();
563 fvalueElectron[0] = pt;
564 fvalueElectron[1] = p;
565 fvalueElectron[2] = fTPCnSigma;
566 fvalueElectron[3] = dEdx;
567 fvalueElectron[4] = fEovP;
568 fvalueElectron[5] = cluster->GetM20();
569 fvalueElectron[6] = cluster->GetM02();
570 fvalueElectron[7] = cluster->GetDispersion();
572 fSparseElectron->Fill(fvalueElectron);
574 if(fTPCnSigma >= -2 && fTPCnSigma <= 2){
575 fTrkEovPBef->Fill(pt,fEovP);
577 if(fTPCnSigma < -3.5)fTrkEovPBefHad->Fill(pt,fEovP);
580 //--- track accepted, do PID
581 AliHFEpidObject hfetrack;
582 hfetrack.SetAnalysisType(AliHFEpidObject::kESDanalysis);
583 hfetrack.SetRecTrack(track);
585 if(fPID->IsSelected(&hfetrack, NULL, "", fPIDqa)) pidpassed = 1;
588 cout << "dedx, E/p : "<< dEdx << ", " << fEovP <<endl;
589 fTrkEovPAft->Fill(pt,fEovP);
590 fdEdxAft->Fill(p,dEdx);
591 fTPCnsigmaAft->Fill(p,fTPCnSigma);
595 //Electron id with TPC and E/p
596 if(fTPCnSigma >= -2 && fTPCnSigma <= 2 && fEovP >= 0.8 && fEovP <=1.2) {
597 // fElecPhiTPCEovP->Fill(track->Phi());
599 //Electron id with shower shape
600 if(cluster->GetM20()<0.2 && cluster->GetM02()< 0.5 && cluster->GetDispersion()<1){
602 fElecPhi->Fill(track->Phi());
603 fElecPhiPt->Fill(track->Phi(),track->Pt());
604 if (track->Eta() >0 && track->Eta() <0.7) fElecPhiTPChalf->Fill(track->Phi());
605 // fTrkEovPAftOwn->Fill(pt,fEovP);
606 // fdEdxAftOwn->Fill(p,dEdx);
607 // fTPCnsigmaAftOwn->Fill(p,fTPCnSigma);
611 Bool_t fFlagPhotonicElec = kFALSE;
612 // select photonic electron
613 SelectPhotonicElectron(iTracks,track,fFlagPhotonicElec);
614 //Inclusive electron-hadron correlation
615 ElectronHadCorrel(iTracks, track, fInclusiveElecDphi, fInclusiveElecDphi1,fInclusiveElecDphi2,fInclusiveElecDphi3,fInclusiveElecDphi4);
616 fInclusiveElecPt->Fill(pt);
617 // MixedEvent(track,fMixedIncElecDphi, fMixedIncElecDphi1,fMixedIncElecDphi2);
620 if(fFlagPhotonicElec){
621 //Electron hadron correlation
622 ElectronHadCorrel(iTracks, track, fPhotElecDphi,fPhotElecDphi1,fPhotElecDphi2,fPhotElecDphi3,fPhotElecDphi4);
623 fPhotoElecPt->Fill(pt);
624 // MixedEvent(track,fMixedPhotElecDphi, fMixedPhotElecDphi1,fMixedPhotElecDphi2);
627 // Semi inclusive electron
628 if(!fFlagPhotonicElec){
629 //Electron hadron correlation
630 ElectronHadCorrel(iTracks, track, fSemiIncElecDphi, fSemiIncElecDphi1,fSemiIncElecDphi2,fSemiIncElecDphi3,fSemiIncElecDphi4);
631 fSemiInclElecPt->Fill(pt);
632 // MixedEvent(track,fMixedSemiIncElecDphi,fMixedSemiIncElecDphi1,fMixedSemiIncElecDphi2);
640 Int_t clsNo = fESD->GetNumberOfCaloClusters();
641 fNClusv1->Fill(clsNo);
642 for(Int_t iclus=0; iclus<clsNo ; iclus++){
643 AliESDCaloCluster* clus = fESD->GetCaloCluster(iclus);
644 if(!clus->IsEMCAL()) continue;
645 fNCellv1->Fill(clus->GetNCells());
646 fClsEv1->Fill(clus->E());
650 TObjArray* tracksClone = CloneAndReduceTrackList();
651 tracksClone->SetOwner();
652 pool->UpdatePool(tracksClone);
654 PostData(1, fOutputList);
656 //_________________________________________
657 void AliAnalysisTaskElecHadronCorrel::UserCreateOutputObjects()
660 // TGeoManager::Import("geometry.root");
661 // fGeom = AliEMCALGeometry::GetInstance("EMCAL_COMPLETEV1");
663 //--------Initialize PID
664 fPID->SetHasMCData(kFALSE);
665 if(!fPID->GetNumberOfPIDdetectors())
667 fPID->AddDetector("TPC", 0);
668 fPID->AddDetector("EMCAL", 1);
671 fPID->SortDetectors();
672 fPIDqa = new AliHFEpidQAmanager();
673 fPIDqa->Initialize(fPID);
675 //--------Initialize correction Framework and Cuts
676 fCFM = new AliCFManager;
677 const Int_t kNcutSteps = AliHFEcuts::kNcutStepsMCTrack + AliHFEcuts::kNcutStepsRecTrack + AliHFEcuts::kNcutStepsDETrack;
678 fCFM->SetNStepParticle(kNcutSteps);
679 for(Int_t istep = 0; istep < kNcutSteps; istep++)
680 fCFM->SetParticleCutsList(istep, NULL);
683 AliWarning("Cuts not available. Default cuts will be used");
684 fCuts = new AliHFEcuts;
685 fCuts->CreateStandardCuts();
687 fCuts->Initialize(fCFM);
689 //Mixed event initialising
690 Int_t trackDepth = 2000;
691 Int_t poolsize = 1000;
693 Int_t nCentralityBins = 5;
694 Double_t CentralityBins[] = {0,2,4,6,8,10};
697 Double_t vertexBins[] = {-10,-5,0,5,10};
699 fPoolMgr = new AliEventPoolManager(poolsize, trackDepth, nCentralityBins, (Double_t*) CentralityBins, nZvtxBins, (Double_t*) vertexBins);
701 //---------Output Tlist
702 fOutputList = new TList();
703 fOutputList->SetOwner();
704 fOutputList->Add(fPIDqa->MakeList("PIDQA"));
706 fNoEvents = new TH1F("fNoEvents","",1,0,1) ;
707 fOutputList->Add(fNoEvents);
709 fcentrality = new TH1F("fcentrality","centrality", 100,0,100);
710 fOutputList->Add(fcentrality);
712 fTrkpt = new TH1F("fTrkpt","track pt",1000,0,50);
713 fOutputList->Add(fTrkpt);
715 fTrackPtBefTrkCuts = new TH1F("fTrackPtBefTrkCuts","track pt before track cuts",1000,0,50);
716 fOutputList->Add(fTrackPtBefTrkCuts);
718 fTrackPtAftTrkCuts = new TH1F("fTrackPtAftTrkCuts","track pt after track cuts",1000,0,50);
719 fOutputList->Add(fTrackPtAftTrkCuts);
721 fTPCnsigma = new TH2F("fTPCnsigma", "TPC - n sigma",1000,0,50,200,-10,10);
722 fOutputList->Add(fTPCnsigma);
724 fTPCnsigmaAft = new TH2F("fTPCnsigmaAft", "TPC - n sigma after hfepid",1000,0,50,200,-10,10);
725 fOutputList->Add(fTPCnsigmaAft);
727 fTPCnsigmaAftOwn = new TH2F("fTPCnsigmaAftOwn", "TPC - n sigma after own pid",1000,0,50,200,-10,10);
728 fOutputList->Add(fTPCnsigmaAftOwn);
730 fTrkEovPBef = new TH2F("fTrkEovPBef","track E/p before HFE pid",1000,0,50,100,0,2);
731 fOutputList->Add(fTrkEovPBef);
733 fTrkEovPBefHad = new TH2F("fTrkEovPBefHad","track E/p for TPCnsig < 3.5",1000,0,50,100,0,2);
734 fOutputList->Add(fTrkEovPBefHad);
736 fTrkEovPAft = new TH2F("fTrkEovPAft","track E/p after HFE pid",1000,0,50,100,0,2);
737 fOutputList->Add(fTrkEovPAft);
739 fTrkEovPAftOwn = new TH2F("fTrkEovPAftOwn","track E/p after own pid",1000,0,50,100,0,2);
740 fOutputList->Add(fTrkEovPAftOwn);
742 fdEdxBef = new TH2F("fdEdxBef","track dEdx vs p before HFE pid",1000,0,50,150,0,150);
743 fOutputList->Add(fdEdxBef);
745 fdEdxAft = new TH2F("fdEdxAft","track dEdx vs p after HFE pid",1000,0,50,150,0,150);
746 fOutputList->Add(fdEdxAft);
748 fdEdxAftOwn = new TH2F("fdEdxAftOwn","track dEdx vs p own HFE pid",1000,0,50,150,0,150);
749 fOutputList->Add(fdEdxAftOwn);
751 fElecPhi = new TH1F("fElecPhi", "Electron phi",1000,0,6.28);
752 fOutputList->Add(fElecPhi);
754 fElecPhiPt = new TH2F("fElecPhiPt", "Electron phi vs pt; Electron phi; pt (GeV/c)",1000,0,6.28,1000,0,100);
755 fOutputList->Add(fElecPhiPt);
757 fElecPhiTPChalf = new TH1F("fElecPhiTPChalf", "Electron phi for 0<eta<0.7",1000,0,6.28);
758 fOutputList->Add(fElecPhiTPChalf);
760 /* fElecPhiTPC = new TH1F("fElecPhiTPC", "Electron phi after TPC cut",1000,0,6.28);
761 fOutputList->Add(fElecPhiTPC);
763 fElecPhiTPCEovP = new TH1F("fElecPhiTPCEovP", "Electron phi after TPC and E/p cut",1000,0,6.28);
764 fOutputList->Add(fElecPhiTPCEovP);
766 fHadronPhi = new TH1F("fHadronPhi", "Hadron phi",1000,0,6.28);
767 fOutputList->Add(fHadronPhi);
769 fHadronPhiTPChalf = new TH1F("fHadronPhiTPChalf", "Hadron phi for 0<eta<0.9",1000,0,6.28);
770 fOutputList->Add(fHadronPhiTPChalf);
772 fHadronPhiPt = new TH2F("fHadronPhiPt", "Hadron phi vs pt; hadron phi; pt (GeV/c)",1000,0,6.28,1000,0,100);
773 fOutputList->Add(fHadronPhiPt);
776 fTrackHFEcuts = new TH1F("fTrackHFEcuts","Track phi for HFE cuts",1000,0,6.28);
777 fOutputList->Add(fTrackHFEcuts);
779 fTrakPhiSPD1 = new TH1F("fTrakPhiSPD1","Track phi for hit in SPD layer 1",1000,0,6.28);
780 fOutputList->Add(fTrakPhiSPD1);
782 fTrakPhiSPD2 = new TH1F("fTrakPhiSPD2","Track phi for hit in SPD layer 2",1000,0,6.28);
783 fOutputList->Add(fTrakPhiSPD2);
785 fTrakPhiSPDOr = new TH1F("fTrakPhiSPDOr","Track phi for hit in any SPD layer",1000,0,6.28);
786 fOutputList->Add(fTrakPhiSPDOr);
788 fTrakPhiSPDAnd = new TH1F("fTrakPhiSPDAnd","Track phi for hit in both SPD layer",1000,0,6.28);
789 fOutputList->Add(fTrakPhiSPDAnd);
791 fTrackHFEcutsITS = new TH1F("fTrackHFEcutsITS","Track phi for HFE cuts + ITS HFE cuts",1000,0,6.28);
792 fOutputList->Add(fTrackHFEcutsITS);
794 fOpeningAngleLS = new TH1F("fOpeningAngleLS","Opening angle for LS pairs",100,0,1);
795 fOutputList->Add(fOpeningAngleLS);
797 fOpeningAngleULS = new TH1F("fOpeningAngleULS","Opening angle for ULS pairs",100,0,1);
798 fOutputList->Add(fOpeningAngleULS);
800 fSemiIncElecDphi = new TH2F("fSemiIncElecDphi", "Semi Inclusive elec-had Dphi correlation",200,0,20,100,-1.57,4.71);
801 fOutputList->Add(fSemiIncElecDphi);
803 fSemiIncElecDphi1 = new TH2F("fSemiIncElecDphi1", "Semi Inclusive elec-had Dphi correlation for 1<pt^{asso}<3",200,0,20,100,-1.57,4.71);
804 fOutputList->Add(fSemiIncElecDphi1);
806 fSemiIncElecDphi2 = new TH2F("fSemiIncElecDphi2", "Semi Inclusive elec-had Dphi correlation for 3<pt^{asso}<5",200,0,20,100,-1.57,4.71);
807 fOutputList->Add(fSemiIncElecDphi2);
809 fSemiIncElecDphi3 = new TH2F("fSemiIncElecDphi3", "Semi Inclusive elec-had Dphi correlation for 5<pt^{asso}<7",200,0,20,100,-1.57,4.71);
810 fOutputList->Add(fSemiIncElecDphi3);
812 fSemiIncElecDphi4 = new TH2F("fSemiIncElecDphi4", "Semi Inclusive elec-had Dphi correlation for 7<pt^{asso}<9",200,0,20,100,-1.57,4.71);
813 fOutputList->Add(fSemiIncElecDphi4);
815 fPhotElecDphi = new TH2F("fPhotElecDphi", "Photon elec-had Dphi correlation",200,0,20,100,-1.57,4.71);
816 fOutputList->Add(fPhotElecDphi);
818 fPhotElecDphi1 = new TH2F("fPhotElecDphi1", "Photon elec-had Dphi correlation for 1<pt^{asso}<3",200,0,20,100,-1.57,4.71);
819 fOutputList->Add(fPhotElecDphi1);
821 fPhotElecDphi2 = new TH2F("fPhotElecDphi2", "Photon elec-had Dphi correlation for 3<pt^{asso}<5",200,0,20,100,-1.57,4.71);
822 fOutputList->Add(fPhotElecDphi2);
824 fPhotElecDphi3 = new TH2F("fPhotElecDphi3", "Photon elec-had Dphi correlation for 5<pt^{asso}<7",200,0,20,100,-1.57,4.71);
825 fOutputList->Add(fPhotElecDphi3);
827 fPhotElecDphi4 = new TH2F("fPhotElecDphi4", "Photon elec-had Dphi correlation for 7<pt^{asso}<9",200,0,20,100,-1.57,4.71);
828 fOutputList->Add(fPhotElecDphi4);
830 fInclusiveElecDphi = new TH2F("fInclusiveElecDphi", "Inclusive elec-had Dphi correlation",200,0,20,100,-1.57,4.71);
831 fOutputList->Add(fInclusiveElecDphi);
833 fInclusiveElecDphi1 = new TH2F("fInclusiveElecDphi1", "Inclusive elec-had Dphi correlation for 1<pt^{asso}<3",200,0,20,100,-1.57,4.71);
834 fOutputList->Add(fInclusiveElecDphi1);
836 fInclusiveElecDphi2 = new TH2F("fInclusiveElecDphi2", "Inclusive elec-had Dphi correlation for 3<pt^{asso}<5",200,0,20,100,-1.57,4.71);
837 fOutputList->Add(fInclusiveElecDphi2);
839 fInclusiveElecDphi3 = new TH2F("fInclusiveElecDphi3", "Inclusive elec-had Dphi correlation for 5<pt^{asso}<7",200,0,20,100,-1.57,4.71);
840 fOutputList->Add(fInclusiveElecDphi3);
842 fInclusiveElecDphi4 = new TH2F("fInclusiveElecDphi4", "Inclusive elec-had Dphi correlation for 7<pt^{asso}<9",200,0,20,100,-1.57,4.71);
843 fOutputList->Add(fInclusiveElecDphi4);
845 fDphiULSMassLow = new TH2F("fDphiULSMassLow", "e-h Dphi ULS, mass<cut",200,0,20,100,-1.57,4.71);
846 fOutputList->Add(fDphiULSMassLow);
848 fDphiULSMassLow1 = new TH2F("fDphiULSMassLow1", "e-h Dphi ULS, mass<cut for 1<pt^{asso}<3",200,0,20,100,-1.57,4.71);
849 fOutputList->Add(fDphiULSMassLow1);
851 fDphiULSMassLow2 = new TH2F("fDphiULSMassLow2", "e-h Dphi ULS, mass<cut for 3<pt^{asso}<5",200,0,20,100,-1.57,4.71);
852 fOutputList->Add(fDphiULSMassLow2);
854 fDphiULSMassLow3 = new TH2F("fDphiULSMassLow3", "e-h Dphi ULS, mass<cut for 5<pt^{asso}<7",200,0,20,100,-1.57,4.71);
855 fOutputList->Add(fDphiULSMassLow3);
857 fDphiULSMassLow4 = new TH2F("fDphiULSMassLow4", "e-h Dphi ULS, mass<cut for 7<pt^{asso}<9",200,0,20,100,-1.57,4.71);
858 fOutputList->Add(fDphiULSMassLow4);
860 fDphiLSMassLow = new TH2F("fDphiLSMassLow", "e-h Dphi LS, mass<cut",200,0,20,100,-1.57,4.71);
861 fOutputList->Add(fDphiLSMassLow);
863 fDphiLSMassLow1 = new TH2F("fDphiLSMassLow1", "e-h Dphi LS, mass<cut for 1<pt^{asso}<3",200,0,20,100,-1.57,4.71);
864 fOutputList->Add(fDphiLSMassLow1);
866 fDphiLSMassLow2 = new TH2F("fDphiLSMassLow2", "e-h Dphi LS, mass<cut for 3<pt^{asso}<5",200,0,20,100,-1.57,4.71);
867 fOutputList->Add(fDphiLSMassLow2);
869 fDphiLSMassLow3 = new TH2F("fDphiLSMassLow3", "e-h Dphi LS, mass<cut for 5<pt^{asso}<7",200,0,20,100,-1.57,4.71);
870 fOutputList->Add(fDphiLSMassLow3);
872 fDphiLSMassLow4 = new TH2F("fDphiLSMassLow4", "e-h Dphi LS, mass<cut for 7<pt^{asso}<9",200,0,20,100,-1.57,4.71);
873 fOutputList->Add(fDphiLSMassLow4);
875 fDphiULSMassLowNoPartner = new TH2F("fDphiULSMassLowNoPartner", "e-h Dphi ULS with no partner, mass<mass cut,",200,0,20,100,-1.57,4.71);
876 fOutputList->Add(fDphiULSMassLowNoPartner);
878 fDphiULSMassLowNoPartner1 = new TH2F("fDphiULSMassLowNoPartner1", "e-h Dphi ULS with no partner, mass<mass cut for 1<pt^{asso}<3,",200,0,20,100,-1.57,4.71);
879 fOutputList->Add(fDphiULSMassLowNoPartner1);
881 fDphiULSMassLowNoPartner2 = new TH2F("fDphiULSMassLowNoPartner2", "e-h Dphi ULS with no partner, mass<mass cut for 3<pt^{asso}<5,",200,0,20,100,-1.57,4.71);
882 fOutputList->Add(fDphiULSMassLowNoPartner2);
884 fDphiULSMassLowNoPartner3 = new TH2F("fDphiULSMassLowNoPartner3", "e-h Dphi ULS with no partner, mass<mass cut for 5<pt^{asso}<7,",200,0,20,100,-1.57,4.71);
885 fOutputList->Add(fDphiULSMassLowNoPartner3);
887 fDphiULSMassLowNoPartner4 = new TH2F("fDphiULSMassLowNoPartner4", "e-h Dphi ULS with no partner, mass<mass cut for 7<pt^{asso}<9,",200,0,20,100,-1.57,4.71);
888 fOutputList->Add(fDphiULSMassLowNoPartner4);
890 fDphiLSMassLowNoPartner = new TH2F("fDphiLSMassLowNoPartner", "e-h Dphi LS with no partner, mass<mass cut",200,0,20,100,-1.57,4.71);
891 fOutputList->Add(fDphiLSMassLowNoPartner);
893 fDphiLSMassLowNoPartner1 = new TH2F("fDphiLSMassLowNoPartner1", "e-h Dphi LS with no partner, mass<mass cut for 1<pt^{asso}<3,",200,0,20,100,-1.57,4.71);
894 fOutputList->Add(fDphiLSMassLowNoPartner1);
896 fDphiLSMassLowNoPartner2 = new TH2F("fDphiLSMassLowNoPartner2", "e-h Dphi LS with no partner, mass<mass cut for 3<pt^{asso}<5,",200,0,20,100,-1.57,4.71);
897 fOutputList->Add(fDphiLSMassLowNoPartner2);
899 fDphiLSMassLowNoPartner3 = new TH2F("fDphiLSMassLowNoPartner3", "e-h Dphi LS with no partner, mass<mass cut for 5<pt^{asso}<7,",200,0,20,100,-1.57,4.71);
900 fOutputList->Add(fDphiLSMassLowNoPartner3);
902 fDphiLSMassLowNoPartner4 = new TH2F("fDphiLSMassLowNoPartner4", "e-h Dphi LS with no partner, mass<mass cut for 7<pt^{asso}<9,",200,0,20,100,-1.57,4.71);
903 fOutputList->Add(fDphiLSMassLowNoPartner4);
905 fPhotoElecPt = new TH1F("fPhotoElecPt", "photonic electron pt",1000,0,100);
906 fOutputList->Add(fPhotoElecPt);
908 fSemiInclElecPt = new TH1F("fSemiInclElecPt", "Semi-inclusive electron pt",1000,0,100);
909 fOutputList->Add(fSemiInclElecPt);
911 fInclusiveElecPt = new TH1F("fInclElecPt", "Inclusive electron pt",1000,0,100);
912 fOutputList->Add(fInclusiveElecPt);
914 fULSElecPt = new TH1F("fULSElecPt", "ULS electron pt",1000,0,100);
915 fOutputList->Add(fULSElecPt);
917 fLSElecPt = new TH1F("fLSElecPt", "LS electron pt",1000,0,100);
918 fOutputList->Add(fLSElecPt);
920 fNCellv1 = new TH1F("fNCellv1","Ncell in clus (v1); NCell; count",100,0,100) ;
921 fOutputList->Add(fNCellv1);
923 fClsEv1 = new TH1F("fClsEv1", "Clus E(v1); Cls E; count",1000,0,100);
924 fOutputList->Add(fClsEv1);
926 fNClusv1 = new TH1F("fNClusv1","Nclus in event (v1); NClus; count",500,0,500) ;
927 fOutputList->Add(fNClusv1);
929 fKFParticleP = new TH1F("fKFParticleP","KFparticle rec P; P(GeV/c)",1000,0,50);
930 fOutputList->Add(fKFParticleP);
932 fKFParticleE = new TH1F("fKFParticleE", "KfParticle rec E; E; count",1000,0,100);
933 fOutputList->Add(fKFParticleE);
935 fInvmassLS1 = new TH1F("fInvmassLS1", "Inv mass of LS (e,e); mass(GeV/c^2); counts;", 1000,0,1.0);
936 fOutputList->Add(fInvmassLS1);
938 fInvmassULS1 = new TH1F("fInvmassULS1", "Inv mass of ULS (e,e); mass(GeV/c^2); counts;", 1000,0,1.0);
939 fOutputList->Add(fInvmassULS1);
941 fInvmassLS2 = new TH1F("fInvmassLS2", "Inv mass of LS (e,e) for pt^{e}>1; mass(GeV/c^2); counts;", 1000,0,1.0);
942 fOutputList->Add(fInvmassLS2);
944 fInvmassULS2 = new TH1F("fInvmassULS2", "Inv mass of ULS (e,e) for pt^{e}>1; mass(GeV/c^2); counts;", 1000,0,1.0);
945 fOutputList->Add(fInvmassULS2);
947 fInvmassLS3 = new TH1F("fInvmassLS3", "Inv mass of LS (e,e) for pt^{e}>2; mass(GeV/c^2); counts;", 1000,0,1.0);
948 fOutputList->Add(fInvmassLS3);
950 fInvmassULS3 = new TH1F("fInvmassULS3", "Inv mass of ULS (e,e) for pt^{e}>2; mass(GeV/c^2); counts;", 1000,0,1.0);
951 fOutputList->Add(fInvmassULS3);
953 fInvmassLS4 = new TH1F("fInvmassLS4", "Inv mass of LS (e,e) for pt^{e}>3; mass(GeV/c^2); counts;", 1000,0,1.0);
954 fOutputList->Add(fInvmassLS4);
956 fInvmassULS4 = new TH1F("fInvmassULS4", "Inv mass of ULS (e,e) for pt^{e}>3; mass(GeV/c^2); counts;", 1000,0,1.0);
957 fOutputList->Add(fInvmassULS4);
959 fInvmassLS5 = new TH1F("fInvmassLS5", "Inv mass of LS (e,e) for pt^{e}>4; mass(GeV/c^2); counts;", 1000,0,1.0);
960 fOutputList->Add(fInvmassLS5);
962 fInvmassULS5 = new TH1F("fInvmassULS5", "Inv mass of ULS (e,e) for pt^{e}>4; mass(GeV/c^2); counts;", 1000,0,1.0);
963 fOutputList->Add(fInvmassULS5);
965 fNoMixedEvents = new TH1F("fNoMixedEvents","",1,0,1) ;
966 fOutputList->Add(fNoMixedEvents);
968 fMixStat = new TH2F("fMixStat","no of events in pool vs Centrality;Nevent in pool;Centrality",200,0,200,5,0,10);
969 fOutputList->Add(fMixStat);
971 fMixStat1 = new TH2F("fMixStat1","no of events in pool vs zvtx;Nevents in pool;zvtx",200,0,200,4,-10,10);
972 fOutputList->Add(fMixStat1);
974 fMixedIncElecDphi = new TH2F("fMixedIncElecDphi", "Mixed event - Inclusive elec-had Dphi correlation",200,0,20,100,-1.57,4.71);
975 fOutputList->Add(fMixedIncElecDphi);
977 fMixedIncElecDphi1 = new TH2F("fMixedIncElecDphi1", "Mixed event - Inclusive elec-had Dphi correlation 1<pt<3",200,0,20,100,-1.57,4.71);
978 fOutputList->Add(fMixedIncElecDphi1);
980 fMixedIncElecDphi2 = new TH2F("fMixedIncElecDphi2", "Mixed event - Inclusive elec-had Dphi correlation 3<pt<5",200,0,20,100,-1.57,4.71);
981 fOutputList->Add(fMixedIncElecDphi2);
983 fMixedSemiIncElecDphi = new TH2F("fMixedSemiIncElecDphi", "Mixed event - Semi Inclusive elec-had Dphi correlation",200,0,20,100,-1.57,4.71);
984 fOutputList->Add(fMixedSemiIncElecDphi);
986 fMixedSemiIncElecDphi1 = new TH2F("fMixedSemiIncElecDphi1", "Mixed event - Semi Inclusive elec-had Dphi correlation 1<pt<3",200,0,20,100,-1.57,4.71);
987 fOutputList->Add(fMixedSemiIncElecDphi1);
989 fMixedSemiIncElecDphi2 = new TH2F("fMixedSemiIncElecDphi2", "Mixed event - Semi Inclusive elec-had Dphi correlation 3<pt<5",200,0,20,100,-1.57,4.71);
990 fOutputList->Add(fMixedSemiIncElecDphi2);
992 fMixedPhotElecDphi = new TH2F("fMixedPhotElecDphi", "Mixed event - Photo elec-had Dphi correlation",200,0,20,100,-1.57,4.71);
993 fOutputList->Add(fMixedPhotElecDphi);
995 fMixedPhotElecDphi1 = new TH2F("fMixedPhotElecDphi1", "Mixed event - Photo elec-had Dphi correlation 1<pt<3",200,0,20,100,-1.57,4.71);
996 fOutputList->Add(fMixedPhotElecDphi1);
998 fMixedPhotElecDphi2 = new TH2F("fMixedPhotElecDphi2", "Mixed event - Photo elec-had Dphi correlation 3<pt<5",200,0,20,100,-1.57,4.71);
999 fOutputList->Add(fMixedPhotElecDphi2);
1001 fMixedDphiULSMassLow = new TH2F("fMixedDphiULSMassLow", "Mixed event - ULS mass < cut elec-had Dphi correlation",200,0,20,100,-1.57,4.71);
1002 fOutputList->Add(fMixedDphiULSMassLow);
1004 fMixedDphiULSMassLow1 = new TH2F("fMixedDphiULSMassLow1", "Mixed event - ULS mass < cut elec-had Dphi correlation 1<pt<3",200,0,20,100,-1.57,4.71);
1005 fOutputList->Add(fMixedDphiULSMassLow1);
1007 fMixedDphiULSMassLow2 = new TH2F("fMixedDphiULSMassLow2", "Mixed event - ULS mass < cut elec-had Dphi correlation 3<pt<5",200,0,20,100,-1.57,4.71);
1008 fOutputList->Add(fMixedDphiULSMassLow2);
1010 fMixedDphiLSMassLow = new TH2F("fMixedDphiLSMassLow", "Mixed event - LS mass < cut elec-had Dphi correlation",200,0,20,100,-1.57,4.71);
1011 fOutputList->Add(fMixedDphiLSMassLow);
1013 fMixedDphiLSMassLow1 = new TH2F("fMixedDphiLSMassLow1", "Mixed event - LS mass < cut elec-had Dphi correlation 1<pt<3",200,0,20,100,-1.57,4.71);
1014 fOutputList->Add(fMixedDphiLSMassLow1);
1016 fMixedDphiLSMassLow2 = new TH2F("fMixedDphiLSMassLow2", "Mixed event - LS mass < cut elec-had Dphi correlation 3<pt<5",200,0,20,100,-1.57,4.71);
1017 fOutputList->Add(fMixedDphiLSMassLow2);
1020 fNLSminus = new TH1F("fNLSminus","No of LS negative pairs (e-,e-) ",1000,-0.5,999.5);
1021 fOutputList->Add(fNLSminus);
1023 fNLSplus = new TH1F("fNLSplus","No of LS positive pairs (e+,e+)",1000,-0.5,999.5);
1024 fOutputList->Add(fNLSplus);
1026 fNULS = new TH1F("fNULS","No of ULS pairs (e+,e-)",1000,-0.5,999.5);
1027 fOutputList->Add(fNULS);
1029 fHadronIPxy = new TH1F("fHadronIPxy", "hadron impact paramter XY",1000,-5,5);
1030 fOutputList->Add(fHadronIPxy);
1032 fHadronIPz = new TH1F("fHadronIPz", "hadron impact paramter Z",1000,-20,20);
1033 fOutputList->Add(fHadronIPz);
1035 fHadronPt = new TH1F("fHadronPt","hadron pt distribution",1000,0,100);
1036 fOutputList->Add(fHadronPt);
1038 fCentralityPass = new TH1F("fCentralityPass", "Centrality Pass", 101, -1, 100);
1039 fOutputList->Add(fCentralityPass);
1041 fCentralityNoPass = new TH1F("fCentralityNoPass", "Centrality No Pass", 101, -1, 100);
1042 fOutputList->Add(fCentralityNoPass);
1045 Int_t binsv1[8]={1000,1000,200,150,100,100,100,100}; //pt, p, TPCnsig, dEdx, E/p, M20, M02, dispersion
1046 Double_t xminv1[8]={0,0,-10,0,0,0,0,0};
1047 Double_t xmaxv1[8]={50,50,10,150,2,2,2,2};
1048 fSparseElectron = new THnSparseD ("Electron","Electron",8,binsv1,xminv1,xmaxv1);
1049 fOutputList->Add(fSparseElectron);
1051 PostData(1,fOutputList);
1054 //________________________________________________________________________
1055 void AliAnalysisTaskElecHadronCorrel::Terminate(Option_t *)
1057 // Info("Terminate");
1058 AliAnalysisTaskSE::Terminate();
1061 //________________________________________________________________________
1062 Bool_t AliAnalysisTaskElecHadronCorrel::ProcessCutStep(Int_t cutStep, AliVParticle *track)
1064 // Check single track cuts for a given cut step
1065 const Int_t kMCOffset = AliHFEcuts::kNcutStepsMCTrack;
1066 if(!fCFM->CheckParticleCuts(cutStep + kMCOffset, track)) return kFALSE;
1069 //_________________________________________
1070 void AliAnalysisTaskElecHadronCorrel::SelectPhotonicElectron(Int_t itrack, AliESDtrack *track, Bool_t &fFlagPhotonicElec)
1072 //Identify non-heavy flavour electrons using Invariant mass method
1074 fTrackCuts1->SetAcceptKinkDaughters(kFALSE);
1075 fTrackCuts1->SetRequireTPCRefit(kTRUE);
1076 fTrackCuts1->SetEtaRange(-0.9,0.9);
1077 fTrackCuts1->SetRequireSigmaToVertex(kTRUE);
1078 fTrackCuts1->SetMaxChi2PerClusterTPC(3.5);
1079 fTrackCuts1->SetMinNClustersTPC(80);
1081 // const AliESDVertex *pVtx = fESD->GetPrimaryVertex();
1083 Bool_t flagPhotonicElec = kFALSE;
1084 Int_t NLS_plus=0, NLS_minus=0, NULS=0;
1086 for(Int_t jTracks = itrack+1; jTracks<fESD->GetNumberOfTracks(); jTracks++){
1087 AliESDtrack* trackAsso = fESD->GetTrack(jTracks);
1089 printf("ERROR: Could not receive track %d\n", jTracks);
1093 Double_t dEdxAsso = -999., ptAsso=-999., openingAngle = -999.,nsigma=-999.0;
1094 Double_t mass=-999., width = -999;
1095 Bool_t fFlagLS=kFALSE, fFlagULS=kFALSE;
1097 dEdxAsso = trackAsso->GetTPCsignal();
1098 nsigma = fPID->GetPIDResponse() ? fPID->GetPIDResponse()->NumberOfSigmasTPC(trackAsso, AliPID::kElectron) : 1000;
1099 ptAsso = trackAsso->Pt();
1100 Int_t chargeAsso = trackAsso->Charge();
1101 Int_t charge = track->Charge();
1103 if(ptAsso <0.3) continue;
1104 if(trackAsso->Eta()<-0.9 || trackAsso->Eta()>0.9) continue;
1105 if(!ProcessCutStep(AliHFEcuts::kStepRecKineITSTPC, trackAsso)) continue;
1106 if(!ProcessCutStep(AliHFEcuts::kStepHFEcutsTPC, trackAsso)) continue;
1108 // if(!fTrackCuts1->AcceptTrack(trackAsso)) continue;
1109 // if(dEdxAsso <70 || dEdxAsso>100) continue; //11a pass1
1110 if(nsigma < -3 || nsigma > 3) continue;
1112 Int_t fPDGe1 = 11; Int_t fPDGe2 = 11;
1113 if(charge>0) fPDGe1 = -11;
1114 if(chargeAsso>0) fPDGe2 = -11;
1116 if(charge == chargeAsso) fFlagLS = kTRUE;
1117 if(charge != chargeAsso) fFlagULS = kTRUE;
1119 AliKFParticle ge1 = AliKFParticle(*track, fPDGe1);
1120 AliKFParticle ge2 = AliKFParticle(*trackAsso, fPDGe2);
1121 AliKFParticle recg(ge1, ge2);
1123 if(recg.GetNDF()<1) continue;
1124 Double_t chi2recg = recg.GetChi2()/recg.GetNDF();
1125 if(TMath::Sqrt(TMath::Abs(chi2recg))>3.) continue;
1127 openingAngle = ge1.GetAngle(ge2);
1128 // if(fFlagLS) fOpeningAngleLS->Fill(openingAngle);
1129 // if(fFlagULS) fOpeningAngleULS->Fill(openingAngle);
1131 // if(openingAngle > fOpeningAngleCut) continue;
1134 MassCorrect = recg.GetMass(mass,width);
1137 if(track->Charge() > 0 ) NLS_plus++;
1138 if(track->Charge() < 0 ) NLS_minus++;
1140 if(fFlagULS) NULS++;
1143 fInvmassLS1->Fill(mass);
1144 if(track->Pt()> 1) fInvmassLS2->Fill(mass);
1145 if(track->Pt()>2) fInvmassLS3->Fill(mass);
1146 if(track->Pt()>3) fInvmassLS4->Fill(mass);
1147 if(track->Pt()>4) fInvmassLS5->Fill(mass);
1150 fInvmassULS1->Fill(mass);
1151 if(track->Pt() >1) fInvmassULS2->Fill(mass);
1152 if(track->Pt() >2) fInvmassULS3->Fill(mass);
1153 if(track->Pt() >3) fInvmassULS4->Fill(mass);
1154 if(track->Pt() >4) fInvmassULS5->Fill(mass);
1157 if(mass<fInvmassCut){
1160 ElectronHadCorrel(itrack,track,fDphiULSMassLow, fDphiULSMassLow1,fDphiULSMassLow2,fDphiULSMassLow3,fDphiULSMassLow4);
1161 fULSElecPt->Fill(track->Pt());
1162 // MixedEvent(track,fMixedDphiULSMassLow,fMixedDphiULSMassLow1,fMixedDphiULSMassLow2);
1166 ElectronHadCorrel(itrack,track,fDphiLSMassLow,fDphiLSMassLow1,fDphiLSMassLow2,fDphiLSMassLow3,fDphiLSMassLow4);
1167 fLSElecPt->Fill(track->Pt());
1168 // MixedEvent(track,fMixedDphiLSMassLow,fMixedDphiLSMassLow1,fMixedDphiLSMassLow2);
1170 if(fFlagLS) ElectronHadCorrelNoPartner(itrack,jTracks,track,fDphiLSMassLowNoPartner, fDphiLSMassLowNoPartner1,fDphiLSMassLowNoPartner2,fDphiLSMassLowNoPartner3,fDphiLSMassLowNoPartner4);
1171 if(fFlagULS) ElectronHadCorrelNoPartner(itrack,jTracks,track,fDphiULSMassLowNoPartner, fDphiULSMassLowNoPartner1,fDphiULSMassLowNoPartner2,fDphiULSMassLowNoPartner3,fDphiULSMassLowNoPartner4);
1174 if(mass<fInvmassCut && fFlagULS && !flagPhotonicElec){
1175 flagPhotonicElec = kTRUE;
1180 fFlagPhotonicElec = flagPhotonicElec;
1182 // fNLSminus->Fill(NLS_minus);
1183 // fNLSplus->Fill(NLS_plus);
1184 // fNULS->Fill(NULS);
1187 //_________________________________________
1188 void AliAnalysisTaskElecHadronCorrel::ElectronHadCorrel(Int_t itrack, AliESDtrack *track, TH2F *DphiPt, TH2F *DphiPt1,TH2F *DphiPt2,TH2F *DphiPt3,TH2F *DphiPt4)
1190 //Construct Delta Phi between electrons and hadrons
1192 fTrackCuts2->SetAcceptKinkDaughters(kFALSE);
1193 fTrackCuts2->SetRequireTPCRefit(kTRUE);
1194 fTrackCuts2->SetRequireITSRefit(kTRUE);
1195 fTrackCuts2->SetEtaRange(-0.9,0.9);
1196 fTrackCuts2->SetRequireSigmaToVertex(kTRUE);
1197 fTrackCuts2->SetMaxChi2PerClusterTPC(3.5);
1198 fTrackCuts2->SetMinNClustersTPC(80);
1200 for(Int_t ktracks = 0; ktracks<fESD->GetNumberOfTracks(); ktracks++){
1201 AliESDtrack* trackHad = fESD->GetTrack(ktracks);
1203 printf("ERROR: Could not receive track %d\n", ktracks);
1206 if(ktracks == itrack) continue; //do not select the same electron
1208 Double_t ptHad= -999, pHad=-999., dEdxHad = -999;
1209 Double_t ptEle = -999;
1210 Double_t phiEle = -999, phiHad = -999, Dphi = -999;
1212 Float_t IPxy=-999.0, IPz=-999.0;
1214 dEdxHad = trackHad->GetTPCsignal();
1215 ptHad = trackHad->Pt();
1216 pHad = trackHad->P();
1217 ptEle = track->Pt();
1218 trackHad->GetImpactParameters(IPxy,IPz);
1220 // if(ptHad <2) continue;
1221 if(ptHad > ptEle) continue;
1222 if(trackHad->Eta()<-0.9 || trackHad->Eta()>0.9) continue;
1223 if(!ProcessCutStep(AliHFEcuts::kStepRecKineITSTPC, trackHad)) continue;
1224 if(!ProcessCutStep(AliHFEcuts::kStepHFEcutsTPC, trackHad)) continue;
1226 // if(!fTrackCuts2->AcceptTrack(trackHad)) continue;
1228 // fHadronIPxy->Fill(IPxy);
1229 // fHadronIPz->Fill(IPz);
1231 // if(TMath::Abs(IPxy)>2.5) continue;
1232 // fHadronPhi->Fill(trackHad->Phi());
1234 phiEle = track->Phi();
1235 phiHad = trackHad->Phi();
1236 Dphi = phiEle - phiHad;
1242 if(ptHad>2) DphiPt->Fill(ptEle,Dphi);
1243 if(ptHad>2 && ptHad<4) DphiPt1->Fill(ptEle,Dphi);
1244 if(ptHad>4 && ptHad<6) DphiPt2->Fill(ptEle,Dphi);
1245 if(ptHad>6 && ptHad<8) DphiPt3->Fill(ptEle,Dphi);
1246 if(ptHad>8 && ptHad<10) DphiPt4->Fill(ptEle,Dphi);
1250 //_________________________________________
1251 void AliAnalysisTaskElecHadronCorrel::ElectronHadCorrelNoPartner(Int_t itrack,Int_t jtrack, AliESDtrack *track, TH2F *DphiPtNew, TH2F *DphiPtNew1,TH2F *DphiPtNew2,TH2F *DphiPtNew3,TH2F *DphiPtNew4)
1253 //Construct Delta Phi between electrons and hadrons for electrons from invariant mass calculation excluding associated track
1255 fTrackCuts2->SetAcceptKinkDaughters(kFALSE);
1256 fTrackCuts2->SetRequireTPCRefit(kTRUE);
1257 fTrackCuts2->SetRequireITSRefit(kTRUE);
1258 fTrackCuts2->SetEtaRange(-0.9,0.9);
1259 fTrackCuts2->SetRequireSigmaToVertex(kTRUE);
1260 fTrackCuts2->SetMaxChi2PerClusterTPC(3.5);
1261 fTrackCuts2->SetMinNClustersTPC(80);
1263 for(Int_t ktracks = 0; ktracks<fESD->GetNumberOfTracks(); ktracks++){
1264 AliESDtrack* trackHad = fESD->GetTrack(ktracks);
1266 printf("ERROR: Could not receive track %d\n", ktracks);
1269 if(ktracks == itrack || ktracks == jtrack) continue; //do not select the same electron and associated track from inv mass cal
1272 Double_t ptHad= -999, pHad=-999., dEdxHad = -999;
1273 Double_t ptEle = -999;
1274 Double_t phiEle = -999, phiHad = -999, Dphi = -999;
1276 Float_t IPxy=-999.0, IPz=-999.0;
1278 dEdxHad = trackHad->GetTPCsignal();
1279 ptHad = trackHad->Pt();
1280 pHad = trackHad->P();
1281 ptEle = track->Pt();
1282 trackHad->GetImpactParameters(IPxy,IPz);
1284 // if(ptHad <2) continue;
1285 if(ptHad > ptEle) continue;
1286 if(trackHad->Eta()<-0.9 || trackHad->Eta()>0.9) continue;
1287 if(!ProcessCutStep(AliHFEcuts::kStepRecKineITSTPC, trackHad)) continue;
1288 if(!ProcessCutStep(AliHFEcuts::kStepHFEcutsTPC, trackHad)) continue;
1290 // if(!fTrackCuts2->AcceptTrack(trackHad)) continue;
1291 // if(TMath::Abs(IPxy)>2.5) continue;
1293 phiEle = track->Phi();
1294 phiHad = trackHad->Phi();
1295 Dphi = phiEle - phiHad;
1301 if(ptHad>2) DphiPtNew->Fill(ptEle,Dphi);
1302 if(ptHad>2 && ptHad<4) DphiPtNew1->Fill(ptEle,Dphi);
1303 if(ptHad>4 && ptHad<6) DphiPtNew2->Fill(ptEle,Dphi);
1304 if(ptHad>6 && ptHad<8) DphiPtNew3->Fill(ptEle,Dphi);
1305 if(ptHad>8 && ptHad<10) DphiPtNew4->Fill(ptEle,Dphi);
1309 //_________________________________________
1310 void AliAnalysisTaskElecHadronCorrel::MixedEvent(AliESDtrack *track, TH2F *DphiPt, TH2F *DphiPt1,TH2F *DphiPt2)
1313 const AliESDVertex *pVtx = fESD->GetPrimaryVertex();
1315 zVtx = pVtx->GetZ();
1318 AliCentrality *fCentrality = (AliCentrality*)fESD->GetCentrality();
1319 Double_t centvalue = fCentrality->GetCentralityPercentile("V0M");
1321 AliEventPool* pool = fPoolMgr->GetEventPool(centvalue, zVtx); // Get the buffer associated with the current centrality and z-vtx
1323 AliFatal(Form("No pool found for centrality = %f, zVtx = %f", centvalue, zVtx));
1325 // pool->PrintInfo();
1326 if (pool->GetCurrentNEvents() >= 5) // start mixing when 5 events are in the buffer
1328 Int_t nMix = pool->GetCurrentNEvents();
1329 fNoMixedEvents->Fill(0);
1330 fMixStat->Fill(pool->GetCurrentNEvents(),centvalue);
1331 fMixStat1->Fill(pool->GetCurrentNEvents(),zVtx);
1333 // cout << "nMix = " << nMix << " tracks in pool = " << pool->NTracksInPool() << endl;
1334 for (Int_t jMix=0; jMix<nMix; jMix++) // mix with each event in the buffer
1336 TObjArray* bgTracks = pool->GetEvent(jMix);
1337 for (Int_t i=0;i<bgTracks->GetEntriesFast(); i++)
1339 AliVParticle* mixtrk = (AliVParticle*) bgTracks->At(i);
1341 Double_t mixtrkPhi = -999;
1342 Double_t ptEle = -999;
1343 Double_t phiEle = -999, Dphi = -999;
1345 Double_t ptmixtrk = -999;
1347 ptEle = track->Pt();
1348 ptmixtrk = mixtrk->Pt();
1349 if(ptmixtrk > ptEle) continue;
1351 mixtrkPhi = mixtrk->Phi();
1352 phiEle = track->Phi();
1353 Dphi = phiEle - mixtrkPhi;
1359 DphiPt->Fill(ptEle,Dphi);
1360 if(ptmixtrk>2 && ptmixtrk<4) DphiPt1->Fill(ptEle,Dphi);
1361 if(ptmixtrk>4 && ptmixtrk<6) DphiPt2->Fill(ptEle,Dphi);
1368 //___________________________________________
1369 TObjArray* AliAnalysisTaskElecHadronCorrel::CloneAndReduceTrackList()
1371 // clones a track list by using AliehDPhiBasicParticle which uses much less memory (used for event mixing)
1373 fTrackCuts2->SetAcceptKinkDaughters(kFALSE);
1374 fTrackCuts2->SetRequireTPCRefit(kTRUE);
1375 fTrackCuts2->SetRequireITSRefit(kTRUE);
1376 fTrackCuts2->SetEtaRange(-0.9,0.9);
1377 fTrackCuts2->SetRequireSigmaToVertex(kTRUE);
1378 fTrackCuts2->SetMaxChi2PerClusterTPC(3.5);
1379 fTrackCuts2->SetMinNClustersTPC(80);
1381 TObjArray* tracksClone = new TObjArray;
1382 tracksClone->SetOwner(kTRUE);
1384 for(Int_t ktracks = 0; ktracks<fESD->GetNumberOfTracks(); ktracks++){
1385 AliESDtrack* track = fESD->GetTrack(ktracks);
1387 printf("ERROR: Could not receive track %d\n", ktracks);
1391 // if(ktracks == iTrack) continue;
1392 Double_t eta=-999,ptHad= -999, pHad=-999., phi=-999.0;
1393 Int_t label=-9999, id=-999;
1395 ptHad = track->Pt();
1398 label= track->GetLabel();
1401 if(ptHad <2) continue;
1402 if(!fTrackCuts2->AcceptTrack(track)) continue;
1404 AliVParticle* particle = (AliVParticle*) fESD->GetTrack(ktracks);
1405 tracksClone->Add(new AliehDPhiBasicParticle(particle->Eta(), particle->Phi(), particle->Pt(), particle->Charge()));
1412 //___________________________________________
1413 void AliAnalysisTaskElecHadronCorrel::HadronInfo(Int_t itrack)
1415 //Hadron information
1416 fTrackCuts2->SetAcceptKinkDaughters(kFALSE);
1417 fTrackCuts2->SetRequireTPCRefit(kTRUE);
1418 fTrackCuts2->SetRequireITSRefit(kTRUE);
1419 fTrackCuts2->SetEtaRange(-0.9,0.9);
1420 fTrackCuts2->SetRequireSigmaToVertex(kTRUE);
1421 fTrackCuts2->SetMaxChi2PerClusterTPC(3.5);
1422 fTrackCuts2->SetMinNClustersTPC(80);
1424 for(Int_t ktracks = 0; ktracks<fESD->GetNumberOfTracks(); ktracks++){
1425 AliESDtrack* trackHad = fESD->GetTrack(ktracks);
1427 printf("ERROR: Could not receive track %d\n", ktracks);
1431 if(ktracks == itrack) continue; //do not select the same electron
1433 Double_t ptHad= -999;
1434 Float_t IPxy=-999.0, IPz=-999.0;
1435 ptHad = trackHad->Pt();
1436 trackHad->GetImpactParameters(IPxy,IPz);
1438 if(trackHad->Eta()<-0.9 || trackHad->Eta()>0.9) continue;
1439 if(!ProcessCutStep(AliHFEcuts::kStepRecKineITSTPC, trackHad)) continue;
1440 if(!ProcessCutStep(AliHFEcuts::kStepHFEcutsTPC, trackHad)) continue;
1442 // if(!fTrackCuts2->AcceptTrack(trackHad)) continue;
1443 if(ptHad<2) continue;
1445 fHadronPhi->Fill(trackHad->Phi());
1446 fHadronPhiPt->Fill(trackHad->Phi(),ptHad);
1447 if (trackHad->Eta() >0 && trackHad->Eta() <0.9) fHadronPhiTPChalf->Fill(trackHad->Phi());
1449 fHadronIPxy->Fill(IPxy);
1450 fHadronIPz->Fill(IPz);
1451 fHadronPt->Fill(ptHad);
1454 //_________________________________________
1455 void AliAnalysisTaskElecHadronCorrel::CheckCentrality(AliESDEvent* event, Bool_t ¢ralitypass)
1457 // Check if event is within the set centrality range. Falls back to V0 centrality determination if no method is set
1458 if (!fkCentralityMethod) AliFatal("No centrality method set! FATAL ERROR!");
1459 fCentrality = event->GetCentrality()->GetCentralityPercentile(fkCentralityMethod);
1460 // cout << "--------------Centrality evaluated-------------------------"<<endl;
1462 if ((fCentrality <= fCentralityMin) || (fCentrality > fCentralityMax))
1464 fCentralityNoPass->Fill(fCentrality);
1465 // cout << "--------------Fill no pass-------------------------"<<endl;
1466 centralitypass = kFALSE;
1469 fCentralityPass->Fill(fCentrality);
1470 // cout << "--------------Fill pass-------------------------"<<endl;
1471 centralitypass = kTRUE;
1475 //_____________________________________________________________________________
1476 void AliAnalysisTaskElecHadronCorrel::SetCentralityParameters(Double_t CentralityMin, Double_t CentralityMax, const char* CentralityMethod)
1478 // Set a centrality range ]min, max] and define the method to use for centrality selection
1479 fCentralityMin = CentralityMin;
1480 fCentralityMax = CentralityMax;
1481 fkCentralityMethod = CentralityMethod;