From ed85b4ccecf9d56bd4bc2c5120a8cb13acbe9d19 Mon Sep 17 00:00:00 2001 From: Giulio Eulisse <10544+ktf@users.noreply.github.com> Date: Thu, 15 Aug 2024 21:44:03 +0200 Subject: [PATCH] Avoid doing one iteration when the tree has no entries (#13388) --- Detectors/EMCAL/simulation/src/RawCreator.cxx | 2 +- Detectors/PHOS/simulation/src/RawCreator.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Detectors/EMCAL/simulation/src/RawCreator.cxx b/Detectors/EMCAL/simulation/src/RawCreator.cxx index 883d907b8858e..386602e32b91c 100644 --- a/Detectors/EMCAL/simulation/src/RawCreator.cxx +++ b/Detectors/EMCAL/simulation/src/RawCreator.cxx @@ -122,7 +122,7 @@ int main(int argc, const char** argv) rawwriter.init(); // Loop over all entries in the tree, where each tree entry corresponds to a time frame - for (auto en : *treereader) { + while (treereader->Next()) { rawwriter.digitsToRaw(*digitbranch, *triggerbranch); } rawwriter.getWriter().writeConfFile("EMC", "RAWDATA", o2::utils::Str::concat_string(outputdir, "/EMCraw.cfg")); diff --git a/Detectors/PHOS/simulation/src/RawCreator.cxx b/Detectors/PHOS/simulation/src/RawCreator.cxx index 620c9f4def2be..de8bd53741572 100644 --- a/Detectors/PHOS/simulation/src/RawCreator.cxx +++ b/Detectors/PHOS/simulation/src/RawCreator.cxx @@ -109,7 +109,7 @@ int main(int argc, const char** argv) rawwriter.init(); // Loop over all entries in the tree, where each tree entry corresponds to a time frame - for (auto en : *treereader) { + while (treereader->Next()) { rawwriter.digitsToRaw(*digitbranch, *triggerbranch); } rawwriter.getWriter().writeConfFile("PHS", "RAWDATA", o2::utils::Str::concat_string(outputdir, "/PHSraw.cfg"));