|
ATLAS Offline Software
|
Go to the documentation of this file.
18 m_particlesLinkKey(
"MuonSpectrometerTrackParticles"),
19 m_particlesTypeKey(
"MuonSpectrometerTrackParticles"),
20 m_particlesOriginKey(
"MuonSpectrometerTrackParticles"),
21 m_particleName(
"InDetTrackParticles"),
22 m_truthParticleLinkVecKey(
"xAODTruthLinks"),
23 m_truthTracksKey(
"TrackTruthCollection"),
24 m_truthClassifier(
"MCTruthClassifier/MCTruthClassifier")
48 return StatusCode::SUCCESS;
53 return StatusCode::SUCCESS;
66 ATH_MSG_WARNING(
"TrackParticleTruthAlg: "<<particlesLink.name()<<
" not found");
67 return StatusCode::SUCCESS;
70 if(!particlesLink.isValid()){
72 return StatusCode::FAILURE;
75 if(!truthParticleLinkVec.
isValid()){
77 return StatusCode::FAILURE;
82 return StatusCode::FAILURE;
94 if( !
particle->trackLink().isValid()){
96 ATH_MSG_WARNING(
"Found TrackParticle with Invalid element link, skipping");
113 if(
result != truthTrackColl.end() ){
115 link = truthParticleLinks.
find(
result->second.particleLink());
121 type = truthClass.first;
122 origin = truthClass.second;
123 ATH_MSG_VERBOSE(
"Got truth type " <<
static_cast<int>(
type) <<
" origin " <<
static_cast<int>(origin));
128 ATH_MSG_DEBUG(
"Found matching xAOD Truth: uniqueID " <<
HepMC::uniqueID(*link) <<
" pt " << (*link)->pt() <<
" eta " << (*link)->eta() <<
" phi " << (*link)->phi());
140 particlesType(partInd)=
static_cast<int>(
type);
141 particlesOrigin(partInd)=
static_cast<int>(origin);
145 return StatusCode::SUCCESS;
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
const std::string & name() const
Return the StoreGate ID for the referenced object.
ElementLink< xAOD::TruthParticleContainer > find(const HepMcParticleLink &hepMCLink) const
TrackParticleTruthAlg(const std::string &name, ISvcLocator *pSvcLocator)
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_particlesTypeKey
#define ATH_MSG_VERBOSE(x)
bool isValid() const
Test to see if the link can be dereferenced.
SG::ReadHandleKey< TrackTruthCollection > m_truthTracksKey
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_particlesLinkKey
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_particlesOriginKey
::StatusCode StatusCode
StatusCode definition for legacy code.
Handle class for adding a decoration to an object.
SG::ReadHandleKey< xAODTruthParticleLinkVector > m_truthParticleLinkVecKey
TrackParticle input name.
Handle class for adding a decoration to an object.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
virtual StatusCode execute() override
virtual bool isValid() override final
Can the handle be successfully dereferenced?
ElementLink implementation for ROOT usage.
virtual StatusCode finalize() override
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
#define ATH_MSG_WARNING(x)
bool toPersistent()
Dummy function provinding the offline interface.
@ STACO
Tracks produced by STACO.
Class describing a TrackParticle.
ToolHandle< IMCTruthClassifier > m_truthClassifier
std::string m_particleName
bool isPresent() const
Is the referenced container present in SG?
virtual StatusCode initialize() override