From 5d442db19f8c7599acd540a26176a6a93f925491 Mon Sep 17 00:00:00 2001
From: "se.gorbunov" <se.gorbunov@gsi.de>
Date: Fri, 24 Jun 2022 08:58:14 +0000
Subject: [PATCH] L1: temporary fix in number of iterations

---
 reco/L1/L1Algo/L1Algo.h            | 15 ++++-----------
 reco/L1/L1Algo/L1CATrackFinder.cxx | 10 +++++++++-
 reco/L1/L1Algo/L1Parameters.h      |  3 +++
 3 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/reco/L1/L1Algo/L1Algo.h b/reco/L1/L1Algo/L1Algo.h
index 59df2b427e..8206baf284 100644
--- a/reco/L1/L1Algo/L1Algo.h
+++ b/reco/L1/L1Algo/L1Algo.h
@@ -643,20 +643,13 @@ private:
     kFastPrimIter2,
     kAllSecJumpIter  // secondary tracks with jumped triplets
   };
+
 #ifdef TRACKS_FROM_TRIPLETS
-  enum
-  {
-    fNFindIterations = TRACKS_FROM_TRIPLETS_ITERATION + 1
-  };  // TODO investigate kAllPrimJumpIter & kAllSecJumpIter
+  int fNFindIterations = TRACKS_FROM_TRIPLETS_ITERATION + 1;  // TODO investigate kAllPrimJumpIter & kAllSecJumpIter
 #else  // not TRACKS_FROM_TRIPLETS
-
-  enum
-  {
-    fNFindIterations = 4
-  };  // TODO investigate kAllPrimJumpIter & kAllSecJumpIter
-
-
+  int fNFindIterations = -1;  // TODO investigate kAllPrimJumpIter & kAllSecJumpIter
 #endif  // TRACKS_FROM_TRIPLETS
+
 #else  // not FIND_GAPED_TRACKS
   enum
   {
diff --git a/reco/L1/L1Algo/L1CATrackFinder.cxx b/reco/L1/L1Algo/L1CATrackFinder.cxx
index 032aed08a5..6c03eb47b1 100644
--- a/reco/L1/L1Algo/L1CATrackFinder.cxx
+++ b/reco/L1/L1Algo/L1CATrackFinder.cxx
@@ -1744,7 +1744,15 @@ void L1Algo::CATrackFinder()
 
 
   // ---- Loop over Track Finder iterations ----------------------------------------------------------------//
-  L1ASSERT(0, fNFindIterations == fParameters.GetCAIterations().size());
+
+#ifdef TRACKS_FROM_TRIPLETS
+  // TODO investigate kAllPrimJumpIter & kAllSecJumpIter
+  fNFindIterations = TRACKS_FROM_TRIPLETS_ITERATION + 1;
+#else
+  fNFindIterations = fParameters.GetNcaIterations();
+#endif
+
+  L1ASSERT(0, fNFindIterations == (int) fParameters.GetCAIterations().size());
   isec = 0;                                                      // TODO: temporary! (S.Zharko)
 
   for (const auto& caIteration : fParameters.GetCAIterations())  // all finder
diff --git a/reco/L1/L1Algo/L1Parameters.h b/reco/L1/L1Algo/L1Parameters.h
index 1a67b24fc1..8dbf3582b3 100644
--- a/reco/L1/L1Algo/L1Parameters.h
+++ b/reco/L1/L1Algo/L1Parameters.h
@@ -118,6 +118,9 @@ public:
   /// Provides access to L1CAIteration vector (const)
   const L1IterationsContainer_t& GetCAIterations() const { return fCAIterations; }
 
+  /// Provides number of iterations
+  int GetNcaIterations() const { return fCAIterations.size(); }
+
   /// Provides access to L1Stations container (const)
   const L1StationsContainer_t& GetStations() const { return fStations; }
 
-- 
GitLab