26 if (!inputCollection.
isValid()) {
27 ATH_MSG_ERROR(
"Could not get input truth collection " << inputCollection.
name() <<
" from store " << inputCollection.
store());
28 return StatusCode::FAILURE;
30 ATH_MSG_DEBUG(
"Found input truth collection " << inputCollection.
name() <<
" in store " << inputCollection.
store());
32 const HepMC::GenEvent *genEvt = *(inputCollection->begin());
34 size_t nVertices = genEvt->vertices_size();
36 ATH_MSG_ERROR(
"Truth collection should have at least one vertex!");
37 return StatusCode::FAILURE;
41 size_t nParticles = genVtx->particles_out().size();
42 if (nParticles == 0) {
43 ATH_MSG_ERROR(
"Truth vertex should have at least one particle!");
44 return StatusCode::FAILURE;
48 auto genVtx = *(genEvt->vertices_end());
49 size_t nParticles = genVtx->particles_out_size();
50 if (nParticles == 0) {
51 ATH_MSG_ERROR(
"Truth vertex should have at least one particle!");
52 return StatusCode::FAILURE;
59 return StatusCode::SUCCESS;
67 if (!inputCollection.
isValid()) {
68 ATH_MSG_ERROR(
"Could not get input truth collection " << inputCollection.
name() <<
" from store " << inputCollection.
store());
69 return StatusCode::FAILURE;
71 ATH_MSG_DEBUG(
"Found input truth collection " << inputCollection.
name() <<
" in store " << inputCollection.
store());
73 const HepMC::GenEvent *genEvt = *(inputCollection->begin());
75 size_t nVertices = genEvt->vertices_size();
77 ATH_MSG_ERROR(
"Truth collection should have at least one vertex!");
78 return StatusCode::FAILURE;
82 size_t nParticles = genVtx->particles_out().size();
83 if (nParticles == 0) {
84 ATH_MSG_ERROR(
"Truth vertex should have at least one particle!");
85 return StatusCode::FAILURE;
90 auto genVtx = *(genEvt->vertices_end());
91 size_t nParticles = genVtx->particles_out_size();
92 if (nParticles == 0) {
93 ATH_MSG_ERROR(
"Truth vertex should have at least one particle!");
94 return StatusCode::FAILURE;
103 return StatusCode::SUCCESS;
a link optimized in size for a GenParticle in a McEventCollection
int id() const
Return the id of the target particle.
index_type eventIndex() const
Return the event number of the referenced GenEvent.
void setTruthSuppressionType(EBC_SUPPRESSED_TRUTH truthSupp)
Return whether the truth particle has been suppressed.