14 const std::vector<HepMC3::GenParticlePtr>& genParticles) {
17 std::vector<SimParticle> actsParticles;
19 for (
auto& genParticle : genParticles)
20 actsParticles.push_back(*(
21 simPart.
particle(std::make_shared<HepMC3::GenParticle>(*genParticle))));
26 const std::shared_ptr<HepMC3::GenVertex> vertex) {
27 SimVertex vtx({vertex->position().x(), vertex->position().y(),
28 vertex->position().z(), vertex->position().t()});
29 vtx.
incoming = genParticlesToActs(vertex->particles_in());
30 vtx.outgoing = genParticlesToActs(vertex->particles_out());
32 return std::make_unique<SimVertex>(std::move(vtx));
36 const std::shared_ptr<HepMC3::GenVertex> vertex) {
37 return vertex->in_event();
45 const std::shared_ptr<HepMC3::GenVertex> vertex) {
46 return genParticlesToActs(vertex->particles_in());
50 const std::shared_ptr<HepMC3::GenVertex> vertex) {
51 return genParticlesToActs(vertex->particles_out());
55 const std::shared_ptr<HepMC3::GenVertex> vertex) {
57 vec(0) = vertex->position().x();
58 vec(1) = vertex->position().y();
59 vec(2) = vertex->position().z();
64 return vertex->position().t();
68 std::shared_ptr<SimParticle> actsParticle) {
70 const auto mom = actsParticle->momentum4();
71 const HepMC3::FourVector vec(
mom[0],
mom[1],
mom[2],
mom[3]);
73 HepMC3::GenParticle genParticle(vec, actsParticle->pdg());
74 genParticle.set_generated_mass(actsParticle->mass());
76 return std::shared_ptr<HepMC3::GenParticle>(&genParticle);
80 std::shared_ptr<SimParticle>
particle) {
81 vertex->add_particle_in(actsParticleToGen(particle));
85 std::shared_ptr<SimParticle>
particle) {
86 vertex->add_particle_out(actsParticleToGen(particle));
90 const std::vector<HepMC3::GenParticlePtr>& genParticles,
91 std::shared_ptr<SimParticle> actsParticle) {
92 const auto id = actsParticle->particleId();
94 for (
auto& genParticle : genParticles) {
95 if (genParticle->id() == id) {
104 std::shared_ptr<HepMC3::GenVertex> vertex,
105 std::shared_ptr<SimParticle>
particle) {
107 if (HepMC3::GenParticlePtr genParticle =
108 matchParticles(vertex->particles_in(),
particle))
109 vertex->remove_particle_in(genParticle);
113 std::shared_ptr<HepMC3::GenVertex> vertex,
114 std::shared_ptr<SimParticle>
particle) {
116 if (HepMC3::GenParticlePtr genParticle =
117 matchParticles(vertex->particles_out(),
particle))
118 vertex->remove_particle_out(genParticle);
123 HepMC3::FourVector fVec(
pos(0),
pos(1),
pos(2), vertex->position().t());
124 vertex->set_position(fVec);
129 HepMC3::FourVector fVec(vertex->position().x(), vertex->position().y(),
130 vertex->position().z(),
time);
131 vertex->set_position(fVec);