|
ATLAS Offline Software
|
Go to the documentation of this file.
28 const unsigned int genEventIndex,
35 if ( 0 == mcCollection ) {
36 ::Warning (
"RootTruthParticleCnvTool",
37 "Null pointer to McEventCollection !");
38 return StatusCode::RECOVERABLE;
41 if ( mcCollection->
size() <= genEventIndex ) {
42 ::Warning (
"RootTruthParticleCnvTool",
43 "McEventCollection size: %ui; Requested element nbr : %ui !!",
46 (
unsigned int)mcCollection->
size(),
48 return StatusCode::RECOVERABLE;
51 const HepMC::GenEvent *
evt = (*mcCollection)[genEventIndex];
52 container->
setGenEvent( mcCollection, genEventIndex );
60 for (
const auto& hepMcPart: *
evt) {
66 visitor->
visit( mcPart );
73 ::Error (
"RootTruthParticleCnvTool",
74 "TruthParticle is not wrapping the GenParticle : %d !!",
78 bcToMcPart[ mcLink.
compress() ] = mcPart;
89 if ( m_doEtIsolation.value() ) {
90 const std::string& etIsolName
91 = m_isolationTool->etIsolationsName( container->
genEventName() );
92 if ( etIsolName.empty() ) {
94 <<
"Could not retrieve the name of the TruthEtIsolations container"
96 return StatusCode::RECOVERABLE;
100 if ( !m_storeGate->retrieve( etIsols, etIsolName ).isSuccess() ) {
101 m_msg << MSG::WARNING
102 <<
"Could not retrieve the TruthEtIsolations container at ["
103 << etIsolName <<
"] !!"
105 return StatusCode::RECOVERABLE;
114 return StatusCode::SUCCESS;
136 const Gaudi::Details::PropertyBase&
139 std::string& )
const {
141 const std::vector< Gaudi::Details::PropertyBase* >&
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
virtual StatusCode sysRestart() override
virtual StatusCode restart() override
virtual StatusCode convert(const McEventCollection *mcEvts, const unsigned int genEvtIndex, TruthParticleContainer *mcParts, const ITruthParticleVisitor *visitor) const override
Converts a McEventCollection into an TruthParticleContainer (ie: converts it into an AOD compliant co...
virtual const std::string & name() const override
void setEtIsolations(const ElementLink< TruthEtIsolationsContainer > &etIsolations)
Setup the persistent pointer toward the TruthEtIsolations.
virtual int pdgId() const
Return enum indicating particle id the enum file is available in Event/EventKernel/PdtPdg....
virtual StatusCode reinitialize() override
virtual Gaudi::StateMachine::State FSMState() const override
barcode_type compress() const
Hash the 32 bit barcode and 16 bit eventindex into a 32bit int.
virtual const IInterface * parent() const override
virtual StatusCode setPropertyRepr(const std::string &n, const std::string &r) override
virtual StatusCode stop() override
HepMC::ConstGenParticlePtr genParticle() const
Retrieve the GenParticle this TruthParticle has been made from (if any)
void setGenEventIndex(size_t index)
set the GenEvent index
virtual StatusCode start() override
virtual StatusCode getProperty(Gaudi::Details::PropertyBase *p) const override
a link optimized in size for a GenParticle in a McEventCollection
::StatusCode StatusCode
StatusCode definition for legacy code.
CalibratedSpacePoint::State State
virtual StatusCode terminate() override
TruthParticle_v1 TruthParticle
Typedef to implementation.
virtual StatusCode sysStop() override
void setGenEvent(const ElementLink< McEventCollection > &genEvent)
Setup the persistent pointer toward the HepMC::GenEvent this TruthParticleContainer is proxying.
This defines the McEventCollection, which is really just an ObjectVector of McEvent objects.
virtual StatusCode configure() override
void clear()
Erase all the elements in the collection.
std::unordered_map< long, const TruthParticle * > Map_t
barcode to TruthParticle dictionary
double charge(const T &p)
virtual const std::string & type() const override
value_type push_back(value_type pElem)
Add an element to the end of the collection.
double chargeFromPdgId(int pdgId) const
Helper method to get the charge of a particle given its PDG Id.
virtual StatusCode finalize() override
virtual StatusCode sysFinalize() override
virtual const std::vector< Gaudi::Details::PropertyBase * > & getProperties() const override
void setParticles(const Map_t &parts)
Setup the dictionary of barcodes-to-TruthParticle.
const std::string & genEventName() const
Retrieve the name (StoreGate location) of the HepMC::GenEvent this TruthParticleContainer is proxying...
virtual void visit(TruthParticle *truthParticle) const =0
The method to visit a TruthParticle to apply further modifications to the instance at hand.
virtual StatusCode sysReinitialize() override
virtual StatusCode execute() const override
A hook for Athena algorithms.
Error
The different types of error that can be flagged in the L1TopoRDO.
virtual StatusCode initialize() override
virtual StatusCode sysInitialize() override
virtual bool hasProperty(std::string_view name) const override
virtual StatusCode setProperty(const std::string &s) override
void setCharge(const ChargeType charge)
Set the charge of this TruthParticle.
size_type size() const noexcept
Returns the number of elements in the collection.
virtual StatusCode sysStart() override