18 const std::string& name,
19 ISvcLocator* pSvcLocator ) :
42 "prong decorations" );
43 return StatusCode::FAILURE;
46 return StatusCode::SUCCESS;
58 ATH_MSG_ERROR(
"Failed to retrieve track particles container" );
59 return StatusCode::FAILURE;
66 return StatusCode::FAILURE;
71 ATH_MSG_DEBUG(
"All decorations already exist. Exiting gracefully" );
72 return StatusCode::SUCCESS;
76 std::vector< IDTPM::OptionalDecoration<xAOD::TrackParticleContainer, ElementTauLink_t> >
79 if( tau_decor.empty() ) {
83 "prong decorations" );
84 return StatusCode::FAILURE;
92 return StatusCode::SUCCESS;
109 int NTauTracks = tau->nTracks();
113 std::vector< const xAOD::TrackParticle* > tauTracks;
114 for(
size_t iprong=0; iprong<(size_t)NTauTracks; iprong++ ) {
116 std::vector< ElementTrackLink_t > tracklink = tau->track( iprong )->trackLinks();
118 "prong " <<
m_tauType.value() <<
"tau) = " << tracklink.size() );
121 for(
size_t ilink=0; ilink<tracklink.size() ; ilink++ ) {
122 if( tracklink.at(ilink).isValid() ) tauTracks.push_back( *(tracklink.at(ilink)) );
128 m_tauType.value() <<
"tau) = " << tauTracks.size() );
138 if( tauTrack == &track ) {
143 bool isTight(
false ), isMedium(
false );
144 bool isLoose(
false ), isVeryLoose(
false );
152 }
else if(
m_tauType.value() ==
"RNN" ) {
160 return StatusCode::FAILURE;
164 if( isTight or isMedium or isLoose or isVeryLoose ) {
168 "prong (pt=" << tau->pt() <<
169 "). Decorating track." );
171 return StatusCode::SUCCESS;
200 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
Algorithm to decorate offline tracks with the corresponding offline tau object (if required for trigg...
An algorithm that can be simultaneously executed in multiple threads.
bool toContainedElement(BaseConstReference data, ElementType element, IProxyDict *sg=0)
Set from element pointer and a reference to the container (storable)
virtual StatusCode initialize() override
ElementLink< xAOD::TauJetContainer > ElementTauLink_t
const std::vector< std::string > m_decor_tau_names
StatusCode decorateTauTrack(const xAOD::TrackParticle &track, std::vector< IDTPM::OptionalDecoration< xAOD::TrackParticleContainer, ElementTauLink_t > > &tau_decor, const xAOD::TauJetContainer &taus) const
OfflineTauDecoratorAlg(const std::string &name, ISvcLocator *pSvcLocator)
Local includes.
UnsignedIntegerProperty m_tauNprongs
std::vector< IDTPM::WriteKeyAccessorPair< xAOD::TrackParticleContainer, ElementTauLink_t > > m_decor_tau
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_offlineTrkParticlesName
virtual StatusCode execute(const EventContext &ctx) const override
SG::ReadHandleKey< xAOD::TauJetContainer > m_tausName
const_pointer_type ptr()
Dereference the pointer.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
std::pair< SG::WriteDecorHandle< ContainerType, VariableType >, bool > OptionalDecoration
bool decorationsAllExist(const T_Cont &container, const std::vector< WriteKeyAccessorPair< T_Cont, T > > &keys, bool verbose=false)
Like above - FIXME: maybe not needed.
void createDecoratorKeysAndAccessor(T_Parent &parent, const SG::ReadHandleKey< T_Cont > &container_key, const std::string &prefix, const std::vector< std::string > &decor_names, std::vector< WriteKeyAccessorPair< T_Cont, T > > &decor_out)
create a pair composed of a WriteDecorHandleKey to create a decorator handle and an accessor to check...
std::vector< OptionalDecoration< T_Cont, T > > createDecoratorsIfNeeded(const T_Cont &container, const std::vector< WriteKeyAccessorPair< T_Cont, T > > &keys, const EventContext &ctx, bool verbose=false)
create/book the decorations if they do not exist already
void decorateOrRejectQuietly(const T_Cont_Elm &particle, OptionalDecoration< T_Cont, T > &decorator, const T &value)
Safe method to fill the decoration if decor flag is true.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
TauJet_v3 TauJet
Definition of the current "tau version".
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".
TauJetContainer_v3 TauJetContainer
Definition of the current "taujet container version".