Skip to content

Commit

Permalink
Standalone printout only for every 10% of processed events (#66)
Browse files Browse the repository at this point in the history
* printout every 10% of events

* add missing space
  • Loading branch information
Zehvogel authored Jun 3, 2024
1 parent 684aae3 commit 69f4482
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions standalone/lcio2edm4hep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,9 @@ int main(int argc, char* argv[]) {

const int nEvt = args.nEvents > 0 ? args.nEvents : lcreader->getNumberOfEvents();
for (int i = 0; i < nEvt; ++i) {
if (i % 10 == 0) {
std::cout << "processing Event: " << i << std::endl;
int percEvt = i * 100 / (nEvt - 1);
if (percEvt % 10 == 0) {
std::cout << "processed amount of events: " << percEvt << "% (event: " << i << ")" << std::endl;
}
auto evt = lcreader->readNextEvent();
// Patching the Event to make sure all events contain the same Collections.
Expand Down
2 changes: 1 addition & 1 deletion tests/compare_contents.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ int main(int argc, char* argv[]) {

// loop going over every name of the lcio collection and checking if a
// collection with the same name exists in the edm file.
std::cout << "number of Events" << edmreader.getEntries("events") << std::endl;
std::cout << "number of Events " << edmreader.getEntries("events") << std::endl;
for (size_t n = 0; n < edmreader.getEntries("events"); ++n) {
if (n % 10 == 0) {
std::cout << "Event number: " << n << std::endl;
Expand Down

0 comments on commit 69f4482

Please sign in to comment.