18 const std::string&
name,
19 ISvcLocator* pSvcLocator ) :
28 ATH_CHECK( m_offlineTrkParticlesName.initialize(
29 not m_offlineTrkParticlesName.key().empty() ) );
31 ATH_CHECK( m_tausName.initialize( not m_tausName.key().empty() ) );
35 *
this, m_offlineTrkParticlesName,
36 m_prefix.value(), m_decor_tau_names, m_decor_tau );
38 if( m_decor_tau.size() != NDecorations ) {
40 m_tauType.value() <<
" " <<
41 m_tauNprongs.value() <<
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_INFO(
"All decorations already exist. Exiting gracefully" );
72 return StatusCode::SUCCESS;
76 std::vector< IDTPM::OptionalDecoration<xAOD::TrackParticleContainer, ElementTauLink_t> >
79 if( tau_decor.empty() ) {
81 m_tauType.value() <<
" " <<
82 m_tauNprongs.value() <<
83 "prong decorations" );
84 return StatusCode::FAILURE;
92 return StatusCode::SUCCESS;
109 int NTauTracks = tau->nTracks();
110 if( m_tauNprongs.value() > 0 and NTauTracks != (
int)m_tauNprongs.value() )
continue;
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();
117 ATH_MSG_DEBUG(
"TauLinkVec size (" << m_tauNprongs.value() <<
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)) );
127 ATH_MSG_DEBUG(
"TauVec size (" << m_tauNprongs.value() <<
"prong " <<
128 m_tauType.value() <<
"tau) = " << tauTracks.size() );
138 if( tauTrack == &
track ) {
143 bool isTight(
false ), isMedium(
false );
144 bool isLoose(
false ), isVeryLoose(
false );
146 if( m_tauType.value() ==
"BDT" ) {
152 }
else if( m_tauType.value() ==
"RNN" ) {
160 return StatusCode::FAILURE;
164 if( isTight or isMedium or isLoose or isVeryLoose ) {
166 m_tauType.value() <<
" " <<
167 m_tauNprongs.value() <<
168 "prong (pt=" << tau->pt() <<
169 "). Decorating track." );
171 return StatusCode::SUCCESS;
200 return StatusCode::SUCCESS;