ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonValidation
MuonHistogramming
MuonHistUtils
Root
MuonParamPlots.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
MuonHistUtils/MuonParamPlots.h
"
6
7
#include "
AthContainers/ConstAccessor.h
"
8
#include "
xAODTracking/TrackingPrimitives.h
"
9
10
namespace
Muon
{
11
12
MuonParamPlots::MuonParamPlots
(
PlotBase
* pParent,
const
std::string& sDir)
13
:
PlotBase
(pParent, sDir)
14
15
{}
16
17
void
MuonParamPlots::initializePlots
() {
18
msInnerMatchChi2
=
Book1D
(
"msInnerMatchChi2"
,
19
"inner match #chi^{2};inner match #chi^{2};;Entries"
, 100, 0., 100.);
20
21
ELoss
=
Book1D
(
"ELoss"
,
"ELoss;ELoss [GeV];Entries"
, 100, 0, 20);
22
ELossSigma
=
Book1D
(
"ELossSigma"
,
"ELossSigma;ELossSgima [GeV];Entries"
, 50, 0, 5);
23
24
paramELoss
=
Book1D
(
"paramELoss"
,
"paramELoss;paramELoss [GeV];Entries"
, 50, 0, 10);
25
measELoss
=
Book1D
(
"measELoss"
,
"measELoss;measELoss [GeV];Entries"
, 100, 0, 20);
26
}
27
28
void
MuonParamPlots::fill
(
const
xAOD::Muon
& mu,
float
weight) {
29
FillPlot
(
msInnerMatchChi2
, mu, xAOD::Muon::ParamDef::msInnerMatchChi2, weight);
30
FillPlot
(
ELoss
, mu, xAOD::Muon::ParamDef::EnergyLoss, 0.001, weight);
31
FillPlot
(
measELoss
, mu, xAOD::Muon::ParamDef::MeasEnergyLoss, 0.001, weight);
32
FillPlot
(
ELossSigma
, mu, xAOD::Muon::ParamDef::EnergyLossSigma, 0.001, weight);
33
FillPlot
(
paramELoss
, mu, xAOD::Muon::ParamDef::ParamEnergyLoss, 0.001, weight);
34
}
35
36
void
MuonParamPlots::FillPlot
(TH1* hist,
const
xAOD::Muon
& mu,
37
const
xAOD::Muon::ParamDef paramDef,
float
scale,
38
float
weight) {
39
if
(mu.muonType() == xAOD::Muon::MuonType::CaloTagged) {
40
return
;
// protection
41
}
42
float
fpar = 0;
43
static
const
SG::ConstAccessor<float>
elossAcc(
"EnergyLoss"
);
44
if
(elossAcc.
isAvailable
(mu)) {
45
if
(mu.parameter(fpar, paramDef)) {
46
hist->Fill(scale * fpar, weight);
// scale to GeV, if needed
47
}
48
}
49
return
;
50
}
51
52
}
// namespace Muon
ConstAccessor.h
Helper class to provide constant type-safe access to aux data.
MuonParamPlots.h
TrackingPrimitives.h
Muon::MuonParamPlots::ELossSigma
TH1 * ELossSigma
Definition
MuonParamPlots.h:24
Muon::MuonParamPlots::MuonParamPlots
MuonParamPlots(PlotBase *pParent, const std::string &sDir)
Definition
MuonParamPlots.cxx:12
Muon::MuonParamPlots::fill
void fill(const xAOD::Muon &mu, float weight=1.0)
Definition
MuonParamPlots.cxx:28
Muon::MuonParamPlots::ELoss
TH1 * ELoss
Definition
MuonParamPlots.h:23
Muon::MuonParamPlots::msInnerMatchChi2
TH1 * msInnerMatchChi2
Definition
MuonParamPlots.h:20
Muon::MuonParamPlots::paramELoss
TH1 * paramELoss
Definition
MuonParamPlots.h:25
Muon::MuonParamPlots::FillPlot
void FillPlot(TH1 *hist, const xAOD::Muon &mu, const xAOD::Muon::ParamDef paramDef, float scale=1, float weight=1.0)
Definition
MuonParamPlots.cxx:36
Muon::MuonParamPlots::initializePlots
void initializePlots()
Definition
MuonParamPlots.cxx:17
Muon::MuonParamPlots::measELoss
TH1 * measELoss
Definition
MuonParamPlots.h:26
PlotBase::Book1D
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
PlotBase(PlotBase *parent, std::string_view sDir)
Definition
PlotBase.cxx:29
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition
ConstAccessor.h:55
SG::ConstAccessor::isAvailable
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
Muon
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition
TrackSystemController.h:46
xAOD::Muon
Muon_v1 Muon
Reference the current persistent version:
Definition
Event/xAOD/xAODMuon/xAODMuon/Muon.h:13
Generated on
for ATLAS Offline Software by
1.17.0