21 const IInterface*
p ) :
24 m_classifier(
"MCTruthClassifier/MCTruthClassifier")
26 declareInterface<DerivationFramework::IAugmentationTool>(
this);
41 ATH_MSG_INFO(
"Decorating " << m_particlesKey.key() <<
" with classification information");
44 ATH_CHECK(m_linkDecoratorKey.initialize());
45 ATH_CHECK(m_originDecoratorKey.initialize());
46 ATH_CHECK(m_typeDecoratorKey.initialize());
47 ATH_CHECK(m_outcomeDecoratorKey.initialize());
48 ATH_CHECK(m_classificationDecoratorKey.initialize());
50 return StatusCode::SUCCESS;
56 ATH_MSG_INFO(
"Processed and decorated "<< m_ntotpart <<
" truth particles");
57 return StatusCode::SUCCESS;
65 const EventContext& ctx = Gaudi::Hive::currentContext();
69 if (!truthParticles.
isValid()) {
70 ATH_MSG_ERROR(
"Couldn't retrieve TruthParticle collection with name " << m_particlesKey);
71 return StatusCode::FAILURE;
74 unsigned int nParticles = truthParticles->
size();
75 m_ntotpart += nParticles;
84 for (
unsigned int i=0;
i<nParticles; ++
i) {
86 auto classification = m_classifier->particleTruthClassifier((*truthParticles)[
i], &
info);
87 unsigned int particleOutCome =
info.particleOutCome;
90 unsigned int particleOrigin = classification.second;
92 originDecorator(*((*truthParticles)[
i])) = particleOrigin;
93 outcomeDecorator(*((*truthParticles)[
i])) = particleOutCome;
95 classificationDecorator(*((*truthParticles)[
i])) =
result;
98 return StatusCode::SUCCESS;