2 /**************************************************************************
3 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * Author: The ALICE Off-line Project. *
6 * Contributors are mentioned in the code where appropriate. *
8 * Permission to use, copy, modify and distribute this software and its *
9 * documentation strictly for non-commercial purposes is hereby granted *
10 * without fee, provided that the above copyright notice appears in all *
11 * copies and that both the copyright notice and this permission notice *
12 * appear in the supporting documentation. The authors make no claims *
13 * about the suitability of this software for any purpose. It is *
14 * provided "as is" without express or implied warranty. *
15 **************************************************************************/
17 ////////////////////////////////////////////////////////////////////////
19 // Task for Heavy-flavour electron analysis in pPb collisions //
20 // (+ Electron-Hadron Jetlike Azimuthal Correlation) //
22 // version: March 23, 2014. //
25 // Elienos Pereira de Oliveira Filho (epereira@cern.ch) //
26 // Cristiane Jahnke (cristiane.jahnke@cern.ch) //
28 ////////////////////////////////////////////////////////////////////////
36 #include "AliAnalysisTask.h"
37 #include "AliAnalysisManager.h"
38 #include "AliESDEvent.h"
39 #include "AliAODEvent.h"
40 #include "AliVEvent.h"
41 #include "AliESDInputHandler.h"
42 #include "AliESDtrackCuts.h"
43 #include "AliESDCaloCluster.h"
44 #include "AliESDCaloCells.h"
45 #include "AliEMCALTrack.h"
46 #include "AliExternalTrackParam.h"
47 #include "AliPhysicsSelection.h"
48 #include "TGeoGlobalMagField.h"
52 #include "AliCentrality.h"
53 #include "AliAODMCParticle.h"
54 #include "AliAODMCHeader.h"
56 #include "AliPIDResponse.h"
57 #include "AliHFEcontainer.h"
58 #include "AliHFEcuts.h"
59 #include "AliHFEpid.h"
60 #include "AliHFEpidBase.h"
61 #include "AliHFEpidQAmanager.h"
62 #include "AliHFEtools.h"
63 #include "AliCFContainer.h"
64 #include "AliCFManager.h"
65 #include "AliSelectNonHFE.h"
66 #include "AliHFEpidTPC.h"
67 #include "AliAnalysisTaskEMCalHFEpA.h"
69 #include "THnSparse.h"
70 #include "TLorentzVector.h"
73 #include "AliESDHandler.h"
74 #include "AliMCEventHandler.h"
75 #include "AliMCEvent.h"
77 #include "TParticle.h"
79 #include "AliAnalysisTaskSE.h"
80 #include "TRefArray.h"
83 #include "TGeoManager.h"
86 #include "AliKFParticle.h"
87 #include "AliKFVertex.h"
88 #include "AliVParticle.h"
89 #include "AliVTrack.h"
90 #include "AliEventPoolManager.h"
91 #include "TObjArray.h"
92 //include to use reader as Lucile does
93 #include "AliCaloTrackAODReader.h"
94 #include "AliCaloTrackReader.h"
96 //______________________________________________________________________
98 //______________________________________________________________________
99 ClassImp(AliAnalysisTaskEMCalHFEpA)
101 //______________________________________________________________________
102 AliAnalysisTaskEMCalHFEpA::AliAnalysisTaskEMCalHFEpA(const char *name)
103 : AliAnalysisTaskSE(name)
108 ,fUseShowerShapeCut(kFALSE)
109 ,fFillBackground(kFALSE)
110 ,fAssocWithSPD(kFALSE)
121 ,fIsFromGamma(kFALSE)
125 ,fPartnerCuts(new AliESDtrackCuts())
128 ,fNonHFE(new AliSelectNonHFE())
133 ,fHasCentralitySelection(kFALSE)
135 ,fCentralityHistPass(0)
154 ,fPtElec_ULS_NoPid(0)
157 ,fPtElec_ULS_MC_weight(0)
160 ,fPtElec_ULS_weight(0)
161 ,fPtElec_LS_weight(0)
162 ,fPtElec_ULS2_weight(0)
163 ,fPtElec_LS2_weight(0)
176 ,fShowerShapeM02_EoverP(0)
177 ,fShowerShapeM20_EoverP(0)
187 ,fpt_reco_pt_MC_num(0)
188 ,fpt_reco_pt_MC_den(0)
210 ,fNcells_electrons(0)
217 ,fTPCnsigma_eta_electrons(0)
218 ,fTPCnsigma_eta_hadrons(0)
221 ,fnsigma_p_EoverPcut(0)
222 ,fEoverP_pt_pions2(0)
224 ,fEoverP_pt_hadrons(0)
230 ,fCEtaPhi_ULS_Weight(0)
231 ,fCEtaPhi_LS_Weight(0)
232 ,fCEtaPhi_ULS_NoP_Weight(0)
233 ,fCEtaPhi_LS_NoP_Weight(0)
261 ,fAngleCutFlag(kFALSE)
262 ,fChi2CutFlag(kFALSE)
264 ,fAssHadronPtMin(0.5)
265 ,fAssHadronPtMax(2.0)
266 ,fPtBackgroundBeforeReco(0)
267 ,fPtBackgroundBeforeReco2(0)
268 ,fPtBackgroundBeforeReco_weight(0)
269 ,fPtBackgroundBeforeReco2_weight(0)
272 ,fPtBackgroundAfterReco(0)
276 ,fPtMCparticleAll_nonPrimary(0)
277 ,fPtMCparticleAlle_nonPrimary(0)
278 ,fPtMCparticleAlle_Primary(0)
279 ,fPtMCparticleReco(0)
280 ,fPtMCparticleReco_nonPrimary(0)
281 ,fPtMCparticleAllHfe1(0)
282 ,fPtMCparticleRecoHfe1(0)
283 ,fPtMCparticleAllHfe2(0)
284 ,fPtMCparticleRecoHfe2(0)
285 ,fPtMCelectronAfterAll(0)
286 ,fPtMCelectronAfterAll_unfolding(0)
287 ,fPtMCelectronAfterAll_nonPrimary(0)
288 ,fPtMCelectronAfterAll_Primary(0)
294 ,fPtMC_EMCal_Selected(0)
296 ,fPtMC_TPC_Selected(0)
297 ,fPt_track_match_den(0)
298 ,fPt_track_match_num(0)
300 ,fPtMCWithoutLabel(0)
301 ,fPtIsPhysicaPrimary(0)
305 ,fPID(new AliHFEpid("hfePid"))
309 ,fRejectKinkMother(kFALSE)
314 ,fMCtrackGGGMother(0)
319 ,fMCparticleMother(0)
320 ,fMCparticleGMother(0)
321 ,fMCparticleGGMother(0)
322 ,fMCparticleGGGMother(0)
332 ,fCEtaPhi_ULS_Weight_EM(0)
333 ,fCEtaPhi_LS_Weight_EM(0)
336 ,fCEtaPhi_Inc_DiHadron(0)
340 // Define input and output slots here
341 // Input slot #0 works with a TChain
342 DefineInput(0, TChain::Class());
343 // Output slot #0 id reserved by the base class for AOD
344 // Output slot #1 writes into a TH1 container
345 // DefineOutput(1, TH1I::Class());
346 DefineOutput(1, TList::Class());
347 // DefineOutput(3, TTree::Class());
350 //________________________________________________________________________
351 AliAnalysisTaskEMCalHFEpA::AliAnalysisTaskEMCalHFEpA()
352 : AliAnalysisTaskSE("DefaultAnalysis_AliAnalysisTaskEMCalHFEpA")
357 ,fUseShowerShapeCut(kFALSE)
358 ,fFillBackground(kFALSE)
359 ,fAssocWithSPD(kFALSE)
369 ,fIsFromGamma(kFALSE)
373 ,fPartnerCuts(new AliESDtrackCuts())
376 ,fNonHFE(new AliSelectNonHFE())
381 ,fHasCentralitySelection(kFALSE)
383 ,fCentralityHistPass(0)
402 ,fPtElec_ULS_NoPid(0)
405 ,fPtElec_ULS_MC_weight(0)
408 ,fPtElec_ULS_weight(0)
409 ,fPtElec_LS_weight(0)
410 ,fPtElec_ULS2_weight(0)
411 ,fPtElec_LS2_weight(0)
424 ,fShowerShapeM02_EoverP(0)
425 ,fShowerShapeM20_EoverP(0)
435 ,fpt_reco_pt_MC_num(0)
436 ,fpt_reco_pt_MC_den(0)
458 ,fNcells_electrons(0)
465 ,fTPCnsigma_eta_electrons(0)
466 ,fTPCnsigma_eta_hadrons(0)
469 ,fnsigma_p_EoverPcut(0)
470 ,fEoverP_pt_pions2(0)
472 ,fEoverP_pt_hadrons(0)
478 ,fCEtaPhi_ULS_Weight(0)
479 ,fCEtaPhi_LS_Weight(0)
480 ,fCEtaPhi_ULS_NoP_Weight(0)
481 ,fCEtaPhi_LS_NoP_Weight(0)
509 ,fAngleCutFlag(kFALSE)
510 ,fChi2CutFlag(kFALSE)
512 ,fAssHadronPtMin(0.5)
513 ,fAssHadronPtMax(2.0)
514 ,fPtBackgroundBeforeReco(0)
515 ,fPtBackgroundBeforeReco2(0)
516 ,fPtBackgroundBeforeReco_weight(0)
517 ,fPtBackgroundBeforeReco2_weight(0)
520 ,fPtBackgroundAfterReco(0)
524 ,fPtMCparticleAll_nonPrimary(0)
525 ,fPtMCparticleAlle_nonPrimary(0)
526 ,fPtMCparticleAlle_Primary(0)
527 ,fPtMCparticleReco(0)
528 ,fPtMCparticleReco_nonPrimary(0)
529 ,fPtMCparticleAllHfe1(0)
530 ,fPtMCparticleRecoHfe1(0)
531 ,fPtMCparticleAllHfe2(0)
532 ,fPtMCparticleRecoHfe2(0)
533 ,fPtMCelectronAfterAll(0)
534 ,fPtMCelectronAfterAll_unfolding(0)
535 ,fPtMCelectronAfterAll_nonPrimary(0)
536 ,fPtMCelectronAfterAll_Primary(0)
542 ,fPtMC_EMCal_Selected(0)
544 ,fPtMC_TPC_Selected(0)
545 ,fPt_track_match_den(0)
546 ,fPt_track_match_num(0)
548 ,fPtMCWithoutLabel(0)
549 ,fPtIsPhysicaPrimary(0)
554 ,fPID(new AliHFEpid("hfePid"))
557 ,fRejectKinkMother(kFALSE)
562 ,fMCtrackGGGMother(0)
567 ,fMCparticleMother(0)
568 ,fMCparticleGMother(0)
569 ,fMCparticleGGMother(0)
570 ,fMCparticleGGGMother(0)
580 ,fCEtaPhi_ULS_Weight_EM(0)
581 ,fCEtaPhi_LS_Weight_EM(0)
584 ,fCEtaPhi_Inc_DiHadron(0)
588 // Define input and output slots here
589 // Input slot #0 works with a TChain
590 DefineInput(0, TChain::Class());
591 // Output slot #0 id reserved by the base class for AOD
592 // Output slot #1 writes into a TH1 container
593 // DefineOutput(1, TH1I::Class());
594 DefineOutput(1, TList::Class());
595 //DefineOutput(3, TTree::Class());
598 //______________________________________________________________________
599 AliAnalysisTaskEMCalHFEpA::~AliAnalysisTaskEMCalHFEpA()
610 //______________________________________________________________________
611 //Create Output Objects
612 //Here we can define the histograms and others output files
614 void AliAnalysisTaskEMCalHFEpA::UserCreateOutputObjects()
616 //______________________________________________________________________
618 if(!fPID->GetNumberOfPIDdetectors())
620 fPID->AddDetector("TPC", 0);
623 fPID->SortDetectors();
625 fPIDqa = new AliHFEpidQAmanager();
626 fPIDqa->Initialize(fPID);
627 //______________________________________________________________________
629 //______________________________________________________________________
630 //Initialize correction Framework and Cuts
631 fCFM = new AliCFManager;
632 const Int_t kNcutSteps = AliHFEcuts::kNcutStepsMCTrack + AliHFEcuts::kNcutStepsRecTrack + AliHFEcuts::kNcutStepsDETrack;
633 fCFM->SetNStepParticle(kNcutSteps);
634 for(Int_t istep = 0; istep < kNcutSteps; istep++) fCFM->SetParticleCutsList(istep, NULL);
638 AliWarning("Cuts not available. Default cuts will be used");
639 fCuts = new AliHFEcuts;
640 fCuts->CreateStandardCuts();
643 fCuts->Initialize(fCFM);
644 //______________________________________________________________________
646 ///___________________//Lucile
649 // reader = new AliCaloTrackAODReader();
651 //___________________________________________________
654 fOutputList = new TList();
655 fOutputList->SetOwner();
658 fOutputList->Add(fPIDqa->MakeList("PIDQA"));
660 //Store the number of events
662 fNevent = new TH1F("fNevent","Number of Events",15,0,15);
663 //And then, add to the output list
664 fOutputList->Add(fNevent);
666 fpid = new TH1F("fpid","PID flag",5,0,5);
667 fOutputList->Add(fpid);
670 fPtElec_Inc = new TH1F("fPtElec_Inc","Inclusive Electrons; p_{T} (GeV/c); Count",300,0,30);
672 fPtPrim = new TH1F("fPtPrim","Primary Electrons aod track; p_{T} (GeV/c); Count",300,0,30);
673 fPtSec = new TH1F("fPtSec","Secundary Electrons aod track; p_{T} (GeV/c); Count",300,0,30);
674 fPtPrim2 = new TH1F("fPtPrim2","Primary Electrons vtrack; p_{T} (GeV/c); Count",300,0,30);
675 fPtSec2 = new TH1F("fPtSec2","Secundary Electrons vtrack; p_{T} (GeV/c); Count",300,0,30);
678 fPtElec_ULS = new TH1F("fPtElec_ULS","ULS; p_{T} (GeV/c); Count",300,0,30);
679 fPtElec_LS = new TH1F("fPtElec_LS","LS; p_{T} (GeV/c); Count",300,0,30);
681 fPtElec_ULS_NoPid = new TH1F("fPtElec_ULS_NoPid","ULS; p_{T} (GeV/c); Count",300,0,30);
682 fPtElec_LS_NoPid = new TH1F("fPtElec_LS_NoPid","LS; p_{T} (GeV/c); Count",300,0,30);
684 fPtElec_ULS_MC = new TH1F("fPtElec_ULS_MC","ULS; p_{T} (GeV/c); Count",300,0,30);
685 fPtElec_ULS_MC_weight = new TH1F("fPtElec_ULS_MC_weight","ULS; p_{T} (GeV/c); Count",300,0,30);
687 fPtElec_ULS_weight = new TH1F("fPtElec_ULS_weight","ULS; p_{T} (GeV/c); Count",300,0,30);
688 fPtElec_LS_weight = new TH1F("fPtElec_LS_weight","LS; p_{T} (GeV/c); Count",300,0,30);
690 fTOF01 = new TH2F("fTOF01","",200,-20,20,200,-20,20);
691 fTOF02 = new TH2F("fTOF02","",200,-20,20,200,-20,20);
692 fTOF03 = new TH2F("fTOF03","",200,-20,20,200,-20,20);
695 fPtElec_ULS2 = new TH1F("fPtElec_ULS2","ULS; p_{T} (GeV/c); Count",300,0,30);
696 fPtElec_LS2 = new TH1F("fPtElec_LS2","LS; p_{T} (GeV/c); Count",300,0,30);
698 fPtElec_ULS2_weight = new TH1F("fPtElec_ULS2_weight","ULS; p_{T} (GeV/c); Count",300,0,30);
699 fPtElec_LS2_weight = new TH1F("fPtElec_LS2_weight","LS; p_{T} (GeV/c); Count",300,0,30);
703 fPtTrigger_Inc = new TH1F("fPtTrigger_Inc","pT dist for Hadron Contamination; p_{t} (GeV/c); Count",300,0,30);
704 fTPCnsigma_pt_2D = new TH2F("fTPCnsigma_pt_2D",";pt (GeV/c);TPC Electron N#sigma",1000,0.3,30,1000,-15,10);
705 fShowerShapeCut = new TH2F("fShowerShapeCut","Shower Shape;M02;M20",500,0,1.8,500,0,1.8);
706 fEtaPhi_num=new TH2F("fEtaPhi_num","#eta x #phi track;#phi;#eta",200,0.,5,50,-1.,1.);
707 fEtaPhi_den=new TH2F("fEtaPhi_den","#eta x #phi track;#phi;#eta",200,0.,5,50,-1.,1.);
709 fpt_reco_pt_MC_num=new TH2F("fpt_reco_pt_MC_num","pt reco x pt MC;pt reco; pt MC",300,0.,30,300,0.,30);
710 fpt_reco_pt_MC_den=new TH2F("fpt_reco_pt_MC_den","pt reco x pt MC;pt reco; pt MC",300,0.,30,300,0.,30);
713 fCharge_n = new TH1F("fCharge_n","Inclusive Electrons (Negative Charge); p_{t} (GeV/c); Count",200,0,30);
714 fCharge_p = new TH1F("fCharge_p","Inclusive Positrons (Positive Charge); p_{t} (GeV/c); Count",200,0,30);
716 fECluster_pure= new TH1F("fECluster_pure", ";ECluster pure",2000,0,100);
721 fTime = new TH2D("fTime","Cells Cluster Time; p_{T} (GeV/c); Time (s)",300,0,30,1000,1e-8,1e-5);
722 fTime2 = new TH2D("fTime2","Cells Cluster Time; p_{T} (GeV/c); Time (s)",300,0,30,1000,1e-8,1e-5);
725 ftimingEle = new TH2D("ftimingEle","Cluster Time; p_{T} (GeV/c); Time (s)",300,0,30,1000,1e-8,1e-5);
726 ftimingEle2 = new TH2D("ftimingEle2","Cluster Time; p_{T} (GeV/c); Time (s)",300,0,30,1000,1e-8,1e-5);
728 fShowerShape_ha = new TH2F("fShowerShape_ha","Shower Shape hadrons;M02;M20",500,0,1.8,500,0,1.8);
729 fShowerShape_ele = new TH2F("fShowerShape_ele","Shower Shape electrons;M02;M20",500,0,1.8,500,0,1.8);
731 fShowerShapeM02_EoverP = new TH2F("fShowerShapeM02_EoverP","Shower Shape;M02;E/p",500,0,1.8,500,0,1.8);
732 fShowerShapeM20_EoverP = new TH2F("fShowerShapeM20_EoverP","Shower Shape;M20;E/p",500,0,1.8,500,0,1.8);
736 fOutputList->Add(fTOF01);
737 fOutputList->Add(fTOF02);
738 fOutputList->Add(fTOF03);
740 fOutputList->Add(fEtaPhi_num);
741 fOutputList->Add(fEtaPhi_den);
743 fOutputList->Add(fpt_reco_pt_MC_num);
744 fOutputList->Add(fpt_reco_pt_MC_den);
747 fOutputList->Add(fPtElec_Inc);
748 fOutputList->Add(fPtElec_ULS);
749 fOutputList->Add(fPtElec_LS);
750 fOutputList->Add(fPtElec_ULS_NoPid);
751 fOutputList->Add(fPtElec_LS_NoPid);
752 fOutputList->Add(fPtElec_ULS_MC);
753 fOutputList->Add(fPtElec_ULS_MC_weight);
755 fOutputList->Add(fPtPrim);
756 fOutputList->Add(fPtSec);
757 fOutputList->Add(fPtPrim2);
758 fOutputList->Add(fPtSec2);
762 fOutputList->Add(fPtElec_ULS_weight);
763 fOutputList->Add(fPtElec_LS_weight);
766 fOutputList->Add(fPtElec_ULS2);
767 fOutputList->Add(fPtElec_LS2);
768 fOutputList->Add(fPtElec_ULS2_weight);
769 fOutputList->Add(fPtElec_LS2_weight);
773 fOutputList->Add(fPtTrigger_Inc);
774 fOutputList->Add(fTPCnsigma_pt_2D);
775 fOutputList->Add(fShowerShapeCut);
777 fOutputList->Add(fCharge_n);
778 fOutputList->Add(fCharge_p);
780 fOutputList->Add(fECluster_pure);
785 fOutputList->Add(fTime);
786 fOutputList->Add(fTime2);
790 fOutputList->Add(ftimingEle);
791 fOutputList->Add(ftimingEle2);
793 fOutputList->Add(fShowerShape_ha);
794 fOutputList->Add(fShowerShape_ele);
796 fOutputList->Add(fShowerShapeM02_EoverP);
797 fOutputList->Add(fShowerShapeM20_EoverP);
803 fVtxZ_new1= new TH1F("fVtxZ_new1","fVtxZ_new1",1000, -50,50);
804 fVtxZ_new2= new TH1F("fVtxZ_new2","fVtxZ_new2",1000, -50,50);
805 fVtxZ_new3= new TH1F("fVtxZ_new3","fVtxZ_new3",1000, -50,50);
806 fVtxZ_new4= new TH1F("fVtxZ_new4","fVtxZ_new4",1000, -50,50);
811 //Step 1: Before Track cuts
815 fEoverP_pt = new TH2F *[3];
816 fTPC_p = new TH2F *[3];
817 fTPCnsigma_p = new TH2F *[3];
819 fECluster= new TH1F *[3];
820 fEtaPhi= new TH2F *[3];
821 fVtxZ= new TH1F *[3];
822 fEtad= new TH1F *[3];
823 fNTracks= new TH1F *[3];
825 fNTracks_pt= new TH2F *[3];
826 fNTracks_eta= new TH2F *[3];
827 fNTracks_phi= new TH2F *[3];
829 fNClusters= new TH1F *[3];
830 fTPCNcls_EoverP= new TH2F *[3];
831 fTPCNcls_pid=new TH2F *[4];
835 for(Int_t i = 0; i < 3; i++)
837 fEoverP_pt[i] = new TH2F(Form("fEoverP_pt%d",i),";p_{t} (GeV/c);E / p ",1000,0,30,500,0,2);
838 fTPC_p[i] = new TH2F(Form("fTPC_p%d",i),";pt (GeV/c);TPC dE/dx (a. u.)",1000,0.3,15,1000,-20,200);
839 fTPCnsigma_p[i] = new TH2F(Form("fTPCnsigma_p%d",i),";p (GeV/c);TPC Electron N#sigma",1000,0.3,15,1000,-15,10);
842 fECluster[i]= new TH1F(Form("fECluster%d",i), ";ECluster",2000, 0,100);
843 fEtaPhi[i]= new TH2F(Form("fEtaPhi%d",i),"#eta x #phi Clusters;#phi;#eta",200,0.,5,50,-1.,1.);
844 fVtxZ[i]= new TH1F(Form("fVtxZ%d",i),"VtxZ",1000, -50,50);
845 fEtad[i]= new TH1F(Form("fEtad%d",i),"Eta distribution",200, -1.2,1.2);
846 fNTracks[i]= new TH1F(Form("fNTracks%d",i),"NTracks",1000, 0,5000);
848 fNTracks_pt[i]= new TH2F(Form("fNTracks_pt%d",i),"NTracks vs. pt",1000, 0,5000, 1000, 0, 100);
849 fNTracks_eta[i]= new TH2F(Form("fNTracks_eta%d",i),"NTracks vs. pt",1000, 0,5000, 500, -1.0, 1.0);
850 fNTracks_phi[i]= new TH2F(Form("fNTracks_phi%d",i),"NTracks vs. pt",1000, 0,5000, 500, 0, 5.0);
854 fNClusters[i]= new TH1F(Form("fNClusters%d",i),"fNClusters0",200, 0,100);
855 fTPCNcls_EoverP[i]= new TH2F(Form("fTPCNcls_EoverP%d",i),"TPCNcls_EoverP",1000,0,200,200,0,2);
859 fOutputList->Add(fEoverP_pt[i]);
860 fOutputList->Add(fTPC_p[i]);
861 fOutputList->Add(fTPCnsigma_p[i]);
864 fOutputList->Add(fECluster[i]);
865 fOutputList->Add(fEtaPhi[i]);
866 fOutputList->Add(fVtxZ[i]);
867 fOutputList->Add(fEtad[i]);
868 fOutputList->Add(fNTracks[i]);
870 fOutputList->Add(fNTracks_pt[i]);
871 fOutputList->Add(fNTracks_eta[i]);
872 fOutputList->Add(fNTracks_phi[i]);
874 fOutputList->Add(fNClusters[i]);
875 fOutputList->Add(fTPCNcls_EoverP[i]);
878 for(Int_t i = 0; i < 4; i++)
880 fTPCNcls_pid[i]= new TH2F(Form("fTPCNcls_pid%d",i),"fTPCNcls_pid;NCls;NCls for PID",200,0,200,200,0,200);
881 fOutputList->Add(fTPCNcls_pid[i]);
885 Int_t fPtBin[7] = {1,2,4,6,8,10,15};
887 fEoverP_tpc = new TH2F *[6];
888 fTPC_pt = new TH1F *[6];
889 fTPCnsigma_pt = new TH1F *[6];
894 fR_EoverP=new TH2F *[6];
895 fNcells=new TH1F *[6];
896 fNcells_EoverP=new TH2F *[6];
897 fM02_EoverP= new TH2F *[6];
898 fM20_EoverP= new TH2F *[6];
899 fEoverP_ptbins=new TH1F *[6];
900 fECluster_ptbins=new TH1F *[6];
901 fEoverP_wSSCut=new TH1F *[6];
902 fNcells_electrons=new TH1F *[6];
903 fNcells_hadrons=new TH1F *[6];
904 fTPCnsigma_eta_electrons=new TH2F *[6];
905 fTPCnsigma_eta_hadrons=new TH2F *[6];
909 fCEtaPhi_Inc = new TH2F *[6];
910 fCEtaPhi_Inc_DiHadron = new TH2F *[6];
912 fCEtaPhi_ULS = new TH2F *[6];
913 fCEtaPhi_LS = new TH2F *[6];
914 fCEtaPhi_ULS_NoP = new TH2F *[6];
915 fCEtaPhi_LS_NoP = new TH2F *[6];
917 fCEtaPhi_ULS_Weight = new TH2F *[6];
918 fCEtaPhi_LS_Weight = new TH2F *[6];
919 fCEtaPhi_ULS_NoP_Weight = new TH2F *[6];
920 fCEtaPhi_LS_NoP_Weight = new TH2F *[6];
922 fCEtaPhi_Inc_EM = new TH2F *[6];
924 fCEtaPhi_ULS_EM = new TH2F *[6];
925 fCEtaPhi_LS_EM = new TH2F *[6];
927 fCEtaPhi_ULS_Weight_EM = new TH2F *[6];
928 fCEtaPhi_LS_Weight_EM = new TH2F *[6];
930 fInvMass = new TH1F("fInvMass","",200,0,0.3);
931 fInvMassBack = new TH1F("fInvMassBack","",200,0,0.3);
932 fDCA = new TH1F("fDCA","",200,0,1);
933 fDCABack = new TH1F("fDCABack","",200,0,1);
934 fOpAngle = new TH1F("fOpAngle","",200,0,0.5);
935 fOpAngleBack = new TH1F("fOpAngleBack","",200,0,0.5);
937 fOutputList->Add(fInvMass);
938 fOutputList->Add(fInvMassBack);
939 fOutputList->Add(fDCA);
940 fOutputList->Add(fDCABack);
941 fOutputList->Add(fOpAngle);
942 fOutputList->Add(fOpAngleBack);
947 fInvMass = new TH1F("fInvMass","",200,0,0.3);
948 fInvMassBack = new TH1F("fInvMassBack","",200,0,0.3);
949 fDCA = new TH1F("fDCA","",200,0,1);
950 fDCABack = new TH1F("fDCABack","",200,0,1);
951 fOpAngle = new TH1F("fOpAngle","",200,0,0.5);
952 fOpAngleBack = new TH1F("fOpAngleBack","",200,0,0.5);
954 fOutputList->Add(fInvMass);
955 fOutputList->Add(fInvMassBack);
956 fOutputList->Add(fDCA);
957 fOutputList->Add(fDCABack);
958 fOutputList->Add(fOpAngle);
959 fOutputList->Add(fOpAngleBack);
961 //histos for TPC-only
962 fInvMass2 = new TH1F("fInvMass2","",200,0,0.3);
963 fInvMassBack2 = new TH1F("fInvMassBack2","",200,0,0.3);
964 fDCA2 = new TH1F("fDCA2","",200,0,1);
965 fDCABack2 = new TH1F("fDCABack2","",200,0,1);
966 fOpAngle2 = new TH1F("fOpAngle2","",200,0,0.5);
967 fOpAngleBack2 = new TH1F("fOpAngleBack2","",200,0,0.5);
969 fOutputList->Add(fInvMass2);
970 fOutputList->Add(fInvMassBack2);
971 fOutputList->Add(fDCA2);
972 fOutputList->Add(fDCABack2);
973 fOutputList->Add(fOpAngle2);
974 fOutputList->Add(fOpAngleBack2);
978 for(Int_t i = 0; i < 6; i++)
980 fEoverP_tpc[i] = new TH2F(Form("fEoverP_tpc%d",i),Form("%d < p_{t} < %d GeV/c;TPC Electron N#sigma;E / p ",fPtBin[i],fPtBin[i+1]),1000,-15,15,100,0,2);
981 fTPC_pt[i] = new TH1F(Form("fTPC_pt%d",i),Form("%d < p_{t} < %d GeV/c;TPC Electron N#sigma;Count",fPtBin[i],fPtBin[i+1]),200,20,200);
982 fTPCnsigma_pt[i] = new TH1F(Form("fTPCnsigma_pt%d",i),Form("%d < p_{t} < %d GeV/c;TPC Electron N#sigma;Count",fPtBin[i],fPtBin[i+1]),200,-15,10);
984 fEta[i]=new TH1F(Form("fEta%d",i), Form("%d < p_{t} < %d GeV/c;#eta; counts",fPtBin[i],fPtBin[i+1]),100, -0.1,0.1);
985 fPhi[i]=new TH1F(Form("fPhi%d",i),Form("%d < p_{t} < %d GeV/c;#phi; counts )",fPtBin[i],fPtBin[i+1]), 100, -0.1,0.1);
986 fR[i]=new TH1F(Form("fR%d",i),Form("%d < p_{t} < %d GeV/c;R;counts )",fPtBin[i],fPtBin[i+1]), 100, -0.1,0.1);
987 fR_EoverP[i]=new TH2F(Form("fR_EoverP%d",i),Form("%d < p_{t} < %d GeV/c;R;E / p ",fPtBin[i],fPtBin[i+1]),100, 0,0.1,1000,0,10);
988 fNcells[i]=new TH1F(Form("fNcells%d",i), Form("%d < p_{t} < %d GeV/c;ncells;counts ",fPtBin[i],fPtBin[i+1]),100, 0, 30);
989 fNcells_electrons[i]=new TH1F(Form("fNcells_electrons%d",i), Form("%d < p_{t} < %d GeV/c;ncells;counts ",fPtBin[i],fPtBin[i+1]),100, 0, 30);
990 fNcells_hadrons[i]=new TH1F(Form("fNcells_hadrons%d",i), Form("%d < p_{t} < %d GeV/c;ncells;counts ",fPtBin[i],fPtBin[i+1]),100, 0, 30);
991 fNcells_EoverP[i]=new TH2F(Form("fNcells_EoverP%d",i),Form("%d < p_{t} < %d GeV/c; Ncells; E / p ",fPtBin[i],fPtBin[i+1]),1000, 0,20,100,0,30);
992 fM02_EoverP[i]= new TH2F(Form("fM02_EoverP%d",i),Form("%d < p_{t} < %d GeV/c; M02; E / p ",fPtBin[i],fPtBin[i+1]),1000,0,100,100,0,2);
993 fM20_EoverP[i]= new TH2F(Form("fM20_EoverP%d",i),Form("%d < p_{t} < %d GeV/c; M20; E / p ",fPtBin[i],fPtBin[i+1]),1000,0,100,100,0,2);
994 fEoverP_ptbins[i] = new TH1F(Form("fEoverP_ptbins%d",i),Form("%d < p_{t} < %d GeV/c;E / p ",fPtBin[i],fPtBin[i+1]),500,0,2);
995 fECluster_ptbins[i]= new TH1F(Form("fECluster_ptbins%d",i), Form("%d < p_{t} < %d GeV/c;ECluster; Counts ",fPtBin[i],fPtBin[i+1]),2000, 0,100);
996 fEoverP_wSSCut[i]=new TH1F(Form("fEoverP_wSSCut%d",i),Form("%d < p_{t} < %d GeV/c;E / p ; Counts",fPtBin[i],fPtBin[i+1]),500,0,2);
997 fTPCnsigma_eta_electrons[i]=new TH2F(Form("fTPCnsigma_eta_electrons%d",i),Form("%d < p_{t} < %d GeV/c;TPC Electron N#sigma;Eta ",fPtBin[i],fPtBin[i+1]),1000,-15,15,100,-1,1);
998 fTPCnsigma_eta_hadrons[i]=new TH2F(Form("fTPCnsigma_eta_hadrons%d",i),Form("%d < p_{t} < %d GeV/c;TPC Electron N#sigma;Eta ",fPtBin[i],fPtBin[i+1]),1000,-15,15,100,-1,1);
1000 fOutputList->Add(fEoverP_tpc[i]);
1001 fOutputList->Add(fTPC_pt[i]);
1002 fOutputList->Add(fTPCnsigma_pt[i]);
1004 fOutputList->Add(fEta[i]);
1005 fOutputList->Add(fPhi[i]);
1006 fOutputList->Add(fR[i]);
1007 fOutputList->Add(fR_EoverP[i]);
1008 fOutputList->Add(fNcells[i]);
1009 fOutputList->Add(fNcells_electrons[i]);
1010 fOutputList->Add(fNcells_hadrons[i]);
1011 fOutputList->Add(fNcells_EoverP[i]);
1012 fOutputList->Add(fECluster_ptbins[i]);
1013 fOutputList->Add(fEoverP_ptbins[i]);
1014 fOutputList->Add(fEoverP_wSSCut[i]);
1015 fOutputList->Add(fM02_EoverP[i]);
1016 fOutputList->Add(fM20_EoverP[i]);
1017 fOutputList->Add(fTPCnsigma_eta_electrons[i]);
1018 fOutputList->Add(fTPCnsigma_eta_hadrons[i]);
1021 if(fCorrelationFlag)
1023 fCEtaPhi_Inc[i] = new TH2F(Form("fCEtaPhi_Inc%d",i),Form("%d < p_{t} < %d GeV/c;#DeltaPhi (rad);#Delta#eta",fPtBin[i],fPtBin[i+1]),200,-0.5*TMath::Pi(),1.5*TMath::Pi(),200,-2,2);
1024 fCEtaPhi_Inc_DiHadron[i] = new TH2F(Form("fCEtaPhi_Inc_DiHadron%d",i),Form("%d < p_{t} < %d GeV/c;#DeltaPhi (rad);#Delta#eta",fPtBin[i],fPtBin[i+1]),200,-0.5*TMath::Pi(),1.5*TMath::Pi(),200,-2,2);
1026 fCEtaPhi_ULS[i] = new TH2F(Form("fCEtaPhi_ULS%d",i),Form("%d < p_{t} < %d GeV/c;#DeltaPhi (rad);#Delta#eta",fPtBin[i],fPtBin[i+1]),200,-0.5*TMath::Pi(),1.5*TMath::Pi(),200,-2,2);
1027 fCEtaPhi_LS[i] = new TH2F(Form("fCEtaPhi_LS%d",i),Form("%d < p_{t} < %d GeV/c;#DeltaPhi (rad);#Delta#eta",fPtBin[i],fPtBin[i+1]),200,-0.5*TMath::Pi(),1.5*TMath::Pi(),200,-2,2);
1028 fCEtaPhi_ULS_NoP[i] = new TH2F(Form("fCEtaPhi_ULS_NoP%d",i),Form("%d < p_{t} < %d GeV/c;#DeltaPhi (rad);#Delta#eta",fPtBin[i],fPtBin[i+1]),200,-0.5*TMath::Pi(),1.5*TMath::Pi(),200,-2,2);
1029 fCEtaPhi_LS_NoP[i] = new TH2F(Form("fCEtaPhi_LS_NoP%d",i),Form("%d < p_{t} < %d GeV/c;#DeltaPhi (rad);#Delta#eta",fPtBin[i],fPtBin[i+1]),200,-0.5*TMath::Pi(),1.5*TMath::Pi(),200,-2,2);
1031 fCEtaPhi_ULS_Weight[i] = new TH2F(Form("fCEtaPhi_ULS_Weight%d",i),Form("%d < p_{t} < %d GeV/c;#DeltaPhi (rad);#Delta#eta",fPtBin[i],fPtBin[i+1]),200,-0.5*TMath::Pi(),1.5*TMath::Pi(),200,-2,2);
1032 fCEtaPhi_LS_Weight[i] = new TH2F(Form("fCEtaPhi_LS_Weight%d",i),Form("%d < p_{t} < %d GeV/c;#DeltaPhi (rad);#Delta#eta",fPtBin[i],fPtBin[i+1]),200,-0.5*TMath::Pi(),1.5*TMath::Pi(),200,-2,2);
1033 fCEtaPhi_ULS_NoP_Weight[i] = new TH2F(Form("fCEtaPhi_ULS_NoP_Weight%d",i),Form("%d < p_{t} < %d GeV/c;#DeltaPhi (rad);#Delta#eta",fPtBin[i],fPtBin[i+1]),200,-0.5*TMath::Pi(),1.5*TMath::Pi(),200,-2,2);
1034 fCEtaPhi_LS_NoP_Weight[i] = new TH2F(Form("fCEtaPhi_LS_NoP_Weight%d",i),Form("%d < p_{t} < %d GeV/c;#DeltaPhi (rad);#Delta#eta",fPtBin[i],fPtBin[i+1]),200,-0.5*TMath::Pi(),1.5*TMath::Pi(),200,-2,2);
1036 fOutputList->Add(fCEtaPhi_Inc[i]);
1037 fOutputList->Add(fCEtaPhi_Inc_DiHadron[i]);
1039 fOutputList->Add(fCEtaPhi_ULS[i]);
1040 fOutputList->Add(fCEtaPhi_LS[i]);
1041 fOutputList->Add(fCEtaPhi_ULS_NoP[i]);
1042 fOutputList->Add(fCEtaPhi_LS_NoP[i]);
1044 fOutputList->Add(fCEtaPhi_ULS_Weight[i]);
1045 fOutputList->Add(fCEtaPhi_LS_Weight[i]);
1046 fOutputList->Add(fCEtaPhi_ULS_NoP_Weight[i]);
1047 fOutputList->Add(fCEtaPhi_LS_NoP_Weight[i]);
1049 if(fEventMixingFlag)
1051 fCEtaPhi_Inc_EM[i] = new TH2F(Form("fCEtaPhi_Inc_EM%d",i),Form("%d < p_{t} < %d GeV/c;#DeltaPhi (rad);#Delta#eta",fPtBin[i],fPtBin[i+1]),200,-0.5*TMath::Pi(),1.5*TMath::Pi(),200,-2,2);
1053 fCEtaPhi_ULS_EM[i] = new TH2F(Form("fCEtaPhi_ULS_EM%d",i),Form("%d < p_{t} < %d GeV/c;#DeltaPhi (rad);#Delta#eta",fPtBin[i],fPtBin[i+1]),200,-0.5*TMath::Pi(),1.5*TMath::Pi(),200,-2,2);
1054 fCEtaPhi_LS_EM[i] = new TH2F(Form("fCEtaPhi_LS_EM%d",i),Form("%d < p_{t} < %d GeV/c;#DeltaPhi (rad);#Delta#eta",fPtBin[i],fPtBin[i+1]),200,-0.5*TMath::Pi(),1.5*TMath::Pi(),200,-2,2);
1056 fCEtaPhi_ULS_Weight_EM[i] = new TH2F(Form("fCEtaPhi_ULS_Weight_EM%d",i),Form("%d < p_{t} < %d GeV/c;#DeltaPhi (rad);#Delta#eta",fPtBin[i],fPtBin[i+1]),200,-0.5*TMath::Pi(),1.5*TMath::Pi(),200,-2,2);
1057 fCEtaPhi_LS_Weight_EM[i] = new TH2F(Form("fCEtaPhi_LS_Weight_EM%d",i),Form("%d < p_{t} < %d GeV/c;#DeltaPhi (rad);#Delta#eta",fPtBin[i],fPtBin[i+1]),200,-0.5*TMath::Pi(),1.5*TMath::Pi(),200,-2,2);
1059 fOutputList->Add(fCEtaPhi_Inc_EM[i]);
1061 fOutputList->Add(fCEtaPhi_ULS_EM[i]);
1062 fOutputList->Add(fCEtaPhi_LS_EM[i]);
1064 fOutputList->Add(fCEtaPhi_ULS_Weight_EM[i]);
1065 fOutputList->Add(fCEtaPhi_LS_Weight_EM[i]);
1071 fTPCnsigma_eta = new TH2F("fTPCnsigma_eta",";Pseudorapidity #eta; TPC signal - <TPC signal>_{elec} (#sigma)",200,-0.9,0.9,200,-15,15);
1072 fTPCnsigma_phi = new TH2F("fTPCnsigma_phi",";Azimuthal Angle #phi; TPC signal - <TPC signal>_{elec} (#sigma)",200,0,2*TMath::Pi(),200,-15,15);
1076 fNcells_pt=new TH2F("fNcells_pt","fNcells_pt",1000, 0,20,100,0,30);
1077 fEoverP_pt_pions= new TH2F("fEoverP_pt_pions","fEoverP_pt_pions",1000,0,30,500,0,2);
1079 ftpc_p_EoverPcut= new TH2F("ftpc_p_EoverPcut","ftpc_p_EoverPcut",1000,0,30,200,20,200);
1080 fnsigma_p_EoverPcut= new TH2F("fnsigma_p_EoverPcut","fnsigma_p_EoverPcut",1000,0,30,500,-15,15);
1082 fEoverP_pt_pions2= new TH2F("fEoverP_pt_pions2","fEoverP_pt_pions2",1000,0,30,500,0,2);
1083 fEoverP_pt_hadrons= new TH2F("fEoverP_pt_hadrons","fEoverP_pt_hadrons",1000,0,30,500,0,2);
1086 fOutputList->Add(fTPCnsigma_eta);
1087 fOutputList->Add(fTPCnsigma_phi);
1089 fOutputList->Add(fNcells_pt);
1090 fOutputList->Add(fEoverP_pt_pions);
1092 fOutputList->Add(ftpc_p_EoverPcut);
1093 fOutputList->Add(fnsigma_p_EoverPcut);
1095 fOutputList->Add(fEoverP_pt_pions2);
1096 fOutputList->Add(fEoverP_pt_hadrons);
1098 fOutputList->Add(fVtxZ_new1);
1099 fOutputList->Add(fVtxZ_new2);
1100 fOutputList->Add(fVtxZ_new3);
1101 fOutputList->Add(fVtxZ_new4);
1106 //__________________________________________________________________
1107 //Efficiency studies
1110 fPtBackgroundBeforeReco = new TH1F("fPtBackgroundBeforeReco",";p_{T} (GeV/c);Count",300,0,30);
1111 fPtBackgroundBeforeReco_weight = new TH1F("fPtBackgroundBeforeReco_weight",";p_{T} (GeV/c);Count",300,0,30);
1112 if(fFillBackground)fPtBackgroundBeforeReco2 = new TH1F("fPtBackgroundBeforeReco2",";p_{T} (GeV/c);Count",300,0,30);
1113 if(fFillBackground)fPtBackgroundBeforeReco2_weight = new TH1F("fPtBackgroundBeforeReco2_weight",";p_{T} (GeV/c);Count",300,0,30);
1114 fpT_m_electron= new TH2F("fpT_m_electron","fpT_m_electron",300,0,30,300,0,30);
1115 fpT_gm_electron= new TH2F("fpT_gm_electron","fpT_gm_electron",300,0,30,300,0,30);
1117 fPtBackgroundAfterReco = new TH1F("fPtBackgroundAfterReco",";p_{T} (GeV/c);Count",300,0,30);
1118 fPtMCparticleAll = new TH1F("fPtMCparticleAll",";p_{T} (GeV/c);Count",200,0,40);
1119 fPtMCparticleReco = new TH1F("fPtMCparticleReco",";p_{T} (GeV/c);Count",200,0,40);
1121 fPtMCparticleAll_nonPrimary = new TH1F("fPtMCparticleAll_nonPrimary",";p_{T} (GeV/c);Count",200,0,40);
1122 fPtMCparticleAlle_nonPrimary = new TH1F("fPtMCparticleAlle_nonPrimary",";p_{T} (GeV/c);Count",200,0,40);
1123 fPtMCparticleAlle_Primary = new TH1F("fPtMCparticleAlle_Primary",";p_{T} (GeV/c);Count",200,0,40);
1125 fPtMCparticleReco_nonPrimary = new TH1F("fPtMCparticleReco_nonPrimary",";p_{T} (GeV/c);Count",200,0,40);
1127 fPtMCparticleAllHfe1 = new TH1F("fPtMCparticleAllHfe1",";p_{t} (GeV/c);Count",200,0,40);
1128 fPtMCparticleRecoHfe1 = new TH1F("fPtMCparticleRecoHfe1",";p_{t} (GeV/c);Count",200,0,40);
1129 fPtMCparticleAllHfe2 = new TH1F("fPtMCparticleAllHfe2",";p_{t} (GeV/c);Count",200,0,40);
1130 fPtMCparticleRecoHfe2 = new TH1F("fPtMCparticleRecoHfe2",";p_{t} (GeV/c);Count",200,0,40);
1132 fPtMCelectronAfterAll = new TH1F("fPtMCelectronAfterAll",";p_{T} (GeV/c);Count",200,0,40);
1133 fPtMCelectronAfterAll_unfolding = new TH1F("fPtMCelectronAfterAll_unfolding",";p_{T} (GeV/c);Count",200,0,40);
1134 fPtMCelectronAfterAll_nonPrimary = new TH1F("fPtMCelectronAfterAll_nonPrimary",";p_{T} (GeV/c);Count",200,0,40);
1135 fPtMCelectronAfterAll_Primary = new TH1F("fPtMCelectronAfterAll_Primary",";p_{T} (GeV/c);Count",200,0,40);
1139 fPtMCpi0 = new TH1F("fPtMCpi0",";p_{t} (GeV/c);Count",200,0,30);
1140 fPtMCeta = new TH1F("fPtMCeta",";p_{T} (GeV/c);Count",200,0,30);
1141 fPtMCpi02 = new TH1F("fPtMCpi02",";p_{t} (GeV/c);Count",200,0,30);
1142 fPtMCeta2 = new TH1F("fPtMCeta2",";p_{T} (GeV/c);Count",200,0,30);
1143 fPtMC_EMCal_All= new TH1F("fPtMC_EMCal_All",";p_{t} (GeV/c);Count",200,0,40);
1144 fPtMC_EMCal_Selected= new TH1F("fPtMC_EMCal_Selected",";p_{t} (GeV/c);Count",200,0,40);
1145 fPtMC_TPC_All= new TH1F("fPtMC_TPC_All",";p_{T} (GeV/c);Count",200,0,40);
1146 fPtMC_TPC_Selected = new TH1F("fPtMC_TPC_Selected",";p_{T} (GeV/c);Count",200,0,40);
1148 fPt_track_match_den = new TH1F("fPt_track_match_den",";p_{T} (GeV/c);Count",200,0,40);
1149 fPt_track_match_num = new TH1F("fPt_track_match_num",";p_{T} (GeV/c);Count",200,0,40);
1151 fPtMCWithLabel = new TH1F("fPtMCWithLabel",";p_{t} (GeV/c);Count",200,0,40);
1152 fPtMCWithoutLabel = new TH1F("fPtMCWithoutLabel",";p_{t} (GeV/c);Count",200,0,40);
1153 fPtIsPhysicaPrimary = new TH1F("fPtIsPhysicaPrimary",";p_{t} (GeV/c);Count",200,0,40);
1155 fOutputList->Add(fPtBackgroundBeforeReco);
1156 fOutputList->Add(fPtBackgroundBeforeReco_weight);
1158 if(fFillBackground) fOutputList->Add(fPtBackgroundBeforeReco2);
1159 if(fFillBackground) fOutputList->Add(fPtBackgroundBeforeReco2_weight);
1161 fOutputList->Add(fpT_m_electron);
1162 fOutputList->Add(fpT_gm_electron);
1164 fOutputList->Add(fPtBackgroundAfterReco);
1165 fOutputList->Add(fPtMCparticleAll);
1166 fOutputList->Add(fPtMCparticleReco);
1168 fOutputList->Add(fPtMCparticleAll_nonPrimary);
1169 fOutputList->Add(fPtMCparticleAlle_nonPrimary);
1171 fOutputList->Add(fPtMCparticleAlle_Primary);
1172 fOutputList->Add(fPtMCparticleReco_nonPrimary);
1174 fOutputList->Add(fPtMCparticleAllHfe1);
1175 fOutputList->Add(fPtMCparticleRecoHfe1);
1176 fOutputList->Add(fPtMCparticleAllHfe2);
1177 fOutputList->Add(fPtMCparticleRecoHfe2);
1178 fOutputList->Add(fPtMCelectronAfterAll);
1179 fOutputList->Add(fPtMCelectronAfterAll_unfolding);
1181 fOutputList->Add(fPtMCelectronAfterAll_nonPrimary);
1182 fOutputList->Add(fPtMCelectronAfterAll_Primary);
1186 fOutputList->Add(fPtMCpi0);
1187 fOutputList->Add(fPtMCeta);
1188 fOutputList->Add(fPtMCpi02);
1189 fOutputList->Add(fPtMCeta2);
1190 fOutputList->Add(fPtMC_EMCal_All);
1191 fOutputList->Add(fPtMC_EMCal_Selected);
1192 fOutputList->Add(fPtMC_TPC_All);
1193 fOutputList->Add(fPtMC_TPC_Selected);
1195 fOutputList->Add(fPt_track_match_den);
1196 fOutputList->Add(fPt_track_match_num);
1198 fOutputList->Add(fPtMCWithLabel);
1199 fOutputList->Add(fPtMCWithoutLabel);
1200 fOutputList->Add(fPtIsPhysicaPrimary);
1203 fCentralityHist = new TH1F("fCentralityHist",";Centrality (%); Count",1000000,0,100);
1204 fCentralityHistPass = new TH1F("fCentralityHistPass",";Centrality (%); Count",1000000,0,100);
1205 fOutputList->Add(fCentralityHist);
1206 fOutputList->Add(fCentralityHistPass);
1208 //______________________________________________________________________
1209 //Mixed event analysis
1210 if(fEventMixingFlag)
1212 fPoolNevents = new TH1F("fPoolNevents","Event Mixing Statistics; Number of events; Count",1000,0,1000);
1213 fOutputList->Add(fPoolNevents);
1215 Int_t trackDepth = 2000; // number of objects (tracks) kept per event buffer bin. Once the number of stored objects (tracks) is above that limit, the oldest ones are removed.
1216 Int_t poolsize = 1000; // Maximum number of events, ignored in the present implemented of AliEventPoolManager
1218 Int_t nCentralityBins = 15;
1219 Double_t centralityBins[] = { 0, 1, 2, 3, 4, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100.1 };
1221 Int_t nZvtxBins = 9;
1222 Double_t vertexBins[] = {-10, -7, -5, -3, -1, 1, 3, 5, 7, 10};
1224 fPoolMgr = new AliEventPoolManager(poolsize, trackDepth, nCentralityBins, (Double_t*) centralityBins, nZvtxBins, (Double_t*) vertexBins);
1226 //______________________________________________________________________
1228 PostData(1, fOutputList);
1230 ///______________________________________________________________________
1233 //______________________________________________________________________
1235 //Called for each event
1236 void AliAnalysisTaskEMCalHFEpA::UserExec(Option_t *)
1239 fESD = dynamic_cast<AliESDEvent*>(InputEvent());
1240 fAOD = dynamic_cast<AliAODEvent*>(InputEvent());
1244 printf("ERROR: fESD & fAOD not available\n");
1248 fVevent = dynamic_cast<AliVEvent*>(InputEvent());
1252 printf("ERROR: fVEvent not available\n");
1259 AliError("HFE cuts not available");
1263 if(!fPID->IsInitialized())
1265 // Initialize PID with the given run number
1266 AliWarning("PID not initialised, get from Run no");
1270 fPID->InitializePID(fAOD->GetRunNumber());
1274 fPID->InitializePID(fESD->GetRunNumber());
1279 fPidResponse = fInputHandler->GetPIDResponse();
1282 //Check PID response
1285 AliDebug(1, "Using default PID Response");
1286 fPidResponse = AliHFEtools::GetDefaultPID(kFALSE, fInputEvent->IsA() == AliAODEvent::Class());
1289 fPID->SetPIDResponse(fPidResponse);
1291 fCFM->SetRecEventInfo(fVevent);
1293 Double_t *fListOfmotherkink = 0;
1294 Int_t fNumberOfVertices = 0;
1295 Int_t fNumberOfMotherkink = 0;
1297 //______________________________________________________________________
1302 const AliAODVertex* trkVtx = fAOD->GetPrimaryVertex();
1303 if(!trkVtx || trkVtx->GetNContributors()<=0) return;
1304 TString vtxTtl = trkVtx->GetTitle();
1305 if(!vtxTtl.Contains("VertexerTracks")) return;
1306 Float_t zvtx = trkVtx->GetZ();
1309 fVtxZ_new1->Fill(fZvtx);
1311 const AliAODVertex* spdVtx = fAOD->GetPrimaryVertexSPD();
1312 if(spdVtx->GetNContributors()<=0) return;
1313 TString vtxTyp = spdVtx->GetTitle();
1314 Double_t cov[6]={0};
1315 spdVtx->GetCovarianceMatrix(cov);
1316 Double_t zRes = TMath::Sqrt(cov[5]);
1317 if(vtxTyp.Contains("vertexer:Z") && (zRes>0.25)) return;
1318 if(TMath::Abs(spdVtx->GetZ() - trkVtx->GetZ())>0.5) return;
1319 if(TMath::Abs(zvtx) > 10) return;
1321 fVtxZ_new2->Fill(fZvtx);
1323 //Look for kink mother for AOD
1325 fNumberOfVertices = 0;
1326 fNumberOfMotherkink = 0;
1330 fNumberOfVertices = fAOD->GetNumberOfVertices();
1332 fListOfmotherkink = new Double_t[fNumberOfVertices];
1334 for(Int_t ivertex=0; ivertex < fNumberOfVertices; ivertex++)
1336 AliAODVertex *aodvertex = fAOD->GetVertex(ivertex);
1337 if(!aodvertex) continue;
1338 if(aodvertex->GetType()==AliAODVertex::kKink)
1340 AliAODTrack *mother1 = (AliAODTrack *) aodvertex->GetParent();
1341 if(!mother1) continue;
1342 Int_t idmother = mother1->GetID();
1343 fListOfmotherkink[fNumberOfMotherkink] = idmother;
1344 fNumberOfMotherkink++;
1355 const AliESDVertex* trkVtx = fESD->GetPrimaryVertex();
1356 if(!trkVtx || trkVtx->GetNContributors()<=0) return;
1357 TString vtxTtl = trkVtx->GetTitle();
1358 if(!vtxTtl.Contains("VertexerTracks")) return;
1359 Float_t zvtx = trkVtx->GetZ();
1361 const AliESDVertex* spdVtx = fESD->GetPrimaryVertexSPD();
1362 if(spdVtx->GetNContributors()<=0) return;
1363 TString vtxTyp = spdVtx->GetTitle();
1364 Double_t cov[6]={0};
1365 spdVtx->GetCovarianceMatrix(cov);
1366 Double_t zRes = TMath::Sqrt(cov[5]);
1367 if(vtxTyp.Contains("vertexer:Z") && (zRes>0.25)) return;
1368 if(TMath::Abs(spdVtx->GetZ() - trkVtx->GetZ())>0.5) return;
1369 if(TMath::Abs(zvtx) > 10) return;
1372 //______________________________________________________________________
1376 //Only events with at least 2 tracks are accepted
1377 Int_t fNOtrks = fVevent->GetNumberOfTracks();
1379 //if(fIsAOD) Int_t fNOtrks = fAOD->GetNumberOfTracks();
1380 //if(!fIsAOD) Int_t fNOtrks = fESD->GetNumberOfTracks();
1383 if(fNOtrks<2) return;
1386 //new track loop to select events
1392 double fTrackMulti=0;
1393 for(Int_t iTracks = 0; iTracks < fVevent->GetNumberOfTracks(); iTracks++)
1395 AliVParticle* Vtrack = fVevent->GetTrack(iTracks);
1398 printf("ERROR: Could not receive track %d\n", iTracks);
1402 AliVTrack *track = dynamic_cast<AliVTrack*>(Vtrack);
1403 //AliESDtrack *etrack = dynamic_cast<AliESDtrack*>(Vtrack);
1404 AliAODTrack *atrack = dynamic_cast<AliAODTrack*>(Vtrack);
1406 if((track->Pt())<0.2 || (track->Pt())>1000.0) continue;
1407 //if it is not a hybrid track, continue
1408 if(!atrack->TestFilterBit(768)) continue;
1409 else fTrackMulti=fTrackMulti+1;
1412 //Only take event if track multiplicity is bigger than 2.
1413 if(fTrackMulti<2) return;
1418 fVtxZ_new3->Fill(fZvtx);
1423 //trying to use same as Lucile
1425 //reader = new AliCaloTrackAODReader();
1426 reader->SwitchOnCTS();
1427 reader->SetCTSPtMin(0.2);
1428 reader->SetCTSPtMax(1000);
1429 reader->SwitchOffRecalculateVertexBC();
1430 reader->SwitchOffVertexBCEventSelection();
1431 reader->SwitchOffUseTrackTimeCut();
1432 reader->SwitchOffUseTrackDCACut();
1433 reader->SwitchOnAODHybridTrackSelection();
1434 reader->SwitchOnRejectNoTrackEvents();
1438 //______________________________________________________________________
1439 //Centrality Selection
1440 if(fHasCentralitySelection)
1442 Float_t centrality = -1;
1446 fCentrality = fAOD->GetHeader()->GetCentralityP();
1450 fCentrality = fESD->GetCentrality();
1453 if(fEstimator==1) centrality = fCentrality->GetCentralityPercentile("ZDC");
1454 else centrality = fCentrality->GetCentralityPercentile("V0A");
1456 //cout << "Centrality = " << centrality << " %" << endl;
1458 fCentralityHist->Fill(centrality);
1460 if(centrality<fCentralityMin || centrality>fCentralityMax) return;
1462 fCentralityHistPass->Fill(centrality);
1464 //______________________________________________________________________
1466 //______________________________________________________________________
1472 fMCarray = dynamic_cast<TClonesArray*>(fAOD->FindListObject(AliAODMCParticle::StdBranchName()));
1476 AliError("Array of MC particles not found");
1480 fMCheader = dynamic_cast<AliAODMCHeader*>(fAOD->GetList()->FindObject(AliAODMCHeader::StdBranchName()));
1484 AliError("Could not find MC Header in AOD");
1488 for(Int_t iMC = 0; iMC < fMCarray->GetEntries(); iMC++)
1490 fMCparticle = (AliAODMCParticle*) fMCarray->At(iMC);
1491 if(fMCparticle->GetMother()>0) fMCparticleMother = (AliAODMCParticle*) fMCarray->At(fMCparticle->GetMother());
1493 Int_t pdg = fMCparticle->GetPdgCode();
1496 double proX = fMCparticle->Xv();
1497 double proY = fMCparticle->Yv();
1498 double proR = sqrt(pow(proX,2)+pow(proY,2));
1501 if(fMCparticle->Eta()>=fEtaCutMin && fMCparticle->Eta()<=fEtaCutMax && fMCparticle->Charge()!=0)
1503 //to correct background
1504 if (TMath::Abs(pdg) == 11 && fMCparticle->GetMother()>0){
1505 Int_t mpdg = fMCparticleMother->GetPdgCode();
1507 if(TMath::Abs(mpdg) == 221 || TMath::Abs(mpdg) == 22 || TMath::Abs(mpdg) == 111){
1510 fPtMCparticleAlle_nonPrimary->Fill(fMCparticle->Pt()); //denominator for total efficiency for all electrons, and not primary
1516 if (TMath::Abs(pdg) == 11 && fMCparticle->IsPhysicalPrimary()) fPtMCparticleAlle_Primary->Fill(fMCparticle->Pt()); //denominator for total efficiency for all electrons primary
1518 if( TMath::Abs(pdg) == 211 || TMath::Abs(pdg) == 2212 || TMath::Abs(pdg) == 321 || TMath::Abs(pdg) == 11 || TMath::Abs(pdg) == 13 )
1521 fPtMCparticleAll_nonPrimary->Fill(fMCparticle->Pt()); //denominator for total efficiency for all particles, and not primary
1522 if(fMCparticle->IsPhysicalPrimary())
1524 fPtMCparticleAll->Fill(fMCparticle->Pt());
1526 Bool_t MotherFound = FindMother(iMC);
1527 //Bool_t MotherFound = FindMother(track->GetLabel());
1531 //denominator for total efficiency and tracking
1532 //unfolding: denominator is pt_MC and numerator is pt_reco
1533 fPtMCparticleAllHfe1->Fill(fMCparticle->Pt());
1534 fEtaPhi_den->Fill(fMCparticle->Phi(),fMCparticle->Eta());
1537 } //denominator for total efficiency and tracking
1538 if(fIsHFE2) fPtMCparticleAllHfe2->Fill(fMCparticle->Pt());
1544 //only primary pions
1545 if(fMCparticle->IsPhysicalPrimary()){
1546 if(TMath::Abs(pdg)==111) fPtMCpi0->Fill(fMCparticle->Pt());
1547 if(TMath::Abs(pdg)==221) fPtMCeta->Fill(fMCparticle->Pt());
1549 if(fMCparticle->Eta()>=fEtaCutMin && fMCparticle->Eta()<=fEtaCutMax)
1552 if(TMath::Abs(pdg)==111) fPtMCpi02->Fill(fMCparticle->Pt());
1553 if(TMath::Abs(pdg)==221) fPtMCeta2->Fill(fMCparticle->Pt());
1563 fEventHandler = dynamic_cast<AliMCEventHandler*> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler());
1564 if (!fEventHandler) {
1565 Printf("ERROR: Could not retrieve MC event handler");
1569 fMCevent = fEventHandler->MCEvent();
1571 Printf("ERROR: Could not retrieve MC event");
1575 fMCstack = fMCevent->Stack();
1577 for(Int_t iMC = 0; iMC < fMCstack->GetNtrack(); iMC++)
1580 fMCtrack = fMCstack->Particle(iMC);
1581 if(fMCtrack->GetFirstMother()>0) fMCtrackMother = fMCstack->Particle(fMCtrack->GetFirstMother());
1582 TParticle *particle=fMCstack->Particle(iMC);
1584 Int_t pdg = fMCtrack->GetPdgCode();
1587 if(TMath::Abs(pdg)==111) fPtMCpi0->Fill(fMCtrack->Pt());
1588 if(TMath::Abs(pdg)==221) fPtMCeta->Fill(fMCtrack->Pt());
1591 if(fMCtrack->Eta()>=fEtaCutMin && fMCtrack->Eta()<=fEtaCutMax)
1594 //to correct background
1595 if (TMath::Abs(pdg) == 11 && fMCtrack->GetFirstMother()>0){
1596 Int_t mpdg = fMCtrackMother->GetPdgCode();
1597 if(TMath::Abs(mpdg) == 221 || TMath::Abs(mpdg) == 22 || TMath::Abs(mpdg) == 111){
1598 Double_t proR=particle->R();
1600 fPtMCparticleAlle_nonPrimary->Fill(fMCtrack->Pt()); //denominator for total efficiency for all electrons, and not primary
1605 if(TMath::Abs(pdg) == 11 && fMCstack->IsPhysicalPrimary(iMC)){
1607 fPtMCparticleAlle_Primary->Fill(fMCtrack->Pt());
1610 if( TMath::Abs(pdg) == 211 || TMath::Abs(pdg) == 2212 || TMath::Abs(pdg) == 321 || TMath::Abs(pdg) == 11 || TMath::Abs(pdg) == 13 )
1612 fPtMCparticleAll_nonPrimary->Fill(fMCtrack->Pt());//denominator for total efficiency for all particle, non Primary track
1614 if(fMCstack->IsPhysicalPrimary(iMC))
1616 fPtMCparticleAll->Fill(fMCtrack->Pt());
1618 Bool_t MotherFound = FindMother(iMC);
1619 //Bool_t MotherFound = FindMother(track->GetLabel());
1623 fPtMCparticleAllHfe1->Fill(fMCtrack->Pt());//denominator for total efficiency and tracking
1624 fEtaPhi_den->Fill(fMCtrack->Phi(),fMCtrack->Eta());
1626 if(fIsHFE2) fPtMCparticleAllHfe2->Fill(fMCtrack->Pt());
1628 }//Is Physical primary
1635 //______________________________________________________________________
1636 //EMCal Trigger Selection (Threshold selection)
1637 TString firedTrigger;
1638 TString TriggerEG1("CEMC7EG1"); //takes trigger with name with EG1, ex: CEMC7EG1-B-NOPF-CENTNOTRD
1639 TString TriggerEG2("CEMC7EG2");
1641 TString TriggerEJE("EJE");
1643 if(fAOD) firedTrigger = fAOD->GetFiredTriggerClasses();
1644 else if(fESD) firedTrigger = fESD->GetFiredTriggerClasses();
1647 if(firedTrigger.Contains(TriggerEG1)) fNevent->Fill(1);
1648 if(firedTrigger.Contains(TriggerEG2)) fNevent->Fill(2);
1650 // Jan 06, 2014: I changed the counters: Only fill with 3 or 4 if we want the trigger threshold selected.
1652 if(firedTrigger.Contains(TriggerEG1))
1654 if(fEMCEG1) fNevent->Fill(3);
1662 if(firedTrigger.Contains(TriggerEG2))
1664 if(fEMCEG2) fNevent->Fill(4);
1671 //______________________________________________________________________
1672 //Testing if there is an overlap EGA and EJE
1674 if(!(firedTrigger.Contains(TriggerEG1) && firedTrigger.Contains(TriggerEG2) ) && !firedTrigger.Contains(TriggerEJE))
1679 if((firedTrigger.Contains(TriggerEG1) || firedTrigger.Contains(TriggerEG2)) && !firedTrigger.Contains(TriggerEJE))
1684 if(!(firedTrigger.Contains(TriggerEG1) && firedTrigger.Contains(TriggerEG2)) && firedTrigger.Contains(TriggerEJE))
1689 if((firedTrigger.Contains(TriggerEG1) || firedTrigger.Contains(TriggerEG2)) && firedTrigger.Contains(TriggerEJE))
1695 //New cluster information
1696 //after trigger threshold selection
1697 Int_t ClsNo2 = fVevent->GetNumberOfCaloClusters();
1700 fNevent->Fill(11); //events with no cluster
1703 for (Int_t i=0; i< ClsNo2; i++ ){
1705 fClus = fVevent->GetCaloCluster(i);
1706 if(fClus->IsEMCAL())
1708 //pure cluster information
1709 fECluster_pure->Fill(fClus->E());
1713 fNevent->Fill(12); //events with cluster
1716 fVtxZ_new4->Fill(fZvtx);
1718 //__________________________________________________________________
1721 if(!fIsAOD) ClsNo = fESD->GetNumberOfCaloClusters();
1722 else ClsNo = fAOD->GetNumberOfCaloClusters();
1724 //______________________________________________________________________
1726 ///_____________________________________________________________________
1728 for(Int_t iTracks = 0; iTracks < fVevent->GetNumberOfTracks(); iTracks++)
1730 AliVParticle* Vtrack = fVevent->GetTrack(iTracks);
1733 printf("ERROR: Could not receive track %d\n", iTracks);
1737 AliVTrack *track = dynamic_cast<AliVTrack*>(Vtrack);
1738 AliESDtrack *etrack = dynamic_cast<AliESDtrack*>(Vtrack);
1739 AliAODTrack *atrack = dynamic_cast<AliAODTrack*>(Vtrack);
1741 //aod test -- Francesco suggestion
1742 AliAODTrack *aod_track=fAOD->GetTrack(iTracks);
1744 Double_t fTPCnSigma = -999;
1745 Double_t fTOFnSigma = -999;
1746 Double_t fTPCnSigma_pion = -999;
1747 Double_t fTPCnSigma_proton = -999;
1748 Double_t fTPCnSigma_kaon = -999;
1749 Double_t fTPCsignal = -999;
1750 Double_t fPt = -999;
1754 //Etacut test on the begging
1755 fEtad[0]->Fill(track->Eta());
1756 //if(track->Eta()<fEtaCutMin || track->Eta()>fEtaCutMax) continue;
1757 fEtad[1]->Fill(track->Eta());
1762 ///_____________________________________________________________________________
1763 ///Fill QA plots without track selection
1765 fP = TMath::Sqrt((track->Pt())*(track->Pt()) + (track->Pz())*(track->Pz()));
1767 fTPCsignal = track->GetTPCsignal();
1768 fTPCnSigma = fPidResponse->NumberOfSigmasTPC(track, AliPID::kElectron);
1769 fTOFnSigma = fPidResponse->NumberOfSigmasTOF(track, AliPID::kElectron);
1770 fTPCnSigma_pion = fPidResponse->NumberOfSigmasTPC(track, AliPID::kPion);
1771 fTPCnSigma_proton = fPidResponse->NumberOfSigmasTPC(track, AliPID::kProton);
1772 fTPCnSigma_kaon = fPidResponse->NumberOfSigmasTPC(track, AliPID::kKaon);
1774 fTPC_p[0]->Fill(fPt,fTPCsignal);
1775 fTPCnsigma_p[0]->Fill(fP,fTPCnSigma);
1778 Float_t TPCNcls = track->GetTPCNcls();
1780 Float_t TPCNcls_pid = track->GetTPCsignalN();
1784 Float_t pos[3]={0,0,0};
1786 Double_t fEMCflag = kFALSE;
1787 if(track->GetEMCALcluster()>0)
1789 fClus = fVevent->GetCaloCluster(track->GetEMCALcluster());
1790 if(fClus->IsEMCAL())
1793 //only for charged tracks
1794 fECluster[0]->Fill(fClus->E());
1797 if(TMath::Abs(fClus->GetTrackDx())<=fdPhiCut && TMath::Abs(fClus->GetTrackDz())<=fdEtaCut)
1800 fEoverP_pt[0]->Fill(fPt,(fClus->E() / fP));
1803 Float_t Energy = fClus->E();
1804 Float_t EoverP = Energy/track->P();
1805 //Float_t M02 = fClus->GetM02();
1806 //Float_t M20 = fClus->GetM20();
1808 /////////////// for Eta Phi distribution
1809 fClus->GetPosition(pos);
1810 TVector3 vpos(pos[0],pos[1],pos[2]);
1811 Double_t cphi = vpos.Phi();
1812 Double_t ceta = vpos.Eta();
1813 fEtaPhi[0]->Fill(cphi,ceta);
1816 fTPCNcls_EoverP[0]->Fill(TPCNcls, EoverP);
1821 //______________________________________________________________
1824 fVtxZ[0]->Fill(fZvtx);
1825 if(iTracks == 0)fNTracks[0]->Fill(fNOtrks);
1826 fNTracks_pt[0]->Fill(fNOtrks, fPt);
1827 fNTracks_eta[0]->Fill(fNOtrks, track->Eta());
1828 fNTracks_phi[0]->Fill(fNOtrks, track->Phi());
1831 fNClusters[0]->Fill(ClsNo);
1832 fTPCNcls_pid[0]->Fill(TPCNcls, TPCNcls_pid);
1833 //______________________________________________________________
1835 ///Fill QA plots without track selection
1836 ///_____________________________________________________________________________
1837 //______________________________________________________________________________________
1838 //Track Selection Cuts
1840 //AOD (Test Filter Bit)
1843 // standard cuts with very loose DCA - BIT(4)
1846 GetStandardITSTPCTrackCuts2011(kFALSE)
1847 SetMaxChi2PerClusterTPC(4);
1848 SetAcceptKinkDaughters(kFALSE);
1849 SetRequireTPCRefit(kTRUE);
1850 SetRequireITSRefit(kTRUE);
1851 SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
1852 SetMaxDCAToVertexZ(2);
1853 SetMaxDCAToVertex2D(kFALSE);
1854 SetRequireSigmaToVertex(kFALSE);
1855 SetMaxChi2PerClusterITS(36);
1856 SetMaxDCAToVertexXY(2.4)
1857 SetMaxDCAToVertexZ(3.2)
1858 SetDCaToVertex2D(kTRUE)
1861 if(!atrack->TestFilterMask(AliAODTrack::kTrkGlobalNoDCA)) continue;
1864 //RecKine: ITSTPC cuts
1865 if(!ProcessCutStep(AliHFEcuts::kStepRecKineITSTPC, track)) continue;
1867 if(fRejectKinkMother)
1871 Bool_t kinkmotherpass = kTRUE;
1872 for(Int_t kinkmother = 0; kinkmother < fNumberOfMotherkink; kinkmother++)
1874 if(track->GetID() == fListOfmotherkink[kinkmother])
1876 kinkmotherpass = kFALSE;
1880 if(!kinkmotherpass) continue;
1884 if(etrack->GetKinkIndex(0) != 0) continue;
1891 if(!ProcessCutStep(AliHFEcuts::kStepRecPrim, track)) continue;
1894 //HFEcuts: ITS layers cuts
1895 if(!ProcessCutStep(AliHFEcuts::kStepHFEcutsITS, track)) continue;
1897 //HFE cuts: TPC PID cleanup
1898 if(!ProcessCutStep(AliHFEcuts::kStepHFEcutsTPC, track)) continue;
1899 //______________________________________________________________________________________
1902 //AOD test -- Fancesco suggestion
1903 Int_t type=aod_track->GetType();
1904 if(type==AliAODTrack::kPrimary) fPtPrim->Fill(aod_track->Pt());
1905 if(type==AliAODTrack::kSecondary) fPtSec->Fill(aod_track->Pt());
1907 //Int_t type2=track->GetType();
1908 if(type==AliAODTrack::kPrimary) fPtPrim2->Fill(track->Pt());
1909 if(type==AliAODTrack::kSecondary) fPtSec2->Fill(track->Pt());
1913 ///_____________________________________________________________
1914 ///QA plots after track selection
1917 if(track->GetLabel()>=0) fPtMCWithLabel->Fill(fPt);
1918 else fPtMCWithoutLabel->Fill(fPt);
1921 if(fIsMC && track->GetLabel()>=0)
1924 fMCparticle = (AliAODMCParticle*) fMCarray->At(track->GetLabel());
1927 if(fMCparticle->IsPhysicalPrimary()) fPtIsPhysicaPrimary->Fill(fPt);
1929 Int_t pdg = fMCparticle->GetPdgCode();
1930 if(fMCparticle->Eta()>=fEtaCutMin && fMCparticle->Eta()<=fEtaCutMax && fMCparticle->Charge()!=0)
1934 if( TMath::Abs(pdg) == 211 || TMath::Abs(pdg) == 2212 || TMath::Abs(pdg) == 321 || TMath::Abs(pdg) == 11 || TMath::Abs(pdg) == 13 )
1936 fPtMCparticleReco_nonPrimary->Fill(fMCparticle->Pt()); //not Primary track
1938 if(fMCparticle->IsPhysicalPrimary())
1940 fPtMCparticleReco->Fill(fMCparticle->Pt());
1942 Bool_t MotherFound = FindMother(track->GetLabel());
1946 fPtMCparticleRecoHfe1->Fill(fMCparticle->Pt());//numerator tracking
1948 fpt_reco_pt_MC_den->Fill(track->Pt(),fMCparticle->Pt());
1951 if(fIsHFE2) fPtMCparticleRecoHfe2->Fill(fMCparticle->Pt());
1965 if(fMCtrack->Eta()>=fEtaCutMin && fMCtrack->Eta()<=fEtaCutMax)
1968 fMCtrack = fMCstack->Particle(track->GetLabel());
1969 Int_t pdg = fMCtrack->GetPdgCode();
1971 if( TMath::Abs(pdg) == 211 || TMath::Abs(pdg) == 2212 || TMath::Abs(pdg) == 321 || TMath::Abs(pdg) == 11 || TMath::Abs(pdg) == 13 )
1973 fPtMCparticleReco_nonPrimary->Fill(fMCtrack->Pt());//not Primary track
1977 if(fMCstack->IsPhysicalPrimary(track->GetLabel()))
1979 fPtIsPhysicaPrimary->Fill(fPt);
1982 if( TMath::Abs(pdg) == 211 || TMath::Abs(pdg) == 2212 || TMath::Abs(pdg) == 321 || TMath::Abs(pdg) == 11 || TMath::Abs(pdg) == 13 )
1984 fPtMCparticleReco->Fill(fMCtrack->Pt());
1986 Bool_t MotherFound = FindMother(track->GetLabel());
1989 if(fIsHFE1) fPtMCparticleRecoHfe1->Fill(fMCtrack->Pt());//numerator tracking
1990 if(fIsHFE2) fPtMCparticleRecoHfe2->Fill(fMCtrack->Pt());
1998 fTPC_p[1]->Fill(fPt,fTPCsignal);
1999 fTPCnsigma_p[1]->Fill(fP,fTPCnSigma);
2000 Double_t fPtBin[7] = {1,2,4,6,8,10,15};
2002 TPCNcls = track->GetTPCNcls();
2003 Float_t pos2[3]={0,0,0};
2005 if(track->GetEMCALcluster()>0)
2007 fClus = fVevent->GetCaloCluster(track->GetEMCALcluster());
2008 if(fClus->IsEMCAL())
2010 if(TMath::Abs(fClus->GetTrackDx())<=fdPhiCut && TMath::Abs(fClus->GetTrackDz())<=fdEtaCut)
2012 fEoverP_pt[1]->Fill(fPt,(fClus->E() / fP));
2014 Float_t Energy = fClus->E();
2015 Float_t EoverP = Energy/track->P();
2016 Float_t M02 = fClus->GetM02();
2017 Float_t M20 = fClus->GetM20();
2018 Float_t ncells = fClus->GetNCells();
2020 /////////////// for Eta Phi distribution
2021 fClus->GetPosition(pos2);
2022 TVector3 vpos(pos2[0],pos2[1],pos2[2]);
2023 Double_t cphi = vpos.Phi();
2024 Double_t ceta = vpos.Eta();
2025 fEtaPhi[1]->Fill(cphi,ceta);
2027 fECluster[1]->Fill(Energy);
2028 fTPCNcls_EoverP[1]->Fill(TPCNcls, EoverP);
2031 //for EMCal trigger performance
2033 ftpc_p_EoverPcut->Fill(track->P(), fTPCsignal);
2034 fnsigma_p_EoverPcut->Fill(track->P(), fTPCnSigma);
2039 //for hadron contamination calculations
2043 if(track->Eta()>=fEtaCutMin && track->Eta()<=fEtaCutMax ){
2045 if(TMath::Abs(fTPCnSigma_pion)<3 || TMath::Abs(fTPCnSigma_proton)<3 || TMath::Abs(fTPCnSigma_kaon)<3 ){
2047 if(fTPCnSigma<-3.5){
2048 fEoverP_pt_hadrons->Fill(fPt,EoverP);
2049 if(fUseEMCal) fShowerShape_ha->Fill(M02,M20);
2052 //for systematic studies of hadron contamination
2053 if(fTPCnSigma < -4){
2054 fEoverP_pt_pions->Fill(fPt, EoverP);
2058 if(fTPCnSigma < -5){
2059 fEoverP_pt_pions2->Fill(fPt, EoverP);
2069 for(Int_t i = 0; i < 6; i++)
2071 if(fPt>=fPtBin[i] && fPt<fPtBin[i+1])
2074 if(fTPCnSigma < -5 && fTPCnSigma > -10){
2075 fNcells_hadrons[i]->Fill(ncells);
2077 //hadrons selection using E/p
2078 if((fClus->E() / fP) >= 0.2 && (fClus->E() / fP) <= 0.7){
2079 fTPCnsigma_eta_hadrons[i]->Fill(fTPCnSigma, ceta);
2081 //electrons selection using E/p
2082 if((fClus->E() / fP) >= fEoverPCutMin && (fClus->E() / fP) <= fEoverPCutMax) {
2083 fTPCnsigma_eta_electrons[i]->Fill(fTPCnSigma, ceta);
2088 if((fClus->E() / fP) >= fEoverPCutMin && (fClus->E() / fP) <= fEoverPCutMax)
2090 fTPCnsigma_eta->Fill(track->Eta(),fTPCnSigma);
2091 fTPCnsigma_phi->Fill(track->Phi(),fTPCnSigma);
2095 if(fTPCnSigma < 3.5 && fCorrelationFlag)
2097 fPtTrigger_Inc->Fill(fPt);
2098 DiHadronCorrelation(track, iTracks);
2107 //______________________________________________________________
2110 fVtxZ[1]->Fill(fZvtx);
2111 if(iTracks == 0)fNTracks[1]->Fill(fNOtrks);
2112 fNTracks_pt[1]->Fill(fNOtrks, fPt);
2113 fNTracks_eta[1]->Fill(fNOtrks, track->Eta());
2114 fNTracks_phi[1]->Fill(fNOtrks, track->Phi());
2115 fNClusters[1]->Fill(ClsNo);
2116 fTPCNcls_pid[1]->Fill(TPCNcls, TPCNcls_pid);
2118 //______________________________________________________________
2120 ///______________________________________________________________________
2121 ///Histograms for PID Studies
2122 //Double_t fPtBin[6] = {2,4,6,8,10,15};
2124 for(Int_t i = 0; i < 6; i++)
2126 if(fPt>=fPtBin[i] && fPt<fPtBin[i+1])
2128 if(fEMCflag) fEoverP_tpc[i]->Fill(fTPCnSigma,(fClus->E() / fP));
2131 fTPC_pt[i]->Fill(fTPCsignal);
2132 fTPCnsigma_pt[i]->Fill(fTPCnSigma);
2137 ///QA plots after track selection
2138 ///_____________________________________________________________
2140 //_______________________________________________________
2141 //Correlation Analysis - DiHadron
2144 if(fTPCnSigma < 3.5 && fCorrelationFlag)
2146 fPtTrigger_Inc->Fill(fPt);
2147 DiHadronCorrelation(track, iTracks);
2150 //_______________________________________________________
2153 ///////////////////////////////////////////////////////////////////
2154 ///TPC - efficiency calculation //
2156 /// changing start here
2157 if(fIsMC && fIsAOD && track->GetLabel()>=0)
2159 fMCparticle = (AliAODMCParticle*) fMCarray->At(track->GetLabel());
2160 Int_t pdg = fMCparticle->GetPdgCode();
2163 if(fMCparticle->IsPhysicalPrimary()){
2166 if(fMCparticle->Eta()>=fEtaCutMin && fMCparticle->Eta()<=fEtaCutMax ){
2168 Bool_t MotherFound = FindMother(track->GetLabel());
2170 fMCparticleMother = (AliAODMCParticle*) fMCarray->At(fMCparticle->GetMother());
2171 if( TMath::Abs(pdg) == 11 && fMCparticleMother->GetPdgCode()!=22 ){
2172 if(fIsHFE1) fPtMC_TPC_All->Fill(fMCparticle->Pt());
2179 else if(fIsMC && track->GetLabel()>=0)//ESD
2182 if(fMCstack->IsPhysicalPrimary(track->GetLabel())){
2183 fMCtrack = fMCstack->Particle(track->GetLabel());
2185 Int_t pdg = fMCtrack->GetPdgCode();
2186 if(fMCtrack->Eta()>=fEtaCutMin && fMCtrack->Eta()<=fEtaCutMax ){
2188 if(fMCtrack->GetFirstMother()>0){
2189 fMCtrackMother = fMCstack->Particle(fMCtrack->GetFirstMother());
2190 Bool_t MotherFound = FindMother(track->GetLabel());
2192 if( TMath::Abs(pdg) == 11 && fMCtrackMother->GetPdgCode()!=22 ){
2193 if(fIsHFE1) fPtMC_TPC_All->Fill(fMCtrack->Pt());
2202 if(fPt>1 && fPt<2) fTOF01->Fill(fTOFnSigma,fTPCnSigma);
2203 if(fPt>2 && fPt<4) fTOF02->Fill(fTOFnSigma,fTPCnSigma);
2204 if(fPt>4 && fPt<6) fTOF03->Fill(fTOFnSigma,fTPCnSigma);
2206 ///________________________________________________________________________
2208 ///Here the PID cuts defined in the file "ConfigEMCalHFEpA.C" is applied
2209 Int_t pidpassed = 1;
2210 AliHFEpidObject hfetrack;
2211 hfetrack.SetAnalysisType(AliHFEpidObject::kESDanalysis);
2212 hfetrack.SetRecTrack(track);
2213 hfetrack.SetPP(); //proton-proton analysis
2214 if(!fPID->IsSelected(&hfetrack, NULL, "", fPIDqa)) pidpassed = 0;
2215 fpid->Fill(pidpassed);
2217 if(pidpassed==0) continue;
2218 ///________________________________________________________________________
2221 ////////////////////////////////////////////////////////////////////
2222 ///TPC efficiency calculations
2225 if(fIsMC && fIsAOD && track->GetLabel()>=0)
2227 fMCparticle = (AliAODMCParticle*) fMCarray->At(track->GetLabel());
2228 Int_t pdg = fMCparticle->GetPdgCode();
2231 if(fMCparticle->IsPhysicalPrimary()){
2234 if(fMCparticle->Eta()>=fEtaCutMin && fMCparticle->Eta()<=fEtaCutMax ){
2236 Bool_t MotherFound = FindMother(track->GetLabel());
2238 fMCparticleMother = (AliAODMCParticle*) fMCarray->At(fMCparticle->GetMother());
2239 if( TMath::Abs(pdg) == 11 && fMCparticleMother->GetPdgCode()!=22 ){
2240 if(fIsHFE1) fPtMC_TPC_Selected->Fill(fMCparticle->Pt());
2247 else if(fIsMC && track->GetLabel()>=0)//ESD
2250 if(fMCstack->IsPhysicalPrimary(track->GetLabel())){
2251 fMCtrack = fMCstack->Particle(track->GetLabel());
2253 Int_t pdg = fMCtrack->GetPdgCode();
2254 if(fMCtrack->Eta()>=fEtaCutMin && fMCtrack->Eta()<=fEtaCutMax ){
2256 if(fMCtrack->GetFirstMother()>0){
2257 fMCtrackMother = fMCstack->Particle(fMCtrack->GetFirstMother());
2258 Bool_t MotherFound = FindMother(track->GetLabel());
2260 if( TMath::Abs(pdg) == 11 && fMCtrackMother->GetPdgCode()!=22 ){
2261 if(fIsHFE1) fPtMC_TPC_Selected->Fill(fMCtrack->Pt());
2269 //Eta Cut for TPC only
2270 if(track->Eta()>=fEtaCutMin && track->Eta()<=fEtaCutMax ){
2271 fTPCnsigma_pt_2D->Fill(fPt,fTPCnSigma);
2274 //Background for TPC only
2275 if(fFillBackground){
2277 //efficiency without SS cut for TPC only
2278 if(track->Eta()>=fEtaCutMin && track->Eta()<=fEtaCutMax){
2279 Background(track, iTracks, Vtrack, kTRUE); //IsTPConly=kTRUE
2280 } //Eta cut to be consistent with other efficiency
2284 fTPCnsigma_p[2]->Fill(fP,fTPCnSigma);
2285 fTPC_p[2]->Fill(fP,fTPCsignal);
2286 TPCNcls = track->GetTPCNcls();
2287 Float_t pos3[3]={0,0,0};
2290 //here denominator for track-matching efficiency
2291 if(fIsMC && fIsAOD && track->GetLabel()>=0)
2293 fMCparticle = (AliAODMCParticle*) fMCarray->At(track->GetLabel());
2294 Int_t pdg = fMCparticle->GetPdgCode();
2297 if(fMCparticle->IsPhysicalPrimary()){
2300 if(fMCparticle->Eta()>=fEtaCutMin && fMCparticle->Eta()<=fEtaCutMax ){
2302 Bool_t MotherFound = FindMother(track->GetLabel());
2304 fMCparticleMother = (AliAODMCParticle*) fMCarray->At(fMCparticle->GetMother());
2305 if( TMath::Abs(pdg) == 11 && fMCparticleMother->GetPdgCode()!=22 ){
2306 if(fIsHFE1) fPt_track_match_den->Fill(fMCparticle->Pt());
2314 if(track->GetEMCALcluster()>0)
2316 fClus = fVevent->GetCaloCluster(track->GetEMCALcluster());
2317 if(fClus->IsEMCAL())
2320 //________________________________________________________________________
2323 //Cluster timing distribution -- for ESD
2324 if(fUseEMCal && !fIsAOD){
2326 AliESDCaloCells &cells_esd=*(fESD->GetEMCALCells());
2327 TRefArray* caloClusters_esd = new TRefArray();
2328 fESD->GetEMCALClusters(caloClusters_esd);
2329 Int_t nclus_esd = caloClusters_esd->GetEntries();
2332 for (Int_t icl = 0; icl < nclus_esd; icl++) {
2334 AliESDCaloCluster* clus_esd = (AliESDCaloCluster*)caloClusters_esd->At(icl);
2336 if(clus_esd->IsEMCAL()){
2337 Float_t ncells_esd = fClus->GetNCells();
2338 UShort_t * index_esd = clus_esd->GetCellsAbsId() ;
2339 UShort_t * index2_esd = fClus->GetCellsAbsId() ;
2342 for(Int_t i = 0; i < ncells_esd ; i++){
2344 Int_t absId_esd = index_esd[i];
2345 fTime->Fill(fPt,cells_esd.GetCellTime(absId_esd));
2347 Int_t absId2_esd = index2_esd[i];
2348 fTime2->Fill(fPt,cells_esd.GetCellTime(absId2_esd));
2356 //Cluster timing distribution -- for AOD
2357 if(fUseEMCal && fIsAOD){
2359 AliAODCaloCells &cells_aod=*(fAOD->GetEMCALCells());
2361 TRefArray* caloClusters_aod = new TRefArray();
2362 fAOD->GetEMCALClusters(caloClusters_aod);
2364 Int_t nclus_aod = caloClusters_aod->GetEntries();
2366 for (Int_t icl = 0; icl < nclus_aod; icl++) {
2368 AliAODCaloCluster* clus_aod = (AliAODCaloCluster*)caloClusters_aod->At(icl);
2371 if(clus_aod->IsEMCAL()){
2372 Float_t ncells_aod = fClus->GetNCells();
2373 UShort_t * index_aod = clus_aod->GetCellsAbsId() ;
2374 UShort_t * index2_aod = fClus->GetCellsAbsId() ;
2377 for(Int_t i = 0; i < ncells_aod ; i++){
2379 Int_t absId_aod = index_aod[i];
2380 fTime->Fill(fPt,cells_aod.GetCellTime(absId_aod));
2382 Int_t absId2_aod = index2_aod[i];
2383 fTime2->Fill(fPt,cells_aod.GetCellTime(absId2_aod));
2394 double emctof = fClus->GetTOF();
2395 ftimingEle->Fill(fPt,emctof);
2397 //________________________________________________________________________
2403 Double_t Dx = fClus->GetTrackDx();
2404 Double_t Dz = fClus->GetTrackDz();
2405 Double_t R=TMath::Sqrt(Dx*Dx+Dz*Dz);
2407 for(Int_t i = 0; i < 6; i++)
2409 if(fPt>=fPtBin[i] && fPt<fPtBin[i+1])
2418 if(TMath::Abs(fClus->GetTrackDx())<=fdPhiCut && TMath::Abs(fClus->GetTrackDz())<=fdEtaCut)
2420 Float_t Energy = fClus->E();
2421 Float_t EoverP = Energy/track->P();
2422 Float_t M02 = fClus->GetM02();
2423 Float_t M20 = fClus->GetM20();
2424 Float_t ncells = fClus->GetNCells();
2426 //here numerator for track-matching efficiency
2427 if(fIsMC && fIsAOD && track->GetLabel()>=0)
2429 fMCparticle = (AliAODMCParticle*) fMCarray->At(track->GetLabel());
2430 Int_t pdg = fMCparticle->GetPdgCode();
2433 if(fMCparticle->IsPhysicalPrimary()){
2436 if(fMCparticle->Eta()>=fEtaCutMin && fMCparticle->Eta()<=fEtaCutMax ){
2438 Bool_t MotherFound = FindMother(track->GetLabel());
2440 fMCparticleMother = (AliAODMCParticle*) fMCarray->At(fMCparticle->GetMother());
2441 if( TMath::Abs(pdg) == 11 && fMCparticleMother->GetPdgCode()!=22 ){
2442 if(fIsHFE1) fPt_track_match_num->Fill(fMCparticle->Pt());
2451 //----------------------------------------------------------------------------------------
2453 // EtaCut electrons histogram
2455 if(track->Eta()>=fEtaCutMin && track->Eta()<=fEtaCutMax ){
2457 if(fUseShowerShapeCut){
2458 if(M02 >= fM02CutMin && M02<=fM02CutMax && M20>=fM20CutMin && M20<=fM20CutMax){
2459 fEoverP_pt[2]->Fill(fPt,(fClus->E() / fP));
2460 fShowerShapeCut->Fill(M02,M20);
2465 if(!fUseShowerShapeCut){
2466 fEoverP_pt[2]->Fill(fPt,(fClus->E() / fP));
2467 fShowerShapeCut->Fill(M02,M20);
2470 if(fUseEMCal) fShowerShape_ele->Fill(M02,M20);
2472 //for shower shape cut studies - now with TPC PID Cut
2474 fShowerShapeM02_EoverP->Fill(M02,EoverP);
2475 fShowerShapeM20_EoverP->Fill(M20,EoverP);
2480 //----------------------------------------------------------------------------------------
2484 // for Eta Phi distribution
2485 fClus->GetPosition(pos3);
2486 TVector3 vpos(pos3[0],pos3[1],pos3[2]);
2487 Double_t cphi = vpos.Phi();
2488 Double_t ceta = vpos.Eta();
2489 fEtaPhi[2]->Fill(cphi,ceta);
2493 fTPCNcls_EoverP[2]->Fill(TPCNcls, EoverP);
2495 for(Int_t i = 0; i < 6; i++)
2497 if(fPt>=fPtBin[i] && fPt<fPtBin[i+1])
2500 fR_EoverP[i]->Fill(R, EoverP);
2501 fNcells[i]->Fill(ncells);
2502 fNcells_EoverP[i]->Fill(EoverP, ncells);
2503 fM02_EoverP[i]->Fill(M02,EoverP);
2504 fM20_EoverP[i]->Fill(M20,EoverP);
2505 fECluster_ptbins[i]->Fill(Energy);
2506 fEoverP_ptbins[i]->Fill(EoverP);
2508 if((fClus->E() / fP) >= fEoverPCutMin && (fClus->E() / fP) <= fEoverPCutMax) {
2509 fNcells_electrons[i]->Fill(ncells);
2512 if(M02<0.5 && M20<0.3) {
2513 fEoverP_wSSCut[i]->Fill(EoverP);
2518 fNcells_pt->Fill(fPt, ncells);
2521 ////////////////////////////////////////////////////////////////////
2522 ///EMCal - Efficiency calculations
2525 if(fIsMC && fIsAOD && track->GetLabel()>=0)
2527 fMCparticle = (AliAODMCParticle*) fMCarray->At(track->GetLabel());
2528 Int_t pdg = fMCparticle->GetPdgCode();
2531 if(fMCparticle->IsPhysicalPrimary()){
2533 //Phi cut && fMCparticle->Phi()>=(TMath::Pi()*80/180) && fMCparticle->Phi()<=TMath::Pi()
2534 if(fMCparticle->Eta()>=fEtaCutMin && fMCparticle->Eta()<=fEtaCutMax ){
2536 Bool_t MotherFound = FindMother(track->GetLabel());
2538 fMCparticleMother = (AliAODMCParticle*) fMCarray->At(fMCparticle->GetMother());
2539 if( TMath::Abs(pdg) == 11 && fMCparticleMother->GetPdgCode()!=22 ){
2540 if(fIsHFE1)fPtMC_EMCal_All->Fill(fMCparticle->Pt());
2547 else if(fIsMC && track->GetLabel()>=0)//ESD
2550 if(fMCstack->IsPhysicalPrimary(track->GetLabel()))
2553 fMCtrack = fMCstack->Particle(track->GetLabel());
2555 Int_t pdg = fMCtrack->GetPdgCode();
2556 //Phi cut && fMCtrack->Phi()>=(TMath::Pi()*80/180) && fMCtrack->Phi()<=TMath::Pi()
2557 if(fMCtrack->Eta()>=fEtaCutMin && fMCtrack->Eta()<=fEtaCutMax )
2559 Bool_t MotherFound = FindMother(track->GetLabel());
2560 //MotherFound included
2562 if(fMCtrack->GetFirstMother()>0){
2563 fMCtrackMother = fMCstack->Particle(fMCtrack->GetFirstMother());
2564 if( TMath::Abs(pdg) == 11 && fMCtrackMother->GetPdgCode()!=22 ){
2565 if(fIsHFE1)fPtMC_EMCal_All->Fill(fMCtrack->Pt());
2573 //_______________________________________________________
2575 if((fClus->E() / fP) >= fEoverPCutMin && (fClus->E() / fP) <= fEoverPCutMax)
2578 fECluster[2]->Fill(Energy);
2579 fTPCNcls_pid[3]->Fill(TPCNcls, TPCNcls_pid);
2583 fPtElec_Inc->Fill(fPt);
2584 //Eta cut for background
2585 if(fFillBackground){
2586 fEtad[2]->Fill(track->Eta());
2588 //background for triggered data: trigger electron must have same cuts on shower shape 06/Jan/2014
2589 if(fUseShowerShapeCut){
2590 if(M02 >= fM02CutMin && M02<=fM02CutMax && M20>=fM20CutMin && M20<=fM20CutMax){
2591 if(track->Eta()>=fEtaCutMin && track->Eta()<=fEtaCutMax){
2592 Background(track, iTracks, Vtrack, kFALSE);
2597 if(track->Eta()>=fEtaCutMin && track->Eta()<=fEtaCutMax){
2598 Background(track, iTracks, Vtrack, kFALSE);
2604 double emctof2 = fClus->GetTOF();
2605 ftimingEle2->Fill(fPt,emctof2);
2606 //Correlation Analysis
2607 if(fCorrelationFlag)
2609 ElectronHadronCorrelation(track, iTracks, Vtrack);
2612 //_______________________________________________________
2614 ////////////////////////////////////////////////////////////////////
2615 ///EMCal - efficiency calculations
2617 if(track->Charge()<0) fCharge_n->Fill(fPt);
2618 if(track->Charge()>0) fCharge_p->Fill(fPt);
2622 if(fIsMC && fIsAOD && track->GetLabel()>=0)//AOD
2624 if(track->Charge()<0) fCharge_n->Fill(fPt);
2625 if(track->Charge()>0) fCharge_p->Fill(fPt);
2627 fMCparticle = (AliAODMCParticle*) fMCarray->At(track->GetLabel());
2628 if(fMCparticle->GetMother()>0) fMCparticleMother = (AliAODMCParticle*) fMCarray->At(fMCparticle->GetMother());
2629 Int_t pdg = fMCparticle->GetPdgCode();
2631 double proX = fMCparticle->Xv();
2632 double proY = fMCparticle->Yv();
2633 double proR = sqrt(pow(proX,2)+pow(proY,2));
2636 if(fMCparticle->Eta()>=fEtaCutMin && fMCparticle->Eta()<=fEtaCutMax && fMCparticle->Phi()>=(TMath::Pi()*80/180) && fMCparticle->Phi()<=TMath::Pi() ){
2638 if( TMath::Abs(pdg) == 11 && fMCparticle->GetMother()>0 ){
2639 Int_t mpdg = fMCparticleMother->GetPdgCode();
2640 if(TMath::Abs(mpdg) == 221 || TMath::Abs(mpdg) == 22 || TMath::Abs(mpdg) == 111){
2641 if(proR<7)fPtMCelectronAfterAll_nonPrimary->Fill(fMCparticle->Pt()); //numerator for the total efficiency, non Primary track
2644 if( TMath::Abs(pdg) == 11 && fMCparticle->IsPhysicalPrimary()) fPtMCelectronAfterAll_Primary->Fill(fMCparticle->Pt());
2649 if(fMCparticle->IsPhysicalPrimary()){
2652 if(fMCparticle->Eta()>=fEtaCutMin && fMCparticle->Eta()<=fEtaCutMax ){
2654 Bool_t MotherFound = FindMother(track->GetLabel());
2657 if(!fUseShowerShapeCut){
2659 //Unfolding pt_reco/pt_MC in the efficiency
2660 fPtMCelectronAfterAll->Fill(fMCparticle->Pt());
2661 fPtMCelectronAfterAll_unfolding->Fill(track->Pt());
2662 fEtaPhi_num->Fill(fMCparticle->Phi(),fMCparticle->Eta());
2664 //new histo to estimate how different is pt reco from pt MC
2665 fpt_reco_pt_MC_num->Fill(track->Pt(),fMCparticle->Pt());
2666 }//numerator for the total efficiency AOD
2668 //November 11 for efficiency of triggered data
2669 if(fUseShowerShapeCut){
2670 if(M02 >= fM02CutMin && M02<=fM02CutMax && M20>=fM20CutMin && M20<=fM20CutMax){
2672 //Unfolding pt_reco/pt_MC in the efficiency
2673 fPtMCelectronAfterAll->Fill(fMCparticle->Pt());
2674 fPtMCelectronAfterAll_unfolding->Fill(track->Pt());
2675 fEtaPhi_num->Fill(fMCparticle->Phi(),fMCparticle->Eta());
2677 //new histo to estimate how different is pt reco from pt MC
2678 fpt_reco_pt_MC_num->Fill(track->Pt(),fMCparticle->Pt());
2679 }//numerator for the total efficiency AOD
2685 fMCparticleMother = (AliAODMCParticle*) fMCarray->At(fMCparticle->GetMother());
2686 if( TMath::Abs(pdg) == 11 && fMCparticleMother->GetPdgCode()!=22 ){
2687 if(fIsHFE1)fPtMC_EMCal_Selected->Fill(fMCparticle->Pt());
2694 else if(fIsMC && track->GetLabel()>=0)//ESD
2696 if(track->Charge()<0) fCharge_n->Fill(fPt);
2697 if(track->Charge()>0) fCharge_p->Fill(fPt);
2699 fMCtrack = fMCstack->Particle(track->GetLabel());
2700 if(fMCtrack->GetFirstMother()>0) fMCtrackMother = fMCstack->Particle(fMCtrack->GetFirstMother());
2701 TParticle *particle=fMCstack->Particle(track->GetLabel());
2703 Int_t pdg = fMCtrack->GetPdgCode();
2706 if(fMCtrack->Eta()>=fEtaCutMin && fMCtrack->Eta()<=fEtaCutMax){
2707 if( TMath::Abs(pdg) == 11 && fMCtrack->GetFirstMother()>0 ){
2708 Int_t mpdg = fMCtrackMother->GetPdgCode();
2709 if(TMath::Abs(mpdg) == 221 || TMath::Abs(mpdg) == 22 || TMath::Abs(mpdg) == 111){
2710 Double_t proR=particle->R();
2712 fPtMCelectronAfterAll_nonPrimary->Fill(fMCtrack->Pt()); //numerator for the total efficiency, non Primary track
2716 if( TMath::Abs(pdg) == 11 && fMCstack->IsPhysicalPrimary(track->GetLabel())) fPtMCelectronAfterAll_Primary->Fill(fMCtrack->Pt());
2719 if(fMCstack->IsPhysicalPrimary(track->GetLabel()))
2721 Bool_t MotherFound = FindMother(track->GetLabel());
2725 if(fMCtrack->Eta()>=fEtaCutMin && fMCtrack->Eta()<=fEtaCutMax){
2728 if(!fUseShowerShapeCut){
2730 fPtMCelectronAfterAll->Fill(fMCtrack->Pt()); //numerator for the total efficiency ESD
2731 fEtaPhi_num->Fill(fMCtrack->Phi(),fMCtrack->Eta());
2734 //November 11 for efficiency of triggered data
2735 if(fUseShowerShapeCut){
2736 if(M02 >= fM02CutMin && M02<=fM02CutMax && M20>=fM20CutMin && M20<=fM20CutMax){
2738 fPtMCelectronAfterAll->Fill(fMCtrack->Pt()); //numerator for the total efficiency ESD
2739 fEtaPhi_num->Fill(fMCtrack->Phi(),fMCtrack->Eta());
2751 // Phi cut && fMCtrack->Phi()>=(TMath::Pi()*80/180) && fMCtrack->Phi()<=TMath::Pi()
2752 if(fMCtrack->Eta()>=fEtaCutMin && fMCtrack->Eta()<=fEtaCutMax)
2754 //included MotherFound
2758 if(fMCtrack->GetFirstMother()>0){
2759 fMCtrackMother = fMCstack->Particle(fMCtrack->GetFirstMother());
2760 if( TMath::Abs(pdg) == 11 && fMCtrackMother->GetPdgCode()!=22 ){
2762 if(fIsHFE1)fPtMC_EMCal_Selected->Fill(fMCtrack->Pt());
2769 ///////////////////////////////////////////////////////////////////
2777 //______________________________________________________________
2780 fVtxZ[2]->Fill(fZvtx);
2781 if(iTracks == 0)fNTracks[2]->Fill(fNOtrks);
2782 fNTracks_pt[2]->Fill(fNOtrks, fPt);
2783 fNTracks_eta[2]->Fill(fNOtrks, track->Eta());
2784 fNTracks_phi[2]->Fill(fNOtrks, track->Phi());
2785 fNClusters[2]->Fill(ClsNo);
2786 fTPCNcls_pid[2]->Fill(TPCNcls, TPCNcls_pid);
2788 //______________________________________________________________
2790 //_______________________________________________________
2791 //Correlation Analysis
2794 fPtElec_Inc->Fill(fPt);
2796 if(fCorrelationFlag)
2798 ElectronHadronCorrelation(track, iTracks, Vtrack);
2801 //_______________________________________________________
2803 ///________________________________________________________________________
2806 //__________________________________________________________________
2807 //Event Mixing Analysis
2809 if(fEventMixingFlag)
2811 fPool = fPoolMgr->GetEventPool(fCentrality->GetCentralityPercentile("V0A"), fZvtx); // Get the buffer associated with the current centrality and z-vtx
2813 if(!fPool) AliFatal(Form("No pool found for centrality = %f, zVtx = %f", fCentrality->GetCentralityPercentile("V0A"), fZvtx));
2815 fPool->UpdatePool(SelectedHadrons()); // fill the tracks in the event buffer. The ownership is handed over to the event mixing class. We are not allowed to delete tracksClone anymore!
2820 //__________________________________________________________________
2822 delete fListOfmotherkink;
2823 PostData(1, fOutputList);
2826 //______________________________________________________________________
2827 void AliAnalysisTaskEMCalHFEpA::Terminate(Option_t *)
2829 //Draw result to the screen
2830 //Called once at the end of the query
2832 fOutputList = dynamic_cast<TList*> (GetOutputData(1));
2836 printf("ERROR: Output list not available\n");
2841 //______________________________________________________________________
2842 Bool_t AliAnalysisTaskEMCalHFEpA::ProcessCutStep(Int_t cutStep, AliVParticle *track)
2844 //Check single track cuts for a given cut step
2845 //Note this function is called inside the UserExec function
2846 const Int_t kMCOffset = AliHFEcuts::kNcutStepsMCTrack;
2847 if(!fCFM->CheckParticleCuts(cutStep + kMCOffset, track)) return kFALSE;
2852 //______________________________________________________________________
2855 void AliAnalysisTaskEMCalHFEpA::Background(AliVTrack *track, Int_t trackIndex, AliVParticle *vtrack, Bool_t IsTPConly)
2857 ///_________________________________________________________________
2859 Bool_t IsMCefix=kFALSE; //to make correction on efix, use kTRUE (do not change the efficiency, so I will keep the correction only for d3)
2863 if(track->GetLabel() < 0)
2865 AliWarning(Form("The track %d does not have a valid MC label",trackIndex));
2871 fMCparticle = (AliAODMCParticle*) fMCarray->At(track->GetLabel());
2873 if(fMCparticle->GetMother()<0) return;
2875 fMCparticleMother = (AliAODMCParticle*) fMCarray->At(fMCparticle->GetMother());
2876 if(fMCparticleMother->GetMother()>0)fMCparticleGMother = (AliAODMCParticle*) fMCarray->At(fMCparticleMother->GetMother());
2878 if(TMath::Abs(fMCparticle->GetPdgCode())==11 && (TMath::Abs(fMCparticleMother->GetPdgCode())==22 || TMath::Abs(fMCparticleMother->GetPdgCode())==111 || TMath::Abs(fMCparticleMother->GetPdgCode())==221))
2881 if(!IsTPConly)fPtBackgroundBeforeReco->Fill(track->Pt());
2882 if(IsTPConly)fPtBackgroundBeforeReco2->Fill(track->Pt());
2885 //October 08th weighted histos
2886 if(TMath::Abs(fMCparticleMother->GetPdgCode())==111 || TMath::Abs(fMCparticleMother->GetPdgCode())==221 ){
2888 Double_t mPt=fMCparticleMother->Pt();
2891 //________________________________________________________________
2892 //correction for efix based on data - parametrization from MinJung
2894 if(TMath::Abs(fMCparticleMother->GetPdgCode())==111){
2896 if(0.100000 <= x < 0.112797 ) mweight=1.030419;
2897 if(0.112797 <= x < 0.127231 ) mweight=1.044554;
2898 if(0.127231 <= x < 0.143512 ) mweight=1.062733;
2899 if(0.143512 <= x < 0.161877 ) mweight=1.085332;
2900 if(0.161877 <= x < 0.182592 ) mweight=1.115248;
2901 if(0.182592 <= x < 0.205957 ) mweight=1.153990;
2902 if(0.205957 <= x < 0.232313 ) mweight=1.201346;
2903 if(0.232313 <= x < 0.262041 ) mweight=1.257332;
2904 if(0.262041 <= x < 0.295573 ) mweight=1.315488;
2905 if(0.295573 <= x < 0.333397 ) mweight=1.369138;
2906 if(0.333397 <= x < 0.376060 ) mweight=1.407632;
2907 if(0.376060 <= x < 0.424183 ) mweight=1.422232;
2908 if(0.424183 <= x < 0.478465 ) mweight=1.406922;
2909 if(0.478465 <= x < 0.539692 ) mweight=1.360082;
2910 if(0.539692 <= x < 0.608754 ) mweight=1.284405;
2911 if(0.608754 <= x < 0.686654 ) mweight=1.182017;
2912 if(0.686654 <= x < 0.774523 ) mweight=1.062002;
2913 if(0.774523 <= x < 0.873636 ) mweight=0.935533;
2914 if(0.873636 <= x < 0.985432 ) mweight=0.816081;
2915 if(0.985432 <= x < 1.111534 ) mweight=0.717527;
2916 if(1.111534 <= x < 1.253773 ) mweight=0.647465;
2917 if(1.253773 <= x < 1.414214 ) mweight=0.607212;
2918 if(1.414214 <= x < 1.595185 ) mweight=0.589750;
2919 if(1.595185 <= x < 1.799315 ) mweight=0.587406;
2920 if(1.799315 <= x < 2.029567 ) mweight=0.592858;
2921 if(2.029567 <= x < 2.289283 ) mweight=0.601059;
2922 if(2.289283 <= x < 2.582235 ) mweight=0.608003;
2923 if(2.582235 <= x < 2.912674 ) mweight=0.611705;
2924 if(2.912674 <= x < 3.285398 ) mweight=0.610086;
2925 if(3.285398 <= x < 3.705818 ) mweight=0.605015;
2926 if(3.705818 <= x < 4.180038 ) mweight=0.596299;
2927 if(4.180038 <= x < 4.714942 ) mweight=0.590727;
2928 if(4.714942 <= x < 5.318296 ) mweight=0.585358;
2929 if(5.318296 <= x < 5.998859 ) mweight=0.585257;
2930 if(5.998859 <= x < 6.766511 ) mweight=0.580812;
2931 if(6.766511 <= x < 7.632396 ) mweight=0.576207;
2932 if(7.632396 <= x < 8.609086 ) mweight=0.575912;
2933 if(8.609086 <= x < 9.710759 ) mweight=0.558718;
2934 if(9.710759 <= x < 10.953409 ) mweight=0.555625;
2935 if(10.953409 <= x < 12.355077 ) mweight=0.558886;
2936 if(12.355077 <= x < 13.936111 ) mweight=0.545318;
2937 if(13.936111 <= x < 15.719464 ) mweight=0.517607;
2938 if(15.719464 <= x < 17.731026 ) mweight=0.512366;
2939 if(17.731026 <= x < 20.000000 ) mweight=0.497034;
2947 //________________________________________________________________
2948 //correction for d3 based on data //from Jan
2950 if(TMath::Abs(fMCparticleMother->GetPdgCode())==111){
2952 if(0.100000 <= x < 0.112797 ) mweight=1.262120;
2953 if(0.112797 <= x < 0.127231 ) mweight=1.277765;
2954 if(0.127231 <= x < 0.143512 ) mweight=1.295605;
2955 if(0.143512 <= x < 0.161877 ) mweight=1.318155;
2956 if(0.161877 <= x < 0.182592 ) mweight=1.348693;
2957 if(0.182592 <= x < 0.205957 ) mweight=1.388636;
2958 if(0.205957 <= x < 0.232313 ) mweight=1.439122;
2959 if(0.232313 <= x < 0.262041 ) mweight=1.497452;
2960 if(0.262041 <= x < 0.295573 ) mweight=1.559409;
2961 if(0.295573 <= x < 0.333397 ) mweight=1.615169;
2962 if(0.333397 <= x < 0.376060 ) mweight=1.654954;
2963 if(0.376060 <= x < 0.424183 ) mweight=1.668753;
2964 if(0.424183 <= x < 0.478465 ) mweight=1.652225;
2965 if(0.478465 <= x < 0.539692 ) mweight=1.603119;
2966 if(0.539692 <= x < 0.608754 ) mweight=1.526049;
2967 if(0.608754 <= x < 0.686654 ) mweight=1.426724;
2968 if(0.686654 <= x < 0.774523 ) mweight=1.312684;
2969 if(0.774523 <= x < 0.873636 ) mweight=1.195395;
2970 if(0.873636 <= x < 0.985432 ) mweight=1.086264;
2971 if(0.985432 <= x < 1.111534 ) mweight=0.993666;
2972 if(1.111534 <= x < 1.253773 ) mweight=0.922587;
2973 if(1.253773 <= x < 1.414214 ) mweight=0.875739;
2974 if(1.414214 <= x < 1.595185 ) mweight=0.852181;
2975 if(1.595185 <= x < 1.799315 ) mweight=0.847828;
2976 if(1.799315 <= x < 2.029567 ) mweight=0.863875;
2977 if(2.029567 <= x < 2.289283 ) mweight=0.899112;
2978 if(2.289283 <= x < 2.582235 ) mweight=0.955194;
2979 if(2.582235 <= x < 2.912674 ) mweight=1.033824;
2980 if(2.912674 <= x < 3.285398 ) mweight=1.133714;
2981 if(3.285398 <= x < 3.705818 ) mweight=1.259471;
2982 if(3.705818 <= x < 4.180038 ) mweight=1.406883;
2983 if(4.180038 <= x < 4.714942 ) mweight=1.578923;
2984 if(4.714942 <= x < 5.318296 ) mweight=1.778513;
2985 if(5.318296 <= x < 5.998859 ) mweight=2.001171;
2986 if(5.998859 <= x < 6.766511 ) mweight=2.223161;
2987 if(6.766511 <= x < 7.632396 ) mweight=2.449445;
2988 if(7.632396 <= x < 8.609086 ) mweight=2.661734;
2989 if(8.609086 <= x < 9.710759 ) mweight=2.851935;
2990 if(9.710759 <= x < 10.953409 ) mweight=2.974319;
2991 if(10.953409 <= x < 12.355077 ) mweight=3.106314;
2992 if(12.355077 <= x < 13.936111 ) mweight=3.126815;
2993 if(13.936111 <= x < 15.719464 ) mweight=3.150053;
2994 if(15.719464 <= x < 17.731026 ) mweight=3.218509;
2995 if(17.731026 <= x < 20.000000 ) mweight=3.252141;
3000 //________________________________________________________________
3002 //Histo pT mother versus pT electron
3003 fpT_m_electron->Fill(mPt, track->Pt());
3005 if(!IsTPConly)fPtBackgroundBeforeReco_weight->Fill(track->Pt(), 1./mweight);
3006 if(IsTPConly)fPtBackgroundBeforeReco2_weight->Fill(track->Pt(), 1./mweight);
3008 else if(fMCparticleMother->GetMother()>0 && (TMath::Abs(fMCparticleGMother->GetPdgCode())==111 || TMath::Abs(fMCparticleGMother->GetPdgCode())==221 )){
3010 Double_t gmPt=fMCparticleGMother->Pt();
3011 Double_t gmweight=1;
3013 //________________________________________________________________
3014 //correction for efix based on data - parametrization from MinJung
3016 if(TMath::Abs(fMCparticleGMother->GetPdgCode())==111){
3018 if(0.100000 <= x < 0.112797 ) gmweight=1.030419;
3019 if(0.112797 <= x < 0.127231 ) gmweight=1.044554;
3020 if(0.127231 <= x < 0.143512 ) gmweight=1.062733;
3021 if(0.143512 <= x < 0.161877 ) gmweight=1.085332;
3022 if(0.161877 <= x < 0.182592 ) gmweight=1.115248;
3023 if(0.182592 <= x < 0.205957 ) gmweight=1.153990;
3024 if(0.205957 <= x < 0.232313 ) gmweight=1.201346;
3025 if(0.232313 <= x < 0.262041 ) gmweight=1.257332;
3026 if(0.262041 <= x < 0.295573 ) gmweight=1.315488;
3027 if(0.295573 <= x < 0.333397 ) gmweight=1.369138;
3028 if(0.333397 <= x < 0.376060 ) gmweight=1.407632;
3029 if(0.376060 <= x < 0.424183 ) gmweight=1.422232;
3030 if(0.424183 <= x < 0.478465 ) gmweight=1.406922;
3031 if(0.478465 <= x < 0.539692 ) gmweight=1.360082;
3032 if(0.539692 <= x < 0.608754 ) gmweight=1.284405;
3033 if(0.608754 <= x < 0.686654 ) gmweight=1.182017;
3034 if(0.686654 <= x < 0.774523 ) gmweight=1.062002;
3035 if(0.774523 <= x < 0.873636 ) gmweight=0.935533;
3036 if(0.873636 <= x < 0.985432 ) gmweight=0.816081;
3037 if(0.985432 <= x < 1.111534 ) gmweight=0.717527;
3038 if(1.111534 <= x < 1.253773 ) gmweight=0.647465;
3039 if(1.253773 <= x < 1.414214 ) gmweight=0.607212;
3040 if(1.414214 <= x < 1.595185 ) gmweight=0.589750;
3041 if(1.595185 <= x < 1.799315 ) gmweight=0.587406;
3042 if(1.799315 <= x < 2.029567 ) gmweight=0.592858;
3043 if(2.029567 <= x < 2.289283 ) gmweight=0.601059;
3044 if(2.289283 <= x < 2.582235 ) gmweight=0.608003;
3045 if(2.582235 <= x < 2.912674 ) gmweight=0.611705;
3046 if(2.912674 <= x < 3.285398 ) gmweight=0.610086;
3047 if(3.285398 <= x < 3.705818 ) gmweight=0.605015;
3048 if(3.705818 <= x < 4.180038 ) gmweight=0.596299;
3049 if(4.180038 <= x < 4.714942 ) gmweight=0.590727;
3050 if(4.714942 <= x < 5.318296 ) gmweight=0.585358;
3051 if(5.318296 <= x < 5.998859 ) gmweight=0.585257;
3052 if(5.998859 <= x < 6.766511 ) gmweight=0.580812;
3053 if(6.766511 <= x < 7.632396 ) gmweight=0.576207;
3054 if(7.632396 <= x < 8.609086 ) gmweight=0.575912;
3055 if(8.609086 <= x < 9.710759 ) gmweight=0.558718;
3056 if(9.710759 <= x < 10.953409 ) gmweight=0.555625;
3057 if(10.953409 <= x < 12.355077 ) gmweight=0.558886;
3058 if(12.355077 <= x < 13.936111 ) gmweight=0.545318;
3059 if(13.936111 <= x < 15.719464 ) gmweight=0.517607;
3060 if(15.719464 <= x < 17.731026 ) gmweight=0.512366;
3061 if(17.731026 <= x < 20.000000 ) gmweight=0.497034;
3070 //________________________________________________________________
3071 //correction for d3 based on data
3073 if(TMath::Abs(fMCparticleGMother->GetPdgCode())==111){
3075 if(0.100000 <= x < 0.112797 ) gmweight=1.262120;
3076 if(0.112797 <= x < 0.127231 ) gmweight=1.277765;
3077 if(0.127231 <= x < 0.143512 ) gmweight=1.295605;
3078 if(0.143512 <= x < 0.161877 ) gmweight=1.318155;
3079 if(0.161877 <= x < 0.182592 ) gmweight=1.348693;
3080 if(0.182592 <= x < 0.205957 ) gmweight=1.388636;
3081 if(0.205957 <= x < 0.232313 ) gmweight=1.439122;
3082 if(0.232313 <= x < 0.262041 ) gmweight=1.497452;
3083 if(0.262041 <= x < 0.295573 ) gmweight=1.559409;
3084 if(0.295573 <= x < 0.333397 ) gmweight=1.615169;
3085 if(0.333397 <= x < 0.376060 ) gmweight=1.654954;
3086 if(0.376060 <= x < 0.424183 ) gmweight=1.668753;
3087 if(0.424183 <= x < 0.478465 ) gmweight=1.652225;
3088 if(0.478465 <= x < 0.539692 ) gmweight=1.603119;
3089 if(0.539692 <= x < 0.608754 ) gmweight=1.526049;
3090 if(0.608754 <= x < 0.686654 ) gmweight=1.426724;
3091 if(0.686654 <= x < 0.774523 ) gmweight=1.312684;
3092 if(0.774523 <= x < 0.873636 ) gmweight=1.195395;
3093 if(0.873636 <= x < 0.985432 ) gmweight=1.086264;
3094 if(0.985432 <= x < 1.111534 ) gmweight=0.993666;
3095 if(1.111534 <= x < 1.253773 ) gmweight=0.922587;
3096 if(1.253773 <= x < 1.414214 ) gmweight=0.875739;
3097 if(1.414214 <= x < 1.595185 ) gmweight=0.852181;
3098 if(1.595185 <= x < 1.799315 ) gmweight=0.847828;
3099 if(1.799315 <= x < 2.029567 ) gmweight=0.863875;
3100 if(2.029567 <= x < 2.289283 ) gmweight=0.899112;
3101 if(2.289283 <= x < 2.582235 ) gmweight=0.955194;
3102 if(2.582235 <= x < 2.912674 ) gmweight=1.033824;
3103 if(2.912674 <= x < 3.285398 ) gmweight=1.133714;
3104 if(3.285398 <= x < 3.705818 ) gmweight=1.259471;
3105 if(3.705818 <= x < 4.180038 ) gmweight=1.406883;
3106 if(4.180038 <= x < 4.714942 ) gmweight=1.578923;
3107 if(4.714942 <= x < 5.318296 ) gmweight=1.778513;
3108 if(5.318296 <= x < 5.998859 ) gmweight=2.001171;
3109 if(5.998859 <= x < 6.766511 ) gmweight=2.223161;
3110 if(6.766511 <= x < 7.632396 ) gmweight=2.449445;
3111 if(7.632396 <= x < 8.609086 ) gmweight=2.661734;
3112 if(8.609086 <= x < 9.710759 ) gmweight=2.851935;
3113 if(9.710759 <= x < 10.953409 ) gmweight=2.974319;
3114 if(10.953409 <= x < 12.355077 ) gmweight=3.106314;
3115 if(12.355077 <= x < 13.936111 ) gmweight=3.126815;
3116 if(13.936111 <= x < 15.719464 ) gmweight=3.150053;
3117 if(15.719464 <= x < 17.731026 ) gmweight=3.218509;
3118 if(17.731026 <= x < 20.000000 ) gmweight=3.252141;
3123 //________________________________________________________________
3126 //Histo pT gmother versus pT electron
3127 fpT_gm_electron->Fill(gmPt, track->Pt());
3129 if(!IsTPConly)fPtBackgroundBeforeReco_weight->Fill(track->Pt(), 1./gmweight);
3130 if(IsTPConly)fPtBackgroundBeforeReco2_weight->Fill(track->Pt(), 1./gmweight);
3133 if(!IsTPConly)fPtBackgroundBeforeReco_weight->Fill(track->Pt());
3134 if(IsTPConly)fPtBackgroundBeforeReco2_weight->Fill(track->Pt());
3141 fMCtrack = fMCstack->Particle(track->GetLabel());
3143 if(fMCtrack->GetFirstMother()<0) return;
3145 fMCtrackMother = fMCstack->Particle(fMCtrack->GetFirstMother());
3147 if(TMath::Abs(fMCtrack->GetPdgCode())==11 && (TMath::Abs(fMCtrackMother->GetPdgCode())==22 || TMath::Abs(fMCtrackMother->GetPdgCode())==111 || TMath::Abs(fMCtrackMother->GetPdgCode())==221))
3150 if(!IsTPConly)fPtBackgroundBeforeReco->Fill(track->Pt());
3151 if(IsTPConly)fPtBackgroundBeforeReco2->Fill(track->Pt());
3156 ///_________________________________________________________________
3158 //________________________________________________
3159 //Associated particle cut
3160 fPartnerCuts->SetAcceptKinkDaughters(kFALSE);
3161 fPartnerCuts->SetRequireITSRefit(kTRUE);
3162 fPartnerCuts->SetRequireTPCRefit(kTRUE);
3163 fPartnerCuts->SetEtaRange(-0.9,0.9);
3164 fPartnerCuts->SetMaxChi2PerClusterTPC(4.0);
3165 fPartnerCuts->SetMinNClustersTPC(80);
3166 fPartnerCuts->SetPtRange(0.3,1e10);
3167 //fPartnerCuts->SetRequireSigmaToVertex(kTRUE);
3168 //fPartnerCuts->SetMaxDCAToVertexXY(1);
3169 //fPartnerCuts->SetMaxDCAToVertexZ(3);
3170 //_________________________________________________
3172 ///#################################################################
3173 //Non-HFE reconstruction
3174 fNonHFE = new AliSelectNonHFE();
3175 fNonHFE->SetAODanalysis(fIsAOD);
3176 if(fMassCutFlag) fNonHFE->SetInvariantMassCut(fMassCut);
3177 if(fAngleCutFlag) fNonHFE->SetOpeningAngleCut(fAngleCut);
3178 if(fChi2CutFlag) fNonHFE->SetChi2OverNDFCut(fChi2Cut);
3179 if(fDCAcutFlag) fNonHFE->SetDCACut(fDCAcut);
3180 fNonHFE->SetAlgorithm("DCA"); //KF
3181 fNonHFE->SetPIDresponse(fPidResponse);
3182 fNonHFE->SetTrackCuts(-3.5,3.5,fPartnerCuts);
3183 fNonHFE->SetAdditionalCuts(fPtMinAsso,fTpcNclsAsso);
3186 fNonHFE->SetHistAngleBack(fOpAngleBack);
3187 fNonHFE->SetHistAngle(fOpAngle);
3188 fNonHFE->SetHistDCABack(fDCABack);
3189 fNonHFE->SetHistDCA(fDCA);
3190 fNonHFE->SetHistMassBack(fInvMassBack);
3191 fNonHFE->SetHistMass(fInvMass);
3194 fNonHFE->SetHistAngleBack(fOpAngleBack2);
3195 fNonHFE->SetHistAngle(fOpAngle2);
3196 fNonHFE->SetHistDCABack(fDCABack2);
3197 fNonHFE->SetHistDCA(fDCA2);
3198 fNonHFE->SetHistMassBack(fInvMassBack2);
3199 fNonHFE->SetHistMass(fInvMass2);
3202 fNonHFE->FindNonHFE(trackIndex,vtrack,fVevent);
3204 //index of track selected as partner
3205 Int_t *fUlsPartner = fNonHFE->GetPartnersULS();
3207 //Electron Information
3208 Double_t fPhiE = -999;
3209 Double_t fEtaE = -999;
3210 Double_t fPtE = -999;
3211 fPhiE = track->Phi();
3212 fEtaE = track->Eta();
3215 ///_________________________________________________________________
3221 if(TMath::Abs(fMCparticle->GetPdgCode())==11 && (TMath::Abs(fMCparticleMother->GetPdgCode())==22 || TMath::Abs(fMCparticleMother->GetPdgCode())==111 || TMath::Abs(fMCparticleMother->GetPdgCode())==221))
3227 if(fNonHFE->IsULS()) fPtElec_ULS->Fill(fPtE,fNonHFE->GetNULS());
3228 if(fNonHFE->IsLS()) fPtElec_LS->Fill(fPtE,fNonHFE->GetNLS());
3233 if(TMath::Abs(fMCparticleMother->GetPdgCode())==111 || TMath::Abs(fMCparticleMother->GetPdgCode())==221){
3234 Double_t mPt=fMCparticleMother->Pt();
3235 Double_t mweight1=1;
3236 Double_t mweight2=1;
3237 //Double_t weight=1;
3239 //----------------------------------------------------------------------------
3241 if(TMath::Abs(fMCparticleMother->GetPdgCode())==111){
3243 if(0.100000 <= x < 0.112797 ) weight=1.030419;
3244 if(0.112797 <= x < 0.127231 ) weight=1.044554;
3245 if(0.127231 <= x < 0.143512 ) weight=1.062733;
3246 if(0.143512 <= x < 0.161877 ) weight=1.085332;
3247 if(0.161877 <= x < 0.182592 ) weight=1.115248;
3248 if(0.182592 <= x < 0.205957 ) weight=1.153990;
3249 if(0.205957 <= x < 0.232313 ) weight=1.201346;
3250 if(0.232313 <= x < 0.262041 ) weight=1.257332;
3251 if(0.262041 <= x < 0.295573 ) weight=1.315488;
3252 if(0.295573 <= x < 0.333397 ) weight=1.369138;
3253 if(0.333397 <= x < 0.376060 ) weight=1.407632;
3254 if(0.376060 <= x < 0.424183 ) weight=1.422232;
3255 if(0.424183 <= x < 0.478465 ) weight=1.406922;
3256 if(0.478465 <= x < 0.539692 ) weight=1.360082;
3257 if(0.539692 <= x < 0.608754 ) weight=1.284405;
3258 if(0.608754 <= x < 0.686654 ) weight=1.182017;
3259 if(0.686654 <= x < 0.774523 ) weight=1.062002;
3260 if(0.774523 <= x < 0.873636 ) weight=0.935533;
3261 if(0.873636 <= x < 0.985432 ) weight=0.816081;
3262 if(0.985432 <= x < 1.111534 ) weight=0.717527;
3263 if(1.111534 <= x < 1.253773 ) weight=0.647465;
3264 if(1.253773 <= x < 1.414214 ) weight=0.607212;
3265 if(1.414214 <= x < 1.595185 ) weight=0.589750;
3266 if(1.595185 <= x < 1.799315 ) weight=0.587406;
3267 if(1.799315 <= x < 2.029567 ) weight=0.592858;
3268 if(2.029567 <= x < 2.289283 ) weight=0.601059;
3269 if(2.289283 <= x < 2.582235 ) weight=0.608003;
3270 if(2.582235 <= x < 2.912674 ) weight=0.611705;
3271 if(2.912674 <= x < 3.285398 ) weight=0.610086;
3272 if(3.285398 <= x < 3.705818 ) weight=0.605015;
3273 if(3.705818 <= x < 4.180038 ) weight=0.596299;
3274 if(4.180038 <= x < 4.714942 ) weight=0.590727;
3275 if(4.714942 <= x < 5.318296 ) weight=0.585358;
3276 if(5.318296 <= x < 5.998859 ) weight=0.585257;
3277 if(5.998859 <= x < 6.766511 ) weight=0.580812;
3278 if(6.766511 <= x < 7.632396 ) weight=0.576207;
3279 if(7.632396 <= x < 8.609086 ) weight=0.575912;
3280 if(8.609086 <= x < 9.710759 ) weight=0.558718;
3281 if(9.710759 <= x < 10.953409 ) weight=0.555625;
3282 if(10.953409 <= x < 12.355077 ) weight=0.558886;
3283 if(12.355077 <= x < 13.936111 ) weight=0.545318;
3284 if(13.936111 <= x < 15.719464 ) weight=0.517607;
3285 if(15.719464 <= x < 17.731026 ) weight=0.512366;
3286 if(17.731026 <= x < 20.000000 ) weight=0.497034;
3293 //----------------------------------------------------------------------------
3294 //correction based on data only for pi0
3296 if(TMath::Abs(fMCparticleMother->GetPdgCode())==111){
3298 if(0.100000 <= x < 0.112797 ) weight=1.262120;
3299 if(0.112797 <= x < 0.127231 ) weight=1.277765;
3300 if(0.127231 <= x < 0.143512 ) weight=1.295605;
3301 if(0.143512 <= x < 0.161877 ) weight=1.318155;
3302 if(0.161877 <= x < 0.182592 ) weight=1.348693;
3303 if(0.182592 <= x < 0.205957 ) weight=1.388636;
3304 if(0.205957 <= x < 0.232313 ) weight=1.439122;
3305 if(0.232313 <= x < 0.262041 ) weight=1.497452;
3306 if(0.262041 <= x < 0.295573 ) weight=1.559409;
3307 if(0.295573 <= x < 0.333397 ) weight=1.615169;
3308 if(0.333397 <= x < 0.376060 ) weight=1.654954;
3309 if(0.376060 <= x < 0.424183 ) weight=1.668753;
3310 if(0.424183 <= x < 0.478465 ) weight=1.652225;
3311 if(0.478465 <= x < 0.539692 ) weight=1.603119;
3312 if(0.539692 <= x < 0.608754 ) weight=1.526049;
3313 if(0.608754 <= x < 0.686654 ) weight=1.426724;
3314 if(0.686654 <= x < 0.774523 ) weight=1.312684;
3315 if(0.774523 <= x < 0.873636 ) weight=1.195395;
3316 if(0.873636 <= x < 0.985432 ) weight=1.086264;
3317 if(0.985432 <= x < 1.111534 ) weight=0.993666;
3318 if(1.111534 <= x < 1.253773 ) weight=0.922587;
3319 if(1.253773 <= x < 1.414214 ) weight=0.875739;
3320 if(1.414214 <= x < 1.595185 ) weight=0.852181;
3321 if(1.595185 <= x < 1.799315 ) weight=0.847828;
3322 if(1.799315 <= x < 2.029567 ) weight=0.863875;
3323 if(2.029567 <= x < 2.289283 ) weight=0.899112;
3324 if(2.289283 <= x < 2.582235 ) weight=0.955194;
3325 if(2.582235 <= x < 2.912674 ) weight=1.033824;
3326 if(2.912674 <= x < 3.285398 ) weight=1.133714;
3327 if(3.285398 <= x < 3.705818 ) weight=1.259471;
3328 if(3.705818 <= x < 4.180038 ) weight=1.406883;
3329 if(4.180038 <= x < 4.714942 ) weight=1.578923;
3330 if(4.714942 <= x < 5.318296 ) weight=1.778513;
3331 if(5.318296 <= x < 5.998859 ) weight=2.001171;
3332 if(5.998859 <= x < 6.766511 ) weight=2.223161;
3333 if(6.766511 <= x < 7.632396 ) weight=2.449445;
3334 if(7.632396 <= x < 8.609086 ) weight=2.661734;
3335 if(8.609086 <= x < 9.710759 ) weight=2.851935;
3336 if(9.710759 <= x < 10.953409 ) weight=2.974319;
3337 if(10.953409 <= x < 12.355077 ) weight=3.106314;
3338 if(12.355077 <= x < 13.936111 ) weight=3.126815;
3339 if(13.936111 <= x < 15.719464 ) weight=3.150053;
3340 if(15.719464 <= x < 17.731026 ) weight=3.218509;
3341 if(17.731026 <= x < 20.000000 ) weight=3.252141;
3347 //----------------------------------------------------------------------------
3350 if(fNonHFE->IsULS()) mweight1=(fNonHFE->GetNULS())/weight;
3351 if(fNonHFE->IsLS()) mweight2=(fNonHFE->GetNLS())/weight;
3354 if(fNonHFE->IsULS())fPtElec_ULS_weight->Fill(fPtE, mweight1);
3355 if(fNonHFE->IsLS())fPtElec_LS_weight->Fill(fPtE, mweight2);
3357 else if(fMCparticleMother->GetMother()>0 && (TMath::Abs(fMCparticleGMother->GetPdgCode())==111 || TMath::Abs(fMCparticleGMother->GetPdgCode())==221 )){
3358 Double_t gmPt=fMCparticleGMother->Pt();
3359 Double_t gmweight1=1;
3360 Double_t gmweight2=1;
3361 //Double_t weight=1;
3363 //----------------------------------------------------------------------------
3365 if(TMath::Abs(fMCparticleGMother->GetPdgCode())==111){
3367 if(0.100000 <= x < 0.112797 ) weight=1.030419;
3368 if(0.112797 <= x < 0.127231 ) weight=1.044554;
3369 if(0.127231 <= x < 0.143512 ) weight=1.062733;
3370 if(0.143512 <= x < 0.161877 ) weight=1.085332;
3371 if(0.161877 <= x < 0.182592 ) weight=1.115248;
3372 if(0.182592 <= x < 0.205957 ) weight=1.153990;
3373 if(0.205957 <= x < 0.232313 ) weight=1.201346;
3374 if(0.232313 <= x < 0.262041 ) weight=1.257332;
3375 if(0.262041 <= x < 0.295573 ) weight=1.315488;
3376 if(0.295573 <= x < 0.333397 ) weight=1.369138;
3377 if(0.333397 <= x < 0.376060 ) weight=1.407632;
3378 if(0.376060 <= x < 0.424183 ) weight=1.422232;
3379 if(0.424183 <= x < 0.478465 ) weight=1.406922;
3380 if(0.478465 <= x < 0.539692 ) weight=1.360082;
3381 if(0.539692 <= x < 0.608754 ) weight=1.284405;
3382 if(0.608754 <= x < 0.686654 ) weight=1.182017;
3383 if(0.686654 <= x < 0.774523 ) weight=1.062002;
3384 if(0.774523 <= x < 0.873636 ) weight=0.935533;
3385 if(0.873636 <= x < 0.985432 ) weight=0.816081;
3386 if(0.985432 <= x < 1.111534 ) weight=0.717527;
3387 if(1.111534 <= x < 1.253773 ) weight=0.647465;
3388 if(1.253773 <= x < 1.414214 ) weight=0.607212;
3389 if(1.414214 <= x < 1.595185 ) weight=0.589750;
3390 if(1.595185 <= x < 1.799315 ) weight=0.587406;
3391 if(1.799315 <= x < 2.029567 ) weight=0.592858;
3392 if(2.029567 <= x < 2.289283 ) weight=0.601059;
3393 if(2.289283 <= x < 2.582235 ) weight=0.608003;
3394 if(2.582235 <= x < 2.912674 ) weight=0.611705;
3395 if(2.912674 <= x < 3.285398 ) weight=0.610086;
3396 if(3.285398 <= x < 3.705818 ) weight=0.605015;
3397 if(3.705818 <= x < 4.180038 ) weight=0.596299;
3398 if(4.180038 <= x < 4.714942 ) weight=0.590727;
3399 if(4.714942 <= x < 5.318296 ) weight=0.585358;
3400 if(5.318296 <= x < 5.998859 ) weight=0.585257;
3401 if(5.998859 <= x < 6.766511 ) weight=0.580812;
3402 if(6.766511 <= x < 7.632396 ) weight=0.576207;
3403 if(7.632396 <= x < 8.609086 ) weight=0.575912;
3404 if(8.609086 <= x < 9.710759 ) weight=0.558718;
3405 if(9.710759 <= x < 10.953409 ) weight=0.555625;
3406 if(10.953409 <= x < 12.355077 ) weight=0.558886;
3407 if(12.355077 <= x < 13.936111 ) weight=0.545318;
3408 if(13.936111 <= x < 15.719464 ) weight=0.517607;
3409 if(15.719464 <= x < 17.731026 ) weight=0.512366;
3410 if(17.731026 <= x < 20.000000 ) weight=0.497034;
3417 //----------------------------------------------------------------------------
3419 //correction based on data only for pi0
3421 if(TMath::Abs(fMCparticleGMother->GetPdgCode())==111){
3423 if(0.100000 <= x < 0.112797 ) weight=1.262120;
3424 if(0.112797 <= x < 0.127231 ) weight=1.277765;
3425 if(0.127231 <= x < 0.143512 ) weight=1.295605;
3426 if(0.143512 <= x < 0.161877 ) weight=1.318155;
3427 if(0.161877 <= x < 0.182592 ) weight=1.348693;
3428 if(0.182592 <= x < 0.205957 ) weight=1.388636;
3429 if(0.205957 <= x < 0.232313 ) weight=1.439122;
3430 if(0.232313 <= x < 0.262041 ) weight=1.497452;
3431 if(0.262041 <= x < 0.295573 ) weight=1.559409;
3432 if(0.295573 <= x < 0.333397 ) weight=1.615169;
3433 if(0.333397 <= x < 0.376060 ) weight=1.654954;
3434 if(0.376060 <= x < 0.424183 ) weight=1.668753;
3435 if(0.424183 <= x < 0.478465 ) weight=1.652225;
3436 if(0.478465 <= x < 0.539692 ) weight=1.603119;
3437 if(0.539692 <= x < 0.608754 ) weight=1.526049;
3438 if(0.608754 <= x < 0.686654 ) weight=1.426724;
3439 if(0.686654 <= x < 0.774523 ) weight=1.312684;
3440 if(0.774523 <= x < 0.873636 ) weight=1.195395;
3441 if(0.873636 <= x < 0.985432 ) weight=1.086264;
3442 if(0.985432 <= x < 1.111534 ) weight=0.993666;
3443 if(1.111534 <= x < 1.253773 ) weight=0.922587;
3444 if(1.253773 <= x < 1.414214 ) weight=0.875739;
3445 if(1.414214 <= x < 1.595185 ) weight=0.852181;
3446 if(1.595185 <= x < 1.799315 ) weight=0.847828;
3447 if(1.799315 <= x < 2.029567 ) weight=0.863875;
3448 if(2.029567 <= x < 2.289283 ) weight=0.899112;
3449 if(2.289283 <= x < 2.582235 ) weight=0.955194;
3450 if(2.582235 <= x < 2.912674 ) weight=1.033824;
3451 if(2.912674 <= x < 3.285398 ) weight=1.133714;
3452 if(3.285398 <= x < 3.705818 ) weight=1.259471;
3453 if(3.705818 <= x < 4.180038 ) weight=1.406883;
3454 if(4.180038 <= x < 4.714942 ) weight=1.578923;
3455 if(4.714942 <= x < 5.318296 ) weight=1.778513;
3456 if(5.318296 <= x < 5.998859 ) weight=2.001171;
3457 if(5.998859 <= x < 6.766511 ) weight=2.223161;
3458 if(6.766511 <= x < 7.632396 ) weight=2.449445;
3459 if(7.632396 <= x < 8.609086 ) weight=2.661734;
3460 if(8.609086 <= x < 9.710759 ) weight=2.851935;
3461 if(9.710759 <= x < 10.953409 ) weight=2.974319;
3462 if(10.953409 <= x < 12.355077 ) weight=3.106314;
3463 if(12.355077 <= x < 13.936111 ) weight=3.126815;
3464 if(13.936111 <= x < 15.719464 ) weight=3.150053;
3465 if(15.719464 <= x < 17.731026 ) weight=3.218509;
3466 if(17.731026 <= x < 20.000000 ) weight=3.252141;
3476 if(fNonHFE->IsULS()) gmweight1=(fNonHFE->GetNULS())/weight;
3477 if(fNonHFE->IsLS()) gmweight2=(fNonHFE->GetNLS())/weight;
3480 if(fNonHFE->IsULS())fPtElec_ULS_weight->Fill(fPtE, gmweight1);
3481 if(fNonHFE->IsLS())fPtElec_LS_weight->Fill(fPtE, gmweight2);
3484 if(fNonHFE->IsULS()) fPtElec_ULS_weight->Fill(fPtE,fNonHFE->GetNULS());
3485 if(fNonHFE->IsLS()) fPtElec_LS_weight->Fill(fPtE,fNonHFE->GetNLS());
3492 if(fNonHFE->IsULS()) fPtElec_ULS2->Fill(fPtE,fNonHFE->GetNULS());
3493 if(fNonHFE->IsLS()) fPtElec_LS2->Fill(fPtE,fNonHFE->GetNLS());
3498 //new 08 October //weighted histograms
3499 if(TMath::Abs(fMCparticleMother->GetPdgCode())==111 || TMath::Abs(fMCparticleMother->GetPdgCode())==221){
3500 Double_t mPt=fMCparticleMother->Pt();
3502 Double_t mweight1=1;
3503 Double_t mweight2=1;
3504 //Double_t weight=1;
3506 //----------------------------------------------------------------------------
3508 if(TMath::Abs(fMCparticleMother->GetPdgCode())==111){
3510 if(0.100000 <= x < 0.112797 ) weight=1.030419;
3511 if(0.112797 <= x < 0.127231 ) weight=1.044554;
3512 if(0.127231 <= x < 0.143512 ) weight=1.062733;
3513 if(0.143512 <= x < 0.161877 ) weight=1.085332;
3514 if(0.161877 <= x < 0.182592 ) weight=1.115248;
3515 if(0.182592 <= x < 0.205957 ) weight=1.153990;
3516 if(0.205957 <= x < 0.232313 ) weight=1.201346;
3517 if(0.232313 <= x < 0.262041 ) weight=1.257332;
3518 if(0.262041 <= x < 0.295573 ) weight=1.315488;
3519 if(0.295573 <= x < 0.333397 ) weight=1.369138;
3520 if(0.333397 <= x < 0.376060 ) weight=1.407632;
3521 if(0.376060 <= x < 0.424183 ) weight=1.422232;
3522 if(0.424183 <= x < 0.478465 ) weight=1.406922;
3523 if(0.478465 <= x < 0.539692 ) weight=1.360082;
3524 if(0.539692 <= x < 0.608754 ) weight=1.284405;
3525 if(0.608754 <= x < 0.686654 ) weight=1.182017;
3526 if(0.686654 <= x < 0.774523 ) weight=1.062002;
3527 if(0.774523 <= x < 0.873636 ) weight=0.935533;
3528 if(0.873636 <= x < 0.985432 ) weight=0.816081;
3529 if(0.985432 <= x < 1.111534 ) weight=0.717527;
3530 if(1.111534 <= x < 1.253773 ) weight=0.647465;
3531 if(1.253773 <= x < 1.414214 ) weight=0.607212;
3532 if(1.414214 <= x < 1.595185 ) weight=0.589750;
3533 if(1.595185 <= x < 1.799315 ) weight=0.587406;
3534 if(1.799315 <= x < 2.029567 ) weight=0.592858;
3535 if(2.029567 <= x < 2.289283 ) weight=0.601059;
3536 if(2.289283 <= x < 2.582235 ) weight=0.608003;
3537 if(2.582235 <= x < 2.912674 ) weight=0.611705;
3538 if(2.912674 <= x < 3.285398 ) weight=0.610086;
3539 if(3.285398 <= x < 3.705818 ) weight=0.605015;
3540 if(3.705818 <= x < 4.180038 ) weight=0.596299;
3541 if(4.180038 <= x < 4.714942 ) weight=0.590727;
3542 if(4.714942 <= x < 5.318296 ) weight=0.585358;
3543 if(5.318296 <= x < 5.998859 ) weight=0.585257;
3544 if(5.998859 <= x < 6.766511 ) weight=0.580812;
3545 if(6.766511 <= x < 7.632396 ) weight=0.576207;
3546 if(7.632396 <= x < 8.609086 ) weight=0.575912;
3547 if(8.609086 <= x < 9.710759 ) weight=0.558718;
3548 if(9.710759 <= x < 10.953409 ) weight=0.555625;
3549 if(10.953409 <= x < 12.355077 ) weight=0.558886;
3550 if(12.355077 <= x < 13.936111 ) weight=0.545318;
3551 if(13.936111 <= x < 15.719464 ) weight=0.517607;
3552 if(15.719464 <= x < 17.731026 ) weight=0.512366;
3553 if(17.731026 <= x < 20.000000 ) weight=0.497034;
3560 //----------------------------------------------------------------------------
3562 //correction based on data only for pi0 for d3
3564 if(TMath::Abs(fMCparticleMother->GetPdgCode())==111){
3566 if(0.100000 <= x < 0.112797 ) weight=1.262120;
3567 if(0.112797 <= x < 0.127231 ) weight=1.277765;
3568 if(0.127231 <= x < 0.143512 ) weight=1.295605;
3569 if(0.143512 <= x < 0.161877 ) weight=1.318155;
3570 if(0.161877 <= x < 0.182592 ) weight=1.348693;
3571 if(0.182592 <= x < 0.205957 ) weight=1.388636;
3572 if(0.205957 <= x < 0.232313 ) weight=1.439122;
3573 if(0.232313 <= x < 0.262041 ) weight=1.497452;
3574 if(0.262041 <= x < 0.295573 ) weight=1.559409;
3575 if(0.295573 <= x < 0.333397 ) weight=1.615169;
3576 if(0.333397 <= x < 0.376060 ) weight=1.654954;
3577 if(0.376060 <= x < 0.424183 ) weight=1.668753;
3578 if(0.424183 <= x < 0.478465 ) weight=1.652225;
3579 if(0.478465 <= x < 0.539692 ) weight=1.603119;
3580 if(0.539692 <= x < 0.608754 ) weight=1.526049;
3581 if(0.608754 <= x < 0.686654 ) weight=1.426724;
3582 if(0.686654 <= x < 0.774523 ) weight=1.312684;
3583 if(0.774523 <= x < 0.873636 ) weight=1.195395;
3584 if(0.873636 <= x < 0.985432 ) weight=1.086264;
3585 if(0.985432 <= x < 1.111534 ) weight=0.993666;
3586 if(1.111534 <= x < 1.253773 ) weight=0.922587;
3587 if(1.253773 <= x < 1.414214 ) weight=0.875739;
3588 if(1.414214 <= x < 1.595185 ) weight=0.852181;
3589 if(1.595185 <= x < 1.799315 ) weight=0.847828;
3590 if(1.799315 <= x < 2.029567 ) weight=0.863875;
3591 if(2.029567 <= x < 2.289283 ) weight=0.899112;
3592 if(2.289283 <= x < 2.582235 ) weight=0.955194;
3593 if(2.582235 <= x < 2.912674 ) weight=1.033824;
3594 if(2.912674 <= x < 3.285398 ) weight=1.133714;
3595 if(3.285398 <= x < 3.705818 ) weight=1.259471;
3596 if(3.705818 <= x < 4.180038 ) weight=1.406883;
3597 if(4.180038 <= x < 4.714942 ) weight=1.578923;
3598 if(4.714942 <= x < 5.318296 ) weight=1.778513;
3599 if(5.318296 <= x < 5.998859 ) weight=2.001171;
3600 if(5.998859 <= x < 6.766511 ) weight=2.223161;
3601 if(6.766511 <= x < 7.632396 ) weight=2.449445;
3602 if(7.632396 <= x < 8.609086 ) weight=2.661734;
3603 if(8.609086 <= x < 9.710759 ) weight=2.851935;
3604 if(9.710759 <= x < 10.953409 ) weight=2.974319;
3605 if(10.953409 <= x < 12.355077 ) weight=3.106314;
3606 if(12.355077 <= x < 13.936111 ) weight=3.126815;
3607 if(13.936111 <= x < 15.719464 ) weight=3.150053;
3608 if(15.719464 <= x < 17.731026 ) weight=3.218509;
3609 if(17.731026 <= x < 20.000000 ) weight=3.252141;
3616 if(fNonHFE->IsULS()) mweight1=(fNonHFE->GetNULS())/weight;
3617 if(fNonHFE->IsLS()) mweight2=(fNonHFE->GetNLS())/weight;
3620 if(fNonHFE->IsULS())fPtElec_ULS2_weight->Fill(fPtE, mweight1);
3621 if(fNonHFE->IsLS())fPtElec_LS2_weight->Fill(fPtE, mweight2);
3623 else if(fMCparticleMother->GetMother()>0 && (TMath::Abs(fMCparticleGMother->GetPdgCode())==111 || TMath::Abs(fMCparticleGMother->GetPdgCode())==221 )){
3624 Double_t gmPt=fMCparticleGMother->Pt();
3625 Double_t gmweight1=1;
3626 Double_t gmweight2=1;
3627 //Double_t weight=1;
3630 //----------------------------------------------------------------------------
3632 if(TMath::Abs(fMCparticleGMother->GetPdgCode())==111){
3634 if(0.100000 <= x < 0.112797 ) weight=1.030419;
3635 if(0.112797 <= x < 0.127231 ) weight=1.044554;
3636 if(0.127231 <= x < 0.143512 ) weight=1.062733;
3637 if(0.143512 <= x < 0.161877 ) weight=1.085332;
3638 if(0.161877 <= x < 0.182592 ) weight=1.115248;
3639 if(0.182592 <= x < 0.205957 ) weight=1.153990;
3640 if(0.205957 <= x < 0.232313 ) weight=1.201346;
3641 if(0.232313 <= x < 0.262041 ) weight=1.257332;
3642 if(0.262041 <= x < 0.295573 ) weight=1.315488;
3643 if(0.295573 <= x < 0.333397 ) weight=1.369138;
3644 if(0.333397 <= x < 0.376060 ) weight=1.407632;
3645 if(0.376060 <= x < 0.424183 ) weight=1.422232;
3646 if(0.424183 <= x < 0.478465 ) weight=1.406922;
3647 if(0.478465 <= x < 0.539692 ) weight=1.360082;
3648 if(0.539692 <= x < 0.608754 ) weight=1.284405;
3649 if(0.608754 <= x < 0.686654 ) weight=1.182017;
3650 if(0.686654 <= x < 0.774523 ) weight=1.062002;
3651 if(0.774523 <= x < 0.873636 ) weight=0.935533;
3652 if(0.873636 <= x < 0.985432 ) weight=0.816081;
3653 if(0.985432 <= x < 1.111534 ) weight=0.717527;
3654 if(1.111534 <= x < 1.253773 ) weight=0.647465;
3655 if(1.253773 <= x < 1.414214 ) weight=0.607212;
3656 if(1.414214 <= x < 1.595185 ) weight=0.589750;
3657 if(1.595185 <= x < 1.799315 ) weight=0.587406;
3658 if(1.799315 <= x < 2.029567 ) weight=0.592858;
3659 if(2.029567 <= x < 2.289283 ) weight=0.601059;
3660 if(2.289283 <= x < 2.582235 ) weight=0.608003;
3661 if(2.582235 <= x < 2.912674 ) weight=0.611705;
3662 if(2.912674 <= x < 3.285398 ) weight=0.610086;
3663 if(3.285398 <= x < 3.705818 ) weight=0.605015;
3664 if(3.705818 <= x < 4.180038 ) weight=0.596299;
3665 if(4.180038 <= x < 4.714942 ) weight=0.590727;
3666 if(4.714942 <= x < 5.318296 ) weight=0.585358;
3667 if(5.318296 <= x < 5.998859 ) weight=0.585257;
3668 if(5.998859 <= x < 6.766511 ) weight=0.580812;
3669 if(6.766511 <= x < 7.632396 ) weight=0.576207;
3670 if(7.632396 <= x < 8.609086 ) weight=0.575912;
3671 if(8.609086 <= x < 9.710759 ) weight=0.558718;
3672 if(9.710759 <= x < 10.953409 ) weight=0.555625;
3673 if(10.953409 <= x < 12.355077 ) weight=0.558886;
3674 if(12.355077 <= x < 13.936111 ) weight=0.545318;
3675 if(13.936111 <= x < 15.719464 ) weight=0.517607;
3676 if(15.719464 <= x < 17.731026 ) weight=0.512366;
3677 if(17.731026 <= x < 20.000000 ) weight=0.497034;
3684 //----------------------------------------------------------------------------
3685 //correction based on data only for pi0
3687 if(TMath::Abs(fMCparticleGMother->GetPdgCode())==111){
3689 if(0.100000 <= x < 0.112797 ) weight=1.262120;
3690 if(0.112797 <= x < 0.127231 ) weight=1.277765;
3691 if(0.127231 <= x < 0.143512 ) weight=1.295605;
3692 if(0.143512 <= x < 0.161877 ) weight=1.318155;
3693 if(0.161877 <= x < 0.182592 ) weight=1.348693;
3694 if(0.182592 <= x < 0.205957 ) weight=1.388636;
3695 if(0.205957 <= x < 0.232313 ) weight=1.439122;
3696 if(0.232313 <= x < 0.262041 ) weight=1.497452;
3697 if(0.262041 <= x < 0.295573 ) weight=1.559409;
3698 if(0.295573 <= x < 0.333397 ) weight=1.615169;
3699 if(0.333397 <= x < 0.376060 ) weight=1.654954;
3700 if(0.376060 <= x < 0.424183 ) weight=1.668753;
3701 if(0.424183 <= x < 0.478465 ) weight=1.652225;
3702 if(0.478465 <= x < 0.539692 ) weight=1.603119;
3703 if(0.539692 <= x < 0.608754 ) weight=1.526049;
3704 if(0.608754 <= x < 0.686654 ) weight=1.426724;
3705 if(0.686654 <= x < 0.774523 ) weight=1.312684;
3706 if(0.774523 <= x < 0.873636 ) weight=1.195395;
3707 if(0.873636 <= x < 0.985432 ) weight=1.086264;
3708 if(0.985432 <= x < 1.111534 ) weight=0.993666;
3709 if(1.111534 <= x < 1.253773 ) weight=0.922587;
3710 if(1.253773 <= x < 1.414214 ) weight=0.875739;
3711 if(1.414214 <= x < 1.595185 ) weight=0.852181;
3712 if(1.595185 <= x < 1.799315 ) weight=0.847828;
3713 if(1.799315 <= x < 2.029567 ) weight=0.863875;
3714 if(2.029567 <= x < 2.289283 ) weight=0.899112;
3715 if(2.289283 <= x < 2.582235 ) weight=0.955194;
3716 if(2.582235 <= x < 2.912674 ) weight=1.033824;
3717 if(2.912674 <= x < 3.285398 ) weight=1.133714;
3718 if(3.285398 <= x < 3.705818 ) weight=1.259471;
3719 if(3.705818 <= x < 4.180038 ) weight=1.406883;
3720 if(4.180038 <= x < 4.714942 ) weight=1.578923;
3721 if(4.714942 <= x < 5.318296 ) weight=1.778513;
3722 if(5.318296 <= x < 5.998859 ) weight=2.001171;
3723 if(5.998859 <= x < 6.766511 ) weight=2.223161;
3724 if(6.766511 <= x < 7.632396 ) weight=2.449445;
3725 if(7.632396 <= x < 8.609086 ) weight=2.661734;
3726 if(8.609086 <= x < 9.710759 ) weight=2.851935;
3727 if(9.710759 <= x < 10.953409 ) weight=2.974319;
3728 if(10.953409 <= x < 12.355077 ) weight=3.106314;
3729 if(12.355077 <= x < 13.936111 ) weight=3.126815;
3730 if(13.936111 <= x < 15.719464 ) weight=3.150053;
3731 if(15.719464 <= x < 17.731026 ) weight=3.218509;
3732 if(17.731026 <= x < 20.000000 ) weight=3.252141;
3737 //----------------------------------------------------------------------------
3742 if(fNonHFE->IsULS()) gmweight1=(fNonHFE->GetNULS())/weight;
3743 if(fNonHFE->IsLS()) gmweight2=(fNonHFE->GetNLS())/weight;
3746 if(fNonHFE->IsULS())fPtElec_ULS2_weight->Fill(fPtE, gmweight1);
3747 if(fNonHFE->IsLS())fPtElec_LS2_weight->Fill(fPtE, gmweight2);
3750 if(fNonHFE->IsULS()) fPtElec_ULS2_weight->Fill(fPtE,fNonHFE->GetNULS());
3751 if(fNonHFE->IsLS()) fPtElec_LS2_weight->Fill(fPtE,fNonHFE->GetNLS());
3754 //ULS with no weight from ULS-LS original
3755 // we have to know if track2 comes from same mother!!!
3756 if(fNonHFE->IsULS()){
3758 for(Int_t iTracks = 0; iTracks < fVevent->GetNumberOfTracks(); iTracks++)
3761 AliVParticle* Vtrack2 = fVevent->GetTrack(iTracks);
3764 printf("ERROR: Could not receive track %d\n", iTracks);
3767 AliVTrack *track2 = dynamic_cast<AliVTrack*>(Vtrack2);
3768 if(track2->GetLabel()<0) continue;
3769 fMCparticle2 = (AliAODMCParticle*) fMCarray->At(track2->GetLabel());
3770 if(fMCparticle2->GetMother()<0) continue;
3772 for(Int_t i = 0; i < fNonHFE->GetNULS(); i++)
3774 if(fUlsPartner[i]==iTracks){
3775 //only fill if it has same mother
3777 if(fMCparticle2->GetMother()==fMCparticle->GetMother()) fPtElec_ULS_MC->Fill(fPtE);
3779 //-----------------------------------------------------------------------------------------------------------
3782 Double_t mPt=fMCparticleMother->Pt();
3785 if(TMath::Abs(fMCparticleMother->GetPdgCode())==111){
3789 if(0.100000 <= x < 0.112797 ) weight=1.262120;
3790 if(0.112797 <= x < 0.127231 ) weight=1.277765;
3791 if(0.127231 <= x < 0.143512 ) weight=1.295605;
3792 if(0.143512 <= x < 0.161877 ) weight=1.318155;
3793 if(0.161877 <= x < 0.182592 ) weight=1.348693;
3794 if(0.182592 <= x < 0.205957 ) weight=1.388636;
3795 if(0.205957 <= x < 0.232313 ) weight=1.439122;
3796 if(0.232313 <= x < 0.262041 ) weight=1.497452;
3797 if(0.262041 <= x < 0.295573 ) weight=1.559409;
3798 if(0.295573 <= x < 0.333397 ) weight=1.615169;
3799 if(0.333397 <= x < 0.376060 ) weight=1.654954;
3800 if(0.376060 <= x < 0.424183 ) weight=1.668753;
3801 if(0.424183 <= x < 0.478465 ) weight=1.652225;
3802 if(0.478465 <= x < 0.539692 ) weight=1.603119;
3803 if(0.539692 <= x < 0.608754 ) weight=1.526049;
3804 if(0.608754 <= x < 0.686654 ) weight=1.426724;
3805 if(0.686654 <= x < 0.774523 ) weight=1.312684;
3806 if(0.774523 <= x < 0.873636 ) weight=1.195395;
3807 if(0.873636 <= x < 0.985432 ) weight=1.086264;
3808 if(0.985432 <= x < 1.111534 ) weight=0.993666;
3809 if(1.111534 <= x < 1.253773 ) weight=0.922587;
3810 if(1.253773 <= x < 1.414214 ) weight=0.875739;
3811 if(1.414214 <= x < 1.595185 ) weight=0.852181;
3812 if(1.595185 <= x < 1.799315 ) weight=0.847828;
3813 if(1.799315 <= x < 2.029567 ) weight=0.863875;
3814 if(2.029567 <= x < 2.289283 ) weight=0.899112;
3815 if(2.289283 <= x < 2.582235 ) weight=0.955194;
3816 if(2.582235 <= x < 2.912674 ) weight=1.033824;
3817 if(2.912674 <= x < 3.285398 ) weight=1.133714;
3818 if(3.285398 <= x < 3.705818 ) weight=1.259471;
3819 if(3.705818 <= x < 4.180038 ) weight=1.406883;
3820 if(4.180038 <= x < 4.714942 ) weight=1.578923;
3821 if(4.714942 <= x < 5.318296 ) weight=1.778513;
3822 if(5.318296 <= x < 5.998859 ) weight=2.001171;
3823 if(5.998859 <= x < 6.766511 ) weight=2.223161;
3824 if(6.766511 <= x < 7.632396 ) weight=2.449445;
3825 if(7.632396 <= x < 8.609086 ) weight=2.661734;
3826 if(8.609086 <= x < 9.710759 ) weight=2.851935;
3827 if(9.710759 <= x < 10.953409 ) weight=2.974319;
3828 if(10.953409 <= x < 12.355077 ) weight=3.106314;
3829 if(12.355077 <= x < 13.936111 ) weight=3.126815;
3830 if(13.936111 <= x < 15.719464 ) weight=3.150053;
3831 if(15.719464 <= x < 17.731026 ) weight=3.218509;
3832 if(17.731026 <= x < 20.000000 ) weight=3.252141;
3837 if(0.100000 <= x < 0.112797 ) weight2=1.030419;
3838 if(0.112797 <= x < 0.127231 ) weight2=1.044554;
3839 if(0.127231 <= x < 0.143512 ) weight2=1.062733;
3840 if(0.143512 <= x < 0.161877 ) weight2=1.085332;
3841 if(0.161877 <= x < 0.182592 ) weight2=1.115248;
3842 if(0.182592 <= x < 0.205957 ) weight2=1.153990;
3843 if(0.205957 <= x < 0.232313 ) weight2=1.201346;
3844 if(0.232313 <= x < 0.262041 ) weight2=1.257332;
3845 if(0.262041 <= x < 0.295573 ) weight2=1.315488;
3846 if(0.295573 <= x < 0.333397 ) weight2=1.369138;
3847 if(0.333397 <= x < 0.376060 ) weight2=1.407632;
3848 if(0.376060 <= x < 0.424183 ) weight2=1.422232;
3849 if(0.424183 <= x < 0.478465 ) weight2=1.406922;
3850 if(0.478465 <= x < 0.539692 ) weight2=1.360082;
3851 if(0.539692 <= x < 0.608754 ) weight2=1.284405;
3852 if(0.608754 <= x < 0.686654 ) weight2=1.182017;
3853 if(0.686654 <= x < 0.774523 ) weight2=1.062002;
3854 if(0.774523 <= x < 0.873636 ) weight2=0.935533;
3855 if(0.873636 <= x < 0.985432 ) weight2=0.816081;
3856 if(0.985432 <= x < 1.111534 ) weight2=0.717527;
3857 if(1.111534 <= x < 1.253773 ) weight2=0.647465;
3858 if(1.253773 <= x < 1.414214 ) weight2=0.607212;
3859 if(1.414214 <= x < 1.595185 ) weight2=0.589750;
3860 if(1.595185 <= x < 1.799315 ) weight2=0.587406;
3861 if(1.799315 <= x < 2.029567 ) weight2=0.592858;
3862 if(2.029567 <= x < 2.289283 ) weight2=0.601059;
3863 if(2.289283 <= x < 2.582235 ) weight2=0.608003;
3864 if(2.582235 <= x < 2.912674 ) weight2=0.611705;
3865 if(2.912674 <= x < 3.285398 ) weight2=0.610086;
3866 if(3.285398 <= x < 3.705818 ) weight2=0.605015;
3867 if(3.705818 <= x < 4.180038 ) weight2=0.596299;
3868 if(4.180038 <= x < 4.714942 ) weight2=0.590727;
3869 if(4.714942 <= x < 5.318296 ) weight2=0.585358;
3870 if(5.318296 <= x < 5.998859 ) weight2=0.585257;
3871 if(5.998859 <= x < 6.766511 ) weight2=0.580812;
3872 if(6.766511 <= x < 7.632396 ) weight2=0.576207;
3873 if(7.632396 <= x < 8.609086 ) weight2=0.575912;
3874 if(8.609086 <= x < 9.710759 ) weight2=0.558718;
3875 if(9.710759 <= x < 10.953409 ) weight2=0.555625;
3876 if(10.953409 <= x < 12.355077 ) weight2=0.558886;
3877 if(12.355077 <= x < 13.936111 ) weight2=0.545318;
3878 if(13.936111 <= x < 15.719464 ) weight2=0.517607;
3879 if(15.719464 <= x < 17.731026 ) weight2=0.512366;
3880 if(17.731026 <= x < 20.000000 ) weight2=0.497034;
3886 //weight for grandmother
3887 Double_t gmPt=fMCparticleGMother->Pt();
3888 if(TMath::Abs((fMCparticleMother->GetMother()>0) && ((fMCparticleGMother->GetPdgCode())==111))){
3892 if(0.100000 <= x < 0.112797 ) weight=1.262120;
3893 if(0.112797 <= x < 0.127231 ) weight=1.277765;
3894 if(0.127231 <= x < 0.143512 ) weight=1.295605;
3895 if(0.143512 <= x < 0.161877 ) weight=1.318155;
3896 if(0.161877 <= x < 0.182592 ) weight=1.348693;
3897 if(0.182592 <= x < 0.205957 ) weight=1.388636;
3898 if(0.205957 <= x < 0.232313 ) weight=1.439122;
3899 if(0.232313 <= x < 0.262041 ) weight=1.497452;
3900 if(0.262041 <= x < 0.295573 ) weight=1.559409;
3901 if(0.295573 <= x < 0.333397 ) weight=1.615169;
3902 if(0.333397 <= x < 0.376060 ) weight=1.654954;
3903 if(0.376060 <= x < 0.424183 ) weight=1.668753;
3904 if(0.424183 <= x < 0.478465 ) weight=1.652225;
3905 if(0.478465 <= x < 0.539692 ) weight=1.603119;
3906 if(0.539692 <= x < 0.608754 ) weight=1.526049;
3907 if(0.608754 <= x < 0.686654 ) weight=1.426724;
3908 if(0.686654 <= x < 0.774523 ) weight=1.312684;
3909 if(0.774523 <= x < 0.873636 ) weight=1.195395;
3910 if(0.873636 <= x < 0.985432 ) weight=1.086264;
3911 if(0.985432 <= x < 1.111534 ) weight=0.993666;
3912 if(1.111534 <= x < 1.253773 ) weight=0.922587;
3913 if(1.253773 <= x < 1.414214 ) weight=0.875739;
3914 if(1.414214 <= x < 1.595185 ) weight=0.852181;
3915 if(1.595185 <= x < 1.799315 ) weight=0.847828;
3916 if(1.799315 <= x < 2.029567 ) weight=0.863875;
3917 if(2.029567 <= x < 2.289283 ) weight=0.899112;
3918 if(2.289283 <= x < 2.582235 ) weight=0.955194;
3919 if(2.582235 <= x < 2.912674 ) weight=1.033824;
3920 if(2.912674 <= x < 3.285398 ) weight=1.133714;
3921 if(3.285398 <= x < 3.705818 ) weight=1.259471;
3922 if(3.705818 <= x < 4.180038 ) weight=1.406883;
3923 if(4.180038 <= x < 4.714942 ) weight=1.578923;
3924 if(4.714942 <= x < 5.318296 ) weight=1.778513;
3925 if(5.318296 <= x < 5.998859 ) weight=2.001171;
3926 if(5.998859 <= x < 6.766511 ) weight=2.223161;
3927 if(6.766511 <= x < 7.632396 ) weight=2.449445;
3928 if(7.632396 <= x < 8.609086 ) weight=2.661734;
3929 if(8.609086 <= x < 9.710759 ) weight=2.851935;
3930 if(9.710759 <= x < 10.953409 ) weight=2.974319;
3931 if(10.953409 <= x < 12.355077 ) weight=3.106314;
3932 if(12.355077 <= x < 13.936111 ) weight=3.126815;
3933 if(13.936111 <= x < 15.719464 ) weight=3.150053;
3934 if(15.719464 <= x < 17.731026 ) weight=3.218509;
3935 if(17.731026 <= x < 20.000000 ) weight=3.252141;
3940 if(0.100000 <= x < 0.112797 ) weight2=1.030419;
3941 if(0.112797 <= x < 0.127231 ) weight2=1.044554;
3942 if(0.127231 <= x < 0.143512 ) weight2=1.062733;
3943 if(0.143512 <= x < 0.161877 ) weight2=1.085332;
3944 if(0.161877 <= x < 0.182592 ) weight2=1.115248;
3945 if(0.182592 <= x < 0.205957 ) weight2=1.153990;
3946 if(0.205957 <= x < 0.232313 ) weight2=1.201346;
3947 if(0.232313 <= x < 0.262041 ) weight2=1.257332;
3948 if(0.262041 <= x < 0.295573 ) weight2=1.315488;
3949 if(0.295573 <= x < 0.333397 ) weight2=1.369138;
3950 if(0.333397 <= x < 0.376060 ) weight2=1.407632;
3951 if(0.376060 <= x < 0.424183 ) weight2=1.422232;
3952 if(0.424183 <= x < 0.478465 ) weight2=1.406922;
3953 if(0.478465 <= x < 0.539692 ) weight2=1.360082;
3954 if(0.539692 <= x < 0.608754 ) weight2=1.284405;
3955 if(0.608754 <= x < 0.686654 ) weight2=1.182017;
3956 if(0.686654 <= x < 0.774523 ) weight2=1.062002;
3957 if(0.774523 <= x < 0.873636 ) weight2=0.935533;
3958 if(0.873636 <= x < 0.985432 ) weight2=0.816081;
3959 if(0.985432 <= x < 1.111534 ) weight2=0.717527;
3960 if(1.111534 <= x < 1.253773 ) weight2=0.647465;
3961 if(1.253773 <= x < 1.414214 ) weight2=0.607212;
3962 if(1.414214 <= x < 1.595185 ) weight2=0.589750;
3963 if(1.595185 <= x < 1.799315 ) weight2=0.587406;
3964 if(1.799315 <= x < 2.029567 ) weight2=0.592858;
3965 if(2.029567 <= x < 2.289283 ) weight2=0.601059;
3966 if(2.289283 <= x < 2.582235 ) weight2=0.608003;
3967 if(2.582235 <= x < 2.912674 ) weight2=0.611705;
3968 if(2.912674 <= x < 3.285398 ) weight2=0.610086;
3969 if(3.285398 <= x < 3.705818 ) weight2=0.605015;
3970 if(3.705818 <= x < 4.180038 ) weight2=0.596299;
3971 if(4.180038 <= x < 4.714942 ) weight2=0.590727;
3972 if(4.714942 <= x < 5.318296 ) weight2=0.585358;
3973 if(5.318296 <= x < 5.998859 ) weight2=0.585257;
3974 if(5.998859 <= x < 6.766511 ) weight2=0.580812;
3975 if(6.766511 <= x < 7.632396 ) weight2=0.576207;
3976 if(7.632396 <= x < 8.609086 ) weight2=0.575912;
3977 if(8.609086 <= x < 9.710759 ) weight2=0.558718;
3978 if(9.710759 <= x < 10.953409 ) weight2=0.555625;
3979 if(10.953409 <= x < 12.355077 ) weight2=0.558886;
3980 if(12.355077 <= x < 13.936111 ) weight2=0.545318;
3981 if(13.936111 <= x < 15.719464 ) weight2=0.517607;
3982 if(15.719464 <= x < 17.731026 ) weight2=0.512366;
3983 if(17.731026 <= x < 20.000000 ) weight2=0.497034;
3988 if(fMCparticle2->GetMother()==fMCparticle->GetMother()) fPtElec_ULS_MC_weight->Fill(fPtE, 1./weight2);
3990 //-----------------------------------------------------------------------------------------------------------
3993 }//partner found same as track
3994 }//loop in all partner
4004 //ULS-LS with no pid AOD
4005 if(fNonHFE->IsULS()) fPtElec_ULS_NoPid->Fill(fPtE,fNonHFE->GetNULS());
4006 if(fNonHFE->IsLS()) fPtElec_LS_NoPid->Fill(fPtE,fNonHFE->GetNLS());
4013 if(TMath::Abs(fMCtrack->GetPdgCode())==11 && (TMath::Abs(fMCtrackMother->GetPdgCode())==22 || TMath::Abs(fMCtrackMother->GetPdgCode())==111 || TMath::Abs(fMCtrackMother->GetPdgCode())==221))
4016 if(fNonHFE->IsULS()) fPtElec_ULS->Fill(fPtE,fNonHFE->GetNULS());
4017 if(fNonHFE->IsLS()) fPtElec_LS->Fill(fPtE,fNonHFE->GetNLS());
4021 if(fNonHFE->IsULS()) fPtElec_ULS2->Fill(fPtE,fNonHFE->GetNULS());
4022 if(fNonHFE->IsLS()) fPtElec_LS2->Fill(fPtE,fNonHFE->GetNLS());
4029 ///_________________________________________________________________
4034 if(fNonHFE->IsULS()) fPtElec_ULS->Fill(fPtE,fNonHFE->GetNULS());
4035 if(fNonHFE->IsLS()) fPtElec_LS->Fill(fPtE,fNonHFE->GetNLS());
4039 if(fNonHFE->IsULS()) fPtElec_ULS2->Fill(fPtE,fNonHFE->GetNULS());
4040 if(fNonHFE->IsLS()) fPtElec_LS2->Fill(fPtE,fNonHFE->GetNLS());
4046 }//end of Background function
4048 //______________________________________________________________________
4049 void AliAnalysisTaskEMCalHFEpA::ElectronHadronCorrelation(AliVTrack *track, Int_t trackIndex, AliVParticle *vtrack)
4052 ///_________________________________________________________________
4056 if(track->GetLabel() < 0)
4058 AliWarning(Form("The track %d does not have a valid MC label",trackIndex));
4064 fMCparticle = (AliAODMCParticle*) fMCarray->At(track->GetLabel());
4066 if(fMCparticle->GetMother()<0) return;
4068 fMCparticleMother = (AliAODMCParticle*) fMCarray->At(fMCparticle->GetMother());
4070 if(TMath::Abs(fMCparticle->GetPdgCode())==11 && (TMath::Abs(fMCparticleMother->GetPdgCode())==22 || TMath::Abs(fMCparticleMother->GetPdgCode())==111 || TMath::Abs(fMCparticleMother->GetPdgCode())==221))
4073 fPtBackgroundBeforeReco->Fill(track->Pt());
4078 fMCtrack = fMCstack->Particle(track->GetLabel());
4080 if(fMCtrack->GetFirstMother()<0) return;
4082 fMCtrackMother = fMCstack->Particle(fMCtrack->GetFirstMother());
4084 if(TMath::Abs(fMCtrack->GetPdgCode())==11 && (TMath::Abs(fMCtrackMother->GetPdgCode())==22 || TMath::Abs(fMCtrackMother->GetPdgCode())==111 || TMath::Abs(fMCtrackMother->GetPdgCode())==221))
4087 fPtBackgroundBeforeReco->Fill(track->Pt());
4091 ///_________________________________________________________________
4093 //________________________________________________
4094 //Associated particle cut
4095 fPartnerCuts->SetAcceptKinkDaughters(kFALSE);
4096 fPartnerCuts->SetRequireITSRefit(kTRUE);
4097 fPartnerCuts->SetRequireTPCRefit(kTRUE);
4098 fPartnerCuts->SetEtaRange(-0.9,0.9);
4099 fPartnerCuts->SetMaxChi2PerClusterTPC(4.0);
4100 fPartnerCuts->SetMinNClustersTPC(80);
4101 fPartnerCuts->SetPtRange(0.3,1e10);
4102 //fPartnerCuts->SetRequireSigmaToVertex(kTRUE);
4103 //fPartnerCuts->SetMaxDCAToVertexXY(1);
4104 //fPartnerCuts->SetMaxDCAToVertexZ(3);
4105 //_________________________________________________
4107 ///#################################################################
4108 //Non-HFE reconstruction
4109 fNonHFE = new AliSelectNonHFE();
4110 fNonHFE->SetAODanalysis(fIsAOD);
4111 if(fMassCutFlag) fNonHFE->SetInvariantMassCut(fMassCut);
4112 if(fAngleCutFlag) fNonHFE->SetOpeningAngleCut(fAngleCut);
4113 if(fChi2CutFlag) fNonHFE->SetChi2OverNDFCut(fChi2Cut);
4114 if(fDCAcutFlag) fNonHFE->SetDCACut(fDCAcut);
4115 fNonHFE->SetAlgorithm("DCA"); //KF
4116 fNonHFE->SetPIDresponse(fPidResponse);
4117 fNonHFE->SetTrackCuts(-3.5,3.5,fPartnerCuts);
4118 fNonHFE->SetAdditionalCuts(fPtMinAsso,fTpcNclsAsso);
4121 fNonHFE->SetHistAngleBack(fOpAngleBack);
4122 fNonHFE->SetHistAngle(fOpAngle);
4123 fNonHFE->SetHistDCABack(fDCABack);
4124 fNonHFE->SetHistDCA(fDCA);
4125 fNonHFE->SetHistMassBack(fInvMassBack);
4126 fNonHFE->SetHistMass(fInvMass);
4128 fNonHFE->FindNonHFE(trackIndex,vtrack,fVevent);
4130 Int_t *fUlsPartner = fNonHFE->GetPartnersULS();
4131 Int_t *fLsPartner = fNonHFE->GetPartnersLS();
4132 Bool_t fUlsIsPartner = kFALSE;
4133 Bool_t fLsIsPartner = kFALSE;
4134 ///#################################################################
4137 //Electron Information
4138 Double_t fPhiE = -999;
4139 Double_t fEtaE = -999;
4140 Double_t fPhiH = -999;
4141 Double_t fEtaH = -999;
4142 Double_t fDphi = -999;
4143 Double_t fDeta = -999;
4144 Double_t fPtE = -999;
4145 Double_t fPtH = -999;
4147 Double_t pi = TMath::Pi();
4149 fPhiE = track->Phi();
4150 fEtaE = track->Eta();
4154 ///_________________________________________________________________
4160 if(TMath::Abs(fMCparticle->GetPdgCode())==11 && (TMath::Abs(fMCparticleMother->GetPdgCode())==22 || TMath::Abs(fMCparticleMother->GetPdgCode())==111 || TMath::Abs(fMCparticleMother->GetPdgCode())==221))
4162 if(fNonHFE->IsULS()) fPtElec_ULS->Fill(fPtE,fNonHFE->GetNULS());
4163 if(fNonHFE->IsLS()) fPtElec_LS->Fill(fPtE,fNonHFE->GetNLS());
4168 if(fNonHFE->IsULS()) fPtElec_ULS_NoPid->Fill(fPtE,fNonHFE->GetNULS());
4169 if(fNonHFE->IsLS()) fPtElec_LS_NoPid->Fill(fPtE,fNonHFE->GetNLS());
4173 if(TMath::Abs(fMCtrack->GetPdgCode())==11 && (TMath::Abs(fMCtrackMother->GetPdgCode())==22 || TMath::Abs(fMCtrackMother->GetPdgCode())==111 || TMath::Abs(fMCtrackMother->GetPdgCode())==221))
4175 if(fNonHFE->IsULS()) fPtElec_ULS->Fill(fPtE,fNonHFE->GetNULS());
4176 if(fNonHFE->IsLS()) fPtElec_LS->Fill(fPtE,fNonHFE->GetNLS());
4183 ///_________________________________________________________________
4186 if(fNonHFE->IsULS()) fPtElec_ULS->Fill(fPtE,fNonHFE->GetNULS());
4187 if(fNonHFE->IsLS()) fPtElec_LS->Fill(fPtE,fNonHFE->GetNLS());
4193 //__________________________________________________________________
4194 //Event Mixing Analysis - Hadron Loop
4196 if(fEventMixingFlag)
4198 fPool = fPoolMgr->GetEventPool(fCentrality->GetCentralityPercentile("V0A"), fZvtx); // Get the buffer associated with the current centrality and z-vtx
4200 if(!fPool) AliFatal(Form("No pool found for centrality = %f, zVtx = %f",fCentrality->GetCentralityPercentile("V0A"), fZvtx));
4202 if(fPool->GetCurrentNEvents() >= 5) // start mixing when 5 events are in the buffer
4204 fPoolNevents->Fill(fPool->GetCurrentNEvents());
4206 for (Int_t jMix = 0; jMix < fPool->GetCurrentNEvents(); jMix++) // mix with each event in the buffer
4208 TObjArray* bgTracks = fPool->GetEvent(jMix);
4210 for (Int_t kMix = 0; kMix < bgTracks->GetEntriesFast(); kMix++) // mix with each track in the event
4212 const AliEHCParticle* MixedTrack(dynamic_cast<AliEHCParticle*>(bgTracks->At(kMix)));
4213 if (NULL == MixedTrack) continue;
4215 fPhiH = MixedTrack->Phi();
4216 fEtaH = MixedTrack->Eta();
4217 fPtH = MixedTrack->Pt();
4219 if(fPtH<fAssHadronPtMin || fPtH>fAssHadronPtMax) continue;
4221 fDphi = fPhiE - fPhiH;
4223 if (fDphi > 3*pi/2) fDphi = fDphi - 2*pi;
4224 if (fDphi < -pi/2) fDphi = fDphi + 2*pi;
4226 fDeta = fEtaE - fEtaH;
4228 Double_t fPtBin[7] = {1,2,4,6,8,10,15};
4230 for(Int_t i = 0; i < 6; i++)
4232 if(fPtE>=fPtBin[i] && fPtE<fPtBin[i+1])
4234 fCEtaPhi_Inc_EM[i]->Fill(fDphi,fDeta);
4236 if(fNonHFE->IsULS()) fCEtaPhi_ULS_EM[i]->Fill(fDphi,fDeta);
4237 if(fNonHFE->IsLS()) fCEtaPhi_LS_EM[i]->Fill(fDphi,fDeta);
4239 if(fNonHFE->IsULS()) fCEtaPhi_ULS_Weight_EM[i]->Fill(fDphi,fDeta,fNonHFE->GetNULS());
4240 if(fNonHFE->IsLS()) fCEtaPhi_LS_Weight_EM[i]->Fill(fDphi,fDeta,fNonHFE->GetNLS());
4244 // TODO your code: do event mixing with current event and bgTracks
4245 // note that usually the content filled now is weighted by 1 / pool->GetCurrentNEvents()
4250 //__________________________________________________________________
4252 //__________________________________________________________________
4253 //Same Event Analysis - Hadron Loop
4254 for(Int_t iTracks = 0; iTracks < fVevent->GetNumberOfTracks(); iTracks++)
4256 if(trackIndex==iTracks) continue;
4258 AliVParticle* Vtrack2 = fVevent->GetTrack(iTracks);
4261 printf("ERROR: Could not receive track %d\n", iTracks);
4265 AliVTrack *track2 = dynamic_cast<AliVTrack*>(Vtrack2);
4267 if(track2->Eta()<fEtaCutMin || track2->Eta()>fEtaCutMax ) continue;
4271 AliAODTrack *atrack2 = dynamic_cast<AliAODTrack*>(Vtrack2);
4272 if(!atrack2->TestFilterMask(AliAODTrack::kTrkTPCOnly)) continue;
4273 if((!(atrack2->GetStatus()&AliESDtrack::kITSrefit)|| (!(atrack2->GetStatus()&AliESDtrack::kTPCrefit)))) continue;
4274 if(atrack2->GetTPCNcls() < 80) continue;
4275 if(fAssocWithSPD && ((!(atrack2->HasPointOnITSLayer(0))) && (!(atrack2->HasPointOnITSLayer(1))))) continue;
4279 AliESDtrack *etrack2 = dynamic_cast<AliESDtrack*>(Vtrack2);
4280 if(!fPartnerCuts->AcceptTrack(etrack2)) continue;
4283 fPhiH = track2->Phi();
4284 fEtaH = track2->Eta();
4285 fPtH = track2->Pt();
4287 if(fPtH<fAssHadronPtMin || fPtH>fAssHadronPtMax) continue;
4289 fDphi = fPhiE - fPhiH;
4291 if (fDphi > 3*pi/2) fDphi = fDphi - 2*pi;
4292 if (fDphi < -pi/2) fDphi = fDphi + 2*pi;
4294 fDeta = fEtaE - fEtaH;
4296 Double_t fPtBin[7] = {1,2,4,6,8,10,15};
4298 //______________________________________________________________
4299 //Check if this track is a Non-HFE partner
4300 for(Int_t i = 0; i < fNonHFE->GetNULS(); i++)
4302 if(fUlsPartner[i]==iTracks) fUlsIsPartner=kTRUE;
4304 for(Int_t i = 0; i < fNonHFE->GetNLS(); i++)
4306 if(fLsPartner[i]==iTracks) fLsIsPartner=kTRUE;
4308 //______________________________________________________________
4310 for(Int_t i = 0; i < 6; i++)
4312 if(fPtE>=fPtBin[i] && fPtE<fPtBin[i+1])
4314 fCEtaPhi_Inc[i]->Fill(fDphi,fDeta);
4316 if(fNonHFE->IsULS()) fCEtaPhi_ULS[i]->Fill(fDphi,fDeta);
4317 if(fNonHFE->IsLS()) fCEtaPhi_LS[i]->Fill(fDphi,fDeta);
4318 if(fNonHFE->IsULS() && !fUlsIsPartner) fCEtaPhi_ULS_NoP[i]->Fill(fDphi,fDeta);
4319 if(fNonHFE->IsLS() && !fLsIsPartner) fCEtaPhi_LS_NoP[i]->Fill(fDphi,fDeta);
4321 if(fNonHFE->IsULS()) fCEtaPhi_ULS_Weight[i]->Fill(fDphi,fDeta,fNonHFE->GetNULS());
4322 if(fNonHFE->IsLS()) fCEtaPhi_LS_Weight[i]->Fill(fDphi,fDeta,fNonHFE->GetNLS());
4323 if(fNonHFE->IsULS() && !fUlsIsPartner) fCEtaPhi_ULS_NoP_Weight[i]->Fill(fDphi,fDeta,fNonHFE->GetNULS());
4324 if(fNonHFE->IsLS() && !fLsIsPartner) fCEtaPhi_LS_NoP_Weight[i]->Fill(fDphi,fDeta,fNonHFE->GetNLS());
4330 //____________________________________________________________________________________________________________
4331 //Create a TObjArray with selected hadrons, for the mixed event analysis
4332 TObjArray* AliAnalysisTaskEMCalHFEpA::SelectedHadrons()
4334 fTracksClone = new TObjArray;
4335 fTracksClone->SetOwner(kTRUE);
4337 for(Int_t iTracks = 0; iTracks < fVevent->GetNumberOfTracks(); iTracks++)
4339 AliVParticle* Vtrack2 = fVevent->GetTrack(iTracks);
4342 printf("ERROR: Could not receive track %d\n", iTracks);
4346 AliVTrack *track2 = dynamic_cast<AliVTrack*>(Vtrack2);
4348 if(track2->Eta()<fEtaCutMin || track2->Eta()>fEtaCutMax ) continue;
4352 AliAODTrack *atrack2 = dynamic_cast<AliAODTrack*>(Vtrack2);
4353 if(!atrack2->TestFilterMask(AliAODTrack::kTrkTPCOnly)) continue;
4354 if((!(atrack2->GetStatus()&AliESDtrack::kITSrefit)|| (!(atrack2->GetStatus()&AliESDtrack::kTPCrefit)))) continue;
4355 if(atrack2->GetTPCNcls() < 80) continue;
4356 if(fAssocWithSPD && ((!(atrack2->HasPointOnITSLayer(0))) && (!(atrack2->HasPointOnITSLayer(1))))) continue;
4360 AliESDtrack *etrack2 = dynamic_cast<AliESDtrack*>(Vtrack2);
4361 if(!fPartnerCuts->AcceptTrack(etrack2)) continue;
4364 fTracksClone->Add(new AliEHCParticle(track2->Eta(), track2->Phi(), track2->Pt()));
4366 return fTracksClone;
4368 //____________________________________________________________________________________________________________
4370 //______________________________________________________________________
4371 void AliAnalysisTaskEMCalHFEpA::DiHadronCorrelation(AliVTrack *track, Int_t trackIndex)
4373 //________________________________________________
4374 //Associated particle cut
4375 fPartnerCuts->SetAcceptKinkDaughters(kFALSE);
4376 fPartnerCuts->SetRequireITSRefit(kTRUE);
4377 fPartnerCuts->SetRequireTPCRefit(kTRUE);
4378 fPartnerCuts->SetEtaRange(-0.9,0.9);
4379 fPartnerCuts->SetMaxChi2PerClusterTPC(4.0);
4380 fPartnerCuts->SetMinNClustersTPC(80);
4381 fPartnerCuts->SetPtRange(0.3,1e10);
4382 //fPartnerCuts->SetRequireSigmaToVertex(kTRUE);
4383 //fPartnerCuts->SetMaxDCAToVertexXY(1);
4384 //fPartnerCuts->SetMaxDCAToVertexZ(3);
4385 //_________________________________________________
4387 //Electron Information
4388 Double_t fPhiE = -999;
4389 Double_t fEtaE = -999;
4390 Double_t fPhiH = -999;
4391 Double_t fEtaH = -999;
4392 Double_t fDphi = -999;
4393 Double_t fDeta = -999;
4394 Double_t fPtE = -999;
4395 Double_t fPtH = -999;
4397 Double_t pi = TMath::Pi();
4399 fPhiE = track->Phi();
4400 fEtaE = track->Eta();
4403 //__________________________________________________________________
4404 //Same Event Analysis - Hadron Loop
4405 for(Int_t iTracks = 0; iTracks < fVevent->GetNumberOfTracks(); iTracks++)
4407 if(trackIndex==iTracks) continue;
4409 AliVParticle* Vtrack2 = fVevent->GetTrack(iTracks);
4412 printf("ERROR: Could not receive track %d\n", iTracks);
4416 AliVTrack *track2 = dynamic_cast<AliVTrack*>(Vtrack2);
4417 if(track2->Eta()<fEtaCutMin || track2->Eta()>fEtaCutMax ) continue;
4421 AliAODTrack *atrack2 = dynamic_cast<AliAODTrack*>(Vtrack2);
4422 if(!atrack2->TestFilterMask(AliAODTrack::kTrkTPCOnly)) continue;
4423 if((!(atrack2->GetStatus()&AliESDtrack::kITSrefit)|| (!(atrack2->GetStatus()&AliESDtrack::kTPCrefit)))) continue;
4424 if(atrack2->GetTPCNcls() < 80) continue;
4425 if(fAssocWithSPD && ((!(atrack2->HasPointOnITSLayer(0))) && (!(atrack2->HasPointOnITSLayer(1))))) continue;
4429 AliESDtrack *etrack2 = dynamic_cast<AliESDtrack*>(Vtrack2);
4430 if(!fPartnerCuts->AcceptTrack(etrack2)) continue;
4433 fPhiH = track2->Phi();
4434 fEtaH = track2->Eta();
4435 fPtH = track2->Pt();
4437 if(fPtH<fAssHadronPtMin || fPtH>fAssHadronPtMax) continue;
4439 fDphi = fPhiE - fPhiH;
4441 if (fDphi > 3*pi/2) fDphi = fDphi - 2*pi;
4442 if (fDphi < -pi/2) fDphi = fDphi + 2*pi;
4444 fDeta = fEtaE - fEtaH;
4446 Double_t fPtBin[7] = {1,2,4,6,8,10,15};
4448 for(Int_t i = 0; i < 6; i++)
4450 if(fPtE>=fPtBin[i] && fPtE<fPtBin[i+1])
4452 fCEtaPhi_Inc_DiHadron[i]->Fill(fDphi,fDeta);
4457 //____________________________________________________________________________________________________________
4459 //______________________________________________________________________
4460 Bool_t AliAnalysisTaskEMCalHFEpA::FindMother(Int_t mcIndex)
4467 fIsFromPi0 = kFALSE;
4468 fIsFromEta = kFALSE;
4469 fIsFromGamma = kFALSE;
4471 if(mcIndex < 0 || !fIsMC)
4477 Int_t mpdg = -99999;
4478 Int_t gmpdg = -99999;
4479 Int_t ggmpdg = -99999;
4480 Int_t gggmpdg = -99999;
4484 fMCparticle = (AliAODMCParticle*) fMCarray->At(mcIndex);
4486 pdg = TMath::Abs(fMCparticle->GetPdgCode());
4496 fIsFromPi0 = kFALSE;
4497 fIsFromEta = kFALSE;
4498 fIsFromGamma = kFALSE;
4502 if(fMCparticle->GetMother()<0)
4509 fIsFromPi0 = kFALSE;
4510 fIsFromEta = kFALSE;
4511 fIsFromGamma = kFALSE;
4515 fMCparticleMother = (AliAODMCParticle*) fMCarray->At(fMCparticle->GetMother());
4516 mpdg = TMath::Abs(fMCparticleMother->GetPdgCode());
4518 if(fMCparticleMother->GetMother()<0)
4526 fMCparticleGMother = (AliAODMCParticle*) fMCarray->At(fMCparticleMother->GetMother());
4527 gmpdg = TMath::Abs(fMCparticleGMother->GetPdgCode());
4528 if(fMCparticleGMother->GetMother()<0)
4535 fMCparticleGGMother = (AliAODMCParticle*) fMCarray->At(fMCparticleGMother->GetMother());
4536 ggmpdg = TMath::Abs(fMCparticleGGMother->GetPdgCode());
4537 if(fMCparticleGGMother->GetMother()<0)
4543 fMCparticleGGGMother = (AliAODMCParticle*) fMCarray->At(fMCparticleGGMother->GetMother());
4544 gggmpdg = TMath::Abs(fMCparticleGGGMother->GetPdgCode());
4551 fMCtrack = fMCstack->Particle(mcIndex);
4553 pdg = TMath::Abs(fMCtrack->GetPdgCode());
4562 fIsFromPi0 = kFALSE;
4563 fIsFromEta = kFALSE;
4564 fIsFromGamma = kFALSE;
4568 if(fMCtrack->GetFirstMother()<0)
4575 fIsFromPi0 = kFALSE;
4576 fIsFromEta = kFALSE;
4577 fIsFromGamma = kFALSE;
4581 fMCtrackMother = fMCstack->Particle(fMCtrack->GetFirstMother());
4582 mpdg = TMath::Abs(fMCtrackMother->GetPdgCode());
4584 if(fMCtrackMother->GetFirstMother()<0)
4592 fMCtrackGMother = fMCstack->Particle(fMCtrackMother->GetFirstMother());
4593 gmpdg = TMath::Abs(fMCtrackGMother->GetPdgCode());
4595 if(fMCtrackGMother->GetFirstMother()<0)
4602 fMCtrackGGMother = fMCstack->Particle(fMCtrackGMother->GetFirstMother());
4603 ggmpdg = TMath::Abs(fMCtrackGGMother->GetPdgCode());
4605 if(fMCtrackGGMother->GetFirstMother()<0)
4611 fMCtrackGGGMother = fMCstack->Particle(fMCtrackGGMother->GetFirstMother());
4612 gggmpdg = TMath::Abs(fMCtrackGGGMother->GetPdgCode());
4618 //Tag Electron Source
4619 if(mpdg==111 || mpdg==221 || mpdg==22)
4627 fIsFromPi0 = kFALSE;
4628 fIsFromEta = kFALSE;
4629 fIsFromGamma = kFALSE;
4631 if(mpdg==111) fIsFromPi0 = kFALSE;
4632 if(mpdg==221)fIsFromEta = kFALSE;
4633 if(mpdg==22) fIsFromGamma = kFALSE;
4642 fIsFromPi0 = kFALSE;
4643 fIsFromEta = kFALSE;
4644 fIsFromGamma = kFALSE;
4651 if(mpdg>400 && mpdg<500)
4653 if((gmpdg>500 && gmpdg<600) || (ggmpdg>500 && ggmpdg<600) || (gggmpdg>500 && gggmpdg<600))
4668 else if(mpdg>500 && mpdg<600)