17 std::make_unique<SG::Decorator<char>>(
m_isolated.value());
23 m_acc_isoVar = std::make_unique<SG::ConstAccessor<float>>(
36 <<
" is not a valid MCTruthPartClassifier::ParticleType string!");
37 return StatusCode::FAILURE;
43 return StatusCode::SUCCESS;
52 "classifierParticleType");
54 "classifierParticleOrigin");
59 for (
const auto* particle : *particles) {
63 bool isolation = acc_type(*particle) ==
m_checkType;
66 if ((*m_acc_isoVar).isAvailable(*particle)) {
68 isolation && ((*m_acc_isoVar)(*particle) / particle->pt() <
73 return StatusCode::FAILURE;
76 (*m_dec_isolated)(*particle) = isolation;
79 "Truth particle is missing the decoration: classifierParticleType.");
80 return StatusCode::FAILURE;
85 (*m_dec_notTauOrigin)(*particle) =
86 acc_orig(*particle) != MCTruthPartClassifier::ParticleOrigin::TauLep;
89 "Truth particle is missing the decoration: "
90 "classifierParticleOrigin.");
91 return StatusCode::FAILURE;
94 return StatusCode::SUCCESS;
std::unique_ptr< const SG::ConstAccessor< float > > m_acc_isoVar
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_particlesKey
MCTruthPartClassifier::ParticleType m_checkType
std::unique_ptr< const SG::Decorator< char > > m_dec_notTauOrigin
Gaudi::Property< float > m_isolationCut
Gaudi::Property< std::string > m_notTauOrigin
std::unique_ptr< const SG::Decorator< char > > m_dec_isolated
virtual StatusCode initialize() final
virtual StatusCode execute(const EventContext &ctx) const final
Gaudi::Property< std::string > m_isolated
Gaudi::Property< std::string > m_checkTypeName
Gaudi::Property< std::string > m_isolationVariable
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.
Helper class to provide type-safe access to aux data.
Select isolated Photons, Electrons and Muons.
std::vector< std::string > sParticleType
the vector of particle types