From a2c48feaafeb4c7cda55ab09fe97d466d86d0d9d Mon Sep 17 00:00:00 2001
From: Tomasz Bold <tomasz.bold@gmail.com>
Date: Fri, 29 Sep 2017 08:33:02 +0200
Subject: [PATCH] Staging bit with RH Array renounce issues

---
 Control/AthenaCommon/python/CFElements.py         | 12 ++++++++++++
 .../DecisionHandling/src/TriggerSummaryAlg.h      |  3 +++
 .../TrigUpgradeTest/share/egamma.withViews.py     | 15 ++++++++++++---
 3 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/Control/AthenaCommon/python/CFElements.py b/Control/AthenaCommon/python/CFElements.py
index 815c3023715..c638273b3cb 100644
--- a/Control/AthenaCommon/python/CFElements.py
+++ b/Control/AthenaCommon/python/CFElements.py
@@ -21,8 +21,20 @@ def seqAND(name, subs=[]):
         seq += s
     return seq
 
+def seqOR(name, subs=[]):
+    """ sequential OR sequencer, used when a barier needs to be set but all subs reached irresepectively of the decision """
+    seq = AthSequencer( name )
+    seq.ModeOR = True
+    seq.Sequential = True
+    seq.StopOverride = True
+    for s in subs:
+        seq += s
+    return seq
+
 def stepSeq(name, filterAlg, rest):
     """ elementary HLT step sequencer, filterAlg is gating, rest is anything that needs to happe within the step """
     stepReco = parOR(name+"_reco", rest)
     stepAnd = seqAND(name, [ filterAlg, stepReco ])
     return stepAnd
+
+    
diff --git a/Trigger/TrigSteer/DecisionHandling/src/TriggerSummaryAlg.h b/Trigger/TrigSteer/DecisionHandling/src/TriggerSummaryAlg.h
index a6bef5084b4..446e7204e63 100644
--- a/Trigger/TrigSteer/DecisionHandling/src/TriggerSummaryAlg.h
+++ b/Trigger/TrigSteer/DecisionHandling/src/TriggerSummaryAlg.h
@@ -31,8 +31,11 @@ class TriggerSummaryAlg : public ::AthReentrantAlgorithm {
   //      "Chain names maping to counters. In the form of: name counter" };
   SG::ReadHandleKey<TrigCompositeUtils::DecisionContainer> m_l1decisionKey{ this, "L1Decision", "", 
       "Partial decisions from the last stage of chains processing, they nay be missing from event to event"};
+
+  
   SG::ReadHandleKeyArray<TrigCompositeUtils::DecisionContainer> m_finalDecisionKeys{ this, "FinalDecisions", {}, 
       "Object ontaining all the HLT input and outpu decision sets"};
+
   SG::WriteHandleKey<TrigCompositeUtils::DecisionContainer> m_summaryKey { this, "HLTSummary", "HLTSummary", "Output summary" };
   //  SG::WriteHandleKey m_hltResultKey{ this, "HLTResult", "", "Output HLT Result" };
 
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/egamma.withViews.py b/Trigger/TrigValidation/TrigUpgradeTest/share/egamma.withViews.py
index bac3917e15c..2aaa6575f25 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/egamma.withViews.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/egamma.withViews.py
@@ -51,7 +51,7 @@ theFastCaloAlgo.OutputLevel=VERBOSE
 theFastCaloAlgo.ClustersName="L2CaloClusters"
 svcMgr.ToolSvc.TrigDataAccess.ApplyOffsetCorrection=False
 
-from AthenaCommon.CFElements import parOR, seqAND, stepSeq
+from AthenaCommon.CFElements import parOR, seqOR, seqAND, stepSeq
 
 from DecisionHandling.DecisionHandlingConf import RoRSeqFilter
 
@@ -325,15 +325,24 @@ else:
 
 # CF construction
 
+
+
 step0 = parOR("step0", [ egammaCaloStep ] )
 step1 = parOR("step1", [ egammaIDStep ] )
 
 from DecisionHandling.DecisionHandlingConf import TriggerSummaryAlg
-summary = TriggerSummaryAlg("TriggerSummaryAlg")
+summary = TriggerSummaryAlg( "TriggerSummaryAlg" )
 summary.L1Decision = "HLTChains"
 summary.FinalDecisions = [ "ElectronL2Decisions", "MuonL2Decisions" ]
 summary.OutputLevel = DEBUG
 
 steps = seqAND("HLTSteps", [ step0, step1, summary ]  )
-topSequence += steps
+
+mon = TriggerSummaryAlg( "TriggerMonitoringAlg" )
+mon.L1Decision = "HLTChains"
+mon.FinalDecisions = [ "ElectronL2Decisions", "MuonL2Decisions", "WhateverElse" ]
+mon.OutputLevel = DEBUG
+
+hltTop = seqOR( "hltTop", [ steps ] )
+topSequence += hltTop
   
-- 
GitLab