82 std::unique_ptr<HepMC::GenEvent> outputEvent = std::make_unique<HepMC::GenEvent>(inputEvent);
83 if (inputEvent.run_info()) {
84 outputEvent->set_run_info(std::make_shared<HepMC3::GenRunInfo>(*(inputEvent.run_info().get())));
86 if (inputEvent.heavy_ion()) {
87 outputEvent->set_heavy_ion(std::make_shared<HepMC::GenHeavyIon>(*(inputEvent.heavy_ion())));
92 for (
auto& particle: outputEvent->particles()) {
96 const int shadowId = particle->id();
99 std::make_shared<HepMC3::IntAttribute>(shadowId));
109 std::vector<HepMC::GenParticlePtr> p_to_remove;
110 std::vector<HepMC::GenVertexPtr> v_to_remove;
111 for (
auto& particle: outputEvent->particles()) {
114 p_to_remove.push_back(particle);
117 for (
auto& particle: p_to_remove) outputEvent->remove_particle(particle);
118 for (
auto& vertex: outputEvent->vertices()) {
121 v_to_remove.push_back(vertex);
124 for (
auto& vertex: v_to_remove) outputEvent->remove_vertex(vertex);
125 if (p_to_remove.empty() && v_to_remove.empty())
break;