|
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef TRUTHHELPER_GENACCESSIO_H
6 #define TRUTHHELPER_GENACCESSIO_H
12 #include "GaudiKernel/Bootstrap.h"
13 #include "GaudiKernel/ISvcLocator.h"
28 if (
m_sgSvc.retrieve().isFailure()) {
29 throw StatusCode::FAILURE;
38 if ( (
m_sgSvc->retrieve(firstMEC, lastMEC)).isFailure() ) {
39 log << MSG::ERROR <<
"Could not retrieve iterators for McEventCollections" <<
endmsg;
43 for ( ; firstMEC!= lastMEC; ++firstMEC) icount++;
56 for (itr = mcColl.
begin(); itr!=mcColl.
end(); ++itr) {
58 const HepMC::GenEvent* genEvt = (*itr);
59 if (genEvt == 0)
return StatusCode::FAILURE;
61 for (
auto it: *genEvt) {
65 for (
auto it: *genEvt) {
66 mcParticles.push_back(
it);
71 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.
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
std::vector< HepMC::ConstGenParticlePtr >::const_iterator MCParticleCollectionCIter
std::vector< HepMC::ConstGenParticlePtr > MCParticleCollection
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.