26 PMGDecayProductsSelectionTool ::
27 PMGDecayProductsSelectionTool (
const std::string& name)
36 StatusCode PMGDecayProductsSelectionTool ::
42 return StatusCode::FAILURE;
47 std::ostringstream particles;
50 particles <<
" " << pdgId;
52 ATH_MSG_DEBUG (
"Performing required parent particle selection with parent PDG IDs:" << particles.str());
57 std::ostringstream particles;
60 particles <<
" " << pdgId;
62 ATH_MSG_DEBUG (
"Performing allowed intermediate particle selection with allowed PDG IDs:" << particles.str());
65 m_parentsAccessor = std::make_unique<const SG::AuxElement::Accessor<std::vector<ElementLink<xAOD::TruthParticleContainer>>>>(
"parentLinks");
67 return StatusCode::SUCCESS;
73 getAcceptInfo ()
const
88 if (truthParticle ==
nullptr)
92 if (truthParticle ==
nullptr)
109 for (
size_t i = 0; i < nParents; i++)
125 ATH_MSG_VERBOSE(
"Removing particle as parent is not allowed: " << parent->pdgId());
147 size_t PMGDecayProductsSelectionTool ::
169 = (*m_parentsAccessor)(*truthParticle).at(
index);
170 return parentElementLink.
isValid() ? *parentElementLink :
nullptr;
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ElementLink implementation for ROOT usage.
bool isValid() const
Test to see if the link can be dereferenced.
void setCutResult(const std::string &cutName, bool cutResult)
Set the result of a cut, based on the cut name (safer)
Class providing the definition of the 4-vector interface.
int pdgId() const
PDG ID code.
const TruthParticle_v1 * parent(size_t i) const
Retrieve the i-th mother (TruthParticle) of this TruthParticle.
size_t nParents() const
Number of parents of this particle.
const xAOD::TruthParticle * getTruthParticle(const xAOD::IParticle &p)
Return the truthParticle associated to the given IParticle (if any)
TruthParticle_v1 TruthParticle
Typedef to implementation.