29 StatusCode TauTruthDecorationsAlg ::
89 return StatusCode::SUCCESS;
94 StatusCode TauTruthDecorationsAlg ::
95 execute (
const EventContext &ctx)
const
131 auto decorateWithNumber = [&truthParticle, &tau]<
typename T>(T & writeHandles, T::mapped_type::accessor_t::element_type v)->
void{
132 for (
auto& [
acc, writeHandle] : writeHandles) {
133 if ((!truthParticle) or (!
acc->isAvailable(*truthParticle)) ) {
134 writeHandle(*tau) = v;
136 writeHandle(*tau) = (*acc)(*truthParticle);
140 decorateWithNumber(doubleWriteHandles, -999.f);
141 decorateWithNumber(floatWriteHandles, -999.f);
142 decorateWithNumber(intWriteHandles, 0);
143 decorateWithNumber(unsignedIntWriteHandles, 0);
144 decorateWithNumber(charWriteHandles, 0);
151 if (truthJet !=
nullptr) {
152 partonTruthLabelIDHandle(*tau) = acc_PartonTruthLabelID(*truthJet);
156 return StatusCode::SUCCESS;
std::unordered_map< std::unique_ptr< SG::ConstAccessor< double > >, SG::WriteDecorHandleKey< xAOD::TauJetContainer > > m_doubleWriteHandleKeys
SG::ReadHandleKey< xAOD::TauJetContainer > m_tausKey
the tau collection we run on
std::unordered_map< std::unique_ptr< SG::ConstAccessor< float > >, SG::WriteDecorHandleKey< xAOD::TauJetContainer > > m_floatWriteHandleKeys
SG::WriteDecorHandleKey< xAOD::TauJetContainer > m_partonTruthLabelIDKey
Gaudi::Property< std::vector< std::string > > m_unsignedIntDecorations
Gaudi::Property< std::vector< std::string > > m_doubleDecorations
the decoration for the tau scale factor
SG::WriteDecorHandleKey< xAOD::TauJetContainer > m_truthParticleTypeKey
std::unordered_map< std::unique_ptr< SG::ConstAccessor< int > >, SG::WriteDecorHandleKey< xAOD::TauJetContainer > > m_intWriteHandleKeys
std::unordered_map< std::unique_ptr< SG::ConstAccessor< char > >, SG::WriteDecorHandleKey< xAOD::TauJetContainer > > m_charWriteHandleKeys
std::unordered_map< std::unique_ptr< SG::ConstAccessor< unsigned int > >, SG::WriteDecorHandleKey< xAOD::TauJetContainer > > m_unsignedIntWriteHandleKeys
Gaudi::Property< std::vector< std::string > > m_intDecorations
SG::WriteDecorHandleKey< xAOD::TauJetContainer > m_truthDecayModeKey
Gaudi::Property< std::vector< std::string > > m_charDecorations
Gaudi::Property< std::vector< std::string > > m_floatDecorations
Gaudi::Property< std::string > m_prefix
Helper class to provide constant type-safe access to aux data.
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Handle class for adding a decoration to an object.
Select isolated Photons, Electrons and Muons.
const xAOD::TruthParticle * getTruthParticle(const xAOD::IParticle *, bool debug=false)
return the truthParticle associated to the given IParticle (if any)
const T * getLink(const xAOD::IParticle *, const std::string &, bool debug=false)
Jet_v1 Jet
Definition of the current "jet version".
TauJet_v3 TauJet
Definition of the current "tau version".
TruthParticle_v1 TruthParticle
Typedef to implementation.
static const SG::AuxElement::Accessor< ElementLink< IParticleContainer > > acc("originalObjectLink")
Object used for setting/getting the dynamic decoration in question.