|
ATLAS Offline Software
|
Go to the documentation of this file.
21 const std::string&
name,
22 ISvcLocator* pSvcLocator ) :
31 ATH_CHECK( m_offlineTrkParticlesName.initialize(
32 not m_offlineTrkParticlesName.key().empty() ) );
34 ATH_CHECK( m_electronsName.initialize( not m_electronsName.key().empty() ) );
38 *
this, m_offlineTrkParticlesName,
39 m_prefix.value(), m_decor_ele_names, m_decor_ele );
41 if( m_decor_ele.size() != NDecorations ) {
43 return StatusCode::FAILURE;
46 return StatusCode::SUCCESS;
58 ATH_MSG_ERROR(
"Failed to retrieve track particles container" );
59 return StatusCode::FAILURE;
64 if( not pelectrons.
isValid() ) {
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, ElementElectronLink_t> >
79 if( ele_decor.empty() ) {
81 return StatusCode::FAILURE;
89 return StatusCode::SUCCESS;
112 return StatusCode::FAILURE;
115 if( eleTrack == &
track ) {
126 if(
electron->passSelection(
"Tight") ) {
131 if(
electron->passSelection(
"Medium") ) {
136 if(
electron->passSelection(
"Loose") ) {
141 if(
electron->passSelection(
"LHTight") ) {
146 if(
electron->passSelection(
"LHMedium") ) {
151 if(
electron->passSelection(
"LHLoose") ) {
155 return StatusCode::SUCCESS;
160 return StatusCode::SUCCESS;
bool toContainedElement(BaseConstReference data, ElementType element, IProxyDict *sg=0)
Set from element pointer and a reference to the container (storable)
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
An algorithm that can be simultaneously executed in multiple threads.
StatusCode decorateElectronTrack(const xAOD::TrackParticle &track, std::vector< IDTPM::OptionalDecoration< xAOD::TrackParticleContainer, ElementElectronLink_t > > &ele_decor, const xAOD::ElectronContainer &electrons) const
::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 execute(const EventContext &ctx) const override
OfflineElectronDecoratorAlg(const std::string &name, ISvcLocator *pSvcLocator)
Local includes.
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...
virtual StatusCode initialize() override
const_pointer_type ptr()
Dereference the pointer.
Algorithm to decorate offline tracks with the corresponding offline electron object (if required for ...
const xAOD::TrackParticle * getOriginalTrackParticle(const xAOD::Electron *el)
Helper function for getting the "Original" Track Particle (i.e before GSF) via the electron.
Class describing a TrackParticle.
std::pair< SG::WriteDecorHandle< ContainerType, VariableType >, bool > OptionalDecoration