Skip to content

Commit

Permalink
Printing PDG works in an interpreter session
Browse files Browse the repository at this point in the history
  • Loading branch information
Juanki0396 committed Aug 8, 2024
1 parent 0821f22 commit 3a92ad5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ReconstructedParticle.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "ral/ReconstructedParticle.h"
#include <cstdlib>
#include <iostream>
#include <stdexcept>

namespace k4::ral {

Expand Down Expand Up @@ -79,11 +80,11 @@ ROOT::VecOps::RVec<float> 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<edm4hep::ReconstructedParticleData> 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;
Expand Down

0 comments on commit 3a92ad5

Please sign in to comment.