ATLAS Offline Software
ZeePlots.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 using CLHEP::GeV;
8 
9 namespace ZeeValidation{
10 
11  ZeePlots::ZeePlots(PlotBase* pParent, std::string sDir, std::string sParticleType):
12  PlotBase(pParent, sDir),
13  m_sParticleType(sParticleType),
14  h_n_el(NULL)
15  {
16  for (int i = 0; i < nLevels; i++) {
17  h_z_mass[i] = NULL;
18  h_z_pt[i] = NULL;
19  h_z_y[i] = NULL;
20  h_dr_electrons[i] = NULL;
21  h_ptclust_electron1[i] = NULL;
22  h_ptclust_electron2[i] = NULL;
23  h_etaclust_electron1[i] = NULL;
24  h_etaclust_electron2[i] = NULL;
25  h_ptclust_electrons[i] = NULL;
26  h_etaclust_electrons[i] = NULL;
27  h_pt_electrons[i] = NULL;
28  h_eta_electrons[i] = NULL;
29  h_phi_electrons[i] = NULL;
30  h_eoverp_electrons[i] = NULL;
31  h_eoverpq_electrons[i] = NULL;
32  }
33  }
34 
35  const std::string ZeePlots::cLevelLabel[nLevels] = {
36  "Reco_OS",
37  "OQ_OS",
38  "Loose_OS",
39  "Medium_OS",
40  "Tight_OS",
41  "Reco_SS",
42  "OQ_SS",
43  "Loose_SS",
44  "Medium_SS",
45  "Tight_SS"
46  };
47 
49 
50  h_n_el = Book1D("NElectrons", "Number of electrons; Number ;Events", 10, -0.5, 9.5);
51 
52  for (int i = 0; i < nLevels; i++) {
53 
54  h_z_mass[i] = Book1D("ZMass"+ cLevelLabel[i], "Mass of Z; Mass (GeV) ;Events", 50, 66., 116.);
55  h_z_pt[i] = Book1D("ZPt"+ cLevelLabel[i], "P_{T} of Z; P_{T} ;Events", 60, 0., 120.);
56  h_z_y[i] = Book1D("ZY"+ cLevelLabel[i], "#eta of Z; #eta ;Events", 100, -5., 5.);
57 
58  h_dr_electrons[i] = Book1D("DRElectrons"+ cLevelLabel[i], " #DeltaR(electrons) ;Events", 50, 0., 6.);
59 
60  h_ptclust_electron1[i] = Book1D("PtClustElectron1"+ cLevelLabel[i], " P_{T}(el cluster_{1}) ;Events", 60, 20., 140.);
61  h_ptclust_electron2[i] = Book1D("PtClustElectron2"+ cLevelLabel[i], " P_{T}(el cluster_{2}) ;Events", 60, 20., 140.);
62  h_etaclust_electron1[i] = Book1D("EtaClustElectron1"+ cLevelLabel[i], " #eta(el cluster_{1}) ;Events", 50, -2.5, 2.5);
63  h_etaclust_electron2[i] = Book1D("EtaClustElectron2"+ cLevelLabel[i], " #eta(el cluster_{2}) ;Events", 50, -2.5, 2.5);
64 
65  h_ptclust_electrons[i] = Book1D("PtClust_Electrons"+ cLevelLabel[i], " P_{T}(el clusters) ;Events", 60, 20., 140.);
66  h_etaclust_electrons[i] = Book1D("EtaClustElectrons"+ cLevelLabel[i], " #eta(el clusters) ;Events", 50, -2.5, 2.5);
67  h_pt_electrons[i] = Book1D("PtElectrons"+ cLevelLabel[i], " P_{T}(electrons) ;Events", 60, 20., 140.);
68  h_eta_electrons[i] = Book1D("EtaElectrons"+ cLevelLabel[i], " #eta(electrons) ;Events", 50, -2.5, 2.5);
69  h_phi_electrons[i] = Book1D("PhiElectrons"+ cLevelLabel[i], " #varphi(electrons) ;Events", 60, -TMath::Pi(), TMath::Pi());
70  h_eoverp_electrons[i] = Book1D("EoverPElectrons"+ cLevelLabel[i], " E/p ;Events", 50, 0., 10.);
71  h_eoverpq_electrons[i] = Book1D("EoverPQElectrons"+ cLevelLabel[i], "E/p*q ;Events", 50, -10., 10.);
72  }
73 
74  }
75 
76  void ZeePlots::fillZPlots(TLorentzVector& z, int level){
77  h_z_mass[level] -> Fill(z.M()*(1./GeV));
78  h_z_pt[level] -> Fill(z.Pt()*(1./GeV));
79  h_z_y[level] -> Fill(z.Rapidity());
80  }
81 
82  void ZeePlots::fillElectronPlots( TLorentzVector& elec1, TLorentzVector& elec2, TLorentzVector& cluster1, TLorentzVector& cluster2, TLorentzVector& track1, TLorentzVector& track2, int charge1, int charge2, int level ){
83 
84  h_dr_electrons[level] -> Fill( elec1.DeltaR(elec2) );
85 
86  h_ptclust_electron1[level] -> Fill( cluster1.Perp()*(1./GeV) );
87  h_ptclust_electron2[level] -> Fill( cluster2.Perp()*(1./GeV) );
88 
89  h_etaclust_electron1[level] -> Fill( cluster1.Rapidity() );
90  h_etaclust_electron2[level] -> Fill( cluster2.Rapidity() );
91 
92  h_ptclust_electrons[level] -> Fill( cluster1.Perp()*(1./GeV) );
93  h_ptclust_electrons[level] -> Fill( cluster2.Perp()*(1./GeV) );
94 
95  h_etaclust_electrons[level] -> Fill( cluster1.Rapidity() );
96  h_etaclust_electrons[level] -> Fill( cluster2.Rapidity() );
97 
98  h_pt_electrons[level] -> Fill( elec1.Perp()*(1./GeV) );
99  h_pt_electrons[level] -> Fill( elec2.Perp()*(1./GeV) );
100 
101  h_eta_electrons[level] -> Fill( elec1.Rapidity() );
102  h_eta_electrons[level] -> Fill( elec2.Rapidity() );
103 
104  h_phi_electrons[level] -> Fill( elec1.Phi() );
105  h_phi_electrons[level] -> Fill( elec2.Phi() );
106 
107  h_eoverp_electrons[level] ->Fill( cluster1.E()/track1.E() );
108  h_eoverp_electrons[level] ->Fill( cluster2.E()/track2.E() );
109 
110  h_eoverpq_electrons[level] ->Fill( cluster1.E()/track1.E()*charge1 );
111  h_eoverpq_electrons[level] ->Fill( cluster2.E()/track2.E()*charge2 );
112  }
113 
114  void ZeePlots::fillGenPlots( int nel ){
115  h_n_el -> Fill( nel );
116  }
117 
118 }
ZeeValidation::ZeePlots::fillGenPlots
void fillGenPlots(int nel)
Definition: ZeePlots.cxx:114
GeV
#define GeV
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:17
PlotBase
Definition: PlotBase.h:34
ZeeValidation::ZeePlots::h_eta_electrons
TH1 * h_eta_electrons[nLevels]
Definition: ZeePlots.h:45
ZeeValidation::ZeePlots::initializePlots
virtual void initializePlots()
Definition: ZeePlots.cxx:48
python.copyTCTOutput.sDir
sDir
Definition: copyTCTOutput.py:60
ZeeValidation::ZeePlots::h_ptclust_electrons
TH1 * h_ptclust_electrons[nLevels]
Definition: ZeePlots.h:42
ZeeValidation::ZeePlots::h_z_y
TH1 * h_z_y[nLevels]
Definition: ZeePlots.h:33
ZeePlots.h
ZeeValidation::ZeePlots::h_eoverp_electrons
TH1 * h_eoverp_electrons[nLevels]
Definition: ZeePlots.h:47
ZeeValidation::ZeePlots::h_etaclust_electrons
TH1 * h_etaclust_electrons[nLevels]
Definition: ZeePlots.h:43
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
PlotBase::Book1D
TH1D * Book1D(const std::string &name, const std::string &labels, int nBins, float start, float end, bool prependDir=true)
Book a TH1D histogram.
Definition: PlotBase.cxx:94
ZeeValidation::ZeePlots::h_ptclust_electron2
TH1 * h_ptclust_electron2[nLevels]
Definition: ZeePlots.h:38
ZeeValidation::ZeePlots::nLevels
static const int nLevels
Definition: ZeePlots.h:24
lumiFormat.i
int i
Definition: lumiFormat.py:85
z
#define z
ZeeValidation::ZeePlots::h_eoverpq_electrons
TH1 * h_eoverpq_electrons[nLevels]
Definition: ZeePlots.h:48
ZeeValidation
Definition: FWDZeePlots.cxx:9
ZeeValidation::ZeePlots::cLevelLabel
static const std::string cLevelLabel[nLevels]
Definition: ZeePlots.h:25
ZeeValidation::ZeePlots::h_pt_electrons
TH1 * h_pt_electrons[nLevels]
Definition: ZeePlots.h:44
ZeeValidation::ZeePlots::h_phi_electrons
TH1 * h_phi_electrons[nLevels]
Definition: ZeePlots.h:46
ZeeValidation::ZeePlots::h_dr_electrons
TH1 * h_dr_electrons[nLevels]
Definition: ZeePlots.h:35
ZeeValidation::ZeePlots::fillZPlots
void fillZPlots(TLorentzVector &z, int level)
Definition: ZeePlots.cxx:76
ZeeValidation::ZeePlots::h_etaclust_electron2
TH1 * h_etaclust_electron2[nLevels]
Definition: ZeePlots.h:40
ZeeValidation::ZeePlots::ZeePlots
ZeePlots(PlotBase *pParent, std::string sDir, std::string sParticleType)
Definition: ZeePlots.cxx:11
ZeeValidation::ZeePlots::h_z_pt
TH1 * h_z_pt[nLevels]
Definition: ZeePlots.h:32
ZeeValidation::ZeePlots::h_ptclust_electron1
TH1 * h_ptclust_electron1[nLevels]
Definition: ZeePlots.h:37
ZeeValidation::ZeePlots::h_etaclust_electron1
TH1 * h_etaclust_electron1[nLevels]
Definition: ZeePlots.h:39
ZeeValidation::ZeePlots::h_n_el
TH1 * h_n_el
Definition: ZeePlots.h:29
ZeeValidation::ZeePlots::h_z_mass
TH1 * h_z_mass[nLevels]
Definition: ZeePlots.h:31
ZeeValidation::ZeePlots::fillElectronPlots
void fillElectronPlots(TLorentzVector &elec1, TLorentzVector &elec2, TLorentzVector &cluster1, TLorentzVector &cluster2, TLorentzVector &track1, TLorentzVector &track2, int charge1, int charge2, int level)
Definition: ZeePlots.cxx:82