5#ifndef TRUTHHELPER_GENACCESSIO_H
6#define TRUTHHELPER_GENACCESSIO_H
25 if (
m_sgSvc.retrieve().isFailure()) {
26 throw StatusCode::FAILURE;
35 if ( (
m_sgSvc->retrieve(firstMEC, lastMEC)).isFailure() ) {
36 log << MSG::ERROR <<
"Could not retrieve iterators for McEventCollections" <<
endmsg;
40 for ( ; firstMEC!= lastMEC; ++firstMEC) icount++;
41 log << MSG::DEBUG <<
"Number of McEventCollections= "<< icount <<
endmsg;
45 log << MSG::DEBUG <<
"Key = " << key <<
endmsg;
47 return this->
getDH(mcCollptr, key);
53 for (itr = mcColl.
begin(); itr!=mcColl.
end(); ++itr) {
55 const HepMC::GenEvent* genEvt = (*itr);
56 if (genEvt == 0)
return StatusCode::FAILURE;
58 for (
auto it: *genEvt) {
62 for (
auto it: *genEvt) {
63 mcParticles.push_back(std::move(it));
68 return StatusCode::SUCCESS;
74 return m_sgSvc->retrieve(dh, key);
77 return m_sgSvc->record(storee, key);
std::vector< HepMC::ConstGenParticlePtr > MCParticleCollection
std::vector< HepMC::ConstGenParticlePtr >::const_iterator MCParticleCollectionCIter
ATLAS-specific HepMC functions.
DataModel_detail::const_iterator< DataVector > const_iterator
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
This defines the McEventCollection, which is really just an ObjectVector of McEvent objectsFile: Gene...
a const_iterator facade to DataHandle.
StatusCode getMC(MCParticleCollection &mcParticles, const bool ifgen=false, const std::string &key="GEN_EVENT") const
ServiceHandle< StoreGateSvc > m_sgSvc
StatusCode getDH(const McEventCollection *&dh, const std::string &key) const
StatusCode store(McEventCollection *storee, const std::string &key) const
StatusCode getDH(const McEventCollection *&dh) const
IMessageSvc * getMessageSvc(bool quiet=false)
bool is_simulation_particle(const T &p)
Method to establish if a particle (or barcode) was created during the simulation (TODO update to be s...