ATLAS Offline Software
Loading...
Searching...
No Matches
LRTElectronPlots.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include "LRTElectronPlots.h"
10#include <iostream>
11using namespace std;
12using namespace MCTruthPartClassifier;
13
14namespace Egamma{
15
16LRTElectronPlots::LRTElectronPlots(PlotBase* pParent, const std::string& sDir,
17 const std::string& sParticleType):PlotBase(pParent, sDir),
18 m_oKinAllRecoPlots(this, "All/KinPlots/", "All Reco "+ sParticleType +" Electron"),
19 m_oShowerShapesAllRecoPlots(this, "All/ShowerShapesPlots/","All Reco "+ sParticleType +" Electron" ),
20 m_oIsolationAllRecoPlots(this, "All/IsolationPlots/", "All Reco "+ sParticleType +" Electron" ),
21 m_oTrackAllRecoPlots(this, "All/TrackPlots/", "All Reco "+ sParticleType +" Electron" ),
22 m_oKinIsoRecoPlots(this, "Iso/KinPlots/", "Iso Reco "+ sParticleType +" Electron"),
23 m_oShowerShapesIsoRecoPlots(this, "Iso/ShowerShapesPlots/","Iso Reco "+ sParticleType +" Electron" ),
24 m_oIsolationIsoRecoPlots(this, "Iso/IsolationPlots/", "Iso Reco "+ sParticleType +" Electron" ),
25 m_oTrackIsoRecoPlots(this, "Iso/TrackPlots/", "Iso Reco "+ sParticleType +" Electron" ),
26
27 m_oKinIsoLHLoosePlots(this, "IsoLHLoose/KinPlots/", "LHLoose "+ sParticleType +" Electron"),
28 m_oShowerShapesIsoLHLoosePlots(this, "IsoLHLoose/ShowerShapesPlots/","LHLoose "+ sParticleType +" Electron" ),
29 m_oIsolationIsoLHLoosePlots(this, "IsoLHLoose/IsolationPlots/", "LHLoose "+ sParticleType +" Electron" ),
30 m_oTrackIsoLHLoosePlots(this, "IsoLHLoose/TrackPlots/", "LHLoose "+ sParticleType +" Electron" ),
31 m_oKinIsoLHMediumPlots(this, "IsoLHMedium/KinPlots/", "LHMedium "+ sParticleType +" Electron"),
32 m_oShowerShapesIsoLHMediumPlots(this, "IsoLHMedium/ShowerShapesPlots/","LHMedium "+ sParticleType +" Electron" ),
33 m_oIsolationIsoLHMediumPlots(this, "IsoLHMedium/IsolationPlots/", "LHMedium "+ sParticleType +" Electron" ),
34 m_oTrackIsoLHMediumPlots(this, "IsoLHMedium/TrackPlots/", "LHMedium "+ sParticleType +" Electron" ),
35 m_oKinIsoLHTightPlots(this, "IsoLHTight/KinPlots/", "LHTight "+ sParticleType +" Electron"),
36 m_oShowerShapesIsoLHTightPlots(this, "IsoLHTight/ShowerShapesPlots/","LHTight "+ sParticleType +" Electron" ),
37 m_oIsolationIsoLHTightPlots(this, "IsoLHTight/IsolationPlots/", "LHTight "+ sParticleType +" Electron" ),
38 m_oTrackIsoLHTightPlots(this, "IsoLHTight/TrackPlots/", "LHTight "+ sParticleType +" Electron" ),
39
40 m_oKinPromptRecoPlots(this, "Truth_matched/KinPlots/", "Truth matched Reco "+ sParticleType +" Electron"),
41 m_oShowerShapesPromptRecoPlots(this, "Truth_matched/ShowerShapesPlots/","Truth matched Reco "+ sParticleType +" Electron" ),
42 m_oIsolationPromptRecoPlots(this, "Truth_matched/IsolationPlots/", "Truth matched Reco "+ sParticleType +" Electron" ),
43 m_oTrackPromptRecoPlots(this, "Truth_matched/TrackPlots/", "Truth matched Reco "+ sParticleType +" Electron" ),
44 m_oKinPromptLHLoosePlots(this, "Truth_matched_LHLoose/KinPlots/", "Truth matched LHLoose "+ sParticleType +" Electron"),
45 m_oShowerShapesPromptLHLoosePlots(this, "Truth_matched_LHLoose/ShowerShapesPlots/","Truth matched LHLoose "+ sParticleType +" Electron" ),
46 m_oIsolationPromptLHLoosePlots(this, "Truth_matched_LHLoose/IsolationPlots/", "Truth matched LHLoose "+ sParticleType +" Electron" ),
47 m_oTrackPromptLHLoosePlots(this, "Truth_matched_LHLoose/TrackPlots/", "Truth matched LHLoose "+ sParticleType +" Electron" ),
48 m_oKinPromptLHMediumPlots(this, "Truth_matched_LHMedium/KinPlots/", "Truth matched LHMedium "+ sParticleType +" Electron"),
49 m_oShowerShapesPromptLHMediumPlots(this, "Truth_matched_LHMedium/ShowerShapesPlots/","Truth matched LHMedium "+ sParticleType +" Electron" ),
50 m_oIsolationPromptLHMediumPlots(this, "Truth_matched_LHMedium/IsolationPlots/", "Truth matched LHMedium "+ sParticleType +" Electron" ),
51 m_oTrackPromptLHMediumPlots(this, "Truth_matched_LHMedium/TrackPlots/", "Truth matched LHMedium "+ sParticleType +" Electron" ),
52 m_oKinPromptLHTightPlots(this, "Truth_matched_LHTight/KinPlots/", "Truth matched LHTight "+ sParticleType +" Electron"),
53 m_oShowerShapesPromptLHTightPlots(this, "Truth_matched_LHTight/ShowerShapesPlots/","Truth matched LHTight "+ sParticleType +" Electron" ),
54 m_oIsolationPromptLHTightPlots(this, "Truth_matched_LHTight/IsolationPlots/", "Truth matched LHTight "+ sParticleType +" Electron" ),
55 m_oTrackPromptLHTightPlots(this, "Truth_matched_LHTight/TrackPlots/", "Truth matched LHTight "+ sParticleType +" Electron" ),
56
57 m_oKinLHVeryLooseNoPixPlots(this, "LHVeryLooseNoPix/KinPlots/", "LHVeryLooseNoPix "+ sParticleType +" Electron"),
58 m_oShowerShapesLHVeryLooseNoPixPlots(this, "LHVeryLooseNoPix/ShowerShapesPlots/","LHVeryLooseNoPix "+ sParticleType +" Electron" ),
59 m_oIsolationLHVeryLooseNoPixPlots(this, "LHVeryLooseNoPix/IsolationPlots/", "LHVeryLooseNoPix "+ sParticleType +" Electron" ),
60 m_oTrackLHVeryLooseNoPixPlots(this, "LHVeryLooseNoPix/TrackPlots/", "LHVeryLooseNoPix "+ sParticleType +" Electron" ),
61
62 m_oKinLHLooseNoPixPlots(this, "LHLooseNoPix/KinPlots/", "LHLooseNoPix "+ sParticleType +" Electron"),
63 m_oShowerShapesLHLooseNoPixPlots(this, "LHLooseNoPix/ShowerShapesPlots/","LHLooseNoPix "+ sParticleType +" Electron" ),
64 m_oIsolationLHLooseNoPixPlots(this, "LHLooseNoPix/IsolationPlots/", "LHLooseNoPix "+ sParticleType +" Electron" ),
65 m_oTrackLHLooseNoPixPlots(this, "LHLooseNoPix/TrackPlots/", "LHLooseNoPix "+ sParticleType +" Electron" ),
66
67 m_oKinLHMediumNoPixPlots(this, "LHMediumNoPix/KinPlots/", "LHMediumNoPix "+ sParticleType +" Electron"),
68 m_oShowerShapesLHMediumNoPixPlots(this, "LHMediumNoPix/ShowerShapesPlots/","LHMediumNoPix "+ sParticleType +" Electron" ),
69 m_oIsolationLHMediumNoPixPlots(this, "LHMediumNoPix/IsolationPlots/", "LHMediumNoPix "+ sParticleType +" Electron" ),
70 m_oTrackLHMediumNoPixPlots(this, "LHMediumNoPix/TrackPlots/", "LHMediumNoPix "+ sParticleType +" Electron" ),
71
72 m_oKinLHTightNoPixPlots(this, "LHTightNoPix/KinPlots/", "LHTightNoPix "+ sParticleType +" Electron"),
73 m_oShowerShapesLHTightNoPixPlots(this, "LHTightNoPix/ShowerShapesPlots/","LHTightNoPix "+ sParticleType +" Electron" ),
74 m_oIsolationLHTightNoPixPlots(this, "LHTightNoPix/IsolationPlots/", "LHTightNoPix "+ sParticleType +" Electron" ),
75 m_oTrackLHTightNoPixPlots(this, "LHTightNoPix/TrackPlots/", "LHTightNoPix "+ sParticleType +" Electron" ),
76
77 nParticles(nullptr),
78 nParticles_weighted(nullptr),
79 nTypeParticles(nullptr),
80 m_sParticleType(sParticleType)
81{}
82
84 nParticles = Book1D("n", "Number of "+ m_sParticleType + "s;#" + m_sParticleType + " electrons;Events", 15, 0, 15.);
85 nParticles_weighted = Book1D("n_weighted", "Number of "+ m_sParticleType + "s;#" + m_sParticleType + " electrons;Events", 15, 0, 15.);
86 }
87
88void LRTElectronPlots::fill(const xAOD::Electron& electron, const xAOD::EventInfo& eventInfo, bool isPrompt, bool pass_LHVeryLooseNoPix, bool pass_LHLooseNoPix, bool pass_LHMediumNoPix, bool pass_LHTightNoPix) {
89
90 m_oKinAllRecoPlots.fill(electron,eventInfo);
91 m_oShowerShapesAllRecoPlots.fill(electron,eventInfo);
92 m_oIsolationAllRecoPlots.fill(electron,eventInfo);
93 m_oTrackAllRecoPlots.fill(electron,eventInfo);
94
95 m_oKinPromptRecoPlots.fill(electron,eventInfo);
96 m_oShowerShapesPromptRecoPlots.fill(electron,eventInfo);
97 m_oIsolationPromptRecoPlots.fill(electron,eventInfo);
98 m_oTrackPromptRecoPlots.fill(electron,eventInfo);
99
100 if (pass_LHVeryLooseNoPix){
101 m_oKinLHVeryLooseNoPixPlots.fill(electron,eventInfo);
102 m_oShowerShapesLHVeryLooseNoPixPlots.fill(electron,eventInfo);
103 m_oIsolationLHVeryLooseNoPixPlots.fill(electron,eventInfo);
104 m_oTrackLHVeryLooseNoPixPlots.fill(electron,eventInfo);
105 }
106
107 if (pass_LHLooseNoPix){
108 m_oKinLHLooseNoPixPlots.fill(electron,eventInfo);
109 m_oShowerShapesLHLooseNoPixPlots.fill(electron,eventInfo);
110 m_oIsolationLHLooseNoPixPlots.fill(electron,eventInfo);
111 m_oTrackLHLooseNoPixPlots.fill(electron,eventInfo);
112 }
113
114 if (pass_LHMediumNoPix){
115 m_oKinLHMediumNoPixPlots.fill(electron,eventInfo);
116 m_oShowerShapesLHMediumNoPixPlots.fill(electron,eventInfo);
117 m_oIsolationLHMediumNoPixPlots.fill(electron,eventInfo);
118 m_oTrackLHMediumNoPixPlots.fill(electron,eventInfo);
119 }
120
121 if (pass_LHTightNoPix){
122 m_oKinLHTightNoPixPlots.fill(electron,eventInfo);
123 m_oShowerShapesLHTightNoPixPlots.fill(electron,eventInfo);
124 m_oIsolationLHTightNoPixPlots.fill(electron,eventInfo);
125 m_oTrackLHTightNoPixPlots.fill(electron,eventInfo);
126 }
127
128 if(!isPrompt) return;
129
130 m_oKinIsoRecoPlots.fill(electron,eventInfo);
131 m_oShowerShapesIsoRecoPlots.fill(electron,eventInfo);
132 m_oIsolationIsoRecoPlots.fill(electron,eventInfo);
133 m_oTrackIsoRecoPlots.fill(electron,eventInfo);
134
135 bool val_LHloose=false;
136 electron.passSelection(val_LHloose, "LHLoose");
137 if(val_LHloose) {
138 m_oKinIsoLHLoosePlots.fill(electron,eventInfo);
139 m_oShowerShapesIsoLHLoosePlots.fill(electron,eventInfo);
140 m_oIsolationIsoLHLoosePlots.fill(electron,eventInfo);
141 m_oTrackIsoLHLoosePlots.fill(electron,eventInfo);
142
143 m_oKinPromptLHLoosePlots.fill(electron,eventInfo);
144 m_oShowerShapesPromptLHLoosePlots.fill(electron,eventInfo);
145 m_oIsolationPromptLHLoosePlots.fill(electron,eventInfo);
146 m_oTrackPromptLHLoosePlots.fill(electron,eventInfo);
147 }
148
149 bool val_LHmed=false;
150 electron.passSelection(val_LHmed, "LHMedium");
151 if(val_LHmed) {
152 m_oKinIsoLHMediumPlots.fill(electron,eventInfo);
153 m_oShowerShapesIsoLHMediumPlots.fill(electron,eventInfo);
154 m_oIsolationIsoLHMediumPlots.fill(electron,eventInfo);
155 m_oTrackIsoLHMediumPlots.fill(electron,eventInfo);
156
157 m_oKinPromptLHMediumPlots.fill(electron,eventInfo);
158 m_oShowerShapesPromptLHMediumPlots.fill(electron,eventInfo);
159 m_oIsolationPromptLHMediumPlots.fill(electron,eventInfo);
160 m_oTrackPromptLHMediumPlots.fill(electron,eventInfo);
161 }
162
163 bool val_LHtight=false;
164 electron.passSelection(val_LHtight, "LHTight");
165 if(val_LHtight) {
166 m_oKinIsoLHTightPlots.fill(electron,eventInfo);
167 m_oShowerShapesIsoLHTightPlots.fill(electron,eventInfo);
168 m_oIsolationIsoLHTightPlots.fill(electron,eventInfo);
169 m_oTrackIsoLHTightPlots.fill(electron,eventInfo);
170
171 m_oKinPromptLHTightPlots.fill(electron,eventInfo);
172 m_oShowerShapesPromptLHTightPlots.fill(electron,eventInfo);
173 m_oIsolationPromptLHTightPlots.fill(electron,eventInfo);
174 m_oTrackPromptLHTightPlots.fill(electron,eventInfo);
175 }
176
177}
178
179
180}
Egamma::KinematicsPlots m_oKinLHMediumNoPixPlots
Egamma::KinematicsPlots m_oKinLHTightNoPixPlots
Egamma::TrackPlots m_oTrackLHVeryLooseNoPixPlots
Egamma::TrackPlots m_oTrackIsoLHTightPlots
Egamma::IsolationPlots m_oIsolationPromptLHLoosePlots
Egamma::IsolationPlots m_oIsolationLHMediumNoPixPlots
Egamma::ShowerShapesPlots m_oShowerShapesPromptLHLoosePlots
Egamma::TrackPlots m_oTrackLHTightNoPixPlots
Egamma::TrackPlots m_oTrackIsoLHMediumPlots
Egamma::IsolationPlots m_oIsolationLHLooseNoPixPlots
Egamma::KinematicsPlots m_oKinLHVeryLooseNoPixPlots
Egamma::ShowerShapesPlots m_oShowerShapesIsoLHLoosePlots
Egamma::TrackPlots m_oTrackPromptLHMediumPlots
Egamma::TrackPlots m_oTrackPromptRecoPlots
Egamma::IsolationPlots m_oIsolationIsoLHMediumPlots
Egamma::IsolationPlots m_oIsolationLHVeryLooseNoPixPlots
Egamma::TrackPlots m_oTrackAllRecoPlots
Egamma::ShowerShapesPlots m_oShowerShapesLHTightNoPixPlots
Egamma::IsolationPlots m_oIsolationPromptLHTightPlots
Egamma::ShowerShapesPlots m_oShowerShapesLHMediumNoPixPlots
Egamma::KinematicsPlots m_oKinIsoLHLoosePlots
Egamma::IsolationPlots m_oIsolationIsoRecoPlots
Egamma::KinematicsPlots m_oKinIsoLHTightPlots
Egamma::KinematicsPlots m_oKinLHLooseNoPixPlots
Egamma::KinematicsPlots m_oKinPromptRecoPlots
void fill(const xAOD::Electron &electron, const xAOD::EventInfo &eventInfo, bool isPrompt, bool pass_LHVeryLooseNoPix, bool pass_LHLooseNoPix, bool pass_LHMediumNoPix, bool pass_LHTightNoPix)
Egamma::KinematicsPlots m_oKinPromptLHTightPlots
Egamma::ShowerShapesPlots m_oShowerShapesPromptLHMediumPlots
Egamma::TrackPlots m_oTrackPromptLHTightPlots
Egamma::KinematicsPlots m_oKinIsoLHMediumPlots
Egamma::TrackPlots m_oTrackIsoLHLoosePlots
Egamma::IsolationPlots m_oIsolationPromptLHMediumPlots
Egamma::ShowerShapesPlots m_oShowerShapesIsoLHMediumPlots
Egamma::TrackPlots m_oTrackPromptLHLoosePlots
Egamma::ShowerShapesPlots m_oShowerShapesPromptRecoPlots
Egamma::IsolationPlots m_oIsolationIsoLHLoosePlots
Egamma::ShowerShapesPlots m_oShowerShapesIsoRecoPlots
Egamma::IsolationPlots m_oIsolationLHTightNoPixPlots
LRTElectronPlots(PlotBase *pParent, const std::string &sDir, const std::string &sParticleType)
Egamma::KinematicsPlots m_oKinPromptLHLoosePlots
Egamma::ShowerShapesPlots m_oShowerShapesLHLooseNoPixPlots
Egamma::ShowerShapesPlots m_oShowerShapesIsoLHTightPlots
Egamma::ShowerShapesPlots m_oShowerShapesLHVeryLooseNoPixPlots
Egamma::TrackPlots m_oTrackLHLooseNoPixPlots
Egamma::TrackPlots m_oTrackLHMediumNoPixPlots
Egamma::IsolationPlots m_oIsolationIsoLHTightPlots
Egamma::ShowerShapesPlots m_oShowerShapesAllRecoPlots
Egamma::IsolationPlots m_oIsolationPromptRecoPlots
Egamma::ShowerShapesPlots m_oShowerShapesPromptLHTightPlots
Egamma::IsolationPlots m_oIsolationAllRecoPlots
Egamma::TrackPlots m_oTrackIsoRecoPlots
Egamma::KinematicsPlots m_oKinAllRecoPlots
Egamma::KinematicsPlots m_oKinIsoRecoPlots
Egamma::KinematicsPlots m_oKinPromptLHMediumPlots
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
PlotBase(PlotBase *parent, const std::string &sDir)
Definition PlotBase.cxx:29
int isPrompt(const unsigned int classify, bool allow_prompt_tau_decays=true)
STL namespace.
EventInfo_v1 EventInfo
Definition of the latest event info version.
Electron_v1 Electron
Definition of the current "egamma version".