Skip to content

Converter: propagate original GenRunInfo for events after the first #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions cpp/abconv/Converter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ void ab::abconv::Converter::convert() {

if (_last_event_number && evt.event_number() > _last_event_number) continue;

// Have to copy run info from existing hepmc
auto run_info = _reader->run_info();

if(0 == events_processed) {
// The first event, determine beams configuration
bool must_exit = check_beams_setup(evt);
if(must_exit) return;

// Have to copy run info from existing hepmc
auto run_info = _reader->run_info();

// Autodetect afterburner config if we have afterburner
if(_afterburner) {
// Print AB configuration and add it to RunInfo
Expand All @@ -57,11 +57,11 @@ void ab::abconv::Converter::convert() {
// set afterburner is not used to run info
run_info->add_attribute("ab_afterburner_is_used", std::make_shared<BoolAttribute>(false));
}

// save updated run info
evt.set_run_info(run_info);
}

// save run info that may have been updated
evt.set_run_info(run_info);

if (_verbose) {
cout << fixed;
std::cout << "************\nORIGIN EVENT\n************\n";
Expand Down