|
ATLAS Offline Software
|
Go to the documentation of this file.
18 const std::string&
name,
19 ISvcLocator* pSvcLocator ) :
28 ATH_CHECK( m_offlineTrkParticlesName.initialize(
29 not m_offlineTrkParticlesName.key().empty() ) );
32 ATH_CHECK( m_muonsName.initialize( not m_muonsName.key().empty() ) );
36 *
this, m_offlineTrkParticlesName,
37 m_prefix.value(), m_decor_mu_names, m_decor_mu );
39 if( m_decor_mu.size() != NDecorations ) {
41 return StatusCode::FAILURE;
44 return StatusCode::SUCCESS;
56 ATH_MSG_ERROR(
"Failed to retrieve track particles container" );
57 return StatusCode::FAILURE;
64 return StatusCode::FAILURE;
69 ATH_MSG_INFO(
"All decorations already exist. Exiting gracefully" );
70 return StatusCode::SUCCESS;
74 std::vector< IDTPM::OptionalDecoration<xAOD::TrackParticleContainer, ElementMuonLink_t> >
77 if( mu_decor.empty() ) {
79 return StatusCode::FAILURE;
87 return StatusCode::SUCCESS;
108 *(
muon->combinedTrackParticleLink() ) :
109 *(
muon->inDetTrackParticleLink() );
113 return StatusCode::FAILURE;
116 if( muTrack == &
track ) {
121 ATH_MSG_DEBUG(
"Found matched muon (pt=" <<
muon->pt() <<
"). Decorating track." );
146 return StatusCode::SUCCESS;
151 return StatusCode::SUCCESS;
bool toContainedElement(BaseConstReference data, ElementType element, IProxyDict *sg=0)
Set from element pointer and a reference to the container (storable)
Algorithm to decorate offline tracks with the corresponding offline muon object (if required for trig...
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.
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
virtual StatusCode execute(const EventContext &ctx) const override
An algorithm that can be simultaneously executed in multiple threads.
::StatusCode StatusCode
StatusCode definition for legacy code.
bool decorationsAllExist(const T_Cont &container, const std::vector< WriteKeyAccessorPair< T_Cont, T > > &keys, bool verbose=false)
Like above - FIXME: maybe not needed.
virtual StatusCode initialize() override
virtual bool isValid() override final
Can the handle be successfully dereferenced?
ElementLink implementation for ROOT usage.
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...
OfflineMuonDecoratorAlg(const std::string &name, ISvcLocator *pSvcLocator)
Local includes.
const_pointer_type ptr()
Dereference the pointer.
StatusCode decorateMuonTrack(const xAOD::TrackParticle &track, std::vector< IDTPM::OptionalDecoration< xAOD::TrackParticleContainer, ElementMuonLink_t > > &mu_decor, const xAOD::MuonContainer &muons) const
Class describing a TrackParticle.
std::pair< SG::WriteDecorHandle< ContainerType, VariableType >, bool > OptionalDecoration