Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
21 return StatusCode::SUCCESS;
32 ATH_CHECK(muonTruthContainer.
record(std::make_unique<xAOD::TruthParticleContainer>(),
33 std::make_unique<xAOD::TruthParticleAuxContainer>()));
39 xAOD::TruthParticle* truthParticle = muonTruthContainer->push_back(std::make_unique<xAOD::TruthParticle>());
40 truthParticle->
setPdgId(truth->pdgId());
42 truthParticle->
setStatus(truth->status());
43 truthParticle->
setPx(truth->px());
44 truthParticle->
setPy(truth->py());
45 truthParticle->
setPz(truth->pz());
46 truthParticle->
setE(truth->e());
47 truthParticle->
setM(truth->m());
48 if (truth->hasProdVtx()) truthParticle->
setProdVtxLink(truth->prodVtxLink());
51 ATH_MSG_DEBUG(
"Found stable muon: " << truth->pt() <<
" eta " << truth->eta() <<
" phi " << truth->phi() <<
" mass "
52 << truth->m() <<
" barcode " <<
HepMC::barcode(truth) <<
" truthParticle->barcode "
61 std::pair<MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin> truthClass =
63 iType = truthClass.first;
64 iOrigin = truthClass.second;
72 ATH_MSG_DEBUG(
"good muon with type " << iType <<
" and origin" << iOrigin);
75 ATH_MSG_DEBUG(
"Registered " << muonTruthContainer->size() <<
" truth muons ");
77 return StatusCode::SUCCESS;
void setStatus(int value)
Set status code.
Gaudi::Property< float > m_pt
void setE(float value)
Set the energy of the particle.
void setBarcode(int value)
Set barcode.
void setPx(float value)
Set the x component of the particle's momentum.
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthRecordKey
#define ATH_MSG_VERBOSE(x)
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
int truthType(const U &p)
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_truthOriginKey
ToolHandle< IMCTruthClassifier > m_truthClassifier
virtual StatusCode execute(const EventContext &ctx) const override
int truthOrigin(const U &p)
void setM(float value)
Also store the mass.
::StatusCode StatusCode
StatusCode definition for legacy code.
Class describing a truth particle in the MC record.
Handle class for adding a decoration to an object.
Handle class for adding a decoration to an object.
void setPy(float value)
Set the y component of the particle's momentum.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
ElementLink implementation for ROOT usage.
void setPdgId(int pid)
Set PDG ID code.
SG::WriteHandleKey< xAOD::TruthParticleContainer > m_outTruthMuonKey
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
bool isStable(const T &p)
Identify if the particle is stable, i.e. has not decayed.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
Gaudi::Property< std::set< int > > m_pdgIds
void setPz(float value)
Set the z component of the particle's momentum.
virtual StatusCode initialize() override
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_truthTypeKey
void setProdVtxLink(const ElementLink< TruthVertexContainer > &link)
Set the production vertex of the particle.
bool toPersistent()
Dummy function provinding the offline interface.