diff --git a/src/ReconstructedParticle.cc b/src/ReconstructedParticle.cc index 571a56d..32440bc 100644 --- a/src/ReconstructedParticle.cc +++ b/src/ReconstructedParticle.cc @@ -1,6 +1,7 @@ #include "ral/ReconstructedParticle.h" #include #include +#include namespace k4::ral { @@ -79,11 +80,11 @@ ROOT::VecOps::RVec get_goodnessOfPID( } print_PDG::print_PDG(int n_events) : m_n_events{n_events}, m_n_printed{0} {} + int print_PDG::operator()( ROOT::VecOps::RVec particles) { if (m_n_events == m_n_printed) { - std::cout << "Finish printing PDG" << std::endl; - std::exit(0); + throw std::runtime_error("End printing"); } auto pdgs = get_PDG(particles); std::cout << "Printing PDG from event " << m_n_printed << std::endl;