ATLAS Offline Software
Loading...
Searching...
No Matches
Muon::MuonParamElossPlots Class Reference

#include <MuonParamElossPlots.h>

Inheritance diagram for Muon::MuonParamElossPlots:
Collaboration diagram for Muon::MuonParamElossPlots:

Public Member Functions

 MuonParamElossPlots (PlotBase *pParent, const std::string &sDir)
void fill (const xAOD::TruthParticle &truthMu, const xAOD::Muon &mu, float weight=1.0)
void initialize ()
void finalize ()
void setDetailLevel (int iDetailLevel)
void RegisterSubPlot (PlotBase *pPlotBase)
std::vector< HistDataretrieveBookedHistograms ()
 Retrieve all booked histograms.
std::vector< TreeDataretrieveBookedTrees ()
 Retrieve all booked trees.
std::vector< EfficiencyDataretrieveBookedEfficiencies ()
 Retrieve all booked efficiency objects.
TTree * BookTree (std::string_view name, bool prependDir=true)
 Book a TTree.
const std::string & getDirectory ()
Methods to book monitoring histograms

Note: methods starting with capitals should be deprecated in favour of camel-cased methods

TH1D * Book1D (std::string_view name, std::string_view labels, int nBins, float start, float end, bool prependDir=true)
 Book a TH1D histogram.
TH1D * Book1D (std::string_view name, TH1 *refHist, std::string_view labels, bool prependDir=true)
 Book a TH1D histogram using refHist as reference for number of bins and axis range.
TH2F * Book2D (std::string_view name, std::string_view labels, int nBinsX, float startX, float endX, int nBinsY, float startY, float endY, bool prependDir=true)
 Book a TH2F histogram.
TH2F * Book2D (std::string_view name, TH2 *refHist, std::string_view labels, bool prependDir=true)
 Book a TH2D histogram using refHist as reference for number of bins and axis range.
TH2F * Book2D (std::string_view name, std::string_view labels, int nBinsX, Double_t *binsX, int nBinsY, Double_t startY, Double_t endY, bool prependDir=true)
 Book a TH2F histogram with variable x axis binning.
TH3F * Book3D (std::string_view name, std::string_view labels, int nBinsX, float startX, float endX, int nBinsY, float startY, float endY, int nBinsZ, float startZ, float endZ, bool prependDir=true)
 Book a TH3F histogram.
TH3F * Book3D (std::string_view name, TH3 *refHist, std::string_view labels, bool prependDir=true)
 Book a TH3F histogram using refHist as reference for number of bins and axis range.
TProfile * BookTProfile (std::string_view name, std::string_view labels, int nBinsX, float startX, float endX, float startY=-1, float endY=-1, bool prependDir=true, bool useRMS=false)
 Book a TProfile histogram.
TProfile * BookTProfile (std::string_view name, std::string_view labels, int nBinsX, float *binsX, bool prependDir=true)
 Book a TProfile histogram with variable binning in x-axis.
TProfile * BookTProfileRangeY (std::string_view name, std::string_view labels, int nBinsX, double *binsX, double startY, double endY, bool prependDir=true)
 Book a TProfile histogram with variable binning in x-axis and limits in y-values.
TProfile2D * BookTProfile2D (std::string_view name, std::string_view labels, const int nBinsX, const double xlo, const double xhi, const int nBinsY, const double ylo, const double yhi, bool prependDir=true, bool useRMS=false)
 Book a TProfile 2D histogram with variable binning in x-axis and limits in y-values.
TProfile2D * BookTProfile2D (std::string_view name, std::string_view labels, const int nBinsX, double *binsX, const int nBinsY, double *binsY, bool prependDir=true, bool useRMS=false)
 Book a TProfile 2D histogram with variable binning in x-axis and limits in y-values.
TEfficiency * BookTEfficiency (std::string_view name, std::string_view labels, const int nBinsX, const float xlo, const float xhi, const bool prependDir=true)
 Book a (1-D) TEfficiency histogram.
TEfficiency * BookTEfficiency (std::string_view name, std::string_view labels, const int nBinsX, const float xlo, const float xhi, const int nBinsy, const float ylo, const float yhi, const bool prependDir=true)
 Book a (2-D) TEfficiency histogram.

Public Attributes

TH1 * msInnerMatchChi2 {nullptr}
TH1 * msOuterMatchChi2 {nullptr}
TH1 * ELoss {nullptr}
TH1 * ELossDiffTruth {nullptr}
TH1 * ELossDiffTruthEta0_1p35 {nullptr}
TH1 * ELossDiffTruthEta1p35_1p55 {nullptr}
TH1 * ELossDiffTruthEta1p55_end {nullptr}
TH1 * ELossSigma {nullptr}
TH1 * paramELoss {nullptr}
TH1 * paramELossDiff {nullptr}
TH1 * paramELossDiffTruth {nullptr}
TH1 * paramELossDiffTruthEta0_1p35 {nullptr}
TH1 * paramELossDiffTruthEta1p35_1p55 {nullptr}
TH1 * paramELossDiffTruthEta1p55_end {nullptr}
TH1 * measELoss {nullptr}
TH1 * measELossDiff {nullptr}
TH1 * measELossDiffTruth {nullptr}
TH1 * measELossDiffTruthEta0_1p35 {nullptr}
TH1 * measELossDiffTruthEta1p35_1p55 {nullptr}
TH1 * measELossDiffTruthEta1p55_end {nullptr}
TH1 * ELossType {nullptr}
TH1 * ELossTypeParametrPt {nullptr}
TH1 * ELossTypeNotIsoPt {nullptr}
TH1 * ELossTypeTailPt {nullptr}
TH1 * ELossTypeAllPt {nullptr}

Protected Attributes

std::vector< PlotBase * > m_vSubNodes
std::vector< HistDatam_vBookedHistograms
std::vector< TreeDatam_vBookedTrees
std::vector< EfficiencyDatam_vBookedEfficiencies
std::string m_sDirectory
int m_iDetailLevel

Private Member Functions

void initializePlots ()
void FillPlot (TH1 *hist, const xAOD::Muon &mu, const xAOD::Muon::ParamDef paramDef, float scale=1, float weight=1.0)
void FillPlot (TH1 *hist, TH1 *hist_DiffTruth, TH1 *hist_DiffTruthEta0_1p35, TH1 *hist_DiffTruthEta1p35_1p55, TH1 *hist_DiffTruthEta1p55_endd, const xAOD::TruthParticle &truthMu, const xAOD::Muon &mu, const xAOD::Muon::ParamDef paramDef, float scale=1, float weight=1.0)
void FillPlotELossType (TH1 *hist, const xAOD::Muon &mu, float scale=1, float weight=1.0)
void FillPlotELossType (TH1 *hist, const xAOD::Muon &mu, xAOD::Muon::EnergyLossType type, float scale=1, float weight=1.0)
virtual void finalizePlots ()

Static Private Member Functions

static std::string constructPrefix (std::string dir, bool prependDir)

Detailed Description

Definition at line 16 of file MuonParamElossPlots.h.

Constructor & Destructor Documentation

◆ MuonParamElossPlots()

Muon::MuonParamElossPlots::MuonParamElossPlots ( PlotBase * pParent,
const std::string & sDir )

Definition at line 12 of file MuonParamElossPlots.cxx.

14 : PlotBase(pParent, sDir) {}
PlotBase(PlotBase *parent, std::string_view sDir)
Definition PlotBase.cxx:29

Member Function Documentation

◆ Book1D() [1/2]

TH1D * PlotBase::Book1D ( std::string_view name,
std::string_view labels,
int nBins,
float start,
float end,
bool prependDir = true )
inherited

Book a TH1D histogram.

Definition at line 94 of file PlotBase.cxx.

95 {
96 std::string prefix = constructPrefix(m_sDirectory, prependDir);
97 Bool_t oldstat = TH1::AddDirectoryStatus();
98 TH1::AddDirectory(false);
99 TH1D *hist = new TH1D(prefix.append(name).c_str(), labels.data(), nBins, start, end);
100 TH1::AddDirectory(oldstat);
101
102 hist->Sumw2();
103 m_vBookedHistograms.emplace_back(hist, m_sDirectory);
104 return hist;
105}
static std::string constructPrefix(std::string dir, bool prependDir)
Definition PlotBase.cxx:289
std::vector< HistData > m_vBookedHistograms
Definition PlotBase.h:98
std::string m_sDirectory
Definition PlotBase.h:101

◆ Book1D() [2/2]

TH1D * PlotBase::Book1D ( std::string_view name,
TH1 * refHist,
std::string_view labels,
bool prependDir = true )
inherited

Book a TH1D histogram using refHist as reference for number of bins and axis range.

Definition at line 108 of file PlotBase.cxx.

108 {
109 std::string prefix = constructPrefix(m_sDirectory, prependDir);
110 Bool_t oldstat = TH1::AddDirectoryStatus();
111 TH1::AddDirectory(false);
112 TH1D *hist = new TH1D(prefix.append(name).c_str(), labels.data(), refHist->GetNbinsX(),
113 refHist->GetXaxis()->GetXbins()->GetArray());
114 hist->Sumw2();
115 TH1::AddDirectory(oldstat);
116
117
118 m_vBookedHistograms.emplace_back(hist, m_sDirectory);
119 return hist;
120}

◆ Book2D() [1/3]

TH2F * PlotBase::Book2D ( std::string_view name,
std::string_view labels,
int nBinsX,
Double_t * binsX,
int nBinsY,
Double_t startY,
Double_t endY,
bool prependDir = true )
inherited

Book a TH2F histogram with variable x axis binning.

Definition at line 144 of file PlotBase.cxx.

145 {
146 std::string prefix = constructPrefix(m_sDirectory, prependDir);
147 Bool_t oldstat = TH2::AddDirectoryStatus();
148 TH2::AddDirectory(false);
149 TH2F *hist = new TH2F(prefix.append(name).c_str(), labels.data(), nBinsX, binsX, nBinsY, startY, endY);
150 hist->Sumw2();
151 TH2::AddDirectory(oldstat);
152 m_vBookedHistograms.emplace_back(hist, m_sDirectory);
153 return hist;
154}
TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)

◆ Book2D() [2/3]

TH2F * PlotBase::Book2D ( std::string_view name,
std::string_view labels,
int nBinsX,
float startX,
float endX,
int nBinsY,
float startY,
float endY,
bool prependDir = true )
inherited

Book a TH2F histogram.

Definition at line 123 of file PlotBase.cxx.

124 {
125 std::string prefix = constructPrefix(m_sDirectory, prependDir);
126 Bool_t oldstat = TH2::AddDirectoryStatus();
127 TH2::AddDirectory(false);
128 TH2F *hist = new TH2F(prefix.append(name).c_str(), labels.data(), nBinsX, startX, endX, nBinsY, startY, endY);
129 hist->Sumw2();
130 TH2::AddDirectory(oldstat);
131
132
133 m_vBookedHistograms.emplace_back(hist, m_sDirectory);
134 return hist;
135}

◆ Book2D() [3/3]

TH2F * PlotBase::Book2D ( std::string_view name,
TH2 * refHist,
std::string_view labels,
bool prependDir = true )
inherited

Book a TH2D histogram using refHist as reference for number of bins and axis range.

Definition at line 138 of file PlotBase.cxx.

138 {
139 return Book2D(name, labels, refHist->GetNbinsX(), refHist->GetXaxis()->GetXmin(), refHist->GetXaxis()->GetXmax(),
140 refHist->GetNbinsY(), refHist->GetYaxis()->GetXmin(), refHist->GetYaxis()->GetXmax(), prependDir);
141}
TH2F * Book2D(std::string_view name, std::string_view labels, int nBinsX, float startX, float endX, int nBinsY, float startY, float endY, bool prependDir=true)
Book a TH2F histogram.
Definition PlotBase.cxx:123

◆ Book3D() [1/2]

TH3F * PlotBase::Book3D ( std::string_view name,
std::string_view labels,
int nBinsX,
float startX,
float endX,
int nBinsY,
float startY,
float endY,
int nBinsZ,
float startZ,
float endZ,
bool prependDir = true )
inherited

Book a TH3F histogram.

Definition at line 157 of file PlotBase.cxx.

158 {
159 std::string prefix = constructPrefix(m_sDirectory, prependDir);
160 Bool_t oldstat = TH3::AddDirectoryStatus();
161 TH3::AddDirectory(false);
162 TH3F *hist = new TH3F(prefix.append(name).c_str(),
163 labels.data(), nBinsX, startX, endX, nBinsY, startY, endY, nBinsZ, startZ, endZ);
164 hist->Sumw2();
165 TH3::AddDirectory(oldstat);
166 m_vBookedHistograms.emplace_back(hist, m_sDirectory);
167 return hist;
168}

◆ Book3D() [2/2]

TH3F * PlotBase::Book3D ( std::string_view name,
TH3 * refHist,
std::string_view labels,
bool prependDir = true )
inherited

Book a TH3F histogram using refHist as reference for number of bins and axis range.

Definition at line 171 of file PlotBase.cxx.

171 {
172 std::string prefix = constructPrefix(m_sDirectory, prependDir);
173 Bool_t oldstat = TH3::AddDirectoryStatus();
174 TH3::AddDirectory(false);
175 TH3F *hist = new TH3F(prefix.append(name).c_str(), labels.data(), refHist->GetNbinsX(),
176 refHist->GetXaxis()->GetXbins()->GetArray(), refHist->GetNbinsY(),
177 refHist->GetYaxis()->GetXbins()->GetArray(), refHist->GetNbinsZ(),
178 refHist->GetZaxis()->GetXbins()->GetArray());
179 TH3::AddDirectory(oldstat);
180
181 m_vBookedHistograms.emplace_back(hist, m_sDirectory);
182 return hist;
183}

◆ BookTEfficiency() [1/2]

TEfficiency * PlotBase::BookTEfficiency ( std::string_view name,
std::string_view labels,
const int nBinsX,
const float xlo,
const float xhi,
const bool prependDir = true )
inherited

Book a (1-D) TEfficiency histogram.

Definition at line 257 of file PlotBase.cxx.

257 {
258 std::string prefix = constructPrefix(m_sDirectory, prependDir);
259 TEfficiency *hist = new TEfficiency(prefix.append(name).c_str(), labels.data(), nBinsX, xlo, xhi);
260 hist->SetDirectory(nullptr);
261 m_vBookedEfficiencies.emplace_back(hist, m_sDirectory);
262 return hist;
263}
std::vector< EfficiencyData > m_vBookedEfficiencies
Definition PlotBase.h:100

◆ BookTEfficiency() [2/2]

TEfficiency * PlotBase::BookTEfficiency ( std::string_view name,
std::string_view labels,
const int nBinsX,
const float xlo,
const float xhi,
const int nBinsy,
const float ylo,
const float yhi,
const bool prependDir = true )
inherited

Book a (2-D) TEfficiency histogram.

Definition at line 266 of file PlotBase.cxx.

266 {
267 std::string prefix = constructPrefix(m_sDirectory, prependDir);
268
269 TEfficiency *hist = new TEfficiency(prefix.append(name).c_str(), labels.data(), nBinsX, xlo, xhi, nBinsY, ylo, yhi);
270 hist->SetDirectory(nullptr);
271 m_vBookedEfficiencies.emplace_back(hist, m_sDirectory);
272
273 return hist;
274}

◆ BookTProfile() [1/2]

TProfile * PlotBase::BookTProfile ( std::string_view name,
std::string_view labels,
int nBinsX,
float * binsX,
bool prependDir = true )
inherited

Book a TProfile histogram with variable binning in x-axis.

Definition at line 204 of file PlotBase.cxx.

204 {
205 std::string prefix = constructPrefix(m_sDirectory, prependDir);
206 TProfile *hist(nullptr);
207 Bool_t oldstat = TProfile::AddDirectoryStatus();
208 TProfile::AddDirectory(false);
209
210 hist = new TProfile(prefix.append(name).c_str(), labels.data(), nBinsX, binsX);
211 TProfile::AddDirectory(oldstat);
212 m_vBookedHistograms.emplace_back(hist, m_sDirectory);
213 return hist;
214}

◆ BookTProfile() [2/2]

TProfile * PlotBase::BookTProfile ( std::string_view name,
std::string_view labels,
int nBinsX,
float startX,
float endX,
float startY = -1,
float endY = -1,
bool prependDir = true,
bool useRMS = false )
inherited

Book a TProfile histogram.

Definition at line 186 of file PlotBase.cxx.

187 {
188 std::string prefix = constructPrefix(m_sDirectory, prependDir);
189 TProfile *hist(nullptr);
190 Bool_t oldstat = TProfile::AddDirectoryStatus();
191 TProfile::AddDirectory(false);
192 std::string opt = useRMS ? "S" : "";
193 if ((startY == -1) and (endY == -1)) {
194 hist = new TProfile(prefix.append(name).c_str(), labels.data(), nBinsX, startX, endX, opt.c_str());
195 } else {
196 hist = new TProfile(prefix.append(name).c_str(), labels.data(), nBinsX, startX, endX, startY, endY, opt.c_str());
197 }
198 TProfile::AddDirectory(oldstat);
199 m_vBookedHistograms.emplace_back(hist, m_sDirectory);
200 return hist;
201}

◆ BookTProfile2D() [1/2]

TProfile2D * PlotBase::BookTProfile2D ( std::string_view name,
std::string_view labels,
const int nBinsX,
const double xlo,
const double xhi,
const int nBinsY,
const double ylo,
const double yhi,
bool prependDir = true,
bool useRMS = false )
inherited

Book a TProfile 2D histogram with variable binning in x-axis and limits in y-values.

Definition at line 231 of file PlotBase.cxx.

233 {
234 std::string prefix = constructPrefix(m_sDirectory, prependDir);
235 Bool_t oldstat = TProfile2D::AddDirectoryStatus();
236 TProfile2D::AddDirectory(false);
237 std::string opt = useRMS ? "S" : "";
238 TProfile2D *hist = new TProfile2D(prefix.append(name).c_str(), labels.data(), nBinsX, xlo, xhi, nBinsY, ylo, yhi, opt.c_str());
239 TProfile2D::AddDirectory(oldstat);
240 m_vBookedHistograms.emplace_back(hist, m_sDirectory);
241 return hist;
242}

◆ BookTProfile2D() [2/2]

TProfile2D * PlotBase::BookTProfile2D ( std::string_view name,
std::string_view labels,
const int nBinsX,
double * binsX,
const int nBinsY,
double * binsY,
bool prependDir = true,
bool useRMS = false )
inherited

Book a TProfile 2D histogram with variable binning in x-axis and limits in y-values.

Definition at line 245 of file PlotBase.cxx.

245 {
246 std::string prefix = constructPrefix(m_sDirectory, prependDir);
247 Bool_t oldstat = TProfile2D::AddDirectoryStatus();
248 TProfile2D::AddDirectory(false);
249 std::string opt = useRMS ? "S" : "";
250 TProfile2D *hist = new TProfile2D(prefix.append(name).c_str(), labels.data(), nBinsX, binsX, nBinsY, binsY, opt.c_str());
251 TProfile2D::AddDirectory(oldstat);
252 m_vBookedHistograms.emplace_back(hist, m_sDirectory);
253 return hist;
254}

◆ BookTProfileRangeY()

TProfile * PlotBase::BookTProfileRangeY ( std::string_view name,
std::string_view labels,
int nBinsX,
double * binsX,
double startY,
double endY,
bool prependDir = true )
inherited

Book a TProfile histogram with variable binning in x-axis and limits in y-values.

Definition at line 217 of file PlotBase.cxx.

218 {
219 std::string prefix = constructPrefix(m_sDirectory, prependDir);
220 TProfile *hist(nullptr);
221 Bool_t oldstat = TProfile::AddDirectoryStatus();
222 TProfile::AddDirectory(false);
223
224 hist = new TProfile(prefix.append(name).c_str(), labels.data(), (Int_t) nBinsX, binsX, startY, endY);
225 TProfile::AddDirectory(oldstat);
226 m_vBookedHistograms.emplace_back(hist, m_sDirectory);
227 return hist;
228}

◆ BookTree()

TTree * PlotBase::BookTree ( std::string_view name,
bool prependDir = true )
inherited

Book a TTree.

Definition at line 277 of file PlotBase.cxx.

277 {
278 std::string prefix = constructPrefix(m_sDirectory, prependDir);
279 TTree *tree = new TTree(prefix.append(name).c_str(), "");
280
281 tree->SetAutoSave(0);
282 tree->SetAutoFlush(0);
283 tree->SetDirectory(nullptr);
284 m_vBookedTrees.emplace_back(tree, m_sDirectory);
285 return tree;
286}
std::vector< TreeData > m_vBookedTrees
Definition PlotBase.h:99
TChain * tree

◆ constructPrefix()

std::string PlotBase::constructPrefix ( std::string dir,
bool prependDir )
staticprivateinherited

Definition at line 289 of file PlotBase.cxx.

289 {
290 if (!prependDir) {
291 return "";
292 }
293 std::replace(dir.begin(), dir.end(), '/', '_');
294 return dir;
295}

◆ fill()

void Muon::MuonParamElossPlots::fill ( const xAOD::TruthParticle & truthMu,
const xAOD::Muon & mu,
float weight = 1.0 )

Definition at line 112 of file MuonParamElossPlots.cxx.

113 {
114 FillPlot(msInnerMatchChi2, mu, xAOD::Muon::ParamDef::msInnerMatchChi2, weight);
115 FillPlot(msOuterMatchChi2, mu, xAOD::Muon::ParamDef::msOuterMatchChi2, weight);
116#ifndef XAOD_ANALYSIS
119 xAOD::Muon::ParamDef::EnergyLoss, 0.001, weight);
122 truthmu, mu, xAOD::Muon::ParamDef::MeasEnergyLoss, 0.001, weight);
123 FillPlot(ELossSigma, mu, xAOD::Muon::ParamDef::EnergyLossSigma, 0.001, weight);
126 truthmu, mu, xAOD::Muon::ParamDef::ParamEnergyLoss, 0.001, weight);
127 FillPlotELossType(ELossType, mu, 0.001, weight);
128 FillPlotELossType(ELossTypeNotIsoPt, mu, xAOD::Muon::EnergyLossType::NotIsolated, 0.001,
129 weight);
130 FillPlotELossType(ELossTypeParametrPt, mu, xAOD::Muon::EnergyLossType::Parametrized, 0.001,
131 weight);
132 FillPlotELossType(ELossTypeTailPt, mu, xAOD::Muon::EnergyLossType::Tail, 0.001, weight);
133#endif // not XAOD_ANALYSIS
134}
void FillPlotELossType(TH1 *hist, const xAOD::Muon &mu, float scale=1, float weight=1.0)
void FillPlot(TH1 *hist, const xAOD::Muon &mu, const xAOD::Muon::ParamDef paramDef, float scale=1, float weight=1.0)

◆ FillPlot() [1/2]

void Muon::MuonParamElossPlots::FillPlot ( TH1 * hist,
const xAOD::Muon & mu,
const xAOD::Muon::ParamDef paramDef,
float scale = 1,
float weight = 1.0 )
private

Definition at line 135 of file MuonParamElossPlots.cxx.

137 {
138 if (mu.muonType() == xAOD::Muon::MuonType::CaloTagged) {
139 return; // protection
140 }
141 float fpar = 0;
142 static const SG::ConstAccessor<float> elossAcc("EnergyLoss");
143 if (elossAcc.isAvailable(mu)) {
144 if (mu.parameter(fpar, paramDef)) {
145 hist->Fill(scale * fpar, weight); // scale to GeV, if needed
146 }
147 }
148 return;
149}

◆ FillPlot() [2/2]

void Muon::MuonParamElossPlots::FillPlot ( TH1 * hist,
TH1 * hist_DiffTruth,
TH1 * hist_DiffTruthEta0_1p35,
TH1 * hist_DiffTruthEta1p35_1p55,
TH1 * hist_DiffTruthEta1p55_endd,
const xAOD::TruthParticle & truthMu,
const xAOD::Muon & mu,
const xAOD::Muon::ParamDef paramDef,
float scale = 1,
float weight = 1.0 )
private

Definition at line 150 of file MuonParamElossPlots.cxx.

154 {
155 if (mu.muonType() == xAOD::Muon::MuonType::CaloTagged) {
156 return; // protection
157 }
158 float fpar = 0;
159 static const SG::ConstAccessor<float> elossAcc("EnergyLoss");
160 if (elossAcc.isAvailable(mu)) {
161 if (mu.parameter(fpar, paramDef)) {
162 hist->Fill(scale * fpar, weight); // scale to GeV, if needed
163 }
164
165 // get true energy loss
166 static const SG::ConstAccessor<float> pxAcc("px");
167 static const SG::ConstAccessor<float> pyAcc("py");
168 static const SG::ConstAccessor<float> pzAcc("pz");
169 static const SG::ConstAccessor<float> muonEnt_pxAcc(
170 "MuonEntryLayer_px");
171 static const SG::ConstAccessor<float> muonEnt_pyAcc(
172 "MuonEntryLayer_py");
173 static const SG::ConstAccessor<float> muonEnt_pzAcc(
174 "MuonEntryLayer_pz");
175 if (!pxAcc.isAvailable(truthprt) || !pyAcc.isAvailable(truthprt) ||
176 !pzAcc.isAvailable(truthprt) ||
177 !muonEnt_pxAcc.isAvailable(truthprt) ||
178 !muonEnt_pyAcc.isAvailable(truthprt) ||
179 !muonEnt_pzAcc.isAvailable(truthprt)) {
180 return;
181 }
182
183 // workaround for missing caloentry
184 Amg::Vector3D vecCaloEntry{pxAcc(truthprt), pyAcc(truthprt),
185 pzAcc(truthprt)};
186
187 Amg::Vector3D vecMuonExit{muonEnt_pxAcc(truthprt),
188 muonEnt_pyAcc(truthprt),
189 muonEnt_pzAcc(truthprt)};
190 float dpTruth = vecCaloEntry.mag() - vecMuonExit.mag();
191 hist_DiffTruth->Fill(scale * (fpar - dpTruth),
192 weight); // scale to GeV, if needed
193 // again in eta ranges
194 if (std::abs(mu.eta()) < 1.35) {
195 hist_DiffTruthEta0_1p35->Fill(scale * (fpar - dpTruth), weight);
196 } else {
197 if (std::abs(mu.eta()) < 1.55) {
198 hist_DiffTruthEta1p35_1p55->Fill(scale * (fpar - dpTruth),
199 weight);
200 } else {
201 hist_DiffTruthEta1p55_end->Fill(scale * (fpar - dpTruth),
202 weight);
203 }
204 }
205 }
206 return;
207}
Eigen::Matrix< double, 3, 1 > Vector3D

◆ FillPlotELossType() [1/2]

void Muon::MuonParamElossPlots::FillPlotELossType ( TH1 * hist,
const xAOD::Muon & mu,
float scale = 1,
float weight = 1.0 )
private

Definition at line 208 of file MuonParamElossPlots.cxx.

209 {
210 if (mu.muonType() == xAOD::Muon::MuonType::CaloTagged) {
211 return; // protection
212 }
213 static const SG::ConstAccessor<float> elossAcc("EnergyLoss");
214 if (elossAcc.isAvailable(mu)) {
215 hist->Fill(static_cast<int>(mu.energyLossType()), weight);
216 ELossTypeAllPt->Fill(mu.pt() * scale, weight);
217 float used = 0;
218 float meas = -100000;
219 float param = -100000;
220 if (mu.parameter(used, xAOD::Muon::ParamDef::EnergyLoss) &&
221 mu.parameter(param, xAOD::Muon::ParamDef::ParamEnergyLoss) &&
222 mu.parameter(meas, xAOD::Muon::ParamDef::MeasEnergyLoss)) {
223 // fill diff plots
224 if (mu.energyLossType() == xAOD::Muon::EnergyLossType::Parametrized) {
225 paramELossDiff->Fill((param - used) * scale, weight);
226 }
227 if (mu.energyLossType() == xAOD::Muon::EnergyLossType::Tail) {
228 measELossDiff->Fill((meas - used) * scale, weight);
229 }
230 }
231 }
232 return;
233}

◆ FillPlotELossType() [2/2]

void Muon::MuonParamElossPlots::FillPlotELossType ( TH1 * hist,
const xAOD::Muon & mu,
xAOD::Muon::EnergyLossType type,
float scale = 1,
float weight = 1.0 )
private

Definition at line 234 of file MuonParamElossPlots.cxx.

236 {
237 if (mu.muonType() == xAOD::Muon::MuonType::CaloTagged) {
238 return; // protection
239 }
240 static const SG::ConstAccessor<float> elossAcc("EnergyLoss");
241 if (elossAcc.isAvailable(mu)) {
242 if (mu.energyLossType() == type) {
243 hist->Fill(mu.pt() * scale, weight); // scale to GeV, if needed
244 }
245 }
246 return;
247}

◆ finalize()

void PlotBase::finalize ( )
inherited

Definition at line 47 of file PlotBase.cxx.

47 {
48 for (auto *subNode: m_vSubNodes) {
49 subNode->finalize();
50 }
52}
std::vector< PlotBase * > m_vSubNodes
Definition PlotBase.h:97
virtual void finalizePlots()
Definition PlotBase.h:93

◆ finalizePlots()

◆ getDirectory()

const std::string & PlotBase::getDirectory ( )
inlineinherited

Definition at line 89 of file PlotBase.h.

89{return m_sDirectory;}

◆ initialize()

void PlotBase::initialize ( )
inherited

Definition at line 39 of file PlotBase.cxx.

39 {
40 for (auto *subNode: m_vSubNodes) {
41 subNode->initialize();
42 }
44}
virtual void initializePlots()
Definition PlotBase.h:92

◆ initializePlots()

void Muon::MuonParamElossPlots::initializePlots ( )
privatevirtual

Reimplemented from PlotBase.

Definition at line 16 of file MuonParamElossPlots.cxx.

16 {
18 "msInnerMatchChi2",
19 "inner match #chi^{2};inner match #chi^{2};;Entries", 100, 0., 100.);
21 "msOuterMatchChi2",
22 "outer match #chi^{2};outer match #chi^{2};;Entries", 100, 0., 100.);
23
24 ELoss = Book1D("ELoss", "ELoss;ELoss [GeV];Entries", 50, 0, 10);
26 "ELossDiffTruth",
27 "Difference ELoss to truth ELoss);#Delta(fitted - truth) [GeV];Entries",
28 100, -10., 10.);
30 Book1D("ELossDiffTruthEta0_1p35",
31 "Difference ELoss to truth ELoss for "
32 "0<|#eta|<1.35;#Delta(fitted - truth) [GeV];Entries",
33 100, -10., 10.);
35 Book1D("ELossDiffTruthEta1p35_1p55",
36 "Difference ELoss to truth ELoss for "
37 "1.35<|#eta|<1.55;#Delta(fitted - truth) [GeV];Entries",
38 100, -10., 10.);
40 Book1D("ELossDiffTruthEta1p55_end",
41 "Difference ELoss to truth ELoss for 1.55<|#eta|;#Delta(fitted "
42 "- truth) [GeV];Entries",
43 100, -10., 10.);
45 Book1D("ELossSigma", "ELossSigma;ELossSgima [GeV];Entries", 50, 0, 5);
46
48 Book1D("paramELoss", "paramELoss;paramELoss [GeV];Entries", 50, 0, 10);
49 paramELossDiff = Book1D("paramELossDiff",
50 "Difference paramELoss to fitted "
51 "ELoss;#Delta(param-fitted) [GeV];Entries",
52 100, -3., 1.);
53 paramELossDiffTruth = Book1D("paramELossDiffTruth",
54 "Difference paramELoss to truth "
55 "ELoss;#Delta(param-truth) [GeV];Entries",
56 100, -10., 10.);
58 Book1D("paramELossDiffTruthEta0_1p35",
59 "Difference paramELoss to truth ELoss for "
60 "0<|#eta|<1.35;#Delta(param-truth) [GeV];Entries",
61 100, -10., 10.);
63 Book1D("paramELossDiffTruthEta1p35_1p55",
64 "Difference paramELoss to truth ELoss for "
65 "1.35<|#eta|<1.55;#Delta(param-truth) [GeV];Entries",
66 100, -10., 10.);
68 Book1D("paramELossDiffTruthhEta1p55_end",
69 "Difference paramELoss to truth ELoss for "
70 "1.55<|#eta|;#Delta(param-truth) [GeV];Entries",
71 100, -10., 10.);
72
73 measELoss =
74 Book1D("measELoss", "measELoss;measELoss [GeV];Entries", 50, 0, 10);
75 measELossDiff = Book1D("measELossDiff",
76 "Difference measELoss to fitted ELoss);#Delta(meas- "
77 "fitted) [GeV];Entries",
78 100, -3., 1.);
79 measELossDiffTruth = Book1D("measELossDiffTruth",
80 "Difference measELoss to truth "
81 "ELoss);#Delta(meas- truth) [GeV];Entries",
82 100, -10., 10.);
84 Book1D("measELossDiffTruthEta0_1p35",
85 "Difference measELoss to truth ELoss for "
86 "0<|#eta|<1.35;#Delta(meas- truth) [GeV];Entries",
87 100, -10., 10.);
89 Book1D("measELossDiffTruthEta1p35_1p55",
90 "Difference measELoss to truth ELoss for "
91 "1.35<|#eta|<1.55;#Delta(meas- truth) [GeV];Entries",
92 100, -10., 10.);
94 Book1D("measELossDiffTruthEta1p55_end",
95 "Difference measELoss to truth ELoss for "
96 "1.55<|#eta|;#Delta(meas- truth) [GeV];Entries",
97 100, -10., 10.);
98
99 ELossType = Book1D("ELossType", "ELossType;Type;Entries", 5, -0.5, 4.5);
101 Book1D("ELossTypeParametrPt",
102 "ELossType:Parametrized Pt;Pt [GeV];Entries", 50, 0, 500);
104 Book1D("ELossTypeNotIsoPt", "ELossType:NotIsolated Pt;Pt [GeV];Entries",
105 50, 0, 500);
106 ELossTypeTailPt = Book1D("ELossTypeTailPt",
107 "ELossType:Tail Pt;Pt [GeV];Entries", 50, 0, 500);
108 ELossTypeAllPt = Book1D("ELossTypeAllPt",
109 "All ELossTypes Pt;Pt [GeV];Entries", 50, 0, 500);
110}
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

◆ RegisterSubPlot()

void PlotBase::RegisterSubPlot ( PlotBase * pPlotBase)
inlineinherited

Definition at line 42 of file PlotBase.h.

42{m_vSubNodes.push_back(pPlotBase);}

◆ retrieveBookedEfficiencies()

std::vector< EfficiencyData > PlotBase::retrieveBookedEfficiencies ( )
inherited

Retrieve all booked efficiency objects.

Definition at line 83 of file PlotBase.cxx.

83 {
84 std::vector<EfficiencyData> vBookedEfficiencies = m_vBookedEfficiencies;
85 for (const auto &subNode: m_vSubNodes) {
86 std::vector<EfficiencyData> subNodeHists = subNode->retrieveBookedEfficiencies();
87 vBookedEfficiencies.insert(vBookedEfficiencies.end(), subNodeHists.begin(), subNodeHists.end());
88 }
89 return vBookedEfficiencies;
90}

◆ retrieveBookedHistograms()

std::vector< HistData > PlotBase::retrieveBookedHistograms ( )
inherited

Retrieve all booked histograms.

Definition at line 63 of file PlotBase.cxx.

63 {
64 std::vector<HistData> vBookedHistograms = m_vBookedHistograms;
65 for (const auto &subNode: m_vSubNodes) {
66 std::vector<HistData> subNodeHists = subNode->retrieveBookedHistograms();
67 vBookedHistograms.insert(vBookedHistograms.end(), subNodeHists.begin(), subNodeHists.end());
68 }
69 return vBookedHistograms;
70}

◆ retrieveBookedTrees()

std::vector< TreeData > PlotBase::retrieveBookedTrees ( )
inherited

Retrieve all booked trees.

Definition at line 73 of file PlotBase.cxx.

73 {
74 std::vector<TreeData> vBookedTrees = m_vBookedTrees;
75 for (auto *subNode: m_vSubNodes) {
76 std::vector<TreeData> subNodeTrees = subNode->retrieveBookedTrees();
77 vBookedTrees.insert(vBookedTrees.end(), subNodeTrees.begin(), subNodeTrees.end());
78 }
79 return vBookedTrees;
80}

◆ setDetailLevel()

void PlotBase::setDetailLevel ( int iDetailLevel)
inherited

Definition at line 55 of file PlotBase.cxx.

55 {
56 for (auto *subNode: m_vSubNodes) {
57 subNode->setDetailLevel(iDetailLevel);
58 }
59 m_iDetailLevel = iDetailLevel;
60}
int m_iDetailLevel
Definition PlotBase.h:102

Member Data Documentation

◆ ELoss

TH1* Muon::MuonParamElossPlots::ELoss {nullptr}

Definition at line 25 of file MuonParamElossPlots.h.

25{nullptr};

◆ ELossDiffTruth

TH1* Muon::MuonParamElossPlots::ELossDiffTruth {nullptr}

Definition at line 26 of file MuonParamElossPlots.h.

26{nullptr};

◆ ELossDiffTruthEta0_1p35

TH1* Muon::MuonParamElossPlots::ELossDiffTruthEta0_1p35 {nullptr}

Definition at line 27 of file MuonParamElossPlots.h.

27{nullptr};

◆ ELossDiffTruthEta1p35_1p55

TH1* Muon::MuonParamElossPlots::ELossDiffTruthEta1p35_1p55 {nullptr}

Definition at line 28 of file MuonParamElossPlots.h.

28{nullptr};

◆ ELossDiffTruthEta1p55_end

TH1* Muon::MuonParamElossPlots::ELossDiffTruthEta1p55_end {nullptr}

Definition at line 29 of file MuonParamElossPlots.h.

29{nullptr};

◆ ELossSigma

TH1* Muon::MuonParamElossPlots::ELossSigma {nullptr}

Definition at line 30 of file MuonParamElossPlots.h.

30{nullptr};

◆ ELossType

TH1* Muon::MuonParamElossPlots::ELossType {nullptr}

Definition at line 43 of file MuonParamElossPlots.h.

43{nullptr};

◆ ELossTypeAllPt

TH1* Muon::MuonParamElossPlots::ELossTypeAllPt {nullptr}

Definition at line 47 of file MuonParamElossPlots.h.

47{nullptr};

◆ ELossTypeNotIsoPt

TH1* Muon::MuonParamElossPlots::ELossTypeNotIsoPt {nullptr}

Definition at line 45 of file MuonParamElossPlots.h.

45{nullptr};

◆ ELossTypeParametrPt

TH1* Muon::MuonParamElossPlots::ELossTypeParametrPt {nullptr}

Definition at line 44 of file MuonParamElossPlots.h.

44{nullptr};

◆ ELossTypeTailPt

TH1* Muon::MuonParamElossPlots::ELossTypeTailPt {nullptr}

Definition at line 46 of file MuonParamElossPlots.h.

46{nullptr};

◆ m_iDetailLevel

int PlotBase::m_iDetailLevel
protectedinherited

Definition at line 102 of file PlotBase.h.

◆ m_sDirectory

std::string PlotBase::m_sDirectory
protectedinherited

Definition at line 101 of file PlotBase.h.

◆ m_vBookedEfficiencies

std::vector<EfficiencyData> PlotBase::m_vBookedEfficiencies
protectedinherited

Definition at line 100 of file PlotBase.h.

◆ m_vBookedHistograms

std::vector<HistData> PlotBase::m_vBookedHistograms
protectedinherited

Definition at line 98 of file PlotBase.h.

◆ m_vBookedTrees

std::vector<TreeData> PlotBase::m_vBookedTrees
protectedinherited

Definition at line 99 of file PlotBase.h.

◆ m_vSubNodes

std::vector<PlotBase*> PlotBase::m_vSubNodes
protectedinherited

Definition at line 97 of file PlotBase.h.

◆ measELoss

TH1* Muon::MuonParamElossPlots::measELoss {nullptr}

Definition at line 37 of file MuonParamElossPlots.h.

37{nullptr};

◆ measELossDiff

TH1* Muon::MuonParamElossPlots::measELossDiff {nullptr}

Definition at line 38 of file MuonParamElossPlots.h.

38{nullptr};

◆ measELossDiffTruth

TH1* Muon::MuonParamElossPlots::measELossDiffTruth {nullptr}

Definition at line 39 of file MuonParamElossPlots.h.

39{nullptr};

◆ measELossDiffTruthEta0_1p35

TH1* Muon::MuonParamElossPlots::measELossDiffTruthEta0_1p35 {nullptr}

Definition at line 40 of file MuonParamElossPlots.h.

40{nullptr};

◆ measELossDiffTruthEta1p35_1p55

TH1* Muon::MuonParamElossPlots::measELossDiffTruthEta1p35_1p55 {nullptr}

Definition at line 41 of file MuonParamElossPlots.h.

41{nullptr};

◆ measELossDiffTruthEta1p55_end

TH1* Muon::MuonParamElossPlots::measELossDiffTruthEta1p55_end {nullptr}

Definition at line 42 of file MuonParamElossPlots.h.

42{nullptr};

◆ msInnerMatchChi2

TH1* Muon::MuonParamElossPlots::msInnerMatchChi2 {nullptr}

Definition at line 22 of file MuonParamElossPlots.h.

22{nullptr};

◆ msOuterMatchChi2

TH1* Muon::MuonParamElossPlots::msOuterMatchChi2 {nullptr}

Definition at line 23 of file MuonParamElossPlots.h.

23{nullptr};

◆ paramELoss

TH1* Muon::MuonParamElossPlots::paramELoss {nullptr}

Definition at line 31 of file MuonParamElossPlots.h.

31{nullptr};

◆ paramELossDiff

TH1* Muon::MuonParamElossPlots::paramELossDiff {nullptr}

Definition at line 32 of file MuonParamElossPlots.h.

32{nullptr};

◆ paramELossDiffTruth

TH1* Muon::MuonParamElossPlots::paramELossDiffTruth {nullptr}

Definition at line 33 of file MuonParamElossPlots.h.

33{nullptr};

◆ paramELossDiffTruthEta0_1p35

TH1* Muon::MuonParamElossPlots::paramELossDiffTruthEta0_1p35 {nullptr}

Definition at line 34 of file MuonParamElossPlots.h.

34{nullptr};

◆ paramELossDiffTruthEta1p35_1p55

TH1* Muon::MuonParamElossPlots::paramELossDiffTruthEta1p35_1p55 {nullptr}

Definition at line 35 of file MuonParamElossPlots.h.

35{nullptr};

◆ paramELossDiffTruthEta1p55_end

TH1* Muon::MuonParamElossPlots::paramELossDiffTruthEta1p55_end {nullptr}

Definition at line 36 of file MuonParamElossPlots.h.

36{nullptr};

The documentation for this class was generated from the following files: