ATLAS Offline Software
Loading...
Searching...
No Matches
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
7
8namespace Trk {
9 void
11 truthType = nullptr;
12 origin = nullptr;
13 }
14
15 void
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}
Helper class to provide constant type-safe access to aux data.
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
Helper class to provide constant type-safe access to aux data.
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
void fill(const xAOD::TruthParticle &truthprt, float weight=1.0)
Ensure that the ATLAS eigen extensions are properly loaded.
TruthParticle_v1 TruthParticle
Typedef to implementation.