From 3c4662528ecb0b2545054bc24af80ae50fd46cc1 Mon Sep 17 00:00:00 2001
From: jhrdinka <julia.hrdinka@cern.ch>
Date: Thu, 9 Nov 2017 13:25:24 +0100
Subject: [PATCH] Correct order of event determination

---
 Core/src/Framework/Sequencer.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Core/src/Framework/Sequencer.cpp b/Core/src/Framework/Sequencer.cpp
index 3058ec78..cc787bce 100644
--- a/Core/src/Framework/Sequencer.cpp
+++ b/Core/src/Framework/Sequencer.cpp
@@ -137,8 +137,6 @@ FW::Sequencer::run(boost::optional<size_t> events, size_t skip)
           "Number of events, to be read in, are differnt for readers. Abort");
       return ProcessCode::ABORT;
     }
-    // Check if user wants to process less events than given by the reader
-    if (events && (*events) < numEvents) numEvents = *events;
     // Check if the number of skipped events is smaller then the overall number
     // if events
     if (skip > numEvents) {
@@ -149,6 +147,8 @@ FW::Sequencer::run(boost::optional<size_t> events, size_t skip)
     // The total number of events is the maximum number of events minus the
     // number of skipped evebts
     numEvents -= skip;
+    // Check if user wants to process less events than given by the reader
+    if (events && (*events) < numEvents) numEvents = *events;
   }
 
   // Execute the event loop
-- 
GitLab