From 309ff2fc97f3fcc35e851e3a5d6a21d5f42d10ed Mon Sep 17 00:00:00 2001
From: Peter Sherwood <peter.sherwood@cern.ch>
Date: Thu, 5 Nov 2020 15:42:04 +0000
Subject: [PATCH] Start work on optimizing of how job groups propagate up a
 hypo tree.

Job group propagation is correct but inefficient in the presence of identical  conditions.

Jet group propagation is currently handled in the following manner.

Let a parent condition P have n siblings: S_1... S_n
Let J_1... J_2 be the jet groups that pass each  of the n siblings.
JetGroupProduct finds all the distinct job groups formed by selecting one jet group from is taken fron each of
the J_i. Only distinct jet groups are retained. Distinct job groups are those obtained by flattening the JobGroup
calculated by the combination process, and discounting differences due to the order of the jets.

When the siblings are identical Conditions, the same jets pass each of the conditions. The combination process
can be optimized. The optimazation exploits the repetion that is _always_ present for identical Conditions.

As an example, let J_1 = J_2 = J_3 = {1,2,3}. Then the combinations are	- excluding repeated jets - {1,2,3}, {1,3,2},
{2, 1, 3}, {2, 3, 1}, {3, 1, 2}, {3, 2, 1}. After repetition removal, we are left with {1,2,3}. Further we only need to
look at jets passing C_1.

This optimatiztion replaces n repeated Conditions of capacity = 1 by a single Condition of capacity n.
After initially allocating jets to Conditions, a further test needs now to be made: were there enough distinct
jets to satisfy the n conditions - i.e. were there at least n jets fulfilling the condition.

To this end, the IConditionMT interface is extended by ICheckedCapacityCondition. This PABC provides a checking function:

bool capacitySatisfied(const HypoJetVector&,..)

 which will be passed the selected jets as an argument.

Currently, the sole implementation is CheckedCapacityCondition.

This commit uses this CheckedCapacityCondition. However the hypo trees remain as before, and no checks are made.
It is therefor expected that they will be no visible effects at this stage.
---
 .../python/TrigJetHypoToolConfig.py           | 18 +-----
 .../python/testChainDictMaker.py              | 21 ++++++-
 .../TrigHLTJetHypo/python/treeVisitors.py     | 14 ++++-
 .../src/CapacityCheckedCondition.h            | 61 +++++++++++++++++++
 .../src/CapacityCheckedConditionsDefs.h       | 23 +++++++
 .../TrigHLTJetHypo/src/FastReducer.cxx        | 28 +++++++--
 .../TrigHLTJetHypo/src/FastReducer.h          |  9 +--
 .../src/FastReductionMatcher.cxx              |  2 +-
 .../TrigHLTJetHypo/src/FastReductionMatcher.h | 10 +--
 .../src/ICapacityCheckedCondition.h           | 38 ++++++++++++
 .../TrigJetHypoToolConfig_fastreduction.cxx   | 27 +++++---
 .../src/TrigJetHypoToolConfig_fastreduction.h |  6 +-
 .../src/groupsMatcherFactoryMT.cxx            |  2 +-
 .../src/groupsMatcherFactoryMT.h              |  3 +-
 14 files changed, 216 insertions(+), 46 deletions(-)
 create mode 100644 Trigger/TrigHypothesis/TrigHLTJetHypo/src/CapacityCheckedCondition.h
 create mode 100644 Trigger/TrigHypothesis/TrigHLTJetHypo/src/CapacityCheckedConditionsDefs.h
 create mode 100644 Trigger/TrigHypothesis/TrigHLTJetHypo/src/ICapacityCheckedCondition.h

diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/TrigJetHypoToolConfig.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/TrigJetHypoToolConfig.py
index e5a870341f8a..a1e5c78989eb 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/TrigJetHypoToolConfig.py
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/TrigJetHypoToolConfig.py
@@ -176,24 +176,8 @@ class TestDebugFlagIsFalse(unittest.TestCase):
         self.assertFalse(tool.visit_debug)
 
 
-def _tests():
-
-    from TriggerMenuMT.HLTMenuConfig.Menu import DictFromChainName
-
-    chainNameDecoder = DictFromChainName.DictFromChainName()
-
-    chain_names = (
-        'j80_0eta240_2j60_320eta490_L1J20',
-        'j80_0eta240_2j60_320eta490_j0_dijetSEP80j1etSEP0j1eta240SEP80j2etSEP0j2eta240SEP700djmass_L1J20',
-    )
-    for cn in chain_names:
-        chain_dict = chainNameDecoder.getChainDict(cn)
-
-        trigJetHypoToolFromDict(chain_dict)
-
 
 if __name__ == '__main__':
     unittest.main()
 
-    # run _tests outide untit tests so as to see stdout
-    # _tests()
+    # other local tests have been moved to testChainDictMaker.py
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/testChainDictMaker.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/testChainDictMaker.py
index b60f1b83b9fe..42d7d53e798c 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/testChainDictMaker.py
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/testChainDictMaker.py
@@ -10,7 +10,9 @@ from TriggerMenuMT.HLTMenuConfig.Menu.Physics_pp_run3_v1 import (
 from TriggerMenuMT.HLTMenuConfig.Menu.ChainDefInMenu import ChainProp
 from TriggerMenuMT.HLTMenuConfig.Menu.DictFromChainName import dictFromChainName
 
-    
+from chainDict2jetLabel import chainDict2jetLabel 
+from TrigJetHypoToolConfig import trigJetHypoToolFromDict
+
 def testChainDictMaker():
 
     chain_props = [
@@ -20,6 +22,10 @@ def testChainDictMaker():
         ChainProp(name='HLT_j80_j60_L1J15',
                   l1SeedThresholds=['FSNOSEED']*2, groups=MultiJetGroup),
 
+        ChainProp(name='HLT_2j80_3j60_L1J15',
+                  l1SeedThresholds=['FSNOSEED']*2, groups=MultiJetGroup),
+
+
         ChainProp(name='HLT_j0_HTSEP1000htSEP100etSEP0eta320_L1J15',
                   l1SeedThresholds=['FSNOSEED'], groups=MultiJetGroup),
 
@@ -45,3 +51,16 @@ if __name__ == '__main__':
     for d in dicts:
         print('')
         print (d)
+
+    print ('\n chain_labels:\n')
+    
+    for d in dicts:
+        print (d[0])
+        print (chainDict2jetLabel(d[1]))
+        print ()
+
+    print ('\nMaking TrigJetHypoTool for each dictiomary\n')
+    for d in dicts:
+        print (d[0])
+        print (trigJetHypoToolFromDict(d[1]))
+        print ()
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/treeVisitors.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/treeVisitors.py
index cc704db08835..fbdf5b60bf49 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/treeVisitors.py
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/treeVisitors.py
@@ -181,7 +181,6 @@ class ConditionsDictMaker(object):
 
 
     def makeDict(self, params):
-
         # conditions example: ['10et,0eta320', '20et']
         conditions = self.get_conditions(params)
 
@@ -256,8 +255,21 @@ class ConditionsDictMaker(object):
             
             result.append(cdict)
 
+
+        # Example: input condition string:
+        #
+        # 260et,320eta490
+        # 
+        # result:
+        #
+        # [
+        #  defaultdict(<class 'dict'>, {'et': {'min': '260000.0', 'max': 'inf'},
+        #                               'eta': {'min': '3.2', 'max': '4.9'}})
+        # ]
+
         msgs = ['ConditionsDict OK']
         error = False
+        print ('ConditionsDictMaker::makeDict(), result', result)
         return result, error, msgs
 
 
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/CapacityCheckedCondition.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/CapacityCheckedCondition.h
new file mode 100644
index 000000000000..1455d594aca7
--- /dev/null
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/CapacityCheckedCondition.h
@@ -0,0 +1,61 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TRIGHLTJETHYPO_CAPACITYCHECKEDCONDITIONMT_H
+#define TRIGHLTJETHYPO_CAPACITYCHECKEDCONDITIONMT_H
+
+/********************************************************************
+ *
+ * NAME:     CapacityCheckedConditionMT.h
+ * PACKAGE:  Trigger/TrigHypothesis/TrigHLTJetHypo
+ *
+ * AUTHOR:   P. Sherwood
+ * 
+ * an implementation of the  ICapacityCheckedConditionMT PABC.
+ *          
+ *********************************************************************/
+
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/HypoJetDefs.h"
+#include "ICapacityCheckedCondition.h"
+
+#include <memory>
+#include <string>
+
+
+class ITrigJetHypoInfoCollector;
+
+class CapacityCheckedCondition: public ICapacityCheckedCondition {
+ public:
+ CapacityCheckedCondition(std::unique_ptr<IConditionMT> cp):
+  m_condition{std::move(cp)} {
+  }
+  
+  virtual ~CapacityCheckedCondition(){
+  }
+
+  virtual bool
+    capacitySatisfied(std::size_t jgMultiplicity,
+		      const Collector&) const override {
+
+    return m_condition->capacity() <= jgMultiplicity;
+  }
+  
+  virtual bool isSatisfied(const HypoJetVector& v,
+                           const std::unique_ptr<ITrigJetHypoInfoCollector>& c) const override {
+    return m_condition->isSatisfied(v, c);
+  }
+  
+  virtual unsigned int capacity() const override {
+    return m_condition->capacity();
+  }
+  
+  virtual std::string toString() const noexcept override {
+    return m_condition->toString();
+  }
+  
+ private:
+  std::unique_ptr<IConditionMT> m_condition;
+};
+
+#endif
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/CapacityCheckedConditionsDefs.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/CapacityCheckedConditionsDefs.h
new file mode 100644
index 000000000000..f26ccc1bc85c
--- /dev/null
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/CapacityCheckedConditionsDefs.h
@@ -0,0 +1,23 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TRIGHLTJETHYPO_CAPCACITYCHECKEDCONDITIONSDEFSMT_H
+#define TRIGHLTJETHYPO_CAPCACITYCHECKEDCONDITIONSDEFSMT_H
+/********************************************************************
+ *
+ * NAME:     ConditionsDefs.h
+ * PACKAGE:  Trigger/TrigHypothesis/TrigHLTJetHypo
+ *
+ * AUTHOR:   P. Sherwood
+ *********************************************************************/
+
+#include <string>
+#include <memory>
+#include "./ICapacityCheckedCondition.h"
+
+using ConditionPtr = std::unique_ptr<ICapacityCheckedCondition>;
+using ConditionPtrs = std::vector<ConditionPtr>;
+using ConditionPtrsIter = ConditionPtrs::iterator;
+
+#endif
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReducer.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReducer.cxx
index 49c56a2e1377..f4f36af1ae37 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReducer.cxx
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReducer.cxx
@@ -38,7 +38,7 @@ struct IndexVecComp{
 
 FastReducer::FastReducer(const HypoJetGroupCIter& groups_b,
                          const HypoJetGroupCIter& groups_e,
-                         const ConditionsMT& conditions,
+                         const ConditionPtrs& conditions,
                          const Tree& tree,
                          const std::vector<std::vector<int>>& sharedConditions,
                          xAODJetCollector& jetCollector,
@@ -179,10 +179,10 @@ bool FastReducer::findInitialJetGroups(const std::vector<int>& leaves,
     }
   }
 
+
   // check all leaf conditions are satisfied
   for (const auto& i : leaves) {
-    auto& satisfiedBy = m_satisfiedBy.at(i);
-    if (satisfiedBy.empty()) {
+    if (!capacitySatisfied(i, collector)) {
       return false;
     }
   }
@@ -328,7 +328,7 @@ bool FastReducer::propagate_(std::size_t child,
    
   auto jg_product = JetGroupProduct(siblings, m_satisfiedBy);
    
-  // obtain the next product of hob groups passing siblings
+  // obtain the next product of jet groups passing siblings
   auto next = jg_product.next(collector);
 
   // step through the jet groups found by combining ghe child groups
@@ -351,7 +351,7 @@ bool FastReducer::propagate_(std::size_t child,
 		      m_jg2elemjgs[i].end());
     }
 
-    // if any of the elemetal jet group indices are repeated,
+    // if any of the elemental jet group indices are repeated,
     // stop processing of the new jet group. (do not allow sharing for
     // among leaf nodes. Sharing is handled by processing > 1 leaf groups
     // each of which does not share.
@@ -497,8 +497,24 @@ void FastReducer::recordJetGroup(std::size_t ind,
 	 << " et " << ip->et();
   }
   ss1 << '\n';
-  collector -> collect(ss0.str(), ss1.str());
+  collector->collect(ss0.str(), ss1.str());
 }
 
 bool FastReducer::pass() const { return m_pass; }
 
+
+bool FastReducer::capacitySatisfied(std::size_t ind,
+				    const Collector& collector) const {
+  // Check that the number of satisfying job groups is sufficient to
+  // satisfy the capacity of the Condition. Uses include handling
+  // of Conditions which represent multiple identical conditions.
+  
+  auto jgMult = m_satisfiedBy.at(ind).size();
+  auto capSat = m_conditions.at(ind)->capacitySatisfied(jgMult, collector);
+  if (!capSat and collector) {
+    collector->collect("FastReduce", "Condition " + std::to_string(ind)
+			 + " unsatisfied capacity, aborting"); 
+  }
+  
+  return capSat;
+}
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReducer.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReducer.h
index 5aba889c93be..e92217ae5e43 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReducer.h
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReducer.h
@@ -5,8 +5,7 @@
 #ifndef TRIGHLTJETHYPO_FASTREDUCER_H
 #define TRIGHLTJETHYPO_FASTREDUCER_H
 
-
-#include "./ConditionsDefsMT.h"
+#include "./CapacityCheckedConditionsDefs.h"
 #include "./Tree.h"
 #include "./JetGroupProduct.h"
 #include "./JetGroupIndAllocator.h"
@@ -30,7 +29,7 @@ class FastReducer {
 
   FastReducer(const HypoJetGroupCIter& groups_b,
               const HypoJetGroupCIter& groups_e,
-              const ConditionsMT& conditionObjects,
+              const ConditionPtrs& conditionObjects,
               const Tree& conditionsTree,
               const std::vector<std::vector<int>>& sharedConditions,
               xAODJetCollector& jetCollector,
@@ -47,7 +46,7 @@ class FastReducer {
 
  private:
 
-  const ConditionsMT& m_conditions;
+  const ConditionPtrs& m_conditions;
 
   /** tree structure for Conditions objects.
    The conditions tree gives relations among conditions (eg parent-child
@@ -114,6 +113,8 @@ class FastReducer {
   void collectLeafJets(xAODJetCollector& jetCollector,
 		       const Collector& collector) const;
 
+  bool capacitySatisfied(std::size_t ind,
+			 const Collector& collector) const;
 
 };
 #endif
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReductionMatcher.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReductionMatcher.cxx
index 7f78b0ca100e..4dfffac4ca42 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReductionMatcher.cxx
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReductionMatcher.cxx
@@ -12,7 +12,7 @@
 
 
 
-FastReductionMatcher::FastReductionMatcher(ConditionsMT conditions,
+FastReductionMatcher::FastReductionMatcher(ConditionPtrs conditions,
 					   const Tree& tree,
 					   const std::vector<std::vector<int>>& sharedNodes):
   m_conditions(std::move(conditions)),
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReductionMatcher.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReductionMatcher.h
index b7fe4d2eb747..62210f404a39 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReductionMatcher.h
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReductionMatcher.h
@@ -7,7 +7,7 @@
 
 
 #include "./IGroupsMatcherMT.h"
-#include "./ConditionsDefsMT.h"
+#include "./CapacityCheckedConditionsDefs.h"
 #include "./Tree.h"
 
 using TreeVec = std::vector<std::size_t>;
@@ -16,9 +16,9 @@ class ITrigJetHypoInfoCollector;
 class FastReductionMatcher: public IGroupsMatcherMT {
  public:
 
-  FastReductionMatcher(ConditionsMT,
-			    const Tree&,
-			    const std::vector<std::vector<int>>&);
+  FastReductionMatcher(ConditionPtrs,
+		       const Tree&,
+		       const std::vector<std::vector<int>>&);
 
 
   /** determine whether a set of jets satisfies all hypo conditions.
@@ -42,7 +42,7 @@ class FastReductionMatcher: public IGroupsMatcherMT {
 
  private:
 
-  ConditionsMT m_conditions;
+  ConditionPtrs m_conditions;
 
   /** tree structure for Conditions objects.
    The conditions tree gives relations among conditions (eg parent-child
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/ICapacityCheckedCondition.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/ICapacityCheckedCondition.h
new file mode 100644
index 000000000000..033ce81570cf
--- /dev/null
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/ICapacityCheckedCondition.h
@@ -0,0 +1,38 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TRIGHLTJETHYPO_ICAPACITYCHECKEDCONDITIONMT_H
+#define TRIGHLTJETHYPO_ICAPACITYCHECKEDCONDITIONMT_H
+
+/********************************************************************
+ *
+ * NAME:     ICapacityCheckedConditionMT.h
+ * PACKAGE:  Trigger/TrigHypothesis/TrigHLTJetHypo
+ *
+ * AUTHOR:   P. Sherwood
+ * 
+ * extend IConditionMT by adding a method that checks whether the
+ * capacity of the Condition has been attained.
+ *          
+ *********************************************************************/
+
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/HypoJetDefs.h"
+#include "IConditionMT.h"
+
+#include <string>
+typedef std::unique_ptr<ITrigJetHypoInfoCollector> Collector;
+
+
+class ITrigJetHypoInfoCollector;
+
+class ICapacityCheckedCondition: public IConditionMT {
+ public:
+  virtual ~ICapacityCheckedCondition(){}
+
+  virtual bool capacitySatisfied(std::size_t jgMultiplicity,
+				 const Collector&) const = 0;
+  
+};
+
+#endif
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_fastreduction.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_fastreduction.cxx
index 051697a152ed..4c4e6691b6d2 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_fastreduction.cxx
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_fastreduction.cxx
@@ -15,6 +15,7 @@
 #include "TrigHLTJetHypo/TrigHLTJetHypoUtils/CleanerFactory.h"
 #include "TrigHLTJetHypo/TrigHLTJetHypoUtils/TrigHLTJetHypoHelper2.h"
 #include "./groupsMatcherFactoryMT.h"
+#include "./CapacityCheckedCondition.h"
 
 #include "TrigCompositeUtils/TrigCompositeUtils.h"
 
@@ -126,20 +127,32 @@ StatusCode TrigJetHypoToolConfig_fastreduction::initialize() {
 
 
 
-std::optional<ConditionsMT>
-TrigJetHypoToolConfig_fastreduction::getConditions() const {
+std::optional<ConditionPtrs>
+TrigJetHypoToolConfig_fastreduction::getCapacityCheckedConditions() const {
 
-  ConditionsMT conditions;
+  ConditionPtrs conditions;
 
   // collect the Conditions objects from the various sources
   // return an invalid optional if any src signals a problem
+
   for(const auto& cm : m_conditionMakers){
-    conditions.push_back(cm->getCondition());
+    conditions.push_back(std::make_unique<CapacityCheckedCondition>(std::move(cm->getCondition())));
   }
-    
-  return std::make_optional<ConditionsMT>(std::move(conditions));
+      
+  return std::make_optional<ConditionPtrs>(std::move(conditions));
 }
 
+std::optional<ConditionsMT>
+TrigJetHypoToolConfig_fastreduction::getConditions() const {
+  /* obtain an unchecked set of conditions */
+  
+  ConditionsMT conditions;
+  for(const auto& cm : m_conditionMakers){
+    conditions.push_back(std::move(cm->getCondition()));
+  }
+  
+  return std::make_optional<ConditionsMT>(std::move(conditions));
+}
 
 // following function not used for treeless hypos
 std::size_t
@@ -156,7 +169,7 @@ TrigJetHypoToolConfig_fastreduction::getJetGrouper() const {
 std::unique_ptr<IGroupsMatcherMT>
 TrigJetHypoToolConfig_fastreduction::getMatcher () const {
 
-  auto opt_conds = getConditions();
+  auto opt_conds = getCapacityCheckedConditions();
 
   if(!opt_conds.has_value()){
     return std::unique_ptr<IGroupsMatcherMT>(nullptr);
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_fastreduction.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_fastreduction.h
index 5625120313e9..2e70bf1b8167 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_fastreduction.h
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_fastreduction.h
@@ -14,7 +14,7 @@
 
 
 #include "ITrigJetHypoToolConfig.h"
-#include "./ConditionsDefsMT.h"
+#include "./CapacityCheckedConditionsDefs.h"
 #include "TrigCompositeUtils/HLTIdentifier.h"
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "TrigCompositeUtils/TrigCompositeUtils.h"
@@ -57,6 +57,8 @@ public extends<AthAlgTool, ITrigJetHypoToolConfig> {
     this, "sharedVector", {}, "nodeID groups for nodes that see input jets"};
 
   std::vector<std::vector<int>> m_sharedNodes{};
- 
+
+  std::optional<ConditionPtrs> getCapacityCheckedConditions() const;
+
 };
 #endif
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/groupsMatcherFactoryMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/groupsMatcherFactoryMT.cxx
index 100bfcc525f3..a580b25257e5 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/groupsMatcherFactoryMT.cxx
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/groupsMatcherFactoryMT.cxx
@@ -47,7 +47,7 @@ groupsMatcherFactoryMT_Partitions (ConditionsMT&& conditions){
 
 
 std::unique_ptr<IGroupsMatcherMT> 
-groupsMatcherFactoryMT_FastReduction (ConditionsMT&& conditions,
+groupsMatcherFactoryMT_FastReduction (ConditionPtrs&& conditions,
 				      const std::vector<std::size_t>& treeVec,
 				      const std::vector<std::vector<int>>& sharedNodes){
   
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/groupsMatcherFactoryMT.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/groupsMatcherFactoryMT.h
index 5b6d1f1f25cc..1865de3d94bf 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/groupsMatcherFactoryMT.h
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/groupsMatcherFactoryMT.h
@@ -7,6 +7,7 @@
 
 #include "./IGroupsMatcherMT.h"
 #include "./ConditionsDefsMT.h"
+#include "./CapacityCheckedConditionsDefs.h"
 #include <memory>
 
 std::unique_ptr<IGroupsMatcherMT>
@@ -20,7 +21,7 @@ groupsMatcherFactoryMT_Partitions(ConditionsMT&&);
 
 
 std::unique_ptr<IGroupsMatcherMT>
-groupsMatcherFactoryMT_FastReduction(ConditionsMT&&,
+groupsMatcherFactoryMT_FastReduction(ConditionPtrs&&,
 				     const std::vector<std::size_t>& treeVec,
 				     const std::vector<std::vector<int>>&);
 #endif
-- 
GitLab