 |
ATLAS Offline Software
|
Go to the documentation of this file.
72 return StatusCode::SUCCESS;
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);
133 const xAOD::Jet *truthJet = xAOD::TauHelpers::getLink<xAOD::Jet>(tau,
"truthJetLink");
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
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
SG::WriteDecorHandleKey< xAOD::TauJetContainer > m_truthDecayModeKey
Gaudi::Property< std::vector< std::string > > m_doubleDecorations
the decoration for the tau scale factor
Gaudi::Property< std::vector< std::string > > m_unsignedIntDecorations
Gaudi::Property< std::string > m_prefix
std::unordered_map< std::unique_ptr< SG::ConstAccessor< unsigned int > >, SG::WriteDecorHandleKey< xAOD::TauJetContainer > > m_unsignedIntWriteHandleKeys
StatusCode initialize() override
SG::WriteDecorHandleKey< xAOD::TauJetContainer > m_truthParticleTypeKey
std::unordered_map< std::unique_ptr< SG::ConstAccessor< float > >, SG::WriteDecorHandleKey< xAOD::TauJetContainer > > m_floatWriteHandleKeys
std::unordered_map< std::unique_ptr< SG::ConstAccessor< char > >, SG::WriteDecorHandleKey< xAOD::TauJetContainer > > m_charWriteHandleKeys
Gaudi::Property< std::vector< std::string > > m_floatDecorations
Select isolated Photons, Electrons and Muons.
StatusCode execute(const EventContext &ctx) const override
const xAOD::TruthParticle * getTruthParticle(const xAOD::IParticle *, bool debug=false)
return the truthParticle associated to the given IParticle (if any)
::StatusCode StatusCode
StatusCode definition for legacy code.
Class describing a truth particle in the MC record.
Handle class for adding a decoration to an object.
Class describing a tau jet.
Gaudi::Property< std::vector< std::string > > m_intDecorations
std::unordered_map< std::unique_ptr< SG::ConstAccessor< int > >, SG::WriteDecorHandleKey< xAOD::TauJetContainer > > m_intWriteHandleKeys
SG::ReadHandleKey< xAOD::TauJetContainer > m_tausKey
the tau collection we run on
SG::WriteDecorHandleKey< xAOD::TauJetContainer > m_partonTruthLabelIDKey
Gaudi::Property< std::vector< std::string > > m_charDecorations