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_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 nParticles(nullptr),
57 nParticles_weighted(nullptr),
58 nTypeParticles(nullptr),
59 m_sParticleType(sParticleType)
60{}
61
63 nParticles = Book1D("n", "Number of "+ m_sParticleType + "s;#" + m_sParticleType + " electrons;Events", 15, 0, 15.);
64 nParticles_weighted = Book1D("n_weighted", "Number of "+ m_sParticleType + "s;#" + m_sParticleType + " electrons;Events", 15, 0, 15.);
65 }
66
67 void ElectronPlots::fill(const xAOD::Electron& electron, const xAOD::EventInfo& eventInfo, bool isPrompt) {
68
69 m_oKinAllRecoPlots.fill(electron,eventInfo);
70 m_oShowerShapesAllRecoPlots.fill(electron,eventInfo);
71 m_oIsolationAllRecoPlots.fill(electron,eventInfo);
72 m_oTrackAllRecoPlots.fill(electron,eventInfo);
73
74 if(!isPrompt) return;
75
76 m_oKinPromptRecoPlots.fill(electron,eventInfo);
77 m_oShowerShapesPromptRecoPlots.fill(electron,eventInfo);
78 m_oIsolationPromptRecoPlots.fill(electron,eventInfo);
79 m_oTrackPromptRecoPlots.fill(electron,eventInfo);
80
81 m_oKinIsoRecoPlots.fill(electron,eventInfo);
82 m_oShowerShapesIsoRecoPlots.fill(electron,eventInfo);
83 m_oIsolationIsoRecoPlots.fill(electron,eventInfo);
84 m_oTrackIsoRecoPlots.fill(electron,eventInfo);
85
86 bool val_LHloose=false;
87 electron.passSelection(val_LHloose, "LHLoose");
88 if(val_LHloose) {
89 m_oKinIsoLHLoosePlots.fill(electron,eventInfo);
90 m_oShowerShapesIsoLHLoosePlots.fill(electron,eventInfo);
91 m_oIsolationIsoLHLoosePlots.fill(electron,eventInfo);
92 m_oTrackIsoLHLoosePlots.fill(electron,eventInfo);
93
94 m_oKinPromptLHLoosePlots.fill(electron,eventInfo);
95 m_oShowerShapesPromptLHLoosePlots.fill(electron,eventInfo);
96 m_oIsolationPromptLHLoosePlots.fill(electron,eventInfo);
97 m_oTrackPromptLHLoosePlots.fill(electron,eventInfo);
98 }
99
100 bool val_LHmed=false;
101 electron.passSelection(val_LHmed, "LHMedium");
102 if(val_LHmed) {
103 m_oKinIsoLHMediumPlots.fill(electron,eventInfo);
104 m_oShowerShapesIsoLHMediumPlots.fill(electron,eventInfo);
105 m_oIsolationIsoLHMediumPlots.fill(electron,eventInfo);
106 m_oTrackIsoLHMediumPlots.fill(electron,eventInfo);
107
108 m_oKinPromptLHMediumPlots.fill(electron,eventInfo);
109 m_oShowerShapesPromptLHMediumPlots.fill(electron,eventInfo);
110 m_oIsolationPromptLHMediumPlots.fill(electron,eventInfo);
111 m_oTrackPromptLHMediumPlots.fill(electron,eventInfo);
112 }
113
114 bool val_LHtight=false;
115 electron.passSelection(val_LHtight, "LHTight");
116 if(val_LHtight) {
117 m_oKinIsoLHTightPlots.fill(electron,eventInfo);
118 m_oShowerShapesIsoLHTightPlots.fill(electron,eventInfo);
119 m_oIsolationIsoLHTightPlots.fill(electron,eventInfo);
120 m_oTrackIsoLHTightPlots.fill(electron,eventInfo);
121
122 m_oKinPromptLHTightPlots.fill(electron,eventInfo);
123 m_oShowerShapesPromptLHTightPlots.fill(electron,eventInfo);
124 m_oIsolationPromptLHTightPlots.fill(electron,eventInfo);
125 m_oTrackPromptLHTightPlots.fill(electron,eventInfo);
126 }
127 }
128
129
130}
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::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::KinematicsPlots m_oKinIsoLHLoosePlots
Egamma::IsolationPlots m_oIsolationPromptLHMediumPlots
Egamma::TrackPlots m_oTrackPromptLHMediumPlots
Egamma::KinematicsPlots m_oKinAllRecoPlots
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".