From bc0edeaee6fcf90c1bb43492d72d8d74fd19c86a Mon Sep 17 00:00:00 2001
From: jhrdinka <julia.hrdinka@cern.ch>
Date: Wed, 8 Nov 2017 13:32:48 +0100
Subject: [PATCH] Allow that user can set maximum event number, when events are
 determined by reader

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

diff --git a/Core/src/Framework/Sequencer.cpp b/Core/src/Framework/Sequencer.cpp
index 4eb41b5f..389ebf99 100644
--- a/Core/src/Framework/Sequencer.cpp
+++ b/Core/src/Framework/Sequencer.cpp
@@ -138,6 +138,8 @@ 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) {
-- 
GitLab