ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
TrkValidation
TrkValHistUtils
Root
TruthInfoPlots.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 "
TrkValHistUtils/TruthInfoPlots.h
"
6
#include "
AthContainers/ConstAccessor.h
"
7
8
namespace
Trk
{
9
void
10
TruthInfoPlots::init
() {
11
truthType
=
nullptr
;
12
origin
=
nullptr
;
13
}
14
15
void
16
TruthInfoPlots::initializePlots
() {
17
truthType
=
Book1D
(
"truthType"
,
"truthType;truthType;Entries"
, 50, -0.5, 49.5);
18
origin
=
Book1D
(
"truthOrigin"
,
"truthOrigin;truthOrigin;Entries"
, 40, -0.5, 39.5);
19
}
20
21
void
22
TruthInfoPlots::fill
(
const
xAOD::TruthParticle
&truthprt,
float
weight ) {
23
static
const
SG::ConstAccessor<int>
truthTypeAcc (
"truthType"
);
24
if
(truthTypeAcc.
isAvailable
(truthprt)) {
25
truthType
->Fill(truthTypeAcc (truthprt), weight);
26
}
27
static
const
SG::ConstAccessor<int>
truthOriginAcc (
"truthOrigin"
);
28
if
(truthOriginAcc.
isAvailable
(truthprt)) {
29
origin
->Fill(truthOriginAcc (truthprt), weight);
30
}
31
}
32
}
ConstAccessor.h
Helper class to provide constant type-safe access to aux data.
TruthInfoPlots.h
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
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.
Trk::TruthInfoPlots::init
void init()
Definition
TruthInfoPlots.cxx:10
Trk::TruthInfoPlots::initializePlots
void initializePlots()
Definition
TruthInfoPlots.cxx:16
Trk::TruthInfoPlots::fill
void fill(const xAOD::TruthParticle &truthprt, float weight=1.0)
Definition
TruthInfoPlots.cxx:22
Trk::TruthInfoPlots::origin
TH1 * origin
Definition
TruthInfoPlots.h:19
Trk::TruthInfoPlots::truthType
TH1 * truthType
Definition
TruthInfoPlots.h:18
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition
FakeTrackBuilder.h:9
xAOD::TruthParticle
TruthParticle_v1 TruthParticle
Typedef to implementation.
Definition
Event/xAOD/xAODTruth/xAODTruth/TruthParticle.h:15
Generated on
for ATLAS Offline Software by
1.17.0