29 StatusCode TauTruthDecorationsAlg ::
72 return StatusCode::SUCCESS;
77 StatusCode TauTruthDecorationsAlg ::
78 execute (
const EventContext &ctx)
const
114 auto decorateWithNumber = [&truthParticle, &tau]<
typename T>(T & writeHandles, T::mapped_type::accessor_t::element_type v)->
void{
115 for (
auto& [
acc, writeHandle] : writeHandles) {
116 if ((!truthParticle) or (!
acc->isAvailable(*truthParticle)) ) {
117 writeHandle(*tau) = v;
119 writeHandle(*tau) = (*acc)(*truthParticle);
123 decorateWithNumber(doubleWriteHandles, -999.f);
124 decorateWithNumber(floatWriteHandles, -999.f);
125 decorateWithNumber(intWriteHandles, 0);
126 decorateWithNumber(unsignedIntWriteHandles, 0);
127 decorateWithNumber(charWriteHandles, 0);
134 if (truthJet !=
nullptr) {
135 partonTruthLabelIDHandle(*tau) = acc_PartonTruthLabelID(*truthJet);
139 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.