 |
ATLAS Offline Software
|
Go to the documentation of this file.
19 const std::string&
name,
20 ISvcLocator* pSvcLocator ) :
29 ATH_CHECK( m_offlineTrkParticlesName.initialize(
30 not m_offlineTrkParticlesName.key().empty() ) );
32 ATH_CHECK( m_jetsName.initialize( not m_jetsName.key().empty() ) );
36 *
this, m_offlineTrkParticlesName,
37 m_prefix.value(), m_decor_jet_names, m_decor_jet );
39 if( m_decor_jet.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_DEBUG(
"All decorations already exist. Exiting gracefully" );
70 return StatusCode::SUCCESS;
74 std::vector< IDTPM::OptionalDecoration<xAOD::TrackParticleContainer, ElementJetLink_t> >
77 if( jet_decor.empty() ) {
79 return StatusCode::FAILURE;
87 return StatusCode::SUCCESS;
108 if( not passJetCuts( *
jet ) )
continue;
114 bool isTruthCjet =
false;
115 bool isTruthBjet =
false;
119 isTruthCjet = ( truthJetTagLabel( *
jet ) == 4 );
120 isTruthBjet = ( truthJetTagLabel( *
jet ) == 5 );
127 ATH_MSG_DEBUG(
"Found matching jet (en=" <<
jet->e() <<
"). Decorating track." );
137 }
else if( isTruthCjet ) {
152 return StatusCode::SUCCESS;
157 const float jetPt =
jet.pt();
158 const float jetEta = std::abs(
jet.eta() );
160 if( jetEta < m_jetAbsEtaMin )
return false;
161 if( jetEta > m_jetAbsEtaMax )
return false;
162 if( jetPt < m_jetPtMin )
return false;
163 if( jetPt > m_jetPtMax )
return false;
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 (reco or truth) jet object.
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.
virtual StatusCode execute(const EventContext &ctx) const override
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.
virtual StatusCode initialize() override
Utility methods to access track/truth particles parmeters in a consitent way in this package.
::StatusCode StatusCode
StatusCode definition for legacy code.
bool passJetCuts(const xAOD::Jet &jet) const
bool decorationsAllExist(const T_Cont &container, const std::vector< WriteKeyAccessorPair< T_Cont, T > > &keys, bool verbose=false)
Like above - FIXME: maybe not needed.
OfflineJetDecoratorAlg(const std::string &name, ISvcLocator *pSvcLocator)
Local includes.
float deltaR(const U1 &p1, const U2 &p2)
Accessor utility function for getting the DeltaR betwen two tracks.
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...
const_pointer_type ptr()
Dereference the pointer.
StatusCode decorateJetTrack(const xAOD::TrackParticle &track, std::vector< IDTPM::OptionalDecoration< xAOD::TrackParticleContainer, ElementJetLink_t > > &jet_decor, const xAOD::JetContainer &jets) const
#define ATH_MSG_WARNING(x)
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
Class describing a TrackParticle.
std::pair< SG::WriteDecorHandle< ContainerType, VariableType >, bool > OptionalDecoration