ATLAS Offline Software
Loading...
Searching...
No Matches
ElectronPlots.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include "ElectronPlots.h"
10#include <iostream>
11using namespace std;
12using namespace MCTruthPartClassifier;
13
14namespace Egamma{
15
16ElectronPlots::ElectronPlots(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_oShowerShapesAll10GeVRecoPlots(this, "All/ShowerShapes10GeVPlots/","All Reco "+ sParticleType +" Electron" ),
21 m_oIsolationAllRecoPlots(this, "All/IsolationPlots/", "All Reco "+ sParticleType +" Electron" ),
22 m_oTrackAllRecoPlots(this, "All/TrackPlots/", "All Reco "+ sParticleType +" Electron" ),
23 m_oKinIsoRecoPlots(this, "Iso/KinPlots/", "Iso Reco "+ sParticleType +" Electron"),
24 m_oShowerShapesIsoRecoPlots(this, "Iso/ShowerShapesPlots/","Iso Reco "+ sParticleType +" Electron" ),
25 m_oShowerShapesIso10GeVRecoPlots(this, "Iso/ShowerShapes10GeVPlots/","Iso Reco "+ sParticleType +" Electron" ),
26 m_oIsolationIsoRecoPlots(this, "Iso/IsolationPlots/", "Iso Reco "+ sParticleType +" Electron" ),
27 m_oTrackIsoRecoPlots(this, "Iso/TrackPlots/", "Iso Reco "+ sParticleType +" Electron" ),
28
29 m_oKinIsoLHLoosePlots(this, "IsoLHLoose/KinPlots/", "LHLoose "+ sParticleType +" Electron"),
30 m_oShowerShapesIsoLHLoosePlots(this, "IsoLHLoose/ShowerShapesPlots/","LHLoose "+ sParticleType +" Electron" ),
31 m_oIsolationIsoLHLoosePlots(this, "IsoLHLoose/IsolationPlots/", "LHLoose "+ sParticleType +" Electron" ),
32 m_oTrackIsoLHLoosePlots(this, "IsoLHLoose/TrackPlots/", "LHLoose "+ sParticleType +" Electron" ),
33 m_oKinIsoLHMediumPlots(this, "IsoLHMedium/KinPlots/", "LHMedium "+ sParticleType +" Electron"),
34 m_oShowerShapesIsoLHMediumPlots(this, "IsoLHMedium/ShowerShapesPlots/","LHMedium "+ sParticleType +" Electron" ),
35 m_oIsolationIsoLHMediumPlots(this, "IsoLHMedium/IsolationPlots/", "LHMedium "+ sParticleType +" Electron" ),
36 m_oTrackIsoLHMediumPlots(this, "IsoLHMedium/TrackPlots/", "LHMedium "+ sParticleType +" Electron" ),
37 m_oKinIsoLHTightPlots(this, "IsoLHTight/KinPlots/", "LHTight "+ sParticleType +" Electron"),
38 m_oShowerShapesIsoLHTightPlots(this, "IsoLHTight/ShowerShapesPlots/","LHTight "+ sParticleType +" Electron" ),
39 m_oIsolationIsoLHTightPlots(this, "IsoLHTight/IsolationPlots/", "LHTight "+ sParticleType +" Electron" ),
40 m_oTrackIsoLHTightPlots(this, "IsoLHTight/TrackPlots/", "LHTight "+ sParticleType +" Electron" ),
41
42 m_oKinPromptRecoPlots(this, "Truth_matched/KinPlots/", "Truth matched Reco "+ sParticleType +" Electron"),
43 m_oShowerShapesPromptRecoPlots(this, "Truth_matched/ShowerShapesPlots/","Truth matched Reco "+ sParticleType +" Electron" ),
44 m_oIsolationPromptRecoPlots(this, "Truth_matched/IsolationPlots/", "Truth matched Reco "+ sParticleType +" Electron" ),
45 m_oTrackPromptRecoPlots(this, "Truth_matched/TrackPlots/", "Truth matched Reco "+ sParticleType +" Electron" ),
46 m_oKinPromptLHLoosePlots(this, "Truth_matched_LHLoose/KinPlots/", "Truth matched LHLoose "+ sParticleType +" Electron"),
47 m_oShowerShapesPromptLHLoosePlots(this, "Truth_matched_LHLoose/ShowerShapesPlots/","Truth matched LHLoose "+ sParticleType +" Electron" ),
48 m_oIsolationPromptLHLoosePlots(this, "Truth_matched_LHLoose/IsolationPlots/", "Truth matched LHLoose "+ sParticleType +" Electron" ),
49 m_oTrackPromptLHLoosePlots(this, "Truth_matched_LHLoose/TrackPlots/", "Truth matched LHLoose "+ sParticleType +" Electron" ),
50 m_oKinPromptLHMediumPlots(this, "Truth_matched_LHMedium/KinPlots/", "Truth matched LHMedium "+ sParticleType +" Electron"),
51 m_oShowerShapesPromptLHMediumPlots(this, "Truth_matched_LHMedium/ShowerShapesPlots/","Truth matched LHMedium "+ sParticleType +" Electron" ),
52 m_oIsolationPromptLHMediumPlots(this, "Truth_matched_LHMedium/IsolationPlots/", "Truth matched LHMedium "+ sParticleType +" Electron" ),
53 m_oTrackPromptLHMediumPlots(this, "Truth_matched_LHMedium/TrackPlots/", "Truth matched LHMedium "+ sParticleType +" Electron" ),
54 m_oKinPromptLHTightPlots(this, "Truth_matched_LHTight/KinPlots/", "Truth matched LHTight "+ sParticleType +" Electron"),
55 m_oShowerShapesPromptLHTightPlots(this, "Truth_matched_LHTight/ShowerShapesPlots/","Truth matched LHTight "+ sParticleType +" Electron" ),
56 m_oIsolationPromptLHTightPlots(this, "Truth_matched_LHTight/IsolationPlots/", "Truth matched LHTight "+ sParticleType +" Electron" ),
57 m_oTrackPromptLHTightPlots(this, "Truth_matched_LHTight/TrackPlots/", "Truth matched LHTight "+ sParticleType +" Electron" ),
58 nParticles(nullptr),
59 nParticles_weighted(nullptr),
60 nTypeParticles(nullptr),
61 m_sParticleType(sParticleType)
62{}
63
65 nParticles = Book1D("n", "Number of "+ m_sParticleType + "s;#" + m_sParticleType + " electrons;Events", 15, 0, 15.);
66 nParticles_weighted = Book1D("n_weighted", "Number of "+ m_sParticleType + "s;#" + m_sParticleType + " electrons;Events", 15, 0, 15.);
67 }
68
69 void ElectronPlots::fill(const xAOD::Electron& electron, const xAOD::EventInfo& eventInfo, bool isPrompt) {
70
71 m_oKinAllRecoPlots.fill(electron,eventInfo);
72 m_oShowerShapesAllRecoPlots.fill(electron,eventInfo);
73 if (electron.pt() > 10 * Gaudi::Units::GeV) {
74 m_oShowerShapesAll10GeVRecoPlots.fill(electron,eventInfo);
75 }
76 m_oIsolationAllRecoPlots.fill(electron,eventInfo);
77 m_oTrackAllRecoPlots.fill(electron,eventInfo);
78
79 if(!isPrompt) return;
80
81 m_oKinPromptRecoPlots.fill(electron,eventInfo);
82 m_oShowerShapesPromptRecoPlots.fill(electron,eventInfo);
83 m_oIsolationPromptRecoPlots.fill(electron,eventInfo);
84 m_oTrackPromptRecoPlots.fill(electron,eventInfo);
85
86 m_oKinIsoRecoPlots.fill(electron,eventInfo);
87 m_oShowerShapesIsoRecoPlots.fill(electron,eventInfo);
88 if (electron.pt() > 10 * Gaudi::Units::GeV) {
89 m_oShowerShapesIso10GeVRecoPlots.fill(electron,eventInfo);
90 }
91 m_oIsolationIsoRecoPlots.fill(electron,eventInfo);
92 m_oTrackIsoRecoPlots.fill(electron,eventInfo);
93
94 bool val_LHloose=false;
95 electron.passSelection(val_LHloose, "LHLoose");
96 if(val_LHloose) {
97 m_oKinIsoLHLoosePlots.fill(electron,eventInfo);
98 m_oShowerShapesIsoLHLoosePlots.fill(electron,eventInfo);
99 m_oIsolationIsoLHLoosePlots.fill(electron,eventInfo);
100 m_oTrackIsoLHLoosePlots.fill(electron,eventInfo);
101
102 m_oKinPromptLHLoosePlots.fill(electron,eventInfo);
103 m_oShowerShapesPromptLHLoosePlots.fill(electron,eventInfo);
104 m_oIsolationPromptLHLoosePlots.fill(electron,eventInfo);
105 m_oTrackPromptLHLoosePlots.fill(electron,eventInfo);
106 }
107
108 bool val_LHmed=false;
109 electron.passSelection(val_LHmed, "LHMedium");
110 if(val_LHmed) {
111 m_oKinIsoLHMediumPlots.fill(electron,eventInfo);
112 m_oShowerShapesIsoLHMediumPlots.fill(electron,eventInfo);
113 m_oIsolationIsoLHMediumPlots.fill(electron,eventInfo);
114 m_oTrackIsoLHMediumPlots.fill(electron,eventInfo);
115
116 m_oKinPromptLHMediumPlots.fill(electron,eventInfo);
117 m_oShowerShapesPromptLHMediumPlots.fill(electron,eventInfo);
118 m_oIsolationPromptLHMediumPlots.fill(electron,eventInfo);
119 m_oTrackPromptLHMediumPlots.fill(electron,eventInfo);
120 }
121
122 bool val_LHtight=false;
123 electron.passSelection(val_LHtight, "LHTight");
124 if(val_LHtight) {
125 m_oKinIsoLHTightPlots.fill(electron,eventInfo);
126 m_oShowerShapesIsoLHTightPlots.fill(electron,eventInfo);
127 m_oIsolationIsoLHTightPlots.fill(electron,eventInfo);
128 m_oTrackIsoLHTightPlots.fill(electron,eventInfo);
129
130 m_oKinPromptLHTightPlots.fill(electron,eventInfo);
131 m_oShowerShapesPromptLHTightPlots.fill(electron,eventInfo);
132 m_oIsolationPromptLHTightPlots.fill(electron,eventInfo);
133 m_oTrackPromptLHTightPlots.fill(electron,eventInfo);
134 }
135 }
136
137
138}
Egamma::IsolationPlots m_oIsolationIsoLHTightPlots
Egamma::IsolationPlots m_oIsolationPromptRecoPlots
Egamma::ShowerShapesPlots m_oShowerShapesIsoLHMediumPlots
Egamma::TrackPlots m_oTrackIsoLHTightPlots
Egamma::IsolationPlots m_oIsolationIsoLHLoosePlots
std::string m_sParticleType
Egamma::ShowerShapesPlots m_oShowerShapesPromptLHLoosePlots
Egamma::ShowerShapesPlots m_oShowerShapesPromptRecoPlots
Egamma::ShowerShapesPlots m_oShowerShapesAllRecoPlots
Egamma::IsolationPlots m_oIsolationIsoRecoPlots
Egamma::TrackPlots m_oTrackIsoLHMediumPlots
ElectronPlots(PlotBase *pParent, const std::string &sDir, const std::string &sParticleType)
Egamma::ShowerShapesPlots m_oShowerShapesPromptLHTightPlots
Egamma::ShowerShapesPlots m_oShowerShapesIsoRecoPlots
Egamma::IsolationPlots m_oIsolationPromptLHTightPlots
Egamma::TrackPlots m_oTrackPromptLHLoosePlots
Egamma::ShowerShapesPlots m_oShowerShapesIsoLHTightPlots
Egamma::ShowerShapesPlots m_oShowerShapesAll10GeVRecoPlots
Egamma::IsolationPlots m_oIsolationAllRecoPlots
Egamma::KinematicsPlots m_oKinPromptLHLoosePlots
Egamma::KinematicsPlots m_oKinIsoLHMediumPlots
Egamma::KinematicsPlots m_oKinIsoRecoPlots
Egamma::TrackPlots m_oTrackIsoRecoPlots
Egamma::TrackPlots m_oTrackIsoLHLoosePlots
Egamma::KinematicsPlots m_oKinPromptLHMediumPlots
Egamma::KinematicsPlots m_oKinPromptRecoPlots
Egamma::IsolationPlots m_oIsolationIsoLHMediumPlots
void fill(const xAOD::Electron &electron, const xAOD::EventInfo &eventInfo, bool isPrompt)
Egamma::TrackPlots m_oTrackPromptLHTightPlots
Egamma::KinematicsPlots m_oKinPromptLHTightPlots
Egamma::ShowerShapesPlots m_oShowerShapesPromptLHMediumPlots
virtual void initializePlots()
Egamma::TrackPlots m_oTrackAllRecoPlots
Egamma::IsolationPlots m_oIsolationPromptLHLoosePlots
Egamma::ShowerShapesPlots m_oShowerShapesIsoLHLoosePlots
Egamma::KinematicsPlots m_oKinIsoLHTightPlots
Egamma::TrackPlots m_oTrackPromptRecoPlots
Egamma::ShowerShapesPlots m_oShowerShapesIso10GeVRecoPlots
Egamma::KinematicsPlots m_oKinIsoLHLoosePlots
Egamma::IsolationPlots m_oIsolationPromptLHMediumPlots
Egamma::TrackPlots m_oTrackPromptLHMediumPlots
Egamma::KinematicsPlots m_oKinAllRecoPlots
TH1D * Book1D(std::string_view name, std::string_view labels, int nBins, float start, float end, bool prependDir=true)
Book a TH1D histogram.
Definition PlotBase.cxx:94
PlotBase(PlotBase *parent, std::string_view 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".