From b5a5eb8ff8d3b7b4922d9207a1aa072006bb3a54 Mon Sep 17 00:00:00 2001
From: Florian Uhlig <f.uhlig@gsi.de>
Date: Wed, 15 Feb 2023 10:47:39 +0100
Subject: [PATCH] Fix operator++ for moduleId enum

The operator needs to exclude a gap in the sequence of numbers. Unfortunately
this was done wrongly such that adding new entries in the enum were also
excluded.
---
 core/data/CbmDefs.cxx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/core/data/CbmDefs.cxx b/core/data/CbmDefs.cxx
index 1ace5dcc15..d5e6ec3e53 100644
--- a/core/data/CbmDefs.cxx
+++ b/core/data/CbmDefs.cxx
@@ -17,13 +17,13 @@
 // the values 11-15 are reserved for future detectors.
 // The ids of the passive modules are only relevant at run time so they can
 // be shifted easily
-// The opeartor takes care about the non continuous values for the enum
+// The operator takes care about the non continuous values for the enum
 // When it reaches the last detector it automatically continuous with the
 // first passive module
 ECbmModuleId& operator++(ECbmModuleId& e)
 {
   if (e == ECbmModuleId::kLastModule) { throw std::out_of_range("for ECbmModuleId& operator ++ (ECbmModuleId&)"); }
-  else if (e == ECbmModuleId::kT0) {
+  else if (e == ECbmModuleId::kNofSystems) {  // jump over gap between end of detectors and begin of passives
     e = ECbmModuleId::kMagnet;
   }
   else {
-- 
GitLab