|
ATLAS Offline Software
|
Go to the documentation of this file.
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++;
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(
it);
68 return StatusCode::SUCCESS;
Const iterator class for DataVector/DataList.
IMessageSvc * getMessageSvc(bool quiet=false)
StatusCode getDH(const McEventCollection *&dh, const std::string &key) const
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...
::StatusCode StatusCode
StatusCode definition for legacy code.
StatusCode getMC(MCParticleCollection &mcParticles, const bool ifgen=false, const std::string &key="GEN_EVENT") const
StatusCode getDH(const McEventCollection *&dh) const
This defines the McEventCollection, which is really just an ObjectVector of McEvent objects.
std::vector< HepMC::ConstGenParticlePtr >::const_iterator MCParticleCollectionCIter
ServiceHandle< StoreGateSvc > m_sgSvc
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
StatusCode store(McEventCollection *storee, const std::string &key) const
std::vector< HepMC::ConstGenParticlePtr > MCParticleCollection
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.