ATLAS Offline Software
Loading...
Searching...
No Matches
AthTruthSelectionTool Class Reference

class to apply selection to xAOD::TruthParticles,required by validation More...

#include <AthTruthSelectionTool.h>

Inheritance diagram for AthTruthSelectionTool:
Collaboration diagram for AthTruthSelectionTool:

Public Member Functions

 AthTruthSelectionTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~AthTruthSelectionTool ()
StatusCode initialize () final
StatusCode finalize () final
virtual IAthSelectionTool::CutResult accept (const xAOD::IParticle *particle) const final
 The most important method to determine whether the particle is accepted.
virtual IAthSelectionTool::CutResult testAllCuts (const xAOD::IParticle *p, std::vector< unsigned int > &counter) const final
 The most important method to determine whether the particle is accepted.
unsigned int nCuts () const final
 return the number of cuts.
std::vector< std::string > names () const final
 return the names of the cuts as a vector<string>
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Static Public Member Functions

static const InterfaceID & interfaceID ()
 interfaceID reimplemented from base

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

CutList< xAOD::TruthParticlem_cutList
FloatProperty m_maxEta {this, "maxEta", 2.5}
FloatProperty m_maxPt {this, "maxPt", -1.}
FloatProperty m_minPt {this, "minPt", 400.}
BooleanProperty m_requireOnlyPrimary {this, "requireOnlyPrimary", true}
BooleanProperty m_requireCharged {this, "requireCharged", true}
IntegerProperty m_selectedCharge {this, "selectedCharge", 0}
BooleanProperty m_requireStable {this, "requireStable", true}
IntegerProperty m_requireSiHit {this, "requireSiHit", 0}
FloatProperty m_maxProdVertRadius {this, "maxProdVertRadius", 110.}
FloatProperty m_minProdVertRadius {this, "minProdVertRadius", 0.}
FloatProperty m_minAbsD0 {this, "minAbsD0", 0.}
IntegerProperty m_pdgId {this, "pdgId", -1}
IntegerProperty m_vetoPdgId {this, "vetoPdgId", -1}
BooleanProperty m_grandparent {this, "hasNoGrandparent", false}
BooleanProperty m_poselectronfromgamma {this, "poselectronfromgamma", false}
std::vector< unsigned int > m_counters {}
IntegerArrayProperty m_ancestors {this, "ancestorList", {}}
FloatProperty m_radiusCylinder
FloatProperty m_minZCylinder
FloatProperty m_maxZCylinder
FloatProperty m_zDisc
FloatProperty m_minRadiusDisc
FloatProperty m_maxRadiusDisc
std::unique_ptr< Trk::CylinderSurfacem_cylinder
std::unique_ptr< Trk::DiscSurfacem_disc1
std::unique_ptr< Trk::DiscSurfacem_disc2
PublicToolHandle< Trk::IExtrapolatorm_extrapolator {this,"Extrapolator","Trk::Extrapolator/AtlasExtrapolator",""}
 Too handle for truth-track extrapolation.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

class to apply selection to xAOD::TruthParticles,required by validation

Definition at line 28 of file AthTruthSelectionTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ AthTruthSelectionTool()

AthTruthSelectionTool::AthTruthSelectionTool ( const std::string & type,
const std::string & name,
const IInterface * parent )

Definition at line 44 of file AthTruthSelectionTool.cxx.

45 :
46 AthAlgTool(type, name, parent)
47{
48 // declare interface from base class
49 declareInterface<IAthSelectionTool>(this);
50}
AthAlgTool()
Default constructor:

◆ ~AthTruthSelectionTool()

virtual AthTruthSelectionTool::~AthTruthSelectionTool ( )
inlinevirtual

Definition at line 31 of file AthTruthSelectionTool.h.

31 {
32 /*nop*/
33 };

Member Function Documentation

◆ accept()

IAthSelectionTool::CutResult AthTruthSelectionTool::accept ( const xAOD::IParticle * p) const
finalvirtual

The most important method to determine whether the particle is accepted.

Parameters
pPointer to particle baseclass, will be cast to truth or track
Returns
the number of cuts which are not passed or tested

Implements IAthSelectionTool.

Definition at line 269 of file AthTruthSelectionTool.cxx.

269 {
270 const xAOD::TruthParticle* pTruth = dynamic_cast<const xAOD::TruthParticle*>(particle);
271
272 //@TODO
273 if (not pTruth) {
274 return m_cutList.size()+1; // marker for invalid particles
275 }
276 return m_cutList.accept(*pTruth);
277}
CutList< xAOD::TruthParticle > m_cutList
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
TruthParticle_v1 TruthParticle
Typedef to implementation.

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ finalize()

StatusCode AthTruthSelectionTool::finalize ( )
final

Definition at line 257 of file AthTruthSelectionTool.cxx.

257 {
258 // nop
259 return StatusCode::SUCCESS;
260}

◆ initialize()

StatusCode AthTruthSelectionTool::initialize ( )
final

Definition at line 53 of file AthTruthSelectionTool.cxx.

53 {
54 // can set cut properties now
55 using P_t = xAOD::TruthParticle;
56 using Accept_t = Accept<P_t>;
57 //
58 const std::vector<Accept_t> filters = {
59 // if p.pt=0, TVector3 generates an error when querying p.eta(); a limit of 1e-7 was not found to be enough to
60 // prevent this
61 // the following also vetoes the case where the p.pt()=NaN, as any inequality with NaN evaluates to false
62 Accept_t([this](const P_t& p) -> bool {
63 return((p.pt() > 0.1) ? (std::abs(p.eta()) < m_maxEta) : false);
64 }, std::string("eta")),
65 Accept_t([this](const P_t& p) -> bool {
66 return(p.pt() > m_minPt);
67 }, std::string("min_pt"))
68 };
69 //
70 m_cutList = CutList<P_t>(filters);
71 if (m_maxProdVertRadius>0) {
72 m_cutList.add(Accept_t([&m_maxProdVertRadius = std::as_const(m_maxProdVertRadius)](const P_t& p) -> bool {
73 return((not (p.hasProdVtx()))or(p.prodVtx()->perp() < m_maxProdVertRadius));
74 },
75 "decay_before_" + std::to_string(m_maxProdVertRadius)));
76 }
77 if (m_minProdVertRadius>0) {
78 m_cutList.add(Accept_t([&m_minProdVertRadius = std::as_const(m_minProdVertRadius)](const P_t& p) -> bool {
79 return((not (p.hasProdVtx()))or(p.prodVtx()->perp() > m_minProdVertRadius));
80 },
81 "decay_after_" + std::to_string(m_minProdVertRadius)));
82 }
83 if (m_minAbsD0>0) {
84 m_cutList.add(Accept_t([&m_minAbsD0 = std::as_const(m_minAbsD0)](const P_t& p) -> bool {
85 static const SG::ConstAccessor<float> d0Acc("d0");
86 if (d0Acc.isAvailable(p)) return (std::abs(d0Acc(p)) > m_minAbsD0);
87 else return false;
88 }, "min_abs_d0_" + std::to_string(m_minAbsD0)));
89 }
90 if (m_maxPt > 0) {
91 m_cutList.add(Accept_t([&m_maxPt = std::as_const(m_maxPt)](const P_t& p) {
92 return(p.pt() < m_maxPt);
93 }, "max_pt"));
94 }
95 if (m_requireSiHit > 0) {
96 m_cutList.add(Accept_t([&m_requireSiHit = std::as_const(m_requireSiHit)](const P_t& p) {
97 static const SG::AuxElement::ConstAccessor< float > nSilHitsAcc("nSilHits");
98 if (nSilHitsAcc.isAvailable(p)) return (nSilHitsAcc(p) >= m_requireSiHit);
99 else return false;
100 }, "siHit"));
101 }
103 m_cutList.add(Accept_t([](const P_t& p) {
105 }, "OnlyPrimary"));
106 }
107 if (m_requireCharged) {
108 m_cutList.add(Accept_t([&m_selectedCharge = std::as_const(m_selectedCharge)](const P_t& p) {
109 if(m_selectedCharge ==0) return(not (p.isNeutral()));
110 else return(not(p.isNeutral()) and p.charge()==m_selectedCharge);
111 }, "charged"));
112 }
113 if (m_requireStable) {
114 m_cutList.add(Accept_t([](const P_t& p) {
115 return(MC::isStable(&p));
116 }, "stable"));
117 }
118 if (m_pdgId > 0) {
119 m_cutList.add(Accept_t([&m_pdgId = std::as_const(m_pdgId)](const P_t& p) {
120 return(std::abs(p.pdgId()) == m_pdgId);
121 }, "pdgId"));
122 }
123 if (m_vetoPdgId > 0) {
124 m_cutList.add(Accept_t([&m_vetoPdgId = std::as_const(m_vetoPdgId)](const P_t& p) {
125 return(std::abs(p.pdgId()) != m_vetoPdgId);
126 }, "vetoPdgId"));
127 }
128 if (m_grandparent) {
129 m_cutList.add(Accept_t([](const P_t& p) {
130 return((p.nParents() == 0) || ((p.nParents() == 1)and((p.parent(0))->nParents() == 0)));
131 }, "hasNoGrandparent"));
132 }
133 //require the truth particles to come from certain ancesters
134 if (!m_ancestors.empty()) {
135 m_cutList.add(Accept_t([&m_ancestors = std::as_const(m_ancestors)](const P_t& p) -> bool {
136 const xAOD::TruthParticle* pTruth = dynamic_cast<const xAOD::TruthParticle*>(&p);
137 if (not pTruth) return false;
138 else return hasAncestor(pTruth, m_ancestors);
139 }, "ancestors"));
140 }
142 m_cutList.add(Accept_t([](const P_t& p) {
143 return((p.absPdgId() == electronId)and(p.nParents() >= 1) and(p.parent(0)) and(p.parent(0)->pdgId() == gammaId));
144 }, "poselectronfromgamma"));
145 }
146 if (m_radiusCylinder > 0) {
147 // m_cutList.add(Accept_t(acceptExtrapolatedTPToSurface, "SelectCylinder"));
148 if (not m_cylinder) {
149 ATH_MSG_VERBOSE("Creating and caching cylinder surface");
150 Amg::Transform3D trnsf;
151 trnsf.setIdentity();
152 m_cylinder = std::make_unique<Trk::CylinderSurface>( trnsf, m_radiusCylinder, 20000.);
153 }
154 m_cutList.add(Accept_t([this](const P_t& p) -> bool {
155 ATH_MSG_VERBOSE("Checking particle for intersection with cylinder of radius " << m_radiusCylinder);
156 //create surface we extrapolate to and cache it
157 const xAOD::TruthVertex* ptruthVertex = p.prodVtx();
158 if (ptruthVertex == nullptr) {
159 //cannot derive production vertex, reject track
160 ATH_MSG_VERBOSE("Rejecting particle without production vertex.");
161 return false;
162 }
163 const auto xPos = ptruthVertex->x();
164 const auto yPos = ptruthVertex->y();
165 const auto z_truth = ptruthVertex->z();
166 const Amg::Vector3D position(xPos, yPos, z_truth);
167 const Amg::Vector3D momentum(p.px(), p.py(), p.pz());
168 const Trk::CurvilinearParameters cParameters(position, momentum, p.charge());
169 const Trk::TrackParameters *exParameters = m_extrapolator->extrapolate(Gaudi::Hive::currentContext(),
170 cParameters,
171 *m_cylinder,
172 Trk::anyDirection, false, Trk::pion).release();
173 if (!exParameters) {
174 ATH_MSG_VERBOSE("Failed extrapolation. Rejecting track.");
175 return false;
176 }
177 ATH_MSG_VERBOSE("Extrapolated parameters to cylinder: " << *exParameters);
178 const float ex_abs_z = fabs(exParameters->position().z());
179 if ( (ex_abs_z > m_minZCylinder) and (ex_abs_z < m_maxZCylinder) ) {
180 ATH_MSG_VERBOSE("Particle accepted.");
181 return true;
182 }
183 //else..
184 ATH_MSG_VERBOSE("Particle rejected");
185 return false;
186 }, "SelectCylinder"));
187 } else if (m_zDisc > 0) {
188 //m_cutList.add(Accept_t(acceptExtrapolatedTPToSurface, "SelectDisc"));
189 if (not m_disc1 || not m_disc2) { //m_disc2 == 0 implied
190 ATH_MSG_VERBOSE("Creating and caching disc surface");
192 m_disc1 = std::make_unique<Trk::DiscSurface>( trnsf_shiftZ, m_minRadiusDisc, m_maxRadiusDisc);
193 trnsf_shiftZ = Amg::Translation3D(0.,0.,-m_zDisc);
194 m_disc2 = std::make_unique<Trk::DiscSurface>( trnsf_shiftZ, m_minRadiusDisc, m_maxRadiusDisc);
195 }
196 m_cutList.add(Accept_t([this](const P_t& p) -> bool {
197 ATH_MSG_VERBOSE("Checking particle for intersection with discs of |z| " << m_zDisc);
198 //create surface we extrapolate to and cache it
199 const xAOD::TruthVertex* ptruthVertex = p.prodVtx();
200 if (ptruthVertex == nullptr) {
201 //cannot derive production vertex, reject track
202 ATH_MSG_VERBOSE("Rejecting particle without production vertex.");
203 return false;
204 }
205 const auto xPos = ptruthVertex->x();
206 const auto yPos = ptruthVertex->y();
207 const auto z_truth = ptruthVertex->z();
208 const Amg::Vector3D position(xPos, yPos, z_truth);
209 const Amg::Vector3D momentum(p.px(), p.py(), p.pz());
210 const Trk::CurvilinearParameters cParameters(position, momentum, p.charge());
211 const Trk::TrackParameters *exParameters = m_extrapolator->extrapolate(Gaudi::Hive::currentContext(),
212 cParameters,
213 *m_disc1, Trk::anyDirection, true, Trk::pion).release();
214 if (exParameters) {
215 //since boundary check is true, should be enough to say we've hit the disk..
216 ATH_MSG_VERBOSE("Successfully extrapolated track to disk at +" << m_zDisc << ": " << *exParameters);
217 float ex_radius = sqrt(pow(exParameters->position().x(),2)+pow(exParameters->position().y(),2));
218 ATH_MSG_VERBOSE("radial position at surface: " << ex_radius);
219 if ((ex_radius > m_minRadiusDisc) and (ex_radius < m_maxRadiusDisc)) {
220 ATH_MSG_VERBOSE("Confirmed within the disk. Accepting particle");
221 return true;
222 }
223 //else...
224 ATH_MSG_VERBOSE("Strange, extrapolation succeeded but extrapolated position not within disc radius! Test next disc");
225 }
226 exParameters = m_extrapolator->extrapolate(Gaudi::Hive::currentContext(),cParameters, *m_disc2, Trk::anyDirection, true, Trk::pion).release();
227 if (exParameters) {
228 //since boundary check is true, should be enough to say we've hit the disk..
229 ATH_MSG_VERBOSE("Successfully extrapolated track to disk at -" << m_zDisc << ": " << *exParameters);
230 float ex_radius = sqrt(pow(exParameters->position().x(),2)+pow(exParameters->position().y(),2));
231 ATH_MSG_VERBOSE("radial position at surface: " << ex_radius);
232 if ((ex_radius > m_minRadiusDisc) and (ex_radius < m_maxRadiusDisc)) {
233 ATH_MSG_VERBOSE("Confirmed within the disk. Accepting particle");
234 return true;
235 }
236 //else...
237 ATH_MSG_VERBOSE("Strange, extrapolation succeeded but extrapolated position not within disc radius! Rejecting");
238 }
239 //else..
240 ATH_MSG_VERBOSE("Particle rejected");
241 return false;
242 }, "SelectDisc"));
243 } //m_zDisc > 0
244
245 std::string msg = std::to_string(m_cutList.size()) + " truth acceptance cuts are used:\n";
246 for (const auto& i:m_cutList.names()) {
247 msg += i + "\n";
248 }
250
251 ATH_CHECK(m_extrapolator.retrieve(EnableTool{ m_radiusCylinder > 0 || m_zDisc >0 }));
252
253 return StatusCode::SUCCESS;
254}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)
MsgStream & msg() const
std::unique_ptr< Trk::CylinderSurface > m_cylinder
PublicToolHandle< Trk::IExtrapolator > m_extrapolator
Too handle for truth-track extrapolation.
std::unique_ptr< Trk::DiscSurface > m_disc1
BooleanProperty m_requireOnlyPrimary
BooleanProperty m_poselectronfromgamma
std::unique_ptr< Trk::DiscSurface > m_disc2
IntegerArrayProperty m_ancestors
const Amg::Vector3D & position() const
Access method for the position.
float z() const
Vertex longitudinal distance along the beam line form the origin.
float y() const
Vertex y displacement.
float x() const
Vertex x displacement.
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D
Eigen::Translation< double, 3 > Translation3D
bool is_simulation_particle(const T &p)
Method to establish if a particle (or barcode) was created during the simulation (TODO update to be s...
bool isStable(const T &p)
Identify if the particle is stable, i.e. has not decayed.
@ anyDirection
CurvilinearParametersT< TrackParametersDim, Charged, PlaneSurface > CurvilinearParameters
ParametersBase< TrackParametersDim, Charged > TrackParameters
constexpr int pow(int x)
Definition conifer.h:27
TruthVertex_v1 TruthVertex
Typedef to implementation.
Definition TruthVertex.h:15

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ interfaceID()

const InterfaceID & IAthSelectionTool::interfaceID ( )
inlinestaticinherited

interfaceID reimplemented from base

Definition at line 73 of file IAthSelectionTool.h.

73 {
75}
static const InterfaceID IID_IAthSelectionTool("IAthSelectionTool", 1, 0)

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ names()

std::vector< std::string > AthTruthSelectionTool::names ( ) const
finalvirtual

return the names of the cuts as a vector<string>

Implements IAthSelectionTool.

Definition at line 264 of file AthTruthSelectionTool.cxx.

264 {
265 return m_cutList.names();
266}

◆ nCuts()

unsigned int AthTruthSelectionTool::nCuts ( ) const
inlinefinalvirtual

return the number of cuts.

Returns
the number of cuts

Implements IAthSelectionTool.

Definition at line 43 of file AthTruthSelectionTool.h.

43 {
44 return m_cutList.size();
45 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ testAllCuts()

IAthSelectionTool::CutResult AthTruthSelectionTool::testAllCuts ( const xAOD::IParticle * p,
std::vector< unsigned int > & counter ) const
finalvirtual

The most important method to determine whether the particle is accepted.

Parameters
pPointer to particle baseclass, will be cast to truth or track
Returns
true if particle passes cuts

Implements IAthSelectionTool.

Definition at line 280 of file AthTruthSelectionTool.cxx.

280 {
281 const xAOD::TruthParticle* pTruth = dynamic_cast<const xAOD::TruthParticle*>(particle);
282
283 //@TODO
284 if (not pTruth) {
285 return m_cutList.size()+1; // marker for invalid particles
286 }
287 return m_cutList.testAllCuts(*pTruth,counter);
288}

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_ancestors

IntegerArrayProperty AthTruthSelectionTool::m_ancestors {this, "ancestorList", {}}
private

Definition at line 70 of file AthTruthSelectionTool.h.

70{this, "ancestorList", {}};

◆ m_counters

std::vector<unsigned int> AthTruthSelectionTool::m_counters {}
private

Definition at line 69 of file AthTruthSelectionTool.h.

69{};

◆ m_cutList

CutList<xAOD::TruthParticle> AthTruthSelectionTool::m_cutList
private

Definition at line 50 of file AthTruthSelectionTool.h.

◆ m_cylinder

std::unique_ptr<Trk::CylinderSurface> AthTruthSelectionTool::m_cylinder
private

Definition at line 89 of file AthTruthSelectionTool.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_disc1

std::unique_ptr<Trk::DiscSurface> AthTruthSelectionTool::m_disc1
private

Definition at line 90 of file AthTruthSelectionTool.h.

◆ m_disc2

std::unique_ptr<Trk::DiscSurface> AthTruthSelectionTool::m_disc2
private

Definition at line 91 of file AthTruthSelectionTool.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extrapolator

PublicToolHandle<Trk::IExtrapolator> AthTruthSelectionTool::m_extrapolator {this,"Extrapolator","Trk::Extrapolator/AtlasExtrapolator",""}
private

Too handle for truth-track extrapolation.

Definition at line 97 of file AthTruthSelectionTool.h.

98{this,"Extrapolator","Trk::Extrapolator/AtlasExtrapolator",""};

◆ m_grandparent

BooleanProperty AthTruthSelectionTool::m_grandparent {this, "hasNoGrandparent", false}
private

Definition at line 67 of file AthTruthSelectionTool.h.

67{this, "hasNoGrandparent", false};

◆ m_maxEta

FloatProperty AthTruthSelectionTool::m_maxEta {this, "maxEta", 2.5}
private

Definition at line 52 of file AthTruthSelectionTool.h.

52{this, "maxEta", 2.5};

◆ m_maxProdVertRadius

FloatProperty AthTruthSelectionTool::m_maxProdVertRadius {this, "maxProdVertRadius", 110.}
private

Definition at line 62 of file AthTruthSelectionTool.h.

62{this, "maxProdVertRadius", 110.};

◆ m_maxPt

FloatProperty AthTruthSelectionTool::m_maxPt {this, "maxPt", -1.}
private

Definition at line 53 of file AthTruthSelectionTool.h.

53{this, "maxPt", -1.};

◆ m_maxRadiusDisc

FloatProperty AthTruthSelectionTool::m_maxRadiusDisc
private
Initial value:
{this, "maxRadiusDisc", 0.,
"Maximum radius on disk for accepting extrapolated truth particle to surface."}

Definition at line 85 of file AthTruthSelectionTool.h.

85 {this, "maxRadiusDisc", 0.,
86 "Maximum radius on disk for accepting extrapolated truth particle to surface."};

◆ m_maxZCylinder

FloatProperty AthTruthSelectionTool::m_maxZCylinder
private
Initial value:
{this, "maxZCylinder", 0.,
"Maximum |Z| on cylinder for accepting extrapolated truth particle to surface."}

Definition at line 79 of file AthTruthSelectionTool.h.

79 {this, "maxZCylinder", 0.,
80 "Maximum |Z| on cylinder for accepting extrapolated truth particle to surface."};

◆ m_minAbsD0

FloatProperty AthTruthSelectionTool::m_minAbsD0 {this, "minAbsD0", 0.}
private

Definition at line 64 of file AthTruthSelectionTool.h.

64{this, "minAbsD0", 0.};

◆ m_minProdVertRadius

FloatProperty AthTruthSelectionTool::m_minProdVertRadius {this, "minProdVertRadius", 0.}
private

Definition at line 63 of file AthTruthSelectionTool.h.

63{this, "minProdVertRadius", 0.};

◆ m_minPt

FloatProperty AthTruthSelectionTool::m_minPt {this, "minPt", 400.}
private

Definition at line 54 of file AthTruthSelectionTool.h.

54{this, "minPt", 400.};

◆ m_minRadiusDisc

FloatProperty AthTruthSelectionTool::m_minRadiusDisc
private
Initial value:
{this, "minRadiusDisc", 0.,
"Minimum radius on disk for accepting extrapolated truth particle to surface."}

Definition at line 83 of file AthTruthSelectionTool.h.

83 {this, "minRadiusDisc", 0.,
84 "Minimum radius on disk for accepting extrapolated truth particle to surface."};

◆ m_minZCylinder

FloatProperty AthTruthSelectionTool::m_minZCylinder
private
Initial value:
{this, "minZCylinder", 0.,
"Minimum |Z| on cylinder for accepting extrapolated truth particle to surface."}

Definition at line 77 of file AthTruthSelectionTool.h.

77 {this, "minZCylinder", 0.,
78 "Minimum |Z| on cylinder for accepting extrapolated truth particle to surface."};

◆ m_pdgId

IntegerProperty AthTruthSelectionTool::m_pdgId {this, "pdgId", -1}
private

Definition at line 65 of file AthTruthSelectionTool.h.

65{this, "pdgId", -1};

◆ m_poselectronfromgamma

BooleanProperty AthTruthSelectionTool::m_poselectronfromgamma {this, "poselectronfromgamma", false}
private

Definition at line 68 of file AthTruthSelectionTool.h.

68{this, "poselectronfromgamma", false};

◆ m_radiusCylinder

FloatProperty AthTruthSelectionTool::m_radiusCylinder
private
Initial value:
{this, "radiusCylinder", -1.,
"Select truth particle based on extrapolated position on cylinder placed at this radius. Enabled if greater than 0."}

Definition at line 75 of file AthTruthSelectionTool.h.

75 {this, "radiusCylinder", -1.,
76 "Select truth particle based on extrapolated position on cylinder placed at this radius. Enabled if greater than 0."};

◆ m_requireCharged

BooleanProperty AthTruthSelectionTool::m_requireCharged {this, "requireCharged", true}
private

Definition at line 56 of file AthTruthSelectionTool.h.

56{this, "requireCharged", true};

◆ m_requireOnlyPrimary

BooleanProperty AthTruthSelectionTool::m_requireOnlyPrimary {this, "requireOnlyPrimary", true}
private

Definition at line 55 of file AthTruthSelectionTool.h.

55{this, "requireOnlyPrimary", true};

◆ m_requireSiHit

IntegerProperty AthTruthSelectionTool::m_requireSiHit {this, "requireSiHit", 0}
private

Definition at line 59 of file AthTruthSelectionTool.h.

59{this, "requireSiHit", 0};

◆ m_requireStable

BooleanProperty AthTruthSelectionTool::m_requireStable {this, "requireStable", true}
private

Definition at line 58 of file AthTruthSelectionTool.h.

58{this, "requireStable", true};

◆ m_selectedCharge

IntegerProperty AthTruthSelectionTool::m_selectedCharge {this, "selectedCharge", 0}
private

Definition at line 57 of file AthTruthSelectionTool.h.

57{this, "selectedCharge", 0};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vetoPdgId

IntegerProperty AthTruthSelectionTool::m_vetoPdgId {this, "vetoPdgId", -1}
private

Definition at line 66 of file AthTruthSelectionTool.h.

66{this, "vetoPdgId", -1};

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ m_zDisc

FloatProperty AthTruthSelectionTool::m_zDisc
private
Initial value:
{this, "zDisc", -1.,
"Select truth particle based on extrapolated position on disks placed at +/- z positions. Enabled if greater than 0."}

Definition at line 81 of file AthTruthSelectionTool.h.

81 {this, "zDisc", -1.,
82 "Select truth particle based on extrapolated position on disks placed at +/- z positions. Enabled if greater than 0."};

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