From e97ab96fb0d4c46bde54f40c8dd4de64f20ba700 Mon Sep 17 00:00:00 2001
From: sutt <sutt@cern.ch>
Date: Mon, 16 May 2022 10:39:28 +0200
Subject: [PATCH 01/11] Add possibility to update the RoiDescriptors to the
 view creation

Adds a new RoiUpdaterTool which can be included by the ViewCreator Tools.
This is implemented here in the Jet slice as a test. In principle, the
ToolHandle for the RoiUpdater Tool can be added to the ViewCreator base
class, and just not initialised.
---
 .../src/TrigFastTrackFinder.cxx               |  62 ++-------
 .../src/TrigFastTrackFinder.h                 |   2 -
 .../TrigSteer/DecisionHandling/CMakeLists.txt |   5 +-
 .../DecisionHandling/IRoiUpdaterTool.h        |  35 ++++++
 .../DecisionHandling/IViewCreatorROITool.h    |   6 +
 .../DecisionHandling/src/InputMakerForRoI.h   |   6 +-
 .../src/ViewCreatorCentredOnClusterROITool.h  |   6 +-
 .../ViewCreatorCentredOnIParticleROITool.h    |   6 +-
 ...eatorCentredOnJetWithPVConstraintROITool.h |   6 +-
 .../src/ViewCreatorFSROITool.cxx              |   8 +-
 .../src/ViewCreatorFSROITool.h                |   5 +-
 .../src/ViewCreatorFetchFromViewROITool.h     |   6 +-
 .../src/ViewCreatorInitialROITool.h           |  10 +-
 .../src/ViewCreatorNamedROITool.h             |   6 +-
 .../src/ViewCreatorPreviousROITool.h          |   6 +-
 Trigger/TrigSteer/HLTSeeding/CMakeLists.txt   |   6 +-
 .../HLTSeeding/HLTSeeding/IRoiUpdaterTool.h   |  35 ++++++
 .../HLTSeeding/src/FSRoIsUnpackingTool.cxx    |  10 +-
 .../HLTSeeding/src/RoIsUnpackingToolBase.cxx  |   5 +
 .../HLTSeeding/src/RoIsUnpackingToolBase.h    |   7 ++
 .../HLTSeeding/src/RoiUpdaterTool.cxx         | 119 ++++++++++++++++++
 .../TrigSteer/HLTSeeding/src/RoiUpdaterTool.h |  53 ++++++++
 22 files changed, 324 insertions(+), 86 deletions(-)
 create mode 100644 Trigger/TrigSteer/DecisionHandling/DecisionHandling/IRoiUpdaterTool.h
 create mode 100644 Trigger/TrigSteer/HLTSeeding/HLTSeeding/IRoiUpdaterTool.h
 create mode 100644 Trigger/TrigSteer/HLTSeeding/src/RoiUpdaterTool.cxx
 create mode 100644 Trigger/TrigSteer/HLTSeeding/src/RoiUpdaterTool.h

diff --git a/Trigger/TrigAlgorithms/TrigFastTrackFinder/src/TrigFastTrackFinder.cxx b/Trigger/TrigAlgorithms/TrigFastTrackFinder/src/TrigFastTrackFinder.cxx
index 753ce0d99b2e..251af9c6a707 100644
--- a/Trigger/TrigAlgorithms/TrigFastTrackFinder/src/TrigFastTrackFinder.cxx
+++ b/Trigger/TrigAlgorithms/TrigFastTrackFinder/src/TrigFastTrackFinder.cxx
@@ -67,7 +67,6 @@ TrigFastTrackFinder::TrigFastTrackFinder(const std::string& name, ISvcLocator* p
   m_doZFinder(false),
   m_doZFinderOnly(false),
   m_storeZFinderVertices(false),
-  m_useBeamSpotForRoiZwidth(false),
   m_nfreeCut(5),
   m_countTotalRoI(0),
   m_countRoIwithEnoughHits(0),
@@ -162,7 +161,6 @@ TrigFastTrackFinder::TrigFastTrackFinder(const std::string& name, ISvcLocator* p
 
   // Accleration
   declareProperty("useGPU", m_useGPU = false,"Use GPU acceleration");
-  declareProperty("useBeamSpotForRoiZwidth", m_useBeamSpotForRoiZwidth = false);
 
   // Large Radius Tracking
   declareProperty("LRT_Mode", m_LRTmode,"Enable Large Radius Tracking mode" );
@@ -281,6 +279,7 @@ StatusCode TrigFastTrackFinder::initialize() {
   if( m_doDisappearingTrk ) {
      ATH_CHECK(m_extrapolator.retrieve());
      ATH_MSG_DEBUG("Retrieved tool " << m_extrapolator);
+
      ATH_CHECK(m_disTrkFitter.retrieve());
      ATH_MSG_DEBUG("Retrieved tool " << m_disTrkFitter);
   } else {
@@ -382,56 +381,18 @@ StatusCode TrigFastTrackFinder::execute(const EventContext& ctx) const {
 
   ATH_CHECK(roiCollection.isValid());
 
-  TrigRoiDescriptor internalRoI;
-
-  if ( roiCollection->size()>1 ) ATH_MSG_WARNING( "More than one Roi in the collection: " << m_roiCollectionKey << ", this is not supported - use a composite Roi" );
-
-  if ( roiCollection->size()>0) {
-      if ( !m_useBeamSpotForRoiZwidth) {
-          internalRoI = **roiCollection->begin();
-      }else{
-          SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey, ctx };
-
-          int beamSpotBitMap = beamSpotHandle->beamStatus();
-          bool isOnlineBeamspot = ((beamSpotBitMap & 0x4) == 0x4);
-
-          if ((isOnlineBeamspot && (beamSpotBitMap & 0x3) == 0x3) || !isOnlineBeamspot){ //converged or MC event, if the original RoI has a zed > 3 sig + 10 then set it to 3 sig + 10.
-              RoiDescriptor originRoI = **roiCollection->begin();
-              double beamSpot_zsig = beamSpotHandle->beamSigma(2);
-              Amg::Vector3D vertex = beamSpotHandle->beamPos();
-              double zVTX = vertex.z();
-              double origin_zedPlus  = originRoI.zedPlus() ;  //!< z at the most forward end of the RoI
-              double origin_zedMinus = originRoI.zedMinus();  //!< z at the most backward end of the RoI
-
-              double new_zedMargin = 10.;
-              double new_zedRange  = 3.;
-
-              double new_zedPlus  = zVTX + beamSpot_zsig * new_zedRange + new_zedMargin;
-              double new_zedMinus = zVTX - beamSpot_zsig * new_zedRange - new_zedMargin;
-
-              if (origin_zedPlus > new_zedPlus && origin_zedMinus < new_zedMinus){
-                  ATH_MSG_DEBUG("Updated RoI with zed = "<<new_zedRange<<" * sig + "<<new_zedMargin);
-                  double origin_eta      = originRoI.eta();    //!< gets eta at zMinus
-                  double origin_etaPlus  = originRoI.etaPlus() ;    //!< gets eta at zedPlus
-                  double origin_etaMinus = originRoI.etaMinus();    //!< gets eta at zMinus
-
-                  double origin_phi      = originRoI.phi() ;     //!< gets phiPlus
-                  double origin_phiPlus  = originRoI.phiPlus() ;     //!< gets phiPlus
-                  double origin_phiMinus = originRoI.phiMinus();    //!< gets phiMinus
-
-                  internalRoI = TrigRoiDescriptor( origin_eta, origin_etaMinus, origin_etaPlus, 
-						   origin_phi, origin_phiMinus, origin_phiPlus, 
-						   zVTX, new_zedMinus, new_zedPlus );
-              }
-              else internalRoI = **roiCollection->begin(); // we have a more narrow zed range in RoI, no need to update.
-          }else{ //Not converged, set to the fullScan RoI
-                internalRoI = **roiCollection->begin();
-          }
-      }
+  if ( roiCollection->size()>1 ) ATH_MSG_WARNING( "More than one Roi in the collection: " << m_roiCollectionKey << ", this is not supported - use a composite Roi: Using the first Roi ONLY" );
+
+  if ( roiCollection->size()==0) {
+    ATH_MSG_ERROR("No Roi found for " << m_roiCollectionKey.key() );
+    return StatusCode::FAILURE;
   }
 
+  TrigRoiDescriptor internalRoI = **roiCollection->begin();
+
+  /// internalRoI.manageConstituents(false);//Don't try to delete RoIs at the end
 
-  //  internalRoI.manageConstituents(false);//Don't try to delete RoIs at the end
+  /// updating this class member counter is not going to be thread safe ...
   m_countTotalRoI++;
 
   SG::WriteHandle<TrackCollection> outputTracks(m_outputTracksKey, ctx);
@@ -458,8 +419,7 @@ StatusCode TrigFastTrackFinder::findTracks(InDet::SiTrackMakerEventData_xk &trac
                                            const TrackCollection* inputTracks,
                                            TrackCollection& outputTracks,
                                            const EventContext& ctx) const {
-
-  ATH_MSG_DEBUG("Input RoI " << roi);
+  ATH_MSG_DEBUG( "Input RoI " << roi );
 
   auto mnt_roi_nTracks = Monitored::Scalar<int>("roi_nTracks", 0);
   auto mnt_roi_nSPs    = Monitored::Scalar<int>("roi_nSPs",    0);
diff --git a/Trigger/TrigAlgorithms/TrigFastTrackFinder/src/TrigFastTrackFinder.h b/Trigger/TrigAlgorithms/TrigFastTrackFinder/src/TrigFastTrackFinder.h
index 3e274babe352..640bd682c42f 100644
--- a/Trigger/TrigAlgorithms/TrigFastTrackFinder/src/TrigFastTrackFinder.h
+++ b/Trigger/TrigAlgorithms/TrigFastTrackFinder/src/TrigFastTrackFinder.h
@@ -187,8 +187,6 @@ protected:
 
   bool m_doResMonitoring;
 
-  bool m_useBeamSpotForRoiZwidth;
-
   // Cuts and settings
   TrigCombinatorialSettings m_tcs;
 
diff --git a/Trigger/TrigSteer/DecisionHandling/CMakeLists.txt b/Trigger/TrigSteer/DecisionHandling/CMakeLists.txt
index 01d72d4b4777..d59aa01e6d28 100644
--- a/Trigger/TrigSteer/DecisionHandling/CMakeLists.txt
+++ b/Trigger/TrigSteer/DecisionHandling/CMakeLists.txt
@@ -12,7 +12,7 @@ atlas_add_library( DecisionHandlingLib
                    src/InputMakerBase.cxx
 		           src/ITestHypoTool.cxx
                    PUBLIC_HEADERS DecisionHandling
-                   LINK_LIBRARIES AthenaBaseComps AthenaMonitoringKernelLib GaudiKernel StoreGateLib TrigCompositeUtilsLib TrigCostMonitorLib TrigSteeringEvent TrigTimeAlgsLib
+                   LINK_LIBRARIES AthenaBaseComps AthenaMonitoringKernelLib GaudiKernel BeamSpotConditionsData StoreGateLib TrigCompositeUtilsLib TrigCostMonitorLib TrigSteeringEvent TrigTimeAlgsLib
                    PRIVATE_LINK_LIBRARIES AthContainers AthViews xAODTrigger )
 
 # Component(s) in the package:
@@ -28,7 +28,8 @@ atlas_add_component( DecisionHandling
                      src/TestHypoTool.cxx
                      src/TestHypoAlg.cxx
                      src/PassFilter.cxx
-                     LINK_LIBRARIES DecisionHandlingLib AthenaKernel xAODTrigCalo AthViews xAODTracking xAODJet )
+		     src/Roi*.cxx
+                     LINK_LIBRARIES DecisionHandlingLib AthenaKernel xAODTrigCalo AthViews xAODTracking xAODJet HLTSeedingLib )
 
 atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
 #atlas_install_joboptions( share/*.py )
diff --git a/Trigger/TrigSteer/DecisionHandling/DecisionHandling/IRoiUpdaterTool.h b/Trigger/TrigSteer/DecisionHandling/DecisionHandling/IRoiUpdaterTool.h
new file mode 100644
index 000000000000..9dc1a3e85108
--- /dev/null
+++ b/Trigger/TrigSteer/DecisionHandling/DecisionHandling/IRoiUpdaterTool.h
@@ -0,0 +1,35 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef DECISIONHANDLING_IROIUPDATERTOOL_H
+#define DECISIONHANDLING_IROIUPDATERTOOL_H
+
+#include <memory>
+
+#include "GaudiKernel/IAlgTool.h"
+#include "Gaudi/Property.h"
+#include "GaudiKernel/StatusCode.h"
+#include "TrigSteeringEvent/TrigRoiDescriptor.h"
+
+
+
+/**
+ * @class IRoiUpdaterTool
+ **/
+class IRoiUpdaterTool : virtual public IAlgTool {
+
+public:
+
+  DeclareInterfaceID(IRoiUpdaterTool, 1, 0);
+
+  virtual ~IRoiUpdaterTool() = default;
+
+  virtual std::unique_ptr<TrigRoiDescriptor> execute( const IRoiDescriptor* roi, const EventContext& ctx) const = 0;
+
+  virtual std::unique_ptr<TrigRoiDescriptor> execute( const EventContext& ctx ) const = 0;
+
+};
+
+#endif //> !DECISIONHANDLING_IROIUPDATERTOOL_H
+
diff --git a/Trigger/TrigSteer/DecisionHandling/DecisionHandling/IViewCreatorROITool.h b/Trigger/TrigSteer/DecisionHandling/DecisionHandling/IViewCreatorROITool.h
index c4d5876bc78c..b161d34aa8af 100644
--- a/Trigger/TrigSteer/DecisionHandling/DecisionHandling/IViewCreatorROITool.h
+++ b/Trigger/TrigSteer/DecisionHandling/DecisionHandling/IViewCreatorROITool.h
@@ -10,6 +10,8 @@
 #include "Gaudi/Property.h"
 #include "TrigCompositeUtils/TrigCompositeUtils.h"
 
+// #include "HLTSeeding/IRoiUpdaterTool.h"
+
 /**
  * @class IViewCreatorROITool
  * MT Trigger Tool interface used to determine the correct ROI to spawn an EventView on for a given Decision object.
@@ -34,6 +36,10 @@ public:
  **/
   virtual StatusCode attachROILinks(TrigCompositeUtils::DecisionContainer& decisions, const EventContext& ctx) const = 0;
 
+  // protected:
+
+  //  ToolHandle<IRoiUpdaterTool> m_roiupdater { this, "RoiUpdater", "", "Roi Updater" };
+
 };
 
 #endif //> !VIEWALGS_IVIEWCREATORROITOOL_H
diff --git a/Trigger/TrigSteer/DecisionHandling/src/InputMakerForRoI.h b/Trigger/TrigSteer/DecisionHandling/src/InputMakerForRoI.h
index 8312eecc1bc4..32f3ea468b6e 100644
--- a/Trigger/TrigSteer/DecisionHandling/src/InputMakerForRoI.h
+++ b/Trigger/TrigSteer/DecisionHandling/src/InputMakerForRoI.h
@@ -1,8 +1,8 @@
 /*
   Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
-#ifndef DESICIONHANDLING_INPUTMAKERFORROI_H
-#define DESICIONHANDLING_INPUTMAKERFORROI_H 
+#ifndef DECISIONHANDLING_INPUTMAKERFORROI_H
+#define DECISIONHANDLING_INPUTMAKERFORROI_H 
 
 
 #include <string>
@@ -39,4 +39,4 @@
   }; 
 
 
-#endif //> !DESICIONHANDLING_INPUTMAKERFORROI_H
+#endif //> !DECISIONHANDLING_INPUTMAKERFORROI_H
diff --git a/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorCentredOnClusterROITool.h b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorCentredOnClusterROITool.h
index 0180320d673e..4b1c9441a940 100644
--- a/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorCentredOnClusterROITool.h
+++ b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorCentredOnClusterROITool.h
@@ -2,8 +2,8 @@
 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-#ifndef DESICIONHANDLING_VIEWCREATORCENTREDONCLUSTERROITOOL_H
-#define DESICIONHANDLING_VIEWCREATORCENTREDONCLUSTERROITOOL_H
+#ifndef DECISIONHANDLING_VIEWCREATORCENTREDONCLUSTERROITOOL_H
+#define DECISIONHANDLING_VIEWCREATORCENTREDONCLUSTERROITOOL_H
 
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "StoreGate/WriteHandleKey.h"
@@ -54,4 +54,4 @@ public:
 
 };
 
-#endif //> !DESICIONHANDLING_VIEWCREATORCENTREDONCLUSTERROITOOL_H
+#endif //> !DECISIONHANDLING_VIEWCREATORCENTREDONCLUSTERROITOOL_H
diff --git a/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorCentredOnIParticleROITool.h b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorCentredOnIParticleROITool.h
index 799d9808bf21..4adce7eb3c2d 100755
--- a/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorCentredOnIParticleROITool.h
+++ b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorCentredOnIParticleROITool.h
@@ -2,8 +2,8 @@
 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-#ifndef DESICIONHANDLING_VIEWCREATORCENTREDONIPARTICLEROITOOL_H
-#define DESICIONHANDLING_VIEWCREATORCENTREDONIPARTICLEROITOOL_H
+#ifndef DECISIONHANDLING_VIEWCREATORCENTREDONIPARTICLEROITOOL_H
+#define DECISIONHANDLING_VIEWCREATORCENTREDONIPARTICLEROITOOL_H
 
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "StoreGate/WriteHandleKey.h"
@@ -55,4 +55,4 @@ public:
 
 };
 
-#endif //> !DESICIONHANDLING_VIEWCREATORCENTREDONIPARTICLEROITOOL_H
+#endif //> !DECISIONHANDLING_VIEWCREATORCENTREDONIPARTICLEROITOOL_H
diff --git a/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorCentredOnJetWithPVConstraintROITool.h b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorCentredOnJetWithPVConstraintROITool.h
index da690591ae86..6fd76dcf0100 100644
--- a/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorCentredOnJetWithPVConstraintROITool.h
+++ b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorCentredOnJetWithPVConstraintROITool.h
@@ -2,8 +2,8 @@
 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-#ifndef DESICIONHANDLING_VIEWCREATORCENTREDONJETWITHPVCONSTRAINTROITOOL_H
-#define DESICIONHANDLING_VIEWCREATORCENTREDONJETWITHPVCONSTRAINTROITOOL_H
+#ifndef DECISIONHANDLING_VIEWCREATORCENTREDONJETWITHPVCONSTRAINTROITOOL_H
+#define DECISIONHANDLING_VIEWCREATORCENTREDONJETWITHPVCONSTRAINTROITOOL_H
 
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "StoreGate/WriteHandleKey.h"
@@ -62,4 +62,4 @@ public:
 
 };
 
-#endif //> !DESICIONHANDLING_VIEWCREATORCENTREDONJETWITHPVCONSTRAINTROITOOL_H
+#endif //> !DECISIONHANDLING_VIEWCREATORCENTREDONJETWITHPVCONSTRAINTROITOOL_H
diff --git a/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorFSROITool.cxx b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorFSROITool.cxx
index 96800ef2f927..20c4a4fbde3f 100644
--- a/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorFSROITool.cxx
+++ b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorFSROITool.cxx
@@ -15,18 +15,22 @@ ViewCreatorFSROITool::ViewCreatorFSROITool(const std::string& type, const std::s
 
 StatusCode ViewCreatorFSROITool::initialize()  {
   ATH_CHECK( m_roisWriteHandleKey.initialize() );
+  if ( !m_roiupdater.empty() ) ATH_CHECK( m_roiupdater.retrieve() );
   return StatusCode::SUCCESS;
 }
 
 
 StatusCode ViewCreatorFSROITool::attachROILinks(TrigCompositeUtils::DecisionContainer& decisions, const EventContext& ctx) const {
   SG::WriteHandle<TrigRoiDescriptorCollection> roisWriteHandle = createAndStoreNoAux(m_roisWriteHandleKey, ctx);
-  roisWriteHandle->push_back( new TrigRoiDescriptor(true) );
+  
+  if ( m_roiupdater.empty() ) roisWriteHandle->push_back( new TrigRoiDescriptor(true) );
+  else                        roisWriteHandle->push_back( m_roiupdater->execute( ctx ) );  
+
   const ElementLink<TrigRoiDescriptorCollection> roiEL = ElementLink<TrigRoiDescriptorCollection>(*roisWriteHandle, /*index =*/ 0, ctx);
 
   for ( Decision* outputDecision : decisions ) { 
     outputDecision->setObjectLink(roiString(), roiEL);
   }
 
-	return StatusCode::SUCCESS;
+  return StatusCode::SUCCESS;
 }
diff --git a/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorFSROITool.h b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorFSROITool.h
index 73396ecbd12e..6616733b0171 100644
--- a/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorFSROITool.h
+++ b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorFSROITool.h
@@ -8,6 +8,7 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "StoreGate/WriteHandleKey.h"
 #include "DecisionHandling/IViewCreatorROITool.h"
+#include "HLTSeeding/IRoiUpdaterTool.h"
 #include "TrigSteeringEvent/TrigRoiDescriptorCollection.h"
 
 /**
@@ -24,7 +25,7 @@ public:
 
   virtual ~ViewCreatorFSROITool() = default;
 
-   virtual StatusCode initialize() override;
+  virtual StatusCode initialize() override;
 
   /**
    * @brief Tool interface method.
@@ -37,6 +38,8 @@ public:
   SG::WriteHandleKey< TrigRoiDescriptorCollection > m_roisWriteHandleKey {this,"RoisWriteHandleKey","",
        "Name of the ROI collection produced by this tool."};
 
+  ToolHandle<IRoiUpdaterTool> m_roiupdater { this, "RoiUpdater", "", "Roi Updater" };
+
 };
 
 #endif //> !DESICIONHANDLING_VIEWCREATORFSROITOOL_H
diff --git a/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorFetchFromViewROITool.h b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorFetchFromViewROITool.h
index a3ae58e43fb1..f9c5cf61a85a 100644
--- a/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorFetchFromViewROITool.h
+++ b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorFetchFromViewROITool.h
@@ -2,8 +2,8 @@
 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-#ifndef DESICIONHANDLING_VIEWCREATORFETCHFROMVIEWROITOOL_H
-#define DESICIONHANDLING_VIEWCREATORFETCHFROMVIEWROITOOL_H
+#ifndef DECISIONHANDLING_VIEWCREATORFETCHFROMVIEWROITOOL_H
+#define DECISIONHANDLING_VIEWCREATORFETCHFROMVIEWROITOOL_H
 
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "StoreGate/WriteHandleKey.h"
@@ -49,4 +49,4 @@ public:
     std::string m_viewToFetchFromProbe;
 };
 
-#endif //> !DESICIONHANDLING_VIEWCREATORFETCHFROMVIEWROITOOL_H
+#endif //> !DECISIONHANDLING_VIEWCREATORFETCHFROMVIEWROITOOL_H
diff --git a/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorInitialROITool.h b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorInitialROITool.h
index 81f2e35843b0..6efb26d9865d 100644
--- a/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorInitialROITool.h
+++ b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorInitialROITool.h
@@ -2,12 +2,15 @@
 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-#ifndef DESICIONHANDLING_VIEWCREATORINITIALROITOOL_H
-#define DESICIONHANDLING_VIEWCREATORINITIALROITOOL_H
+#ifndef DECISIONHANDLING_VIEWCREATORINITIALROITOOL_H
+#define DECISIONHANDLING_VIEWCREATORINITIALROITOOL_H
 
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "DecisionHandling/IViewCreatorROITool.h"
 
+// #include "DecisionHandling/IRoiUpdaterTool.h"
+#include "HLTSeeding/IRoiUpdaterTool.h"
+
 /**
  * @class ViewCreatorInitialROITool
  * Basic ROI provider tool which retrieves and re-attaches an existing "initialRoI" ElementLink.
@@ -30,6 +33,7 @@ public:
  **/
   virtual StatusCode attachROILinks(TrigCompositeUtils::DecisionContainer& decisions, const EventContext& ctx) const override;
 
+  ToolHandle<IRoiUpdaterTool> m_roiupdater { this, "RoiUpdater", "", "Roi Updater" };
 };
 
-#endif //> !DESICIONHANDLING_VIEWCREATORINITIALROITOOL_H
+#endif //> !DECISIONHANDLING_VIEWCREATORINITIALROITOOL_H
diff --git a/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorNamedROITool.h b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorNamedROITool.h
index 1bc3c37da151..f13b740c7ecf 100644
--- a/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorNamedROITool.h
+++ b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorNamedROITool.h
@@ -2,8 +2,8 @@
 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-#ifndef DESICIONHANDLING_VIEWCREATORNAMEDROITOOL_H
-#define DESICIONHANDLING_VIEWCREATORNAMEDROITOOL_H
+#ifndef DECISIONHANDLING_VIEWCREATORNAMEDROITOOL_H
+#define DECISIONHANDLING_VIEWCREATORNAMEDROITOOL_H
 
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "DecisionHandling/IViewCreatorROITool.h"
@@ -32,4 +32,4 @@ public:
 
 };
 
-#endif //> !DESICIONHANDLING_VIEWCREATORNAMEDROITOOL_H
+#endif //> !DECISIONHANDLING_VIEWCREATORNAMEDROITOOL_H
diff --git a/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorPreviousROITool.h b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorPreviousROITool.h
index f1549e10a763..60bce63db605 100644
--- a/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorPreviousROITool.h
+++ b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorPreviousROITool.h
@@ -2,8 +2,8 @@
 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-#ifndef DESICIONHANDLING_VIEWCREATORPREVIOUSROITOOL_H
-#define DESICIONHANDLING_VIEWCREATORPREVIOUSROITOOL_H
+#ifndef DECISIONHANDLING_VIEWCREATORPREVIOUSROITOOL_H
+#define DECISIONHANDLING_VIEWCREATORPREVIOUSROITOOL_H
 
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "DecisionHandling/IViewCreatorROITool.h"
@@ -37,4 +37,4 @@ public:
 
 };
 
-#endif //> !DESICIONHANDLING_VIEWCREATORPREVIOUSROITOOL_H
+#endif //> !DECISIONHANDLING_VIEWCREATORPREVIOUSROITOOL_H
diff --git a/Trigger/TrigSteer/HLTSeeding/CMakeLists.txt b/Trigger/TrigSteer/HLTSeeding/CMakeLists.txt
index a0d857ddb296..a0847761668c 100644
--- a/Trigger/TrigSteer/HLTSeeding/CMakeLists.txt
+++ b/Trigger/TrigSteer/HLTSeeding/CMakeLists.txt
@@ -11,13 +11,13 @@ find_package( CLHEP )
 atlas_add_library( HLTSeedingLib
                    PUBLIC_HEADERS HLTSeeding
                    INTERFACE 
-                   LINK_LIBRARIES AthenaBaseComps GaudiKernel StoreGateLib TrigCompositeUtilsLib TrigConfData )
+                   LINK_LIBRARIES AthenaBaseComps GaudiKernel StoreGateLib TrigCompositeUtilsLib TrigConfData BeamSpotConditionsData )
                    
 atlas_add_component( HLTSeeding
                      src/*.cxx src/components/*.cxx
-                     INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
+                     INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} 
                      LINK_LIBRARIES ${Boost_LIBRARIES} ${CLHEP_LIBRARIES} AthenaKernel AthenaMonitoringKernelLib
-                     GaudiKernel HLTSeedingLib L1TopoAlgorithms StoreGateLib TrigCompositeUtilsLib TrigConfxAODLib TrigCostMonitorLib
+                     GaudiKernel L1TopoAlgorithms HLTSeedingLib StoreGateLib TrigCompositeUtilsLib TrigConfxAODLib TrigCostMonitorLib 
                      TrigSteeringEvent TrigT1Interfaces TrigT1Result TrigTimeAlgsLib xAODEventInfo xAODTrigger xAODCore )
 
 # Install files from the package:
diff --git a/Trigger/TrigSteer/HLTSeeding/HLTSeeding/IRoiUpdaterTool.h b/Trigger/TrigSteer/HLTSeeding/HLTSeeding/IRoiUpdaterTool.h
new file mode 100644
index 000000000000..9dc1a3e85108
--- /dev/null
+++ b/Trigger/TrigSteer/HLTSeeding/HLTSeeding/IRoiUpdaterTool.h
@@ -0,0 +1,35 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef DECISIONHANDLING_IROIUPDATERTOOL_H
+#define DECISIONHANDLING_IROIUPDATERTOOL_H
+
+#include <memory>
+
+#include "GaudiKernel/IAlgTool.h"
+#include "Gaudi/Property.h"
+#include "GaudiKernel/StatusCode.h"
+#include "TrigSteeringEvent/TrigRoiDescriptor.h"
+
+
+
+/**
+ * @class IRoiUpdaterTool
+ **/
+class IRoiUpdaterTool : virtual public IAlgTool {
+
+public:
+
+  DeclareInterfaceID(IRoiUpdaterTool, 1, 0);
+
+  virtual ~IRoiUpdaterTool() = default;
+
+  virtual std::unique_ptr<TrigRoiDescriptor> execute( const IRoiDescriptor* roi, const EventContext& ctx) const = 0;
+
+  virtual std::unique_ptr<TrigRoiDescriptor> execute( const EventContext& ctx ) const = 0;
+
+};
+
+#endif //> !DECISIONHANDLING_IROIUPDATERTOOL_H
+
diff --git a/Trigger/TrigSteer/HLTSeeding/src/FSRoIsUnpackingTool.cxx b/Trigger/TrigSteer/HLTSeeding/src/FSRoIsUnpackingTool.cxx
index 3aa7ff929c76..8aeed5ea9609 100644
--- a/Trigger/TrigSteer/HLTSeeding/src/FSRoIsUnpackingTool.cxx
+++ b/Trigger/TrigSteer/HLTSeeding/src/FSRoIsUnpackingTool.cxx
@@ -61,7 +61,15 @@ StatusCode FSRoIsUnpackingTool::unpack(const EventContext& ctx,
 
   auto roiHandle = SG::makeHandle( m_trigRoIsKey, ctx );
   ATH_CHECK(roiHandle.record( std::make_unique<TrigRoiDescriptorCollection>() ));
-  roiHandle->push_back( std::make_unique<TrigRoiDescriptor>(true) ); // true == FS
+  ///
+  if ( !m_roiupdater.empty() ) { 
+    std::cout << "SUTT: RoiUpdater FFS" << std::endl;
+    roiHandle->push_back( m_roiupdater->execute(ctx) );
+  }
+  else {
+    std::cout << "SUTT: NO RoiUpdater - WHY NOT ? " << std::endl;
+    roiHandle->push_back( std::make_unique<TrigRoiDescriptor>( RoiDescriptor::FULLSCAN) ); 
+  }
 
   ATH_MSG_DEBUG("Linking to FS RoI descriptor");
   decision->setObjectLink( initialRoIString(), ElementLink<TrigRoiDescriptorCollection>( m_trigRoIsKey.key(), 0 ) );
diff --git a/Trigger/TrigSteer/HLTSeeding/src/RoIsUnpackingToolBase.cxx b/Trigger/TrigSteer/HLTSeeding/src/RoIsUnpackingToolBase.cxx
index 215570a4a417..de6f7861bb44 100644
--- a/Trigger/TrigSteer/HLTSeeding/src/RoIsUnpackingToolBase.cxx
+++ b/Trigger/TrigSteer/HLTSeeding/src/RoIsUnpackingToolBase.cxx
@@ -15,6 +15,11 @@ RoIsUnpackingToolBase::RoIsUnpackingToolBase(const std::string& type,
 
 StatusCode RoIsUnpackingToolBase::initialize() {
   if ( !m_monTool.empty() ) {ATH_CHECK( m_monTool.retrieve() );}
+  if ( !m_roiupdater.empty() ) {
+    std::cout << "SUTT: RoiUpdater" << std::endl;
+    ATH_CHECK( m_roiupdater.retrieve() );
+  }
+
   ATH_CHECK( m_decisionsKey.initialize() );
   ATH_CHECK( m_decisionsKeyProbe.initialize(SG::AllowEmpty) );
   ATH_CHECK( m_trigRoIsKey.initialize(SG::AllowEmpty) );
diff --git a/Trigger/TrigSteer/HLTSeeding/src/RoIsUnpackingToolBase.h b/Trigger/TrigSteer/HLTSeeding/src/RoIsUnpackingToolBase.h
index d6550ea948a1..337bdb472aab 100644
--- a/Trigger/TrigSteer/HLTSeeding/src/RoIsUnpackingToolBase.h
+++ b/Trigger/TrigSteer/HLTSeeding/src/RoIsUnpackingToolBase.h
@@ -16,6 +16,9 @@
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "AthenaMonitoringKernel/GenericMonitoringTool.h"
 
+#include "HLTSeeding/IRoiUpdaterTool.h"
+
+
 namespace ROIB {
   class RoIBResult;
 }
@@ -64,6 +67,10 @@ protected:
   ToolHandle<GenericMonitoringTool> m_monTool{
     this, "MonTool", "", "Monitoring tool"};
 
+  ToolHandle<IRoiUpdaterTool> m_roiupdater{ 
+    this, "RoiUpdater", "", "Roi Updater"};
+
+
   std::map<HLT::Identifier, HLT::IDVec> m_thresholdToChainMapping;
   std::map<HLT::Identifier, HLT::Identifier> m_legToChainMapping;
 
diff --git a/Trigger/TrigSteer/HLTSeeding/src/RoiUpdaterTool.cxx b/Trigger/TrigSteer/HLTSeeding/src/RoiUpdaterTool.cxx
new file mode 100644
index 000000000000..28d0450b4451
--- /dev/null
+++ b/Trigger/TrigSteer/HLTSeeding/src/RoiUpdaterTool.cxx
@@ -0,0 +1,119 @@
+
+/*
+Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "TrigSteeringEvent/TrigRoiDescriptorCollection.h"
+#include "RoiUpdaterTool.h"
+
+
+
+RoiUpdaterTool::RoiUpdaterTool(const std::string& type, const std::string& name, const IInterface* parent)
+  : base_class(type, name, parent), m_update(false) 
+{}
+
+
+
+StatusCode RoiUpdaterTool::initialize()  {
+
+  std::cout << "SUTT: roiUpdater:initialize()" << std::endl;
+
+  if ( m_etaWidth!=-999 || m_phiWidth!=-999 || m_zedWidth!=-999 ) m_update = true;
+
+  if ( m_useBeamspot ) m_update = true;
+
+  ATH_CHECK( m_beamspotKey.initialize( m_useBeamspot ) );
+
+  return StatusCode::SUCCESS;
+}
+
+
+
+
+void zrange( double nsigma, double& zed, double& zedMinus, double& zedPlus, const SG::ReadCondHandleKey<InDet::BeamSpotData>& bs, const EventContext& ctx ) { 
+
+      SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle( bs, ctx );
+
+      uint32_t bitmap = beamSpotHandle->beamStatus();
+         
+      /// 0x4 is the online flag - 0x7 is presumably converged online
+      if ( ( (bitmap & 0x7) == 0x7 ) || !(bitmap & 0x4) ) { 
+	double zsigma = beamSpotHandle->beamSigma(2);
+	double zpos   = beamSpotHandle->beamPos()[2];
+	
+	zed      = zpos; /// technically, updating the z position itself should not be needed
+	zedMinus = zpos - nsigma*zsigma;
+	zedPlus  = zpos + nsigma*zsigma;
+      }
+      else { 
+	zedMinus = -RoiDescriptor::zedWidthDefault();     
+	zedPlus  =  RoiDescriptor::zedWidthDefault();  	
+      }
+
+}
+
+
+std::unique_ptr<TrigRoiDescriptor> RoiUpdaterTool::execute( const EventContext& ctx ) const {  
+  /// create initial dummy FS Roi here - used to define the new Roi and is then discarded  
+  RoiDescriptor troi( RoiDescriptor::FULLSCAN );
+  return execute( &troi, ctx );
+}
+
+
+std::unique_ptr<TrigRoiDescriptor> RoiUpdaterTool::execute( const IRoiDescriptor* iroi, const EventContext& ctx ) const {  
+  
+  /// should not update a composite Roi - or do we want the constituents updated ???
+  /// or what ??? Return a copy ? Who will own this stuff ?? 
+  /// why are you calling the updater on a composite Roi in any case ? 
+  /// will retuern a unique_ptr - if that causes issues down the line, so be it
+  if ( iroi->composite() )  { 
+    ATH_MSG_WARNING( "Will not update composite Roi parameters: " << *iroi );
+    return std::make_unique<TrigRoiDescriptor>( *iroi );
+  }  
+
+  double eta      = iroi->eta();
+  double etaMinus = iroi->etaMinus();
+  double etaPlus  = iroi->etaPlus();
+  
+  double phi      = iroi->phi();
+  double phiMinus = iroi->phiMinus();
+  double phiPlus  = iroi->phiPlus();
+  
+  double zed      = iroi->zed();
+  double zedMinus = iroi->zedMinus();
+  double zedPlus  = iroi->zedPlus();
+  
+  if ( m_etaWidth!=-999 ) { 
+    etaMinus = eta - m_etaWidth;  
+    etaPlus  = eta + m_etaWidth;  
+  }
+  
+  if ( m_phiWidth!=-999 ) { 
+    /// NB: the correct mapping of phi to the range  -M_PIF < phi < M_PIF is
+    ///     done in the RoiDescriptor constuctor so we don't bother here 
+    phiMinus = phi - m_phiWidth;  
+    phiPlus  = phi + m_phiWidth;  
+  }
+  
+  if ( m_zedWidth!=-999 ) { 
+    zedMinus = zed - m_zedWidth;
+    zedPlus  = zed + m_zedWidth;
+  }
+  
+  /// do *not* prevent the beamspot from *increasing* the size of the Roi
+  if ( m_useBeamspot ) zrange( m_nsigma, zed, zedMinus, zedPlus, m_beamspotKey, ctx );
+  
+  /// limit to old range - no point going well outside the interaction region
+  if ( zedMinus<-RoiDescriptor::zedWidthDefault() ) zedMinus = -RoiDescriptor::zedWidthDefault();     
+  if (  zedPlus> RoiDescriptor::zedWidthDefault() ) zedPlus  =  RoiDescriptor::zedWidthDefault();  
+  
+  /// don't use an actual fullscan Roi, since the parameters have been changed so may not actually 
+  /// include all detector elements - the FS flag, prevents the RegionSelector from actually testing
+  /// the detector element containment, so could create a "fullscan" Roi with only a small number of
+  /// detector elements. If you want genuine FS behaviour for the RS, use an FS Roi. If you want 
+  /// a restricted Roi for non RS use, even if it is FS for a specific subdetector, use a restricted 
+  /// Roi    
+  return std::make_unique<TrigRoiDescriptor>( eta, etaMinus, etaPlus, phi, phiMinus, phiPlus, zed, zedMinus, zedPlus );
+
+}
+
diff --git a/Trigger/TrigSteer/HLTSeeding/src/RoiUpdaterTool.h b/Trigger/TrigSteer/HLTSeeding/src/RoiUpdaterTool.h
new file mode 100644
index 000000000000..e0484bc7773d
--- /dev/null
+++ b/Trigger/TrigSteer/HLTSeeding/src/RoiUpdaterTool.h
@@ -0,0 +1,53 @@
+/*
+Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef DECISIONHANDLING_ROIUPDATERTOOL_H
+#define DECISIONHANDLING_ROIUPDATERTOOL_H
+
+#include "AthenaBaseComps/AthAlgTool.h"
+
+#include "TrigSteeringEvent/TrigRoiDescriptorCollection.h"
+#include "BeamSpotConditionsData/BeamSpotData.h"
+#include "StoreGate/ReadCondHandleKey.h"
+#include "HLTSeeding/IRoiUpdaterTool.h"
+
+/**
+ * @class RoiUpdaterTool
+ * Tool to create a new RoiDescriptor from an existing input5 RoiDescriptor
+ *
+
+ **/
+class RoiUpdaterTool: public extends<AthAlgTool, IRoiUpdaterTool>
+{
+public:
+
+  RoiUpdaterTool(const std::string& type, const std::string& name, const IInterface* parent);
+
+  virtual ~RoiUpdaterTool() = default;
+  
+  virtual StatusCode initialize() override;
+
+  std::unique_ptr<TrigRoiDescriptor> execute( const EventContext& ctx ) const override;
+
+  std::unique_ptr<TrigRoiDescriptor> execute( const IRoiDescriptor* iroi, const EventContext& ctx ) const override;
+
+  /// whether to update the RoiDescritor or not - determiuned from whether any of 
+  /// update parameters are set
+  bool m_update;
+
+  /** 
+   * don't want these parameters used if not set
+   **/
+  Gaudi::Property<double> m_etaWidth { this, "EtaWidth", -999, "FS Roi eta half width" };
+  Gaudi::Property<double> m_phiWidth { this, "PhiWidth", -999, "FS Roi phi half width" };
+  Gaudi::Property<double> m_zedWidth { this, "ZedWidth", -999, "FS Roi zed half width" };
+
+  Gaudi::Property<bool>   m_useBeamspot { this, "useBeamSpot", false, "use beamspot for zed width" };
+  Gaudi::Property<double> m_nsigma      { this, "NSigma",      3.3,   "width (in simga) for the beamspot Roi sidth" };
+
+  SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamspotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" };
+
+};
+
+#endif //> !DECISIONHANDLING_ROIUPDATERTOOL_H
-- 
GitLab


From 0615be55720b8bd9cc5e7dc837b855c6aeb2241a Mon Sep 17 00:00:00 2001
From: sutt <sutt@cern.ch>
Date: Mon, 16 May 2022 12:32:56 +0200
Subject: [PATCH 02/11] argh

---
 .../TrigFastTrackFinder/python/TrigFastTrackFinder_Config.py    | 2 --
 1 file changed, 2 deletions(-)

diff --git a/Trigger/TrigAlgorithms/TrigFastTrackFinder/python/TrigFastTrackFinder_Config.py b/Trigger/TrigAlgorithms/TrigFastTrackFinder/python/TrigFastTrackFinder_Config.py
index 83ce229b0a59..989ecdbf8a69 100755
--- a/Trigger/TrigAlgorithms/TrigFastTrackFinder/python/TrigFastTrackFinder_Config.py
+++ b/Trigger/TrigAlgorithms/TrigFastTrackFinder/python/TrigFastTrackFinder_Config.py
@@ -391,8 +391,6 @@ class TrigFastTrackFinderBase(TrigFastTrackFinder):
         if remapped_type=="cosmics":
           TrackMaker_FTF.CosmicTrack=True
 
-        self.useBeamSpotForRoiZwidth = config.useBeamSpotForRoiZwidth
-        
         ToolSvc += TrackMaker_FTF
         self.initialTrackMaker = TrackMaker_FTF
 
-- 
GitLab


From 959f12ac947f6bd2fa5b99414b698e9bf0d3a706 Mon Sep 17 00:00:00 2001
From: sutt <sutt@cern.ch>
Date: Mon, 16 May 2022 12:59:32 +0200
Subject: [PATCH 03/11] config

---
 Trigger/TrigSteer/HLTSeeding/python/HLTSeedingConfig.py  | 4 ++++
 .../TrigInDetConfig/python/ConfigSettingsBase.py         | 9 +++++----
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/Trigger/TrigSteer/HLTSeeding/python/HLTSeedingConfig.py b/Trigger/TrigSteer/HLTSeeding/python/HLTSeedingConfig.py
index 30eb36820c84..87656c741357 100644
--- a/Trigger/TrigSteer/HLTSeeding/python/HLTSeedingConfig.py
+++ b/Trigger/TrigSteer/HLTSeeding/python/HLTSeedingConfig.py
@@ -277,8 +277,12 @@ class HLTSeeding(CompFactory.HLTSeeding) :
 
         self.ctpUnpacker = ctpUnpacker
         from TrigEDMConfig.TriggerEDMRun3 import recordable
+
+        # needs to be set up such that the Roiupdater is set to false by default
+
         self.RoIBRoIUnpackers += [
             CompFactory.FSRoIsUnpackingTool("FSRoIsUnpackingTool",
+                                            RoiUpdater=CompFactory.RoiUpdaterTool( useBeamSpot=True ),
                                             Decisions=mapThresholdToL1DecisionCollection("FSNOSEED"),
                                             OutputTrigRoIs = recordable(mapThresholdToL1RoICollection("FSNOSEED") )) ]
         # EM unpacker
diff --git a/Trigger/TrigTools/TrigInDetConfig/python/ConfigSettingsBase.py b/Trigger/TrigTools/TrigInDetConfig/python/ConfigSettingsBase.py
index 02890db38a36..c6ec72a42c65 100644
--- a/Trigger/TrigTools/TrigInDetConfig/python/ConfigSettingsBase.py
+++ b/Trigger/TrigTools/TrigInDetConfig/python/ConfigSettingsBase.py
@@ -63,7 +63,9 @@ class _ConfigSettingsBase() :
       self._doHitDV             = False 
       self._doDisappearingTrk   = False
       self._usePixelNN          = False
-      self._useBeamSpotForRoiZwidth = False
+      self._useDynamicRoiZWidth = False
+
+
       #precision tracking configuration values
       self._maxRPhiImpactPT   = None
       self._maxZImpactPT      = None
@@ -381,10 +383,9 @@ class _ConfigSettingsBase() :
    def minTRTonTrk(self):
       return self._minTRTonTrkPT
 
-     
    @property
-   def useBeamSpotForRoiZwidth(self):
-      return self._useBeamSpotForRoiZwidth 
+   def useDynamicRoiZWidth(self):
+      return self._useDynamicRoiZWidth
 
    @property
    def useSiSPSeededTrackFinder(self):
-- 
GitLab


From 221c0220a75c4a7d57489d2d9bb5ab3fd9be9f2a Mon Sep 17 00:00:00 2001
From: sutt <sutt@cern.ch>
Date: Mon, 16 May 2022 17:58:26 +0200
Subject: [PATCH 04/11] fixes

---
 .../TrigEDMConfig/python/TriggerEDMRun3.py    |  5 +++-
 .../HLT/CommonSequences/FullScanDefs.py       |  6 +++-
 .../python/HLT/Jet/JetMenuSequences.py        | 28 +++++++++++++++----
 3 files changed, 32 insertions(+), 7 deletions(-)

diff --git a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py
index c1b622f0cd41..88a452e44928 100644
--- a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py
+++ b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py
@@ -862,14 +862,17 @@ TriggerHLTListRun3 = [
     ('TrigRoiDescriptorCollection#HLT_Roi_Bjet',                   'BS ESD AODFULL', 'Bjet'),
 
 
-    # jet superRoI Descriptor and associated track and vertex class used for EventView creation
 
+    # jet superRoI Descriptor and associated track and vertex class used for EventView creation
+    ('TrigRoiDescriptorCollection#HLT_Roi_FS',                         'BS ESD AODFULL', 'Jet'),
     ('TrigRoiDescriptorCollection#HLT_Roi_JetSuper',                   'BS ESD AODFULL', 'Jet'),
+
     ('xAOD::TrackParticleContainer#HLT_IDTrack_JetSuper_FTF',          'BS ESD AODFULL', 'Jet', 'inViews:JetSuperRoIViews'),
     ('xAOD::TrackParticleAuxContainer#HLT_IDTrack_JetSuper_FTFAux.',   'BS ESD AODFULL', 'Jet'),
 
 
 
+
     # bjet Second Stage Fast tracks
     ('xAOD::TrackParticleContainer#HLT_IDTrack_Bjet_FTF',        'BS ESD AODFULL', 'Bjet', 'inViews:'+BTagViewsEMTopo+','+BTagViewsEMPFlow),
     ('xAOD::TrackParticleAuxContainer#HLT_IDTrack_Bjet_FTFAux.', 'BS ESD AODFULL', 'Bjet'),
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/CommonSequences/FullScanDefs.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/CommonSequences/FullScanDefs.py
index 18fa0685eddf..2d538bb0b833 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/CommonSequences/FullScanDefs.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/CommonSequences/FullScanDefs.py
@@ -4,11 +4,15 @@
 
 # RoI used for the full-scan calorimeter step
 caloFSRoI = "FSJETMETCaloRoI"
+
 # RoI used for the full-scan tracking step
 trkFSRoI = "FSJETMETTrkRoI"
+
 # Name of the fullscan cells
 fs_cells = "CaloCellsFS"
+
 # Name of the fullscan EM clusters
 em_clusters = "HLT_TopoCaloClustersFS"
+
 # Name of the fullscan LC clusters
-lc_clusters = "HLT_TopoCaloClustersLCFS"
\ No newline at end of file
+lc_clusters = "HLT_TopoCaloClustersLCFS"
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Jet/JetMenuSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Jet/JetMenuSequences.py
index 94cf99e9ea04..bba0c619c883 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Jet/JetMenuSequences.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Jet/JetMenuSequences.py
@@ -40,11 +40,29 @@ def getCaloInputMaker():
 # Used for chains that use tracking
 def getTrackingInputMaker(trkopt):
     if trkopt=="ftf":
-        InputMakerAlg = conf2toConfigurable(CompFactory.InputMakerForRoI(
-            "IM_Jet_TrackingStep",
-            mergeUsingFeature = False,
-            RoITool = conf2toConfigurable(CompFactory.ViewCreatorInitialROITool()),
-            RoIs = trkFSRoI))
+
+        IDTrigConfig = getInDetTrigConfig( 'jet' )
+        
+        IDTrigConfig.printout()
+        
+        roiUpdater = None
+        if IDTrigConfig.useDynamicRoiZWidth:
+            roiUpdater=CompFactory.RoiUpdaterTool( useBeamSpot=True )
+            
+            InputMakerAlg = conf2toConfigurable(CompFactory.InputMakerForRoI( "IM_Jet_TrackingStep",
+                                                                              mergeUsingFeature = False,
+                                                                              RoITool = conf2toConfigurable( CompFactory.ViewCreatorFSROITool( name="RoiTool_FS", 
+                                                                                                                                               RoiUpdater=roiUpdater,
+                                                                                                                                               RoisWriteHandleKey=recordable( IDTrigConfig.roi ) ) ), 
+                                                                              RoIs = trkFSRoI ) )                                                
+        else: 
+            InputMakerAlg = conf2toConfigurable( CompFactory.InputMakerForRoI( "IM_Jet_TrackingStep",
+                                                                               mergeUsingFeature = False,
+                                                                               RoITool = conf2toConfigurable(CompFactory.ViewCreatorInitialROITool()),
+                                                                               RoIs = trkFSRoI) )
+
+
+
     elif trkopt=="roiftf":
         IDTrigConfig = getInDetTrigConfig( 'jetSuper' )
         InputMakerAlg = EventViewCreatorAlgorithm(
-- 
GitLab


From a02c13ad1255c7bf438598d02437f61ba8dc78ac Mon Sep 17 00:00:00 2001
From: sutt <sutt@cern.ch>
Date: Tue, 17 May 2022 06:50:46 +0200
Subject: [PATCH 05/11] outstanding fixes

---
 .../src/TrigFastTrackFinder.cxx                 |  2 +-
 .../src/ViewCreatorFSROITool.cxx                | 17 ++++++++++++-----
 .../HLTSeeding/src/FSRoIsUnpackingTool.cxx      | 10 ++++++----
 .../HLTSeeding/src/RoIsUnpackingToolBase.cxx    | 10 +++++-----
 .../HLTSeeding/src/RoIsUnpackingToolBase.h      |  8 ++------
 .../TrigSteer/HLTSeeding/src/RoiUpdaterTool.cxx | 15 +++++++++------
 .../TrigSteer/HLTSeeding/src/RoiUpdaterTool.h   |  4 +++-
 .../src/components/HLTSeeding_entries.cxx       |  4 ++++
 .../TrigInDetConfig/python/ConfigSettings.py    |  2 +-
 .../python/ConfigSettingsBase.py                | 10 ++++++----
 .../python/HLT/Jet/JetMenuSequences.py          | 10 ++++++----
 11 files changed, 55 insertions(+), 37 deletions(-)

diff --git a/Trigger/TrigAlgorithms/TrigFastTrackFinder/src/TrigFastTrackFinder.cxx b/Trigger/TrigAlgorithms/TrigFastTrackFinder/src/TrigFastTrackFinder.cxx
index 251af9c6a707..202f1ff4ec66 100644
--- a/Trigger/TrigAlgorithms/TrigFastTrackFinder/src/TrigFastTrackFinder.cxx
+++ b/Trigger/TrigAlgorithms/TrigFastTrackFinder/src/TrigFastTrackFinder.cxx
@@ -382,7 +382,7 @@ StatusCode TrigFastTrackFinder::execute(const EventContext& ctx) const {
   ATH_CHECK(roiCollection.isValid());
 
   if ( roiCollection->size()>1 ) ATH_MSG_WARNING( "More than one Roi in the collection: " << m_roiCollectionKey << ", this is not supported - use a composite Roi: Using the first Roi ONLY" );
-
+  
   if ( roiCollection->size()==0) {
     ATH_MSG_ERROR("No Roi found for " << m_roiCollectionKey.key() );
     return StatusCode::FAILURE;
diff --git a/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorFSROITool.cxx b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorFSROITool.cxx
index 20c4a4fbde3f..132e3b682f6f 100644
--- a/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorFSROITool.cxx
+++ b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorFSROITool.cxx
@@ -15,21 +15,28 @@ ViewCreatorFSROITool::ViewCreatorFSROITool(const std::string& type, const std::s
 
 StatusCode ViewCreatorFSROITool::initialize()  {
   ATH_CHECK( m_roisWriteHandleKey.initialize() );
+
   if ( !m_roiupdater.empty() ) ATH_CHECK( m_roiupdater.retrieve() );
+
   return StatusCode::SUCCESS;
 }
 
 
 StatusCode ViewCreatorFSROITool::attachROILinks(TrigCompositeUtils::DecisionContainer& decisions, const EventContext& ctx) const {
+
   SG::WriteHandle<TrigRoiDescriptorCollection> roisWriteHandle = createAndStoreNoAux(m_roisWriteHandleKey, ctx);
-  
-  if ( m_roiupdater.empty() ) roisWriteHandle->push_back( new TrigRoiDescriptor(true) );
-  else                        roisWriteHandle->push_back( m_roiupdater->execute( ctx ) );  
 
-  const ElementLink<TrigRoiDescriptorCollection> roiEL = ElementLink<TrigRoiDescriptorCollection>(*roisWriteHandle, /*index =*/ 0, ctx);
+  if ( m_roiupdater.empty() ) { 
+    roisWriteHandle->push_back( new TrigRoiDescriptor(true) );
+  }
+  else {
+    roisWriteHandle->push_back( m_roiupdater->execute( ctx ) );
+  }
+
+  const ElementLink<TrigRoiDescriptorCollection> roiEL = ElementLink<TrigRoiDescriptorCollection>( *roisWriteHandle, /*index =*/ 0, ctx );
 
   for ( Decision* outputDecision : decisions ) { 
-    outputDecision->setObjectLink(roiString(), roiEL);
+    outputDecision->setObjectLink( roiString(), roiEL );
   }
 
   return StatusCode::SUCCESS;
diff --git a/Trigger/TrigSteer/HLTSeeding/src/FSRoIsUnpackingTool.cxx b/Trigger/TrigSteer/HLTSeeding/src/FSRoIsUnpackingTool.cxx
index 8aeed5ea9609..ea26b17d047b 100644
--- a/Trigger/TrigSteer/HLTSeeding/src/FSRoIsUnpackingTool.cxx
+++ b/Trigger/TrigSteer/HLTSeeding/src/FSRoIsUnpackingTool.cxx
@@ -9,7 +9,8 @@
 FSRoIsUnpackingTool::FSRoIsUnpackingTool(const std::string& type,
                                          const std::string& name,
                                          const IInterface* parent)
-  : RoIsUnpackingToolBase(type, name, parent) {}
+  : RoIsUnpackingToolBase(type, name, parent) {
+}
 
 
 StatusCode FSRoIsUnpackingTool::initialize() {
@@ -29,6 +30,9 @@ StatusCode FSRoIsUnpackingTool::start() {
     m_allFSChains.insert( thresholdToChain.second.begin(), thresholdToChain.second.end() );
   }
 
+  /// shouldn;t this be protected by an output level check ?
+  /// hopefully the optimisation will remove the loop if the 
+  /// ATH_MSG_DEBUG gets compiled out 
   for ( auto id: m_allFSChains ) {
     ATH_MSG_DEBUG( "FS Chain " << id  );
   }
@@ -63,12 +67,10 @@ StatusCode FSRoIsUnpackingTool::unpack(const EventContext& ctx,
   ATH_CHECK(roiHandle.record( std::make_unique<TrigRoiDescriptorCollection>() ));
   ///
   if ( !m_roiupdater.empty() ) { 
-    std::cout << "SUTT: RoiUpdater FFS" << std::endl;
     roiHandle->push_back( m_roiupdater->execute(ctx) );
   }
   else {
-    std::cout << "SUTT: NO RoiUpdater - WHY NOT ? " << std::endl;
-    roiHandle->push_back( std::make_unique<TrigRoiDescriptor>( RoiDescriptor::FULLSCAN) ); 
+    roiHandle->push_back( std::make_unique<TrigRoiDescriptor>( RoiDescriptor::FULLSCAN ) ); 
   }
 
   ATH_MSG_DEBUG("Linking to FS RoI descriptor");
diff --git a/Trigger/TrigSteer/HLTSeeding/src/RoIsUnpackingToolBase.cxx b/Trigger/TrigSteer/HLTSeeding/src/RoIsUnpackingToolBase.cxx
index de6f7861bb44..b74a8dba84ea 100644
--- a/Trigger/TrigSteer/HLTSeeding/src/RoIsUnpackingToolBase.cxx
+++ b/Trigger/TrigSteer/HLTSeeding/src/RoIsUnpackingToolBase.cxx
@@ -14,11 +14,11 @@ RoIsUnpackingToolBase::RoIsUnpackingToolBase(const std::string& type,
 
 
 StatusCode RoIsUnpackingToolBase::initialize() {
-  if ( !m_monTool.empty() ) {ATH_CHECK( m_monTool.retrieve() );}
-  if ( !m_roiupdater.empty() ) {
-    std::cout << "SUTT: RoiUpdater" << std::endl;
-    ATH_CHECK( m_roiupdater.retrieve() );
-  }
+
+  if ( !m_monTool.empty() )     ATH_CHECK( m_monTool.retrieve() );
+  /// should this really be here if it is only accessed in 
+  /// derived classes ?
+  if ( !m_roiupdater.empty() )  ATH_CHECK( m_roiupdater.retrieve() );
 
   ATH_CHECK( m_decisionsKey.initialize() );
   ATH_CHECK( m_decisionsKeyProbe.initialize(SG::AllowEmpty) );
diff --git a/Trigger/TrigSteer/HLTSeeding/src/RoIsUnpackingToolBase.h b/Trigger/TrigSteer/HLTSeeding/src/RoIsUnpackingToolBase.h
index 337bdb472aab..27da3cc4a23e 100644
--- a/Trigger/TrigSteer/HLTSeeding/src/RoIsUnpackingToolBase.h
+++ b/Trigger/TrigSteer/HLTSeeding/src/RoIsUnpackingToolBase.h
@@ -64,12 +64,8 @@ protected:
     this, "HLTTriggerMenu", "DetectorStore+HLTTriggerMenu", "Name of the HLTMenu object to read configuration from"};
   /// @}
 
-  ToolHandle<GenericMonitoringTool> m_monTool{
-    this, "MonTool", "", "Monitoring tool"};
-
-  ToolHandle<IRoiUpdaterTool> m_roiupdater{ 
-    this, "RoiUpdater", "", "Roi Updater"};
-
+  ToolHandle<GenericMonitoringTool> m_monTool{ this, "MonTool",    "", "Monitoring tool" };
+  ToolHandle<IRoiUpdaterTool>    m_roiupdater{ this, "RoiUpdater", "", "Roi Updater" };
 
   std::map<HLT::Identifier, HLT::IDVec> m_thresholdToChainMapping;
   std::map<HLT::Identifier, HLT::Identifier> m_legToChainMapping;
diff --git a/Trigger/TrigSteer/HLTSeeding/src/RoiUpdaterTool.cxx b/Trigger/TrigSteer/HLTSeeding/src/RoiUpdaterTool.cxx
index 28d0450b4451..293cb2b7fd46 100644
--- a/Trigger/TrigSteer/HLTSeeding/src/RoiUpdaterTool.cxx
+++ b/Trigger/TrigSteer/HLTSeeding/src/RoiUpdaterTool.cxx
@@ -16,7 +16,7 @@ RoiUpdaterTool::RoiUpdaterTool(const std::string& type, const std::string& name,
 
 StatusCode RoiUpdaterTool::initialize()  {
 
-  std::cout << "SUTT: roiUpdater:initialize()" << std::endl;
+  ATH_MSG_DEBUG("initialize()");
 
   if ( m_etaWidth!=-999 || m_phiWidth!=-999 || m_zedWidth!=-999 ) m_update = true;
 
@@ -29,8 +29,7 @@ StatusCode RoiUpdaterTool::initialize()  {
 
 
 
-
-void zrange( double nsigma, double& zed, double& zedMinus, double& zedPlus, const SG::ReadCondHandleKey<InDet::BeamSpotData>& bs, const EventContext& ctx ) { 
+void zrange( double nsigma, double fence, double& zed, double& zedMinus, double& zedPlus, const SG::ReadCondHandleKey<InDet::BeamSpotData>& bs, const EventContext& ctx ) { 
 
       SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle( bs, ctx );
 
@@ -42,8 +41,8 @@ void zrange( double nsigma, double& zed, double& zedMinus, double& zedPlus, cons
 	double zpos   = beamSpotHandle->beamPos()[2];
 	
 	zed      = zpos; /// technically, updating the z position itself should not be needed
-	zedMinus = zpos - nsigma*zsigma;
-	zedPlus  = zpos + nsigma*zsigma;
+	zedMinus = zpos - nsigma*zsigma + fence;
+	zedPlus  = zpos + nsigma*zsigma + fence;
       }
       else { 
 	zedMinus = -RoiDescriptor::zedWidthDefault();     
@@ -53,6 +52,8 @@ void zrange( double nsigma, double& zed, double& zedMinus, double& zedPlus, cons
 }
 
 
+
+
 std::unique_ptr<TrigRoiDescriptor> RoiUpdaterTool::execute( const EventContext& ctx ) const {  
   /// create initial dummy FS Roi here - used to define the new Roi and is then discarded  
   RoiDescriptor troi( RoiDescriptor::FULLSCAN );
@@ -61,6 +62,8 @@ std::unique_ptr<TrigRoiDescriptor> RoiUpdaterTool::execute( const EventContext&
 
 
 std::unique_ptr<TrigRoiDescriptor> RoiUpdaterTool::execute( const IRoiDescriptor* iroi, const EventContext& ctx ) const {  
+
+  ATH_MSG_DEBUG("execute(): " );
   
   /// should not update a composite Roi - or do we want the constituents updated ???
   /// or what ??? Return a copy ? Who will own this stuff ?? 
@@ -101,7 +104,7 @@ std::unique_ptr<TrigRoiDescriptor> RoiUpdaterTool::execute( const IRoiDescriptor
   }
   
   /// do *not* prevent the beamspot from *increasing* the size of the Roi
-  if ( m_useBeamspot ) zrange( m_nsigma, zed, zedMinus, zedPlus, m_beamspotKey, ctx );
+  if ( m_useBeamspot ) zrange( m_nsigma, m_fence, zed, zedMinus, zedPlus, m_beamspotKey, ctx );
   
   /// limit to old range - no point going well outside the interaction region
   if ( zedMinus<-RoiDescriptor::zedWidthDefault() ) zedMinus = -RoiDescriptor::zedWidthDefault();     
diff --git a/Trigger/TrigSteer/HLTSeeding/src/RoiUpdaterTool.h b/Trigger/TrigSteer/HLTSeeding/src/RoiUpdaterTool.h
index e0484bc7773d..726034731c43 100644
--- a/Trigger/TrigSteer/HLTSeeding/src/RoiUpdaterTool.h
+++ b/Trigger/TrigSteer/HLTSeeding/src/RoiUpdaterTool.h
@@ -44,7 +44,9 @@ public:
   Gaudi::Property<double> m_zedWidth { this, "ZedWidth", -999, "FS Roi zed half width" };
 
   Gaudi::Property<bool>   m_useBeamspot { this, "useBeamSpot", false, "use beamspot for zed width" };
-  Gaudi::Property<double> m_nsigma      { this, "NSigma",      3.3,   "width (in simga) for the beamspot Roi sidth" };
+  /// default settings - should be retuned with data
+  Gaudi::Property<double> m_nsigma      { this, "NSigma",      3,    "width (in simga) for the beamspot Roi sidth" };
+  Gaudi::Property<double> m_fence       { this, "Fance",       10,   "fence width for the beamspot Roi sidth" };
 
   SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamspotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" };
 
diff --git a/Trigger/TrigSteer/HLTSeeding/src/components/HLTSeeding_entries.cxx b/Trigger/TrigSteer/HLTSeeding/src/components/HLTSeeding_entries.cxx
index 8a4573cc0abc..08169851a450 100644
--- a/Trigger/TrigSteer/HLTSeeding/src/components/HLTSeeding_entries.cxx
+++ b/Trigger/TrigSteer/HLTSeeding/src/components/HLTSeeding_entries.cxx
@@ -25,6 +25,8 @@
 #include "../L1TriggerResultMaker.h"
 #include "../L1DataConsistencyChecker.h"
 
+#include "../RoiUpdaterTool.h"
+
 // Algorithms
 DECLARE_COMPONENT( HLTSeeding )
 DECLARE_COMPONENT( HLTSeedingNoCtpForTesting )
@@ -72,3 +74,5 @@ DECLARE_COMPONENT( RoIsUnpackingToolBase )
 DECLARE_COMPONENT( RoIsUnpackingEmulationTool )
 DECLARE_COMPONENT( FSRoIsUnpackingTool )
 DECLARE_COMPONENT( L1DataConsistencyChecker )
+
+DECLARE_COMPONENT( RoiUpdaterTool )
diff --git a/Trigger/TrigTools/TrigInDetConfig/python/ConfigSettings.py b/Trigger/TrigTools/TrigInDetConfig/python/ConfigSettings.py
index c7b0b79bfd45..91e404ad96b1 100644
--- a/Trigger/TrigTools/TrigInDetConfig/python/ConfigSettings.py
+++ b/Trigger/TrigTools/TrigInDetConfig/python/ConfigSettings.py
@@ -220,7 +220,7 @@ class _ConfigSettings_fullScan( _ConfigSettingsBase ):
       self._dodEdxTrk         = True
       self._doHitDV           = True
       self._doDisappearingTrk = True
-
+      # self._useDynamicRoiZWidth = True
 
 class _ConfigSettings_beamSpotFS( _ConfigSettingsBase ):
    def __init__( self ):
diff --git a/Trigger/TrigTools/TrigInDetConfig/python/ConfigSettingsBase.py b/Trigger/TrigTools/TrigInDetConfig/python/ConfigSettingsBase.py
index c6ec72a42c65..89d14267d474 100644
--- a/Trigger/TrigTools/TrigInDetConfig/python/ConfigSettingsBase.py
+++ b/Trigger/TrigTools/TrigInDetConfig/python/ConfigSettingsBase.py
@@ -424,10 +424,8 @@ class _ConfigSettingsBase() :
       log.info( "   LRTHardPtmin          : %s", self._LRTHardPtMin )
       log.info( "   doHitDV               : %s", self._doHitDV )
       log.info( "   nClustersMin          : %s", self._nClustersMin )
-      log.info( "   useBremModel          : %s", self._useBremModel )
       log.info( "   suffix                : %s", self._suffix )
-      log.info( "   record                : %s", self._record )
-      log.info( "   Roi                   : %s", self._Roi )
+      log.info( "   roi                   : %s", self._roi )
       log.info( "   addSingleTrackVertices: %s", self._addSingleTrackVertices )
       log.info( "   maxRPhiImpact         : %s", self._maxRPhiImpactPT )
       log.info( "   maxZImpact            : %s", self._maxZImpactPT )
@@ -440,5 +438,9 @@ class _ConfigSettingsBase() :
       log.info( "   useSCT                : %s", self._useSCTPT )
       log.info( "   doEmCaloSeed          : %s", self._doEmCaloSeedPT )
       log.info( "   minTRTonTrk           : %s", self._minTRTonTrkPT )
-      log.info( "   BeamSpotForRoiZwidth  : %s", self._useBeamSpotForRoiZwidth )
+      log.info( "   useDynamicRoiZWidth   : %s", self._useDynamicRoiZWidth )
       log.info( "   useSiSPSeededTrackFinder : %s", self._useSiSPSeededTrackFinder )
+
+if __name__=='__main__':
+   config = _ConfigSettingsBase()
+   config.printout()
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Jet/JetMenuSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Jet/JetMenuSequences.py
index bba0c619c883..10dbb633125d 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Jet/JetMenuSequences.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Jet/JetMenuSequences.py
@@ -42,13 +42,15 @@ def getTrackingInputMaker(trkopt):
     if trkopt=="ftf":
 
         IDTrigConfig = getInDetTrigConfig( 'jet' )
-        
-        IDTrigConfig.printout()
+
+        log.info( "jet FS tracking: useDynamicRoiZWidth: %s", str(IDTrigConfig.useDynamicRoiZWidth) )
         
         roiUpdater = None
         if IDTrigConfig.useDynamicRoiZWidth:
-            roiUpdater=CompFactory.RoiUpdaterTool( useBeamSpot=True )
-            
+            roiUpdater = CompFactory.RoiUpdaterTool( useBeamSpot=True )
+
+            log.info( roiUpdater )
+
             InputMakerAlg = conf2toConfigurable(CompFactory.InputMakerForRoI( "IM_Jet_TrackingStep",
                                                                               mergeUsingFeature = False,
                                                                               RoITool = conf2toConfigurable( CompFactory.ViewCreatorFSROITool( name="RoiTool_FS", 
-- 
GitLab


From e8b5cb15a64865ccd5920b580a8ed43bd819b209 Mon Sep 17 00:00:00 2001
From: sutt <sutt@cern.ch>
Date: Tue, 17 May 2022 07:02:59 +0200
Subject: [PATCH 06/11] AAARGH !

---
 Trigger/TrigSteer/HLTSeeding/src/RoiUpdaterTool.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Trigger/TrigSteer/HLTSeeding/src/RoiUpdaterTool.h b/Trigger/TrigSteer/HLTSeeding/src/RoiUpdaterTool.h
index 726034731c43..59ec7accc2b8 100644
--- a/Trigger/TrigSteer/HLTSeeding/src/RoiUpdaterTool.h
+++ b/Trigger/TrigSteer/HLTSeeding/src/RoiUpdaterTool.h
@@ -45,8 +45,8 @@ public:
 
   Gaudi::Property<bool>   m_useBeamspot { this, "useBeamSpot", false, "use beamspot for zed width" };
   /// default settings - should be retuned with data
-  Gaudi::Property<double> m_nsigma      { this, "NSigma",      3,    "width (in simga) for the beamspot Roi sidth" };
-  Gaudi::Property<double> m_fence       { this, "Fance",       10,   "fence width for the beamspot Roi sidth" };
+  Gaudi::Property<double> m_nsigma      { this, "NSigma",       3,   "width (in simga) for the beamspot Roi width" };
+  Gaudi::Property<double> m_fence       { this, "Fance",       10,   "fence width for the beamspot Roi width" }; /// do we need an mm unit here ? 
 
   SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamspotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" };
 
-- 
GitLab


From 6262efa49753ccf2e0eb328224bd593826be4560 Mon Sep 17 00:00:00 2001
From: sutt <sutt@cern.ch>
Date: Tue, 17 May 2022 07:37:49 +0200
Subject: [PATCH 07/11] oh dear

---
 .../DecisionHandling/DecisionHandling/IViewCreatorROITool.h   | 4 ----
 .../DecisionHandling/src/ViewCreatorInitialROITool.h          | 1 -
 Trigger/TrigSteer/HLTSeeding/python/HLTSeedingConfig.py       | 2 +-
 Trigger/TrigSteer/HLTSeeding/src/RoiUpdaterTool.cxx           | 2 +-
 Trigger/TrigTools/TrigInDetConfig/python/ConfigSettings.py    | 1 -
 5 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/Trigger/TrigSteer/DecisionHandling/DecisionHandling/IViewCreatorROITool.h b/Trigger/TrigSteer/DecisionHandling/DecisionHandling/IViewCreatorROITool.h
index b161d34aa8af..509308499347 100644
--- a/Trigger/TrigSteer/DecisionHandling/DecisionHandling/IViewCreatorROITool.h
+++ b/Trigger/TrigSteer/DecisionHandling/DecisionHandling/IViewCreatorROITool.h
@@ -10,7 +10,6 @@
 #include "Gaudi/Property.h"
 #include "TrigCompositeUtils/TrigCompositeUtils.h"
 
-// #include "HLTSeeding/IRoiUpdaterTool.h"
 
 /**
  * @class IViewCreatorROITool
@@ -36,9 +35,6 @@ public:
  **/
   virtual StatusCode attachROILinks(TrigCompositeUtils::DecisionContainer& decisions, const EventContext& ctx) const = 0;
 
-  // protected:
-
-  //  ToolHandle<IRoiUpdaterTool> m_roiupdater { this, "RoiUpdater", "", "Roi Updater" };
 
 };
 
diff --git a/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorInitialROITool.h b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorInitialROITool.h
index 6efb26d9865d..853c3201c976 100644
--- a/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorInitialROITool.h
+++ b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorInitialROITool.h
@@ -8,7 +8,6 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "DecisionHandling/IViewCreatorROITool.h"
 
-// #include "DecisionHandling/IRoiUpdaterTool.h"
 #include "HLTSeeding/IRoiUpdaterTool.h"
 
 /**
diff --git a/Trigger/TrigSteer/HLTSeeding/python/HLTSeedingConfig.py b/Trigger/TrigSteer/HLTSeeding/python/HLTSeedingConfig.py
index 87656c741357..ef1ef0b7dc5c 100644
--- a/Trigger/TrigSteer/HLTSeeding/python/HLTSeedingConfig.py
+++ b/Trigger/TrigSteer/HLTSeeding/python/HLTSeedingConfig.py
@@ -282,7 +282,7 @@ class HLTSeeding(CompFactory.HLTSeeding) :
 
         self.RoIBRoIUnpackers += [
             CompFactory.FSRoIsUnpackingTool("FSRoIsUnpackingTool",
-                                            RoiUpdater=CompFactory.RoiUpdaterTool( useBeamSpot=True ),
+                                            RoiUpdater=None, 
                                             Decisions=mapThresholdToL1DecisionCollection("FSNOSEED"),
                                             OutputTrigRoIs = recordable(mapThresholdToL1RoICollection("FSNOSEED") )) ]
         # EM unpacker
diff --git a/Trigger/TrigSteer/HLTSeeding/src/RoiUpdaterTool.cxx b/Trigger/TrigSteer/HLTSeeding/src/RoiUpdaterTool.cxx
index 293cb2b7fd46..27f7703d63c5 100644
--- a/Trigger/TrigSteer/HLTSeeding/src/RoiUpdaterTool.cxx
+++ b/Trigger/TrigSteer/HLTSeeding/src/RoiUpdaterTool.cxx
@@ -41,7 +41,7 @@ void zrange( double nsigma, double fence, double& zed, double& zedMinus, double&
 	double zpos   = beamSpotHandle->beamPos()[2];
 	
 	zed      = zpos; /// technically, updating the z position itself should not be needed
-	zedMinus = zpos - nsigma*zsigma + fence;
+	zedMinus = zpos - nsigma*zsigma - fence;
 	zedPlus  = zpos + nsigma*zsigma + fence;
       }
       else { 
diff --git a/Trigger/TrigTools/TrigInDetConfig/python/ConfigSettings.py b/Trigger/TrigTools/TrigInDetConfig/python/ConfigSettings.py
index 91e404ad96b1..f99d82b480d1 100644
--- a/Trigger/TrigTools/TrigInDetConfig/python/ConfigSettings.py
+++ b/Trigger/TrigTools/TrigInDetConfig/python/ConfigSettings.py
@@ -220,7 +220,6 @@ class _ConfigSettings_fullScan( _ConfigSettingsBase ):
       self._dodEdxTrk         = True
       self._doHitDV           = True
       self._doDisappearingTrk = True
-      # self._useDynamicRoiZWidth = True
 
 class _ConfigSettings_beamSpotFS( _ConfigSettingsBase ):
    def __init__( self ):
-- 
GitLab


From ddde1b987c4c87241f3dd588387f7e720511a9b7 Mon Sep 17 00:00:00 2001
From: sutt <sutt@cern.ch>
Date: Tue, 17 May 2022 08:04:04 +0200
Subject: [PATCH 08/11] hmm

---
 Trigger/TrigSteer/DecisionHandling/src/ViewCreatorFSROITool.cxx | 2 +-
 Trigger/TrigTools/TrigInDetConfig/python/ConfigSettings.py      | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorFSROITool.cxx b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorFSROITool.cxx
index 132e3b682f6f..15b7517ed487 100644
--- a/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorFSROITool.cxx
+++ b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorFSROITool.cxx
@@ -27,7 +27,7 @@ StatusCode ViewCreatorFSROITool::attachROILinks(TrigCompositeUtils::DecisionCont
   SG::WriteHandle<TrigRoiDescriptorCollection> roisWriteHandle = createAndStoreNoAux(m_roisWriteHandleKey, ctx);
 
   if ( m_roiupdater.empty() ) { 
-    roisWriteHandle->push_back( new TrigRoiDescriptor(true) );
+    roisWriteHandle->push_back( new TrigRoiDescriptor( RoiDescriptor::FULLSCAN ) );
   }
   else {
     roisWriteHandle->push_back( m_roiupdater->execute( ctx ) );
diff --git a/Trigger/TrigTools/TrigInDetConfig/python/ConfigSettings.py b/Trigger/TrigTools/TrigInDetConfig/python/ConfigSettings.py
index f99d82b480d1..c7b0b79bfd45 100644
--- a/Trigger/TrigTools/TrigInDetConfig/python/ConfigSettings.py
+++ b/Trigger/TrigTools/TrigInDetConfig/python/ConfigSettings.py
@@ -221,6 +221,7 @@ class _ConfigSettings_fullScan( _ConfigSettingsBase ):
       self._doHitDV           = True
       self._doDisappearingTrk = True
 
+
 class _ConfigSettings_beamSpotFS( _ConfigSettingsBase ):
    def __init__( self ):
       _ConfigSettingsBase.__init__(self)
-- 
GitLab


From 67c54097827b239f3bd541340016dc367c9d7d71 Mon Sep 17 00:00:00 2001
From: sutt <sutt@cern.ch>
Date: Tue, 17 May 2022 08:48:44 +0200
Subject: [PATCH 09/11] more fixes

---
 .../TrigSteer/HLTSeeding/src/RoiUpdaterTool.cxx   | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/Trigger/TrigSteer/HLTSeeding/src/RoiUpdaterTool.cxx b/Trigger/TrigSteer/HLTSeeding/src/RoiUpdaterTool.cxx
index 27f7703d63c5..4fe44b28b29b 100644
--- a/Trigger/TrigSteer/HLTSeeding/src/RoiUpdaterTool.cxx
+++ b/Trigger/TrigSteer/HLTSeeding/src/RoiUpdaterTool.cxx
@@ -20,9 +20,10 @@ StatusCode RoiUpdaterTool::initialize()  {
 
   if ( m_etaWidth!=-999 || m_phiWidth!=-999 || m_zedWidth!=-999 ) m_update = true;
 
-  if ( m_useBeamspot ) m_update = true;
-
-  ATH_CHECK( m_beamspotKey.initialize( m_useBeamspot ) );
+  if ( m_useBeamspot ) { 
+    m_update = true;
+    ATH_CHECK( m_beamspotKey.initialize( m_useBeamspot ) );
+  }
 
   return StatusCode::SUCCESS;
 }
@@ -63,12 +64,16 @@ std::unique_ptr<TrigRoiDescriptor> RoiUpdaterTool::execute( const EventContext&
 
 std::unique_ptr<TrigRoiDescriptor> RoiUpdaterTool::execute( const IRoiDescriptor* iroi, const EventContext& ctx ) const {  
 
-  ATH_MSG_DEBUG("execute(): " );
+  ATH_MSG_DEBUG( "execute()" );
   
+  /// if we don't want to update, why are we even including trhe RoiUIpdater ???
+  /// will return a unique_ptr - if that causes issues down the line, so be it
+  if ( !m_update ) return std::make_unique<TrigRoiDescriptor>( *iroi );
+
   /// should not update a composite Roi - or do we want the constituents updated ???
   /// or what ??? Return a copy ? Who will own this stuff ?? 
   /// why are you calling the updater on a composite Roi in any case ? 
-  /// will retuern a unique_ptr - if that causes issues down the line, so be it
+  /// will return a unique_ptr - if that causes issues down the line, so be it
   if ( iroi->composite() )  { 
     ATH_MSG_WARNING( "Will not update composite Roi parameters: " << *iroi );
     return std::make_unique<TrigRoiDescriptor>( *iroi );
-- 
GitLab


From 82047e5ee0ad6006827e61a3cb33c6bcb70f76c1 Mon Sep 17 00:00:00 2001
From: sutt <sutt@cern.ch>
Date: Tue, 24 May 2022 10:51:04 +0200
Subject: [PATCH 10/11] pointlessly change pointless "copyright" statement

---
 .../DecisionHandling/DecisionHandling/IViewCreatorROITool.h     | 2 +-
 .../DecisionHandling/src/ViewCreatorCentredOnClusterROITool.h   | 2 +-
 .../DecisionHandling/src/ViewCreatorCentredOnIParticleROITool.h | 2 +-
 .../src/ViewCreatorCentredOnJetWithPVConstraintROITool.h        | 2 +-
 Trigger/TrigSteer/DecisionHandling/src/ViewCreatorFSROITool.cxx | 2 +-
 Trigger/TrigSteer/DecisionHandling/src/ViewCreatorFSROITool.h   | 2 +-
 .../DecisionHandling/src/ViewCreatorFetchFromViewROITool.h      | 2 +-
 .../TrigSteer/DecisionHandling/src/ViewCreatorInitialROITool.h  | 2 +-
 .../TrigSteer/DecisionHandling/src/ViewCreatorNamedROITool.h    | 2 +-
 .../TrigSteer/DecisionHandling/src/ViewCreatorPreviousROITool.h | 2 +-
 Trigger/TrigSteer/HLTSeeding/src/FSRoIsUnpackingTool.cxx        | 2 +-
 Trigger/TrigSteer/HLTSeeding/src/RoIsUnpackingToolBase.h        | 2 +-
 Trigger/TrigSteer/HLTSeeding/src/RoiUpdaterTool.cxx             | 2 +-
 Trigger/TrigSteer/HLTSeeding/src/RoiUpdaterTool.h               | 2 +-
 14 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/Trigger/TrigSteer/DecisionHandling/DecisionHandling/IViewCreatorROITool.h b/Trigger/TrigSteer/DecisionHandling/DecisionHandling/IViewCreatorROITool.h
index 509308499347..7047b4b51b93 100644
--- a/Trigger/TrigSteer/DecisionHandling/DecisionHandling/IViewCreatorROITool.h
+++ b/Trigger/TrigSteer/DecisionHandling/DecisionHandling/IViewCreatorROITool.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef VIEWALGS_IVIEWCREATORROITOOL_H
diff --git a/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorCentredOnClusterROITool.h b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorCentredOnClusterROITool.h
index 4b1c9441a940..9a89a444a68f 100644
--- a/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorCentredOnClusterROITool.h
+++ b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorCentredOnClusterROITool.h
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef DECISIONHANDLING_VIEWCREATORCENTREDONCLUSTERROITOOL_H
diff --git a/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorCentredOnIParticleROITool.h b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorCentredOnIParticleROITool.h
index 4adce7eb3c2d..c21e38423b8c 100755
--- a/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorCentredOnIParticleROITool.h
+++ b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorCentredOnIParticleROITool.h
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef DECISIONHANDLING_VIEWCREATORCENTREDONIPARTICLEROITOOL_H
diff --git a/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorCentredOnJetWithPVConstraintROITool.h b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorCentredOnJetWithPVConstraintROITool.h
index 6fd76dcf0100..26b682152885 100644
--- a/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorCentredOnJetWithPVConstraintROITool.h
+++ b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorCentredOnJetWithPVConstraintROITool.h
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef DECISIONHANDLING_VIEWCREATORCENTREDONJETWITHPVCONSTRAINTROITOOL_H
diff --git a/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorFSROITool.cxx b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorFSROITool.cxx
index 15b7517ed487..d80f2c3c7273 100644
--- a/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorFSROITool.cxx
+++ b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorFSROITool.cxx
@@ -1,6 +1,6 @@
 
 /*
-Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "TrigSteeringEvent/TrigRoiDescriptorCollection.h"
diff --git a/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorFSROITool.h b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorFSROITool.h
index 6616733b0171..288504f86ae5 100644
--- a/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorFSROITool.h
+++ b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorFSROITool.h
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef DESICIONHANDLING_VIEWCREATORFSROITOOL_H
diff --git a/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorFetchFromViewROITool.h b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorFetchFromViewROITool.h
index f9c5cf61a85a..9e2e48a56ff8 100644
--- a/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorFetchFromViewROITool.h
+++ b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorFetchFromViewROITool.h
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef DECISIONHANDLING_VIEWCREATORFETCHFROMVIEWROITOOL_H
diff --git a/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorInitialROITool.h b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorInitialROITool.h
index 853c3201c976..f56d74fdea94 100644
--- a/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorInitialROITool.h
+++ b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorInitialROITool.h
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef DECISIONHANDLING_VIEWCREATORINITIALROITOOL_H
diff --git a/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorNamedROITool.h b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorNamedROITool.h
index f13b740c7ecf..5432a592526f 100644
--- a/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorNamedROITool.h
+++ b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorNamedROITool.h
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef DECISIONHANDLING_VIEWCREATORNAMEDROITOOL_H
diff --git a/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorPreviousROITool.h b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorPreviousROITool.h
index 60bce63db605..f0abe88affc7 100644
--- a/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorPreviousROITool.h
+++ b/Trigger/TrigSteer/DecisionHandling/src/ViewCreatorPreviousROITool.h
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef DECISIONHANDLING_VIEWCREATORPREVIOUSROITOOL_H
diff --git a/Trigger/TrigSteer/HLTSeeding/src/FSRoIsUnpackingTool.cxx b/Trigger/TrigSteer/HLTSeeding/src/FSRoIsUnpackingTool.cxx
index ea26b17d047b..f83febc075a0 100644
--- a/Trigger/TrigSteer/HLTSeeding/src/FSRoIsUnpackingTool.cxx
+++ b/Trigger/TrigSteer/HLTSeeding/src/FSRoIsUnpackingTool.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "FSRoIsUnpackingTool.h"
diff --git a/Trigger/TrigSteer/HLTSeeding/src/RoIsUnpackingToolBase.h b/Trigger/TrigSteer/HLTSeeding/src/RoIsUnpackingToolBase.h
index 27da3cc4a23e..0c81e025d5f3 100644
--- a/Trigger/TrigSteer/HLTSeeding/src/RoIsUnpackingToolBase.h
+++ b/Trigger/TrigSteer/HLTSeeding/src/RoIsUnpackingToolBase.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
 */
 #ifndef HLTSEEDING_ROISUNPACKINGTOOLBASE_H
 #define HLTSEEDING_ROISUNPACKINGTOOLBASE_H
diff --git a/Trigger/TrigSteer/HLTSeeding/src/RoiUpdaterTool.cxx b/Trigger/TrigSteer/HLTSeeding/src/RoiUpdaterTool.cxx
index 4fe44b28b29b..d609228dda03 100644
--- a/Trigger/TrigSteer/HLTSeeding/src/RoiUpdaterTool.cxx
+++ b/Trigger/TrigSteer/HLTSeeding/src/RoiUpdaterTool.cxx
@@ -1,6 +1,6 @@
 
 /*
-Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "TrigSteeringEvent/TrigRoiDescriptorCollection.h"
diff --git a/Trigger/TrigSteer/HLTSeeding/src/RoiUpdaterTool.h b/Trigger/TrigSteer/HLTSeeding/src/RoiUpdaterTool.h
index 59ec7accc2b8..344aa366227b 100644
--- a/Trigger/TrigSteer/HLTSeeding/src/RoiUpdaterTool.h
+++ b/Trigger/TrigSteer/HLTSeeding/src/RoiUpdaterTool.h
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef DECISIONHANDLING_ROIUPDATERTOOL_H
-- 
GitLab


From 7acdfcbc7c38fe41265aaee77d0c213436c76a74 Mon Sep 17 00:00:00 2001
From: sutt <sutt@cern.ch>
Date: Tue, 24 May 2022 10:54:08 +0200
Subject: [PATCH 11/11] give me strength !

---
 .../HLTSeeding/src/RoiUpdaterTool.cxx         | 34 +++++++++----------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/Trigger/TrigSteer/HLTSeeding/src/RoiUpdaterTool.cxx b/Trigger/TrigSteer/HLTSeeding/src/RoiUpdaterTool.cxx
index d609228dda03..c7118b7212f0 100644
--- a/Trigger/TrigSteer/HLTSeeding/src/RoiUpdaterTool.cxx
+++ b/Trigger/TrigSteer/HLTSeeding/src/RoiUpdaterTool.cxx
@@ -32,24 +32,24 @@ StatusCode RoiUpdaterTool::initialize()  {
 
 void zrange( double nsigma, double fence, double& zed, double& zedMinus, double& zedPlus, const SG::ReadCondHandleKey<InDet::BeamSpotData>& bs, const EventContext& ctx ) { 
 
-      SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle( bs, ctx );
-
-      uint32_t bitmap = beamSpotHandle->beamStatus();
-         
-      /// 0x4 is the online flag - 0x7 is presumably converged online
-      if ( ( (bitmap & 0x7) == 0x7 ) || !(bitmap & 0x4) ) { 
-	double zsigma = beamSpotHandle->beamSigma(2);
-	double zpos   = beamSpotHandle->beamPos()[2];
-	
-	zed      = zpos; /// technically, updating the z position itself should not be needed
-	zedMinus = zpos - nsigma*zsigma - fence;
-	zedPlus  = zpos + nsigma*zsigma + fence;
-      }
-      else { 
-	zedMinus = -RoiDescriptor::zedWidthDefault();     
-	zedPlus  =  RoiDescriptor::zedWidthDefault();  	
-      }
+  SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle( bs, ctx );
 
+  uint32_t bitmap = beamSpotHandle->beamStatus();
+  
+  /// 0x4 is the online flag - 0x7 is presumably converged online
+  if ( ( (bitmap & 0x7) == 0x7 ) || !(bitmap & 0x4) ) { 
+    double zsigma = beamSpotHandle->beamSigma(2);
+    double zpos   = beamSpotHandle->beamPos()[2];
+    
+    zed      = zpos; /// technically, updating the z position itself should not be needed
+    zedMinus = zpos - nsigma*zsigma - fence;
+    zedPlus  = zpos + nsigma*zsigma + fence;
+  }
+  else { 
+    zedMinus = -RoiDescriptor::zedWidthDefault();     
+    zedPlus  =  RoiDescriptor::zedWidthDefault();  	
+  }
+  
 }
 
 
-- 
GitLab