29 {
31
32
33 SG::ConstIterator<McEventCollection> firstMEC;
34 SG::ConstIterator<McEventCollection> lastMEC;
35 if ( (
m_sgSvc->retrieve(firstMEC, lastMEC)).isFailure() ) {
36 log << MSG::ERROR <<
"Could not retrieve iterators for McEventCollections" <<
endmsg;
37 }
39 int icount = 0;
40 for ( ; firstMEC!= lastMEC; ++firstMEC) icount++;
41 log << MSG::DEBUG <<
"Number of McEventCollections= "<< icount <<
endmsg;
42
43
44 if (icount > 1) {
47 return this->
getDH(mcCollptr, key);
48 }
49
50 if (icount > 0) {
51
53 for (itr = mcColl.
begin(); itr!=mcColl.
end(); ++itr) {
54
55 const HepMC::GenEvent* genEvt = (*itr);
56 if (genEvt == 0) return StatusCode::FAILURE;
57 if (ifgen) {
58 for (auto it: *genEvt) {
60 }
61 } else {
62 for (auto it: *genEvt) {
63 mcParticles.push_back(std::move(it));
64 }
65 }
66 }
67 }
68 return StatusCode::SUCCESS;
69 }
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.
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...