 |
ATLAS Offline Software
|
Go to the documentation of this file.
33 return StatusCode::SUCCESS;
39 ATH_MSG_INFO(
"Processed and decorated "<< m_ntotpart <<
" truth particles");
40 return StatusCode::SUCCESS;
51 if (!truthParticles.
isValid()) {
52 ATH_MSG_ERROR(
"Couldn't retrieve TruthParticle collection with name " << m_particlesKey);
53 return StatusCode::FAILURE;
56 unsigned int nParticles = truthParticles->
size();
57 m_ntotpart += nParticles;
65 for (
unsigned int i=0;
i<nParticles; ++
i) {
67 auto classification = m_classifier->particleTruthClassifier((*truthParticles)[
i], &
info);
68 unsigned int particleOutCome =
info.particleOutCome;
71 unsigned int particleOrigin = classification.second;
73 originDecorator(*((*truthParticles)[
i])) = particleOrigin;
74 outcomeDecorator(*((*truthParticles)[
i])) = particleOutCome;
76 classificationDecorator(*((*truthParticles)[
i])) =
result;
79 return StatusCode::SUCCESS;
PublicToolHandle< IMCTruthClassifier > m_classifier
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_classificationDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_outcomeDecoratorKey
virtual StatusCode finalize() override final
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_originDecoratorKey
std::tuple< unsigned int, T > defOrigOfParticle(T thePart)
#define ATH_MSG_VERBOSE(x)
const std::string & key() const
Return the StoreGate ID for the referenced object.
virtual StatusCode addBranches(const EventContext &ctx) const override final
::StatusCode StatusCode
StatusCode definition for legacy code.
Handle class for adding a decoration to an object.
Handle class for adding a decoration to an object.
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_particlesKey
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
virtual StatusCode initialize() override final
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_typeDecoratorKey
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Handle class for reading from StoreGate.
size_type size() const noexcept
Returns the number of elements in the collection.