69 auto const size =
static_cast<std::int32_t
>(particles.size());
70 for (std::int32_t i = 0; i < size; ++i) {
71 auto const& mothers = particles[i].mothers;
72 if (particles[i].mother_id < -1 || particles[i].mother_id >= size) {
75 if (mothers.empty()) {
78 if (mothers.front() != particles[i].mother_id) {
81 for (
auto m = mothers.begin(); m != mothers.end(); ++m) {
82 if (*m < 0 || *m >= size || *m == i) {
87 if (std::find(mothers.begin(), m, *m) != m) {
bool mothers_are_consistent(std::vector< MCParticle > const &particles)
True when the mother indices of a whole collection are self-consistent, i.e.
Definition MCParticle.hpp:68
bool mothers_are_populated(std::vector< MCParticle > const &particles)
True when, on top of mothers_are_consistent(), every entry that has a mother carries the full list — ...
Definition MCParticle.hpp:101
Monte Carlo particle — input to simulation.
Definition MCParticle.hpp:48
bool operator==(MCParticle const &) const =default
std::array< double, 3 > vertex
Production vertex [mm].
Definition MCParticle.hpp:50
double time
Production time [ns].
Definition MCParticle.hpp:53
std::int32_t status
HepMC status (see above)
Definition MCParticle.hpp:56
std::array< double, 3 > momentum
Momentum (px, py, pz) [GeV/c].
Definition MCParticle.hpp:51
double energy
Total energy [GeV].
Definition MCParticle.hpp:52
std::int32_t mother_id
First mother (-1 = none)
Definition MCParticle.hpp:54
std::vector< std::int32_t > mothers
All mothers (see above)
Definition MCParticle.hpp:55
std::int32_t pdg_code
Definition MCParticle.hpp:49