18 MCTCDecorationAlg (
const std::string&
name,
19 ISvcLocator* pSvcLocator)
25 StatusCode MCTCDecorationAlg ::
30 ANA_MSG_ERROR(
"Classification decoration name needs to be set");
31 return StatusCode::FAILURE;
57 return StatusCode::SUCCESS;
61 StatusCode MCTCDecorationAlg ::
75 if (truthParticle ==
nullptr)
82 if (truthParticle !=
nullptr && truthParticle->
isLepton() && (truthParticle->
status() == 1 || truthParticle->
status() == 2))
87 result = (*m_classificationAccessor)(*truthParticle);
91 ANA_MSG_ERROR (
"MCTC Classification decoration not available.");
92 return StatusCode::FAILURE;
95 std::bitset<MCTruthPartClassifier::MCTC_bits::totalBits> bitset(
result);
119 (*m_isPromptDecorator)(*particle) = -1;
123 (*m_fromHadronDecorator)(*particle) = -1;
127 (*m_fromBSMDecorator)(*particle) = -1;
131 (*m_fromTauDecorator)(*particle) = -1;
136 return StatusCode::SUCCESS;
SysReadHandle< xAOD::IParticleContainer > m_particlesHandle
the particle collection we run on
std::unique_ptr< const SG::Decorator< int > > m_fromHadronDecorator
the decorator for m_fromHadDecoration
std::unique_ptr< const SG::ConstAccessor< unsigned int > > m_classificationAccessor
the accessor for m_classificationDecoration
std::unique_ptr< const SG::Decorator< int > > m_fromBSMDecorator
the decorator for m_fromBSMDecoration
std::unique_ptr< const SG::Decorator< int > > m_isPromptDecorator
the decorator for m_isPromptDecoration
std::unique_ptr< const SG::Decorator< int > > m_fromTauDecorator
the decorator for m_fromTauDecoration
Gaudi::Property< std::string > m_classificationDecoration
the decoration for the MCTC classification bitmask
SysListHandle m_systematicsList
the systematics list we run
Gaudi::Property< std::string > m_fromBSMDecoration
the decoration for the BSM origin
Gaudi::Property< std::string > m_isPromptDecoration
the decoration for the promptness
Gaudi::Property< std::string > m_fromTauDecoration
the decoration for the tau origin
SysReadSelectionHandle m_preselection
the preselection we apply to our input
Gaudi::Property< std::string > m_fromHadronDecoration
the decoration for the hadronic origin
AnaAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
constructor with parameters
Class providing the definition of the 4-vector interface.
int status() const
Status code.
bool isLepton() const
Whether the particle is a lepton.
Select isolated Photons, Electrons and Muons.
int isPrompt(const unsigned int classify, bool allow_prompt_tau_decays=true)
const xAOD::TruthParticle * getTruthParticle(const xAOD::IParticle &p)
Return the truthParticle associated to the given IParticle (if any)
TruthParticle_v1 TruthParticle
Typedef to implementation.
DataVector< IParticle > IParticleContainer
Simple convenience declaration of IParticleContainer.