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"
41 #include "AliESDEvent.h"
42 #include "AliESDHandler.h"
43 #include "AliAODEvent.h"
44 #include "AliAODHandler.h"
46 #include "AliAnalysisTaskElecHadronCorrel.h"
47 #include "TGeoGlobalMagField.h"
49 #include "AliAnalysisTaskSE.h"
50 #include "TRefArray.h"
53 #include "AliESDInputHandler.h"
54 #include "AliAODInputHandler.h"
55 #include "AliESDpid.h"
56 #include "AliAODPid.h"
57 #include "AliESDtrackCuts.h"
58 #include "AliPhysicsSelection.h"
59 #include "AliCentralitySelectionTask.h"
60 #include "AliESDCaloCluster.h"
61 #include "AliAODCaloCluster.h"
62 #include "AliESDCaloTrigger.h"
63 #include "AliEMCALRecoUtils.h"
64 #include "AliEMCALGeometry.h"
65 #include "AliGeomManager.h"
67 #include "TGeoManager.h"
71 //#include "AliEventPoolManager.h"
73 #include "AliCentrality.h"
76 #include "AliKFParticle.h"
77 #include "AliKFVertex.h"
80 #include "AliPIDResponse.h"
81 #include "AliHFEcontainer.h"
82 #include "AliHFEcuts.h"
83 #include "AliHFEpid.h"
84 #include "AliHFEpidBase.h"
85 #include "AliHFEpidQAmanager.h"
86 #include "AliHFEtools.h"
87 #include "AliCFContainer.h"
88 #include "AliCFManager.h"
89 #include "AliVEvent.h"
91 #include "AliMCEvent.h"
93 #include "AliESDVZERO.h"
94 #include "AliAODVZERO.h"
98 ClassImp(AliAnalysisTaskElecHadronCorrel)
99 //ClassImp(AliehDPhiBasicParticle)
100 //________________________________________________________________________
101 AliAnalysisTaskElecHadronCorrel::AliAnalysisTaskElecHadronCorrel(const char *name)
102 : AliAnalysisTaskSE(name)
108 ,fTrackCuts1(new AliESDtrackCuts)
109 ,fTrackCuts2(new AliESDtrackCuts)
111 ,fIdentifiedAsOutInz(kFALSE)
112 ,fPassTheEventCut(kFALSE)
113 ,fRejectKinkMother(kFALSE)
122 ,fkCentralityMethod(0)
130 ,fSemiIncElecDphi1(0)
131 ,fSemiIncElecDphi2(0)
132 ,fSemiIncElecDphi3(0)
133 ,fSemiIncElecDphi4(0)
139 ,fInclusiveElecDphi(0)
140 ,fInclusiveElecDphi1(0)
141 ,fInclusiveElecDphi2(0)
142 ,fInclusiveElecDphi3(0)
143 ,fInclusiveElecDphi4(0)
154 ,fDphiULSMassLowNoPartner(0)
155 ,fDphiULSMassLowNoPartner1(0)
156 ,fDphiULSMassLowNoPartner2(0)
157 ,fDphiULSMassLowNoPartner3(0)
158 ,fDphiULSMassLowNoPartner4(0)
159 ,fDphiLSMassLowNoPartner(0)
160 ,fDphiLSMassLowNoPartner1(0)
161 ,fDphiLSMassLowNoPartner2(0)
162 ,fDphiLSMassLowNoPartner3(0)
163 ,fDphiLSMassLowNoPartner4(0)
169 ,fTrackPtBefTrkCuts(0)
170 ,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)
222 ,fCentralityNoPass(0)
223 // ,fSparseElectron(0)
224 // ,fvalueElectron(0)
228 fPID = new AliHFEpid("hfePid");
229 // fvalueElectron = new Double_t[8];
231 // Define input and output slots here
232 // Input slot #0 works with a TChain
233 DefineInput(0, TChain::Class());
234 // Output slot #0 id reserved by the base class for AOD
235 // Output slot #1 writes into a TH1 container
236 // DefineOutput(1, TH1I::Class());
237 DefineOutput(1, TList::Class());
238 // DefineOutput(3, TTree::Class());
241 //________________________________________________________________________
242 AliAnalysisTaskElecHadronCorrel::AliAnalysisTaskElecHadronCorrel()
243 : AliAnalysisTaskSE("DefaultAnalysis_AliAnalysisElecHadCorrel")
249 ,fTrackCuts1(new AliESDtrackCuts)
250 ,fTrackCuts2(new AliESDtrackCuts)
252 ,fIdentifiedAsOutInz(kFALSE)
253 ,fPassTheEventCut(kFALSE)
254 ,fRejectKinkMother(kFALSE)
263 ,fkCentralityMethod(0)
271 ,fSemiIncElecDphi1(0)
272 ,fSemiIncElecDphi2(0)
273 ,fSemiIncElecDphi3(0)
274 ,fSemiIncElecDphi4(0)
280 ,fInclusiveElecDphi(0)
281 ,fInclusiveElecDphi1(0)
282 ,fInclusiveElecDphi2(0)
283 ,fInclusiveElecDphi3(0)
284 ,fInclusiveElecDphi4(0)
295 ,fDphiULSMassLowNoPartner(0)
296 ,fDphiULSMassLowNoPartner1(0)
297 ,fDphiULSMassLowNoPartner2(0)
298 ,fDphiULSMassLowNoPartner3(0)
299 ,fDphiULSMassLowNoPartner4(0)
300 ,fDphiLSMassLowNoPartner(0)
301 ,fDphiLSMassLowNoPartner1(0)
302 ,fDphiLSMassLowNoPartner2(0)
303 ,fDphiLSMassLowNoPartner3(0)
304 ,fDphiLSMassLowNoPartner4(0)
310 ,fTrackPtBefTrkCuts(0)
311 ,fTrackPtAftTrkCuts(0)
331 // ,fElecPhiTPCEovP(0)
333 ,fHadronPhiTPChalf(0)
342 /* ,fNoMixedEvents(0)
345 ,fMixedIncElecDphi(0)
346 ,fMixedIncElecDphi1(0)
347 ,fMixedIncElecDphi2(0)
348 ,fMixedPhotElecDphi(0)
349 ,fMixedPhotElecDphi1(0)
350 ,fMixedPhotElecDphi2(0)
351 ,fMixedSemiIncElecDphi(0)
352 ,fMixedSemiIncElecDphi1(0)
353 ,fMixedSemiIncElecDphi2(0)
354 ,fMixedDphiULSMassLow(0)
355 ,fMixedDphiULSMassLow1(0)
356 ,fMixedDphiULSMassLow2(0)
357 ,fMixedDphiLSMassLow(0)
358 ,fMixedDphiLSMassLow1(0)
359 ,fMixedDphiLSMassLow2(0)
363 ,fCentralityNoPass(0)
364 // ,fSparseElectron(0)
365 // ,fvalueElectron(0)
367 //Default constructor
368 fPID = new AliHFEpid("hfePid");
369 // fvalueElectron = new Double_t[8];
372 // Define input and output slots here
373 // Input slot #0 works with a TChain
374 DefineInput(0, TChain::Class());
375 // Output slot #0 id reserved by the base class for AOD
376 // Output slot #1 writes into a TH1 container
377 // DefineOutput(1, TH1I::Class());
378 DefineOutput(1, TList::Class());
379 //DefineOutput(3, TTree::Class());
381 //_________________________________________
383 AliAnalysisTaskElecHadronCorrel::~AliAnalysisTaskElecHadronCorrel()
394 // delete fSparseElectron;
395 // delete []fvalueElectron;
397 //_________________________________________
399 void AliAnalysisTaskElecHadronCorrel::UserExec(Option_t*)
402 //Called for each event
404 // create pointer to event
405 fAOD = dynamic_cast<AliAODEvent*>(InputEvent());
406 fESD = dynamic_cast<AliESDEvent*>(InputEvent());
409 printf("ERROR: fESD & fAOD not available\n");
412 fVevent = dynamic_cast<AliVEvent*>(InputEvent());
414 printf("ERROR: fVEvent not available\n");
419 AliError("HFE cuts not available");
423 if(!fPID->IsInitialized()){
424 // Initialize PID with the given run number
425 AliWarning("PID not initialised, get from Run no");
427 if(IsAODanalysis())fPID->InitializePID(fAOD->GetRunNumber());
428 else fPID->InitializePID(fESD->GetRunNumber());
432 if(!(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & (AliVEvent::kCentral))) return;
434 // centrality selection
435 SetCentralityParameters(0., 10., "V0M");
436 Bool_t pass = kFALSE;
437 CheckCentrality(fVevent,pass);
440 Int_t fNOtrks = fVevent->GetNumberOfTracks();
441 const AliVVertex *pVtx = fVevent->GetPrimaryVertex();
443 Double_t pVtxZ = -999;
444 pVtxZ = pVtx->GetZ();
446 if(TMath::Abs(pVtxZ)>10) return;
449 if(fNOtrks<2) return;
451 AliPIDResponse *pidResponse = fInputHandler->GetPIDResponse();
453 AliDebug(1, "Using default PID Response");
454 pidResponse = AliHFEtools::GetDefaultPID(kFALSE, fInputEvent->IsA() == AliAODEvent::Class());
457 fPID->SetPIDResponse(pidResponse);
459 fCFM->SetRecEventInfo(fVevent);
463 AliEventPool* pool = fPoolMgr->GetEventPool(centvalue, pVtxZ); // Get the buffer associated with the current centrality and z-vtx
465 AliFatal(Form("No pool found for centrality = %f, zVtx = %f", centvalue, pVtxZ));
468 // Look for kink mother for AOD
469 Double_t *listofmotherkink =0;
470 Int_t numberofvertices = 0, numberofmotherkink = 0;
472 numberofvertices = fAOD->GetNumberOfVertices();
473 listofmotherkink = new Double_t[numberofvertices];
474 for(Int_t ivertex=0; ivertex < numberofvertices; ivertex++) {
475 AliAODVertex *aodvertex = fAOD->GetVertex(ivertex);
476 if(!aodvertex) continue;
477 if(aodvertex->GetType()==AliAODVertex::kKink) {
478 AliAODTrack *mother = (AliAODTrack *) aodvertex->GetParent();
479 if(!mother) continue;
480 Int_t idmother = mother->GetID();
481 listofmotherkink[numberofmotherkink] = idmother;
482 numberofmotherkink++;
488 for (Int_t iTracks = 0; iTracks < fVevent->GetNumberOfTracks(); iTracks++) {
489 AliVParticle* Vtrack = fVevent->GetTrack(iTracks);
491 printf("ERROR: Could not receive track %d\n", iTracks);
494 AliVTrack *track = dynamic_cast<AliVTrack*>(Vtrack);
495 AliESDtrack *etrack = dynamic_cast<AliESDtrack*>(Vtrack);
496 AliAODTrack *atrack = dynamic_cast<AliAODTrack*>(Vtrack);
499 if(!atrack->TestFilterMask(AliAODTrack::kTrkGlobalNoDCA)) continue;
501 if(track->Pt()<1) continue;
503 fTrackPtBefTrkCuts->Fill(track->Pt());
505 // RecKine: ITSTPC cuts
506 if(!ProcessCutStep(AliHFEcuts::kStepRecKineITSTPC, track)) continue;
508 // Reject kink mother
509 if(fRejectKinkMother) { // Quick and dirty fix to reject both kink mothers and daughters
511 Bool_t kinkmotherpass = kTRUE;
512 for(Int_t kinkmother = 0; kinkmother < numberofmotherkink; kinkmother++) {
513 if(track->GetID() == listofmotherkink[kinkmother]) {
514 kinkmotherpass = kFALSE;
518 if(!kinkmotherpass) continue;
521 if(etrack->GetKinkIndex(0) != 0) continue;
525 // if(!ProcessCutStep(AliHFEcuts::kStepRecPrim, track)) continue; //gives warning for AOD, so not using
527 // HFE cuts: TPC PID cleanup
528 if(!ProcessCutStep(AliHFEcuts::kStepHFEcutsTPC, track)) continue;
530 // fTrackHFEcuts->Fill(track->Phi());
532 // HFEcuts: ITS layers cuts
533 if(!ProcessCutStep(AliHFEcuts::kStepHFEcutsITS, track)) continue;
535 // fTrackHFEcutsITS->Fill(track->Phi());
536 fTrackPtAftTrkCuts->Fill(track->Pt());
538 Double_t fClsE = -999, p = -999, fEovP=-999, pt = -999, dEdx=-999, fTPCnSigma=0;
541 dEdx = track->GetTPCsignal();
542 fTPCnSigma = fPID->GetPIDResponse() ? fPID->GetPIDResponse()->NumberOfSigmasTPC(track, AliPID::kElectron) : 1000;
545 // if(fTPCnSigma >= -2 && fTPCnSigma <= 2){
546 // fElecPhiTPC->Fill(track->Phi());
550 if(track->Eta() < -0.7 || track->Eta() > 0.7) continue;
552 // Track extrapolation to EMCAL
553 Int_t fClsId = track->GetEMCALcluster();
554 if(fClsId <0) continue;
555 AliVCluster *cluster = fVevent->GetCaloCluster(fClsId);
556 if(!cluster->IsEMCAL()) continue;
557 if(TMath::Abs(cluster->GetTrackDx())>0.05 || TMath::Abs(cluster->GetTrackDz())>0.05) continue;
558 // fdEdxBef->Fill(p,dEdx);
559 fTPCnsigma->Fill(p,fTPCnSigma);
562 fClsE = cluster->E();
565 fvalueElectron[0] = pt;
566 fvalueElectron[1] = p;
567 fvalueElectron[2] = fTPCnSigma;
568 fvalueElectron[3] = dEdx;
569 fvalueElectron[4] = fEovP;
570 fvalueElectron[5] = cluster->GetM20();
571 fvalueElectron[6] = cluster->GetM02();
572 fvalueElectron[7] = cluster->GetDispersion();
574 fSparseElectron->Fill(fvalueElectron);
576 if(fTPCnSigma >= -2 && fTPCnSigma <= 2 && cluster->GetM20()<0.2 && cluster->GetM02()<0.5 && cluster->GetDispersion()<1){
577 fTrkEovPBef->Fill(pt,fEovP);
579 if(fTPCnSigma < -3.5)fTrkEovPBefHad->Fill(pt,fEovP);
581 //Electron id with TPC and E/p
582 if(fTPCnSigma >= -2 && fTPCnSigma <= 2 && fEovP >= 0.8 && fEovP <=1.2) {
583 // fElecPhiTPCEovP->Fill(track->Phi());
585 //Electron id with shower shape
586 if(cluster->GetM20()<0.2 && cluster->GetM02()< 0.5 && cluster->GetDispersion()<1){
588 fElecPhi->Fill(track->Phi());
589 fElecPhiPt->Fill(track->Phi(),track->Pt());
590 if (track->Eta() >0 && track->Eta() <0.7) fElecPhiTPChalf->Fill(track->Phi());
594 Bool_t fFlagPhotonicElec = kFALSE;
595 // select photonic electron
596 SelectPhotonicElectron(iTracks,track,fFlagPhotonicElec);
598 //Inclusive electron-hadron correlation
599 ElectronHadCorrel(iTracks, track, fInclusiveElecDphi, fInclusiveElecDphi1,fInclusiveElecDphi2,fInclusiveElecDphi3,fInclusiveElecDphi4);
600 fInclusiveElecPt->Fill(pt);
601 // MixedEvent(track,fMixedIncElecDphi, fMixedIncElecDphi1,fMixedIncElecDphi2);
604 if(fFlagPhotonicElec){
605 //Electron hadron correlation
606 ElectronHadCorrel(iTracks, track, fPhotElecDphi,fPhotElecDphi1,fPhotElecDphi2,fPhotElecDphi3,fPhotElecDphi4);
607 fPhotoElecPt->Fill(pt);
608 // MixedEvent(track,fMixedPhotElecDphi, fMixedPhotElecDphi1,fMixedPhotElecDphi2);
611 // Semi inclusive electron
612 if(!fFlagPhotonicElec){
613 //Electron hadron correlation
614 ElectronHadCorrel(iTracks, track, fSemiIncElecDphi, fSemiIncElecDphi1,fSemiIncElecDphi2,fSemiIncElecDphi3,fSemiIncElecDphi4);
615 fSemiInclElecPt->Fill(pt);
616 // MixedEvent(track,fMixedSemiIncElecDphi,fMixedSemiIncElecDphi1,fMixedSemiIncElecDphi2);
624 Int_t clsNo = fVevent->GetNumberOfCaloClusters();
625 fNClusv1->Fill(clsNo);
626 for(Int_t iclus=0; iclus<clsNo ; iclus++){
627 AliVCluster* clus = fVevent->GetCaloCluster(iclus);
628 if(!clus->IsEMCAL()) continue;
629 fNCellv1->Fill(clus->GetNCells());
630 fClsEv1->Fill(clus->E());
634 TObjArray* tracksClone = CloneAndReduceTrackList();
635 tracksClone->SetOwner();
636 pool->UpdatePool(tracksClone);
638 delete listofmotherkink;
639 PostData(1, fOutputList);
641 //_________________________________________
642 void AliAnalysisTaskElecHadronCorrel::UserCreateOutputObjects()
646 AliDebug(3, "Creating Output Objects");
647 // Automatic determination of the analysis mode
648 AliVEventHandler *inputHandler = dynamic_cast<AliVEventHandler *>(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
649 if(!TString(inputHandler->IsA()->GetName()).CompareTo("AliAODInputHandler")){
654 printf("Analysis Mode: %s Analysis\n", IsAODanalysis() ? "AOD" : "ESD");
656 //--------Initialize PID
657 fPID->SetHasMCData(kFALSE);
658 if(!fPID->GetNumberOfPIDdetectors())
660 fPID->AddDetector("TPC", 0);
661 fPID->AddDetector("EMCAL", 1);
664 fPID->SortDetectors();
665 fPIDqa = new AliHFEpidQAmanager();
666 fPIDqa->Initialize(fPID);
668 //--------Initialize correction Framework and Cuts
669 fCFM = new AliCFManager;
670 const Int_t kNcutSteps = AliHFEcuts::kNcutStepsMCTrack + AliHFEcuts::kNcutStepsRecTrack + AliHFEcuts::kNcutStepsDETrack;
671 fCFM->SetNStepParticle(kNcutSteps);
672 for(Int_t istep = 0; istep < kNcutSteps; istep++)
673 fCFM->SetParticleCutsList(istep, NULL);
676 AliWarning("Cuts not available. Default cuts will be used");
677 fCuts = new AliHFEcuts;
678 fCuts->CreateStandardCuts();
681 if(IsAODanalysis()) fCuts->SetAOD();
682 fCuts->Initialize(fCFM);
684 //Mixed event initialising
685 Int_t trackDepth = 2000;
686 Int_t poolsize = 1000;
688 Int_t nCentralityBins = 5;
689 Double_t CentralityBins[] = {0,2,4,6,8,10};
692 Double_t vertexBins[] = {-10,-5,0,5,10};
694 fPoolMgr = new AliEventPoolManager(poolsize, trackDepth, nCentralityBins, (Double_t*) CentralityBins, nZvtxBins, (Double_t*) vertexBins);
696 //---------Output Tlist
697 fOutputList = new TList();
698 fOutputList->SetOwner();
699 fOutputList->Add(fPIDqa->MakeList("PIDQA"));
701 fNoEvents = new TH1F("fNoEvents","",1,0,1) ;
702 fOutputList->Add(fNoEvents);
704 fcentrality = new TH1F("fcentrality","centrality", 100,0,100);
705 fOutputList->Add(fcentrality);
707 // fTrkpt = new TH1F("fTrkpt","track pt",1000,0,50);
708 // fOutputList->Add(fTrkpt);
710 fTrackPtBefTrkCuts = new TH1F("fTrackPtBefTrkCuts","track pt before track cuts",1000,0,50);
711 fOutputList->Add(fTrackPtBefTrkCuts);
713 fTrackPtAftTrkCuts = new TH1F("fTrackPtAftTrkCuts","track pt after track cuts",1000,0,50);
714 fOutputList->Add(fTrackPtAftTrkCuts);
716 fTPCnsigma = new TH2F("fTPCnsigma", "TPC - n sigma",1000,0,50,200,-10,10);
717 fOutputList->Add(fTPCnsigma);
719 fTrkEovPBef = new TH2F("fTrkEovPBef","track E/p before HFE pid",1000,0,50,100,0,2);
720 fOutputList->Add(fTrkEovPBef);
722 fTrkEovPBefHad = new TH2F("fTrkEovPBefHad","track E/p for TPCnsig < 3.5",1000,0,50,100,0,2);
723 fOutputList->Add(fTrkEovPBefHad);
725 // fdEdxBef = new TH2F("fdEdxBef","track dEdx vs p before HFE pid",1000,0,50,150,0,150);
726 // fOutputList->Add(fdEdxBef);
728 fElecPhi = new TH1F("fElecPhi", "Electron phi",1000,0,6.28);
729 fOutputList->Add(fElecPhi);
731 fElecPhiPt = new TH2F("fElecPhiPt", "Electron phi vs pt; Electron phi; pt (GeV/c)",1000,0,6.28,1000,0,100);
732 fOutputList->Add(fElecPhiPt);
734 fElecPhiTPChalf = new TH1F("fElecPhiTPChalf", "Electron phi for 0<eta<0.7",1000,0,6.28);
735 fOutputList->Add(fElecPhiTPChalf);
737 /* fElecPhiTPC = new TH1F("fElecPhiTPC", "Electron phi after TPC cut",1000,0,6.28);
738 fOutputList->Add(fElecPhiTPC);
740 fElecPhiTPCEovP = new TH1F("fElecPhiTPCEovP", "Electron phi after TPC and E/p cut",1000,0,6.28);
741 fOutputList->Add(fElecPhiTPCEovP);
743 fHadronPhi = new TH1F("fHadronPhi", "Hadron phi",1000,0,6.28);
744 fOutputList->Add(fHadronPhi);
746 fHadronPhiTPChalf = new TH1F("fHadronPhiTPChalf", "Hadron phi for 0<eta<0.9",1000,0,6.28);
747 fOutputList->Add(fHadronPhiTPChalf);
749 fHadronPhiPt = new TH2F("fHadronPhiPt", "Hadron phi vs pt; hadron phi; pt (GeV/c)",1000,0,6.28,1000,0,100);
750 fOutputList->Add(fHadronPhiPt);
753 fTrackHFEcuts = new TH1F("fTrackHFEcuts","Track phi for HFE cuts",1000,0,6.28);
754 fOutputList->Add(fTrackHFEcuts);
756 fTrakPhiSPD1 = new TH1F("fTrakPhiSPD1","Track phi for hit in SPD layer 1",1000,0,6.28);
757 fOutputList->Add(fTrakPhiSPD1);
759 fTrakPhiSPD2 = new TH1F("fTrakPhiSPD2","Track phi for hit in SPD layer 2",1000,0,6.28);
760 fOutputList->Add(fTrakPhiSPD2);
762 fTrakPhiSPDOr = new TH1F("fTrakPhiSPDOr","Track phi for hit in any SPD layer",1000,0,6.28);
763 fOutputList->Add(fTrakPhiSPDOr);
765 fTrakPhiSPDAnd = new TH1F("fTrakPhiSPDAnd","Track phi for hit in both SPD layer",1000,0,6.28);
766 fOutputList->Add(fTrakPhiSPDAnd);
768 fTrackHFEcutsITS = new TH1F("fTrackHFEcutsITS","Track phi for HFE cuts + ITS HFE cuts",1000,0,6.28);
769 fOutputList->Add(fTrackHFEcutsITS);
771 fSemiIncElecDphi = new TH2F("fSemiIncElecDphi", "Semi Inclusive elec-had Dphi correlation",200,0,20,64,-1.57,4.71);
772 fOutputList->Add(fSemiIncElecDphi);
774 fSemiIncElecDphi1 = new TH2F("fSemiIncElecDphi1", "Semi Inclusive elec-had Dphi correlation for 1<pt^{asso}<3",200,0,20,64,-1.57,4.71);
775 fOutputList->Add(fSemiIncElecDphi1);
777 fSemiIncElecDphi2 = new TH2F("fSemiIncElecDphi2", "Semi Inclusive elec-had Dphi correlation for 3<pt^{asso}<5",200,0,20,64,-1.57,4.71);
778 fOutputList->Add(fSemiIncElecDphi2);
780 fSemiIncElecDphi3 = new TH2F("fSemiIncElecDphi3", "Semi Inclusive elec-had Dphi correlation for 5<pt^{asso}<7",200,0,20,64,-1.57,4.71);
781 fOutputList->Add(fSemiIncElecDphi3);
783 fSemiIncElecDphi4 = new TH2F("fSemiIncElecDphi4", "Semi Inclusive elec-had Dphi correlation for 7<pt^{asso}<9",200,0,20,64,-1.57,4.71);
784 fOutputList->Add(fSemiIncElecDphi4);
786 fPhotElecDphi = new TH2F("fPhotElecDphi", "Photon elec-had Dphi correlation",200,0,20,64,-1.57,4.71);
787 fOutputList->Add(fPhotElecDphi);
789 fPhotElecDphi1 = new TH2F("fPhotElecDphi1", "Photon elec-had Dphi correlation for 1<pt^{asso}<3",200,0,20,64,-1.57,4.71);
790 fOutputList->Add(fPhotElecDphi1);
792 fPhotElecDphi2 = new TH2F("fPhotElecDphi2", "Photon elec-had Dphi correlation for 3<pt^{asso}<5",200,0,20,64,-1.57,4.71);
793 fOutputList->Add(fPhotElecDphi2);
795 fPhotElecDphi3 = new TH2F("fPhotElecDphi3", "Photon elec-had Dphi correlation for 5<pt^{asso}<7",200,0,20,64,-1.57,4.71);
796 fOutputList->Add(fPhotElecDphi3);
798 fPhotElecDphi4 = new TH2F("fPhotElecDphi4", "Photon elec-had Dphi correlation for 7<pt^{asso}<9",200,0,20,64,-1.57,4.71);
799 fOutputList->Add(fPhotElecDphi4);
801 fInclusiveElecDphi = new TH2F("fInclusiveElecDphi", "Inclusive elec-had Dphi correlation",200,0,20,64,-1.57,4.71);
802 fOutputList->Add(fInclusiveElecDphi);
804 fInclusiveElecDphi1 = new TH2F("fInclusiveElecDphi1", "Inclusive elec-had Dphi correlation for 1<pt^{asso}<3",200,0,20,64,-1.57,4.71);
805 fOutputList->Add(fInclusiveElecDphi1);
807 fInclusiveElecDphi2 = new TH2F("fInclusiveElecDphi2", "Inclusive elec-had Dphi correlation for 3<pt^{asso}<5",200,0,20,64,-1.57,4.71);
808 fOutputList->Add(fInclusiveElecDphi2);
810 fInclusiveElecDphi3 = new TH2F("fInclusiveElecDphi3", "Inclusive elec-had Dphi correlation for 5<pt^{asso}<7",200,0,20,64,-1.57,4.71);
811 fOutputList->Add(fInclusiveElecDphi3);
813 fInclusiveElecDphi4 = new TH2F("fInclusiveElecDphi4", "Inclusive elec-had Dphi correlation for 7<pt^{asso}<9",200,0,20,64,-1.57,4.71);
814 fOutputList->Add(fInclusiveElecDphi4);
816 fDphiULSMassLow = new TH2F("fDphiULSMassLow", "e-h Dphi ULS, mass<cut",200,0,20,64,-1.57,4.71);
817 fOutputList->Add(fDphiULSMassLow);
819 fDphiULSMassLow1 = new TH2F("fDphiULSMassLow1", "e-h Dphi ULS, mass<cut for 1<pt^{asso}<3",200,0,20,64,-1.57,4.71);
820 fOutputList->Add(fDphiULSMassLow1);
822 fDphiULSMassLow2 = new TH2F("fDphiULSMassLow2", "e-h Dphi ULS, mass<cut for 3<pt^{asso}<5",200,0,20,64,-1.57,4.71);
823 fOutputList->Add(fDphiULSMassLow2);
825 fDphiULSMassLow3 = new TH2F("fDphiULSMassLow3", "e-h Dphi ULS, mass<cut for 5<pt^{asso}<7",200,0,20,64,-1.57,4.71);
826 fOutputList->Add(fDphiULSMassLow3);
828 fDphiULSMassLow4 = new TH2F("fDphiULSMassLow4", "e-h Dphi ULS, mass<cut for 7<pt^{asso}<9",200,0,20,64,-1.57,4.71);
829 fOutputList->Add(fDphiULSMassLow4);
831 fDphiLSMassLow = new TH2F("fDphiLSMassLow", "e-h Dphi LS, mass<cut",200,0,20,64,-1.57,4.71);
832 fOutputList->Add(fDphiLSMassLow);
834 fDphiLSMassLow1 = new TH2F("fDphiLSMassLow1", "e-h Dphi LS, mass<cut for 1<pt^{asso}<3",200,0,20,64,-1.57,4.71);
835 fOutputList->Add(fDphiLSMassLow1);
837 fDphiLSMassLow2 = new TH2F("fDphiLSMassLow2", "e-h Dphi LS, mass<cut for 3<pt^{asso}<5",200,0,20,64,-1.57,4.71);
838 fOutputList->Add(fDphiLSMassLow2);
840 fDphiLSMassLow3 = new TH2F("fDphiLSMassLow3", "e-h Dphi LS, mass<cut for 5<pt^{asso}<7",200,0,20,64,-1.57,4.71);
841 fOutputList->Add(fDphiLSMassLow3);
843 fDphiLSMassLow4 = new TH2F("fDphiLSMassLow4", "e-h Dphi LS, mass<cut for 7<pt^{asso}<9",200,0,20,64,-1.57,4.71);
844 fOutputList->Add(fDphiLSMassLow4);
846 fDphiULSMassLowNoPartner = new TH2F("fDphiULSMassLowNoPartner", "e-h Dphi ULS with no partner, mass<mass cut,",200,0,20,64,-1.57,4.71);
847 fOutputList->Add(fDphiULSMassLowNoPartner);
849 fDphiULSMassLowNoPartner1 = new TH2F("fDphiULSMassLowNoPartner1", "e-h Dphi ULS with no partner, mass<mass cut for 1<pt^{asso}<3,",200,0,20,64,-1.57,4.71);
850 fOutputList->Add(fDphiULSMassLowNoPartner1);
852 fDphiULSMassLowNoPartner2 = new TH2F("fDphiULSMassLowNoPartner2", "e-h Dphi ULS with no partner, mass<mass cut for 3<pt^{asso}<5,",200,0,20,64,-1.57,4.71);
853 fOutputList->Add(fDphiULSMassLowNoPartner2);
855 fDphiULSMassLowNoPartner3 = new TH2F("fDphiULSMassLowNoPartner3", "e-h Dphi ULS with no partner, mass<mass cut for 5<pt^{asso}<7,",200,0,20,64,-1.57,4.71);
856 fOutputList->Add(fDphiULSMassLowNoPartner3);
858 fDphiULSMassLowNoPartner4 = new TH2F("fDphiULSMassLowNoPartner4", "e-h Dphi ULS with no partner, mass<mass cut for 7<pt^{asso}<9,",200,0,20,64,-1.57,4.71);
859 fOutputList->Add(fDphiULSMassLowNoPartner4);
861 fDphiLSMassLowNoPartner = new TH2F("fDphiLSMassLowNoPartner", "e-h Dphi LS with no partner, mass<mass cut",200,0,20,64,-1.57,4.71);
862 fOutputList->Add(fDphiLSMassLowNoPartner);
864 fDphiLSMassLowNoPartner1 = new TH2F("fDphiLSMassLowNoPartner1", "e-h Dphi LS with no partner, mass<mass cut for 1<pt^{asso}<3,",200,0,20,64,-1.57,4.71);
865 fOutputList->Add(fDphiLSMassLowNoPartner1);
867 fDphiLSMassLowNoPartner2 = new TH2F("fDphiLSMassLowNoPartner2", "e-h Dphi LS with no partner, mass<mass cut for 3<pt^{asso}<5,",200,0,20,64,-1.57,4.71);
868 fOutputList->Add(fDphiLSMassLowNoPartner2);
870 fDphiLSMassLowNoPartner3 = new TH2F("fDphiLSMassLowNoPartner3", "e-h Dphi LS with no partner, mass<mass cut for 5<pt^{asso}<7,",200,0,20,64,-1.57,4.71);
871 fOutputList->Add(fDphiLSMassLowNoPartner3);
873 fDphiLSMassLowNoPartner4 = new TH2F("fDphiLSMassLowNoPartner4", "e-h Dphi LS with no partner, mass<mass cut for 7<pt^{asso}<9,",200,0,20,64,-1.57,4.71);
874 fOutputList->Add(fDphiLSMassLowNoPartner4);
876 fPhotoElecPt = new TH1F("fPhotoElecPt", "photonic electron pt",1000,0,100);
877 fOutputList->Add(fPhotoElecPt);
879 fSemiInclElecPt = new TH1F("fSemiInclElecPt", "Semi-inclusive electron pt",1000,0,100);
880 fOutputList->Add(fSemiInclElecPt);
882 fInclusiveElecPt = new TH1F("fInclElecPt", "Inclusive electron pt",1000,0,100);
883 fOutputList->Add(fInclusiveElecPt);
885 fULSElecPt = new TH1F("fULSElecPt", "ULS electron pt",1000,0,100);
886 fOutputList->Add(fULSElecPt);
888 fLSElecPt = new TH1F("fLSElecPt", "LS electron pt",1000,0,100);
889 fOutputList->Add(fLSElecPt);
891 fNCellv1 = new TH1F("fNCellv1","Ncell in clus (v1); NCell; count",100,0,100) ;
892 fOutputList->Add(fNCellv1);
894 fClsEv1 = new TH1F("fClsEv1", "Clus E(v1); Cls E; count",1000,0,100);
895 fOutputList->Add(fClsEv1);
897 fNClusv1 = new TH1F("fNClusv1","Nclus in event (v1); NClus; count",500,0,500) ;
898 fOutputList->Add(fNClusv1);
900 fInvmassLS1 = new TH1F("fInvmassLS1", "Inv mass of LS (e,e); mass(GeV/c^2); counts;", 1000,0,1.0);
901 fOutputList->Add(fInvmassLS1);
903 fInvmassULS1 = new TH1F("fInvmassULS1", "Inv mass of ULS (e,e); mass(GeV/c^2); counts;", 1000,0,1.0);
904 fOutputList->Add(fInvmassULS1);
906 fInvmassLS2 = new TH1F("fInvmassLS2", "Inv mass of LS (e,e) for pt^{e}>1; mass(GeV/c^2); counts;", 1000,0,1.0);
907 fOutputList->Add(fInvmassLS2);
909 fInvmassULS2 = new TH1F("fInvmassULS2", "Inv mass of ULS (e,e) for pt^{e}>1; mass(GeV/c^2); counts;", 1000,0,1.0);
910 fOutputList->Add(fInvmassULS2);
912 fInvmassLS3 = new TH1F("fInvmassLS3", "Inv mass of LS (e,e) for pt^{e}>2; mass(GeV/c^2); counts;", 1000,0,1.0);
913 fOutputList->Add(fInvmassLS3);
915 fInvmassULS3 = new TH1F("fInvmassULS3", "Inv mass of ULS (e,e) for pt^{e}>2; mass(GeV/c^2); counts;", 1000,0,1.0);
916 fOutputList->Add(fInvmassULS3);
918 fInvmassLS4 = new TH1F("fInvmassLS4", "Inv mass of LS (e,e) for pt^{e}>3; mass(GeV/c^2); counts;", 1000,0,1.0);
919 fOutputList->Add(fInvmassLS4);
921 fInvmassULS4 = new TH1F("fInvmassULS4", "Inv mass of ULS (e,e) for pt^{e}>3; mass(GeV/c^2); counts;", 1000,0,1.0);
922 fOutputList->Add(fInvmassULS4);
924 fInvmassLS5 = new TH1F("fInvmassLS5", "Inv mass of LS (e,e) for pt^{e}>4; mass(GeV/c^2); counts;", 1000,0,1.0);
925 fOutputList->Add(fInvmassLS5);
927 fInvmassULS5 = new TH1F("fInvmassULS5", "Inv mass of ULS (e,e) for pt^{e}>4; mass(GeV/c^2); counts;", 1000,0,1.0);
928 fOutputList->Add(fInvmassULS5);
930 /* fNoMixedEvents = new TH1F("fNoMixedEvents","",1,0,1) ;
931 fOutputList->Add(fNoMixedEvents);
933 fMixStat = new TH2F("fMixStat","no of events in pool vs Centrality;Nevent in pool;Centrality",200,0,200,5,0,10);
934 fOutputList->Add(fMixStat);
936 fMixStat1 = new TH2F("fMixStat1","no of events in pool vs zvtx;Nevents in pool;zvtx",200,0,200,4,-10,10);
937 fOutputList->Add(fMixStat1);
939 fMixedIncElecDphi = new TH2F("fMixedIncElecDphi", "Mixed event - Inclusive elec-had Dphi correlation",200,0,20,100,-1.57,4.71);
940 fOutputList->Add(fMixedIncElecDphi);
942 fMixedIncElecDphi1 = new TH2F("fMixedIncElecDphi1", "Mixed event - Inclusive elec-had Dphi correlation 1<pt<3",200,0,20,100,-1.57,4.71);
943 fOutputList->Add(fMixedIncElecDphi1);
945 fMixedIncElecDphi2 = new TH2F("fMixedIncElecDphi2", "Mixed event - Inclusive elec-had Dphi correlation 3<pt<5",200,0,20,100,-1.57,4.71);
946 fOutputList->Add(fMixedIncElecDphi2);
948 fMixedSemiIncElecDphi = new TH2F("fMixedSemiIncElecDphi", "Mixed event - Semi Inclusive elec-had Dphi correlation",200,0,20,100,-1.57,4.71);
949 fOutputList->Add(fMixedSemiIncElecDphi);
951 fMixedSemiIncElecDphi1 = new TH2F("fMixedSemiIncElecDphi1", "Mixed event - Semi Inclusive elec-had Dphi correlation 1<pt<3",200,0,20,100,-1.57,4.71);
952 fOutputList->Add(fMixedSemiIncElecDphi1);
954 fMixedSemiIncElecDphi2 = new TH2F("fMixedSemiIncElecDphi2", "Mixed event - Semi Inclusive elec-had Dphi correlation 3<pt<5",200,0,20,100,-1.57,4.71);
955 fOutputList->Add(fMixedSemiIncElecDphi2);
957 fMixedPhotElecDphi = new TH2F("fMixedPhotElecDphi", "Mixed event - Photo elec-had Dphi correlation",200,0,20,100,-1.57,4.71);
958 fOutputList->Add(fMixedPhotElecDphi);
960 fMixedPhotElecDphi1 = new TH2F("fMixedPhotElecDphi1", "Mixed event - Photo elec-had Dphi correlation 1<pt<3",200,0,20,100,-1.57,4.71);
961 fOutputList->Add(fMixedPhotElecDphi1);
963 fMixedPhotElecDphi2 = new TH2F("fMixedPhotElecDphi2", "Mixed event - Photo elec-had Dphi correlation 3<pt<5",200,0,20,100,-1.57,4.71);
964 fOutputList->Add(fMixedPhotElecDphi2);
966 fMixedDphiULSMassLow = new TH2F("fMixedDphiULSMassLow", "Mixed event - ULS mass < cut elec-had Dphi correlation",200,0,20,100,-1.57,4.71);
967 fOutputList->Add(fMixedDphiULSMassLow);
969 fMixedDphiULSMassLow1 = new TH2F("fMixedDphiULSMassLow1", "Mixed event - ULS mass < cut elec-had Dphi correlation 1<pt<3",200,0,20,100,-1.57,4.71);
970 fOutputList->Add(fMixedDphiULSMassLow1);
972 fMixedDphiULSMassLow2 = new TH2F("fMixedDphiULSMassLow2", "Mixed event - ULS mass < cut elec-had Dphi correlation 3<pt<5",200,0,20,100,-1.57,4.71);
973 fOutputList->Add(fMixedDphiULSMassLow2);
975 fMixedDphiLSMassLow = new TH2F("fMixedDphiLSMassLow", "Mixed event - LS mass < cut elec-had Dphi correlation",200,0,20,100,-1.57,4.71);
976 fOutputList->Add(fMixedDphiLSMassLow);
978 fMixedDphiLSMassLow1 = new TH2F("fMixedDphiLSMassLow1", "Mixed event - LS mass < cut elec-had Dphi correlation 1<pt<3",200,0,20,100,-1.57,4.71);
979 fOutputList->Add(fMixedDphiLSMassLow1);
981 fMixedDphiLSMassLow2 = new TH2F("fMixedDphiLSMassLow2", "Mixed event - LS mass < cut elec-had Dphi correlation 3<pt<5",200,0,20,100,-1.57,4.71);
982 fOutputList->Add(fMixedDphiLSMassLow2);
984 fHadronPt = new TH1F("fHadronPt","hadron pt distribution",1000,0,100);
985 fOutputList->Add(fHadronPt);
987 fCentralityPass = new TH1F("fCentralityPass", "Centrality Pass", 101, -1, 100);
988 fOutputList->Add(fCentralityPass);
990 fCentralityNoPass = new TH1F("fCentralityNoPass", "Centrality No Pass", 101, -1, 100);
991 fOutputList->Add(fCentralityNoPass);
994 Int_t binsv1[8]={1000,1000,200,150,100,100,100,100}; //pt, p, TPCnsig, dEdx, E/p, M20, M02, dispersion
995 Double_t xminv1[8]={0,0,-10,0,0,0,0,0};
996 Double_t xmaxv1[8]={50,50,10,150,2,2,2,2};
997 fSparseElectron = new THnSparseD ("Electron","Electron",8,binsv1,xminv1,xmaxv1);
998 fOutputList->Add(fSparseElectron);
1000 PostData(1,fOutputList);
1003 //________________________________________________________________________
1004 void AliAnalysisTaskElecHadronCorrel::Terminate(Option_t *)
1006 // Info("Terminate");
1007 AliAnalysisTaskSE::Terminate();
1010 //________________________________________________________________________
1011 Bool_t AliAnalysisTaskElecHadronCorrel::ProcessCutStep(Int_t cutStep, AliVParticle *track)
1013 // Check single track cuts for a given cut step
1014 const Int_t kMCOffset = AliHFEcuts::kNcutStepsMCTrack;
1015 if(!fCFM->CheckParticleCuts(cutStep + kMCOffset, track)) return kFALSE;
1019 //_________________________________________
1020 void AliAnalysisTaskElecHadronCorrel::SelectPhotonicElectron(Int_t itrack, AliVTrack *track, Bool_t &fFlagPhotonicElec)
1022 //Identify non-heavy flavour electrons using Invariant mass method
1024 fTrackCuts1->SetAcceptKinkDaughters(kFALSE);
1025 fTrackCuts1->SetRequireTPCRefit(kTRUE);
1026 fTrackCuts1->SetRequireITSRefit(kTRUE);
1027 fTrackCuts1->SetEtaRange(-0.9,0.9);
1028 fTrackCuts1->SetRequireSigmaToVertex(kTRUE);
1029 fTrackCuts1->SetMaxChi2PerClusterTPC(4);
1030 fTrackCuts1->SetMinNClustersTPC(80);
1031 fTrackCuts1->SetMaxDCAToVertexZ(3.2);
1032 fTrackCuts1->SetMaxDCAToVertexXY(2.4);
1033 fTrackCuts1->SetDCAToVertex2D(kTRUE);
1035 Bool_t flagPhotonicElec = kFALSE;
1037 for(Int_t jTracks = 0; jTracks<fVevent->GetNumberOfTracks(); jTracks++){
1038 AliVParticle* VtrackAsso = fVevent->GetTrack(jTracks);
1040 printf("ERROR: Could not receive track %d\n", jTracks);
1044 AliVTrack *trackAsso = dynamic_cast<AliVTrack*>(VtrackAsso);
1046 //track cuts applied
1047 if(IsAODanalysis()) {
1048 AliAODTrack *atrackAsso = dynamic_cast<AliAODTrack*>(VtrackAsso);
1049 if(!atrackAsso->TestFilterMask(AliAODTrack::kTrkTPCOnly)) continue;
1050 if(atrackAsso->GetTPCNcls() < 80) continue;
1051 if((!(atrackAsso->GetStatus()&AliESDtrack::kITSrefit)|| (!(atrackAsso->GetStatus()&AliESDtrack::kTPCrefit)))) continue;
1054 AliESDtrack *etrackAsso = dynamic_cast<AliESDtrack*>(VtrackAsso);
1055 if(!fTrackCuts1->AcceptTrack(etrackAsso)) continue;
1058 if(jTracks==itrack) continue;
1060 Double_t dEdxAsso = -999., ptAsso=-999., nsigma=-999.0;
1061 Double_t mass=-999., width = -999;
1062 Bool_t fFlagLS=kFALSE, fFlagULS=kFALSE;
1064 dEdxAsso = trackAsso->GetTPCsignal();
1065 nsigma = fPID->GetPIDResponse() ? fPID->GetPIDResponse()->NumberOfSigmasTPC(trackAsso, AliPID::kElectron) : 1000;
1066 ptAsso = trackAsso->Pt();
1067 Int_t chargeAsso = trackAsso->Charge();
1068 Int_t charge = track->Charge();
1070 if(ptAsso <0.3) continue;
1071 if(trackAsso->Eta()<-0.9 || trackAsso->Eta()>0.9) continue;
1072 if(nsigma < -3 || nsigma > 3) continue;
1074 Int_t fPDGe1 = 11; Int_t fPDGe2 = 11;
1075 if(charge>0) fPDGe1 = -11;
1076 if(chargeAsso>0) fPDGe2 = -11;
1078 if(charge == chargeAsso) fFlagLS = kTRUE;
1079 if(charge != chargeAsso) fFlagULS = kTRUE;
1081 AliKFParticle ge1 = AliKFParticle(*track, fPDGe1);
1082 AliKFParticle ge2 = AliKFParticle(*trackAsso, fPDGe2);
1083 AliKFParticle recg(ge1, ge2);
1085 if(recg.GetNDF()<1) continue;
1086 Double_t chi2recg = recg.GetChi2()/recg.GetNDF();
1087 if(TMath::Sqrt(TMath::Abs(chi2recg))>3.) continue;
1090 MassCorrect = recg.GetMass(mass,width);
1093 fInvmassLS1->Fill(mass);
1094 if(track->Pt()> 1) fInvmassLS2->Fill(mass);
1095 if(track->Pt()>2) fInvmassLS3->Fill(mass);
1096 if(track->Pt()>3) fInvmassLS4->Fill(mass);
1097 if(track->Pt()>4) fInvmassLS5->Fill(mass);
1100 fInvmassULS1->Fill(mass);
1101 if(track->Pt() >1) fInvmassULS2->Fill(mass);
1102 if(track->Pt() >2) fInvmassULS3->Fill(mass);
1103 if(track->Pt() >3) fInvmassULS4->Fill(mass);
1104 if(track->Pt() >4) fInvmassULS5->Fill(mass);
1107 if(mass<fInvmassCut){
1110 ElectronHadCorrel(itrack,track,fDphiULSMassLow, fDphiULSMassLow1,fDphiULSMassLow2,fDphiULSMassLow3,fDphiULSMassLow4);
1111 fULSElecPt->Fill(track->Pt());
1112 // MixedEvent(track,fMixedDphiULSMassLow,fMixedDphiULSMassLow1,fMixedDphiULSMassLow2);
1116 ElectronHadCorrel(itrack,track,fDphiLSMassLow,fDphiLSMassLow1,fDphiLSMassLow2,fDphiLSMassLow3,fDphiLSMassLow4);
1117 fLSElecPt->Fill(track->Pt());
1118 // MixedEvent(track,fMixedDphiLSMassLow,fMixedDphiLSMassLow1,fMixedDphiLSMassLow2);
1120 if(fFlagLS) ElectronHadCorrelNoPartner(itrack,jTracks,track,fDphiLSMassLowNoPartner, fDphiLSMassLowNoPartner1,fDphiLSMassLowNoPartner2,fDphiLSMassLowNoPartner3,fDphiLSMassLowNoPartner4);
1121 if(fFlagULS) ElectronHadCorrelNoPartner(itrack,jTracks,track,fDphiULSMassLowNoPartner, fDphiULSMassLowNoPartner1,fDphiULSMassLowNoPartner2,fDphiULSMassLowNoPartner3,fDphiULSMassLowNoPartner4);
1124 if(mass<fInvmassCut && fFlagULS && !flagPhotonicElec){
1125 flagPhotonicElec = kTRUE;
1130 fFlagPhotonicElec = flagPhotonicElec;
1132 //_________________________________________
1133 void AliAnalysisTaskElecHadronCorrel::ElectronHadCorrel(Int_t itrack, AliVTrack *track, TH2F *DphiPt, TH2F *DphiPt1,TH2F *DphiPt2,TH2F *DphiPt3,TH2F *DphiPt4)
1135 //Construct Delta Phi between electrons and hadrons
1137 fTrackCuts2->SetAcceptKinkDaughters(kFALSE);
1138 fTrackCuts2->SetRequireTPCRefit(kTRUE);
1139 fTrackCuts2->SetRequireITSRefit(kTRUE);
1140 fTrackCuts2->SetEtaRange(-0.9,0.9);
1141 fTrackCuts2->SetRequireSigmaToVertex(kTRUE);
1142 fTrackCuts2->SetMaxChi2PerClusterTPC(4);
1143 fTrackCuts2->SetMinNClustersTPC(80);
1144 fTrackCuts2->SetMaxDCAToVertexZ(3.2);
1145 fTrackCuts2->SetMaxDCAToVertexXY(2.4);
1146 fTrackCuts2->SetDCAToVertex2D(kTRUE);
1148 for(Int_t ktracks = 0; ktracks<fVevent->GetNumberOfTracks(); ktracks++){
1149 AliVParticle* VtrackHad = fVevent->GetTrack(ktracks);
1151 printf("ERROR: Could not receive track %d\n", ktracks);
1155 AliVTrack *trackHad = dynamic_cast<AliVTrack*>(VtrackHad);
1157 if(IsAODanalysis()) {
1158 AliAODTrack *atrackHad = dynamic_cast<AliAODTrack*>(VtrackHad);
1159 if(!atrackHad->TestFilterMask(AliAODTrack::kTrkTPCOnly)) continue;
1160 if((!(atrackHad->GetStatus()&AliESDtrack::kITSrefit)|| (!(atrackHad->GetStatus()&AliESDtrack::kTPCrefit)))) continue;
1161 if(atrackHad->GetTPCNcls() < 80) continue;
1164 AliESDtrack *etrackHad = dynamic_cast<AliESDtrack*>(VtrackHad);
1165 if(!fTrackCuts2->AcceptTrack(etrackHad)) continue;
1168 if(ktracks == itrack) continue; //do not select the same electron
1170 Double_t ptHad= -999, pHad=-999., dEdxHad = -999;
1171 Double_t ptEle = -999;
1172 Double_t phiEle = -999, phiHad = -999, Dphi = -999;
1175 dEdxHad = trackHad->GetTPCsignal();
1176 ptHad = trackHad->Pt();
1177 pHad = trackHad->P();
1178 ptEle = track->Pt();
1180 // if(ptHad <2) continue;
1181 if(ptHad > ptEle) continue;
1182 if(trackHad->Eta()<-0.9 || trackHad->Eta()>0.9) continue;
1184 phiEle = track->Phi();
1185 phiHad = trackHad->Phi();
1186 Dphi = phiEle - phiHad;
1192 if(ptHad>2) DphiPt->Fill(ptEle,Dphi);
1193 if(ptHad>2 && ptHad<4) DphiPt1->Fill(ptEle,Dphi);
1194 if(ptHad>4 && ptHad<6) DphiPt2->Fill(ptEle,Dphi);
1195 if(ptHad>6 && ptHad<8) DphiPt3->Fill(ptEle,Dphi);
1196 if(ptHad>8 && ptHad<10) DphiPt4->Fill(ptEle,Dphi);
1200 //_________________________________________
1201 void AliAnalysisTaskElecHadronCorrel::ElectronHadCorrelNoPartner(Int_t itrack,Int_t jtrack, AliVTrack *track, TH2F *DphiPtNew, TH2F *DphiPtNew1,TH2F *DphiPtNew2,TH2F *DphiPtNew3,TH2F *DphiPtNew4)
1203 //Construct Delta Phi between electrons and hadrons for electrons from invariant mass calculation excluding associated track
1205 fTrackCuts2->SetAcceptKinkDaughters(kFALSE);
1206 fTrackCuts2->SetRequireTPCRefit(kTRUE);
1207 fTrackCuts2->SetRequireITSRefit(kTRUE);
1208 fTrackCuts2->SetEtaRange(-0.9,0.9);
1209 fTrackCuts2->SetRequireSigmaToVertex(kTRUE);
1210 fTrackCuts2->SetMaxChi2PerClusterTPC(4);
1211 fTrackCuts2->SetMinNClustersTPC(80);
1212 fTrackCuts2->SetMaxDCAToVertexZ(3.2);
1213 fTrackCuts2->SetMaxDCAToVertexXY(2.4);
1214 fTrackCuts2->SetDCAToVertex2D(kTRUE);
1216 for(Int_t ktracks = 0; ktracks<fVevent->GetNumberOfTracks(); ktracks++){
1217 AliVParticle* VtrackHad = fVevent->GetTrack(ktracks);
1219 printf("ERROR: Could not receive track %d\n", ktracks);
1223 AliVTrack *trackHad = dynamic_cast<AliVTrack*>(VtrackHad);
1225 if(IsAODanalysis()) {
1226 AliAODTrack *atrackHad = dynamic_cast<AliAODTrack*>(VtrackHad);
1227 if(!atrackHad->TestFilterMask(AliAODTrack::kTrkTPCOnly)) continue;
1228 if((!(atrackHad->GetStatus()&AliESDtrack::kITSrefit)|| (!(atrackHad->GetStatus()&AliESDtrack::kTPCrefit)))) continue;
1229 if(atrackHad->GetTPCNcls() < 80) continue;
1232 AliESDtrack *etrackHad = dynamic_cast<AliESDtrack*>(VtrackHad);
1233 if(!fTrackCuts2->AcceptTrack(etrackHad)) continue;
1236 if(ktracks == itrack || ktracks == jtrack) continue; //do not select the same electron and associated track from inv mass cal
1238 Double_t ptHad= -999, pHad=-999., dEdxHad = -999;
1239 Double_t ptEle = -999;
1240 Double_t phiEle = -999, phiHad = -999, Dphi = -999;
1243 dEdxHad = trackHad->GetTPCsignal();
1244 ptHad = trackHad->Pt();
1245 pHad = trackHad->P();
1246 ptEle = track->Pt();
1248 // if(ptHad <2) continue;
1249 if(ptHad > ptEle) continue;
1250 if(trackHad->Eta()<-0.9 || trackHad->Eta()>0.9) continue;
1252 phiEle = track->Phi();
1253 phiHad = trackHad->Phi();
1254 Dphi = phiEle - phiHad;
1260 if(ptHad>2) DphiPtNew->Fill(ptEle,Dphi);
1261 if(ptHad>2 && ptHad<4) DphiPtNew1->Fill(ptEle,Dphi);
1262 if(ptHad>4 && ptHad<6) DphiPtNew2->Fill(ptEle,Dphi);
1263 if(ptHad>6 && ptHad<8) DphiPtNew3->Fill(ptEle,Dphi);
1264 if(ptHad>8 && ptHad<10) DphiPtNew4->Fill(ptEle,Dphi);
1269 //_________________________________________
1270 void AliAnalysisTaskElecHadronCorrel::MixedEvent(AliAODTrack *track, TH2F *DphiPt, TH2F *DphiPt1,TH2F *DphiPt2)
1273 const AliAODVertex *pVtx = fAOD->GetPrimaryVertex();
1275 zVtx = pVtx->GetZ();
1278 AliCentrality *fCentrality = (AliCentrality*)fAOD->GetCentrality();
1279 Double_t centvalue = fCentrality->GetCentralityPercentile("V0M");
1281 AliEventPool* pool = fPoolMgr->GetEventPool(centvalue, zVtx); // Get the buffer associated with the current centrality and z-vtx
1283 AliFatal(Form("No pool found for centrality = %f, zVtx = %f", centvalue, zVtx));
1285 // pool->PrintInfo();
1286 if (pool->GetCurrentNEvents() >= 5) // start mixing when 5 events are in the buffer
1288 Int_t nMix = pool->GetCurrentNEvents();
1289 fNoMixedEvents->Fill(0);
1290 fMixStat->Fill(pool->GetCurrentNEvents(),centvalue);
1291 fMixStat1->Fill(pool->GetCurrentNEvents(),zVtx);
1293 // cout << "nMix = " << nMix << " tracks in pool = " << pool->NTracksInPool() << endl;
1294 for (Int_t jMix=0; jMix<nMix; jMix++) // mix with each event in the buffer
1296 TObjArray* bgTracks = pool->GetEvent(jMix);
1297 for (Int_t i=0;i<bgTracks->GetEntriesFast(); i++)
1299 AliVParticle* mixtrk = (AliVParticle*) bgTracks->At(i);
1301 Double_t mixtrkPhi = -999;
1302 Double_t ptEle = -999;
1303 Double_t phiEle = -999, Dphi = -999;
1305 Double_t ptmixtrk = -999;
1307 ptEle = track->Pt();
1308 ptmixtrk = mixtrk->Pt();
1309 if(ptmixtrk > ptEle) continue;
1311 mixtrkPhi = mixtrk->Phi();
1312 phiEle = track->Phi();
1313 Dphi = phiEle - mixtrkPhi;
1319 if(ptmixtrk>2) DphiPt->Fill(ptEle,Dphi);
1320 if(ptmixtrk>2 && ptmixtrk<4) DphiPt1->Fill(ptEle,Dphi);
1321 if(ptmixtrk>4 && ptmixtrk<6) DphiPt2->Fill(ptEle,Dphi);
1328 //___________________________________________
1329 TObjArray* AliAnalysisTaskElecHadronCorrel::CloneAndReduceTrackList()
1331 // clones a track list by using AliehDPhiBasicParticle which uses much less memory (used for event mixing)
1333 fTrackCuts2->SetAcceptKinkDaughters(kFALSE);
1334 fTrackCuts2->SetRequireTPCRefit(kTRUE);
1335 fTrackCuts2->SetRequireITSRefit(kTRUE);
1336 fTrackCuts2->SetEtaRange(-0.9,0.9);
1337 fTrackCuts2->SetRequireSigmaToVertex(kTRUE);
1338 fTrackCuts2->SetMaxChi2PerClusterTPC(3.5);
1339 fTrackCuts2->SetMinNClustersTPC(80);
1341 TObjArray* tracksClone = new TObjArray;
1342 tracksClone->SetOwner(kTRUE);
1344 for(Int_t ktracks = 0; ktracks<fAOD->GetNumberOfTracks(); ktracks++){
1345 AliAODTrack* track = fAOD->GetTrack(ktracks);
1347 printf("ERROR: Could not receive track %d\n", ktracks);
1350 if(!track->TestFilterMask(AliAODTrack::kTrkGlobalNoDCA)) continue;
1352 // if(ktracks == iTrack) continue;
1353 Double_t eta=-999,ptHad= -999, pHad=-999., phi=-999.0;
1354 Int_t label=-9999, id=-999;
1356 ptHad = track->Pt();
1359 label= track->GetLabel();
1362 if(track->Eta()<-0.9 || track->Eta()>0.9) continue;
1363 if(!ProcessCutStep(AliHFEcuts::kStepRecKineITSTPC, track)) continue;
1364 if(!ProcessCutStep(AliHFEcuts::kStepHFEcutsTPC, track)) continue;
1365 if(ptHad <2) continue;
1366 // if(!fTrackCuts2->AcceptTrack(track)) continue;
1368 AliVParticle* particle = (AliVParticle*) fAOD->GetTrack(ktracks);
1369 tracksClone->Add(new AliehDPhiBasicParticle(particle->Eta(), particle->Phi(), particle->Pt(), particle->Charge()));
1376 //___________________________________________
1377 void AliAnalysisTaskElecHadronCorrel::HadronInfo(Int_t itrack)
1379 //Hadron information
1381 fTrackCuts2->SetAcceptKinkDaughters(kFALSE);
1382 fTrackCuts2->SetRequireTPCRefit(kTRUE);
1383 fTrackCuts2->SetRequireITSRefit(kTRUE);
1384 fTrackCuts2->SetEtaRange(-0.9,0.9);
1385 fTrackCuts2->SetRequireSigmaToVertex(kTRUE);
1386 fTrackCuts2->SetMaxChi2PerClusterTPC(4);
1387 fTrackCuts2->SetMinNClustersTPC(80);
1388 fTrackCuts2->SetMaxDCAToVertexZ(3.2);
1389 fTrackCuts2->SetMaxDCAToVertexXY(2.4);
1390 fTrackCuts2->SetDCAToVertex2D(kTRUE);
1392 for(Int_t ktracks = 0; ktracks<fVevent->GetNumberOfTracks(); ktracks++){
1393 AliVParticle* VtrackHad = fVevent->GetTrack(ktracks);
1395 printf("ERROR: Could not receive track %d\n", ktracks);
1399 AliVTrack *trackHad = dynamic_cast<AliVTrack*>(VtrackHad);
1401 if(IsAODanalysis()) {
1402 AliAODTrack *atrackHad = dynamic_cast<AliAODTrack*>(VtrackHad);
1403 if(!atrackHad->TestFilterMask(AliAODTrack::kTrkTPCOnly)) continue;
1404 if((!(atrackHad->GetStatus()&AliESDtrack::kITSrefit)|| (!(atrackHad->GetStatus()&AliESDtrack::kTPCrefit)))) continue;
1405 if(atrackHad->GetTPCNcls() < 80) continue;
1408 AliESDtrack *etrackHad = dynamic_cast<AliESDtrack*>(VtrackHad);
1409 if(!fTrackCuts2->AcceptTrack(etrackHad)) continue;
1412 if(ktracks == itrack) continue; //do not select the same electron
1414 Double_t ptHad= -999;
1415 ptHad = trackHad->Pt();
1417 if(trackHad->Eta()<-0.9 || trackHad->Eta()>0.9) continue;
1418 // cout << "pt had = " << ptHad <<endl;
1420 if(ptHad<2) continue;
1422 fHadronPhi->Fill(trackHad->Phi());
1423 fHadronPhiPt->Fill(trackHad->Phi(),ptHad);
1424 if (trackHad->Eta() >0 && trackHad->Eta() <0.9) fHadronPhiTPChalf->Fill(trackHad->Phi());
1426 fHadronPt->Fill(ptHad);
1429 //_________________________________________
1430 void AliAnalysisTaskElecHadronCorrel::CheckCentrality(AliVEvent* event, Bool_t ¢ralitypass)
1432 // Check if event is within the set centrality range. Falls back to V0 centrality determination if no method is set
1433 if (!fkCentralityMethod) AliFatal("No centrality method set! FATAL ERROR!");
1434 fCentrality = event->GetCentrality()->GetCentralityPercentile(fkCentralityMethod);
1435 // cout << "Centrality evaluated-------------------------: " << fCentrality <<endl;
1437 if ((fCentrality <= fCentralityMin) || (fCentrality > fCentralityMax))
1439 fCentralityNoPass->Fill(fCentrality);
1440 // cout << "--------------Fill no pass-------------------------"<<endl;
1441 centralitypass = kFALSE;
1444 fCentralityPass->Fill(fCentrality);
1445 // cout << "--------------Fill pass-------------------------"<<endl;
1446 centralitypass = kTRUE;
1450 //_____________________________________________________________________________
1451 void AliAnalysisTaskElecHadronCorrel::SetCentralityParameters(Double_t CentralityMin, Double_t CentralityMax, const char* CentralityMethod)
1453 // Set a centrality range ]min, max] and define the method to use for centrality selection
1454 fCentralityMin = CentralityMin;
1455 fCentralityMax = CentralityMax;
1456 fkCentralityMethod = CentralityMethod;