From b63e4fc5bf999c53b7679bdfbb6bec5a963fc204 Mon Sep 17 00:00:00 2001
From: Sara Alderweireldt <sara.alderweireldt@cern.ch>
Date: Wed, 22 Aug 2018 12:10:42 +0000
Subject: [PATCH] Merge branch 'Temp' into '21.1-dev'

bug fix for no RPC events + *remove RPC*

See merge request atlas/athena!13616

(cherry picked from commit d28d26fe5e6619bc097e738450dbe8f87b794fec [formerly 48f82b77c6e404d562ad3e8ceaef4f3e36e88c60])

123c5fda bug fix for no RPC events + *remove RPC*
12892842 add flag to control emulation of no RPC hit events

Former-commit-id: 16e531bdd81a6bf312843bb7bd1e959e4a0558ea
---
 .../TrigL2MuonSA/RpcDataPreparator.h          |  1 +
 .../TrigL2MuonSA/src/MdtRegionDefiner.cxx     |  4 +--
 .../TrigL2MuonSA/src/MuFastDataPreparator.cxx |  2 +-
 .../TrigL2MuonSA/src/RpcDataPreparator.cxx    |  4 +++
 .../TrigL2MuonSA/src/RpcRoadDefiner.cxx       | 25 +++++++++++++------
 5 files changed, 26 insertions(+), 10 deletions(-)

diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/RpcDataPreparator.h b/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/RpcDataPreparator.h
index 839514a5f26..e92d1a6fe07 100644
--- a/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/RpcDataPreparator.h
+++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/RpcDataPreparator.h
@@ -105,6 +105,7 @@ class RpcDataPreparator: public AthAlgTool
 
       bool m_use_RoIBasedDataAccess;
       bool m_isFakeRoi;
+      bool m_emulateNoRpcHit;
 };
 
 } // namespace TrigL2MuonSA
diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtRegionDefiner.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtRegionDefiner.cxx
index 490b8a38dfa..ce6b88080d5 100644
--- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtRegionDefiner.cxx
+++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtRegionDefiner.cxx
@@ -476,8 +476,8 @@ void TrigL2MuonSA::MdtRegionDefiner::find_phi_min_max(float phiMiddle, float& ph
 void TrigL2MuonSA::MdtRegionDefiner::find_eta_min_max(float zMin, float rMin, float zMax, float rMax,
 						      float& etaMin, float& etaMax)
 {   
-   const bool doEmulateMuFast = true;
-   // const bool doEmulateMuFast = false;
+   // const bool doEmulateMuFast = true;
+   const bool doEmulateMuFast = false;
 
    etaMin = 0.;
    etaMax = 0.;
diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastDataPreparator.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastDataPreparator.cxx
index 08a8d63a2d2..edda46791f3 100644
--- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastDataPreparator.cxx
+++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastDataPreparator.cxx
@@ -283,7 +283,7 @@ StatusCode TrigL2MuonSA::MuFastDataPreparator::prepareData(const LVL1::RecMuonRo
     }
   }
  
-  //m_recRPCRoiSvc->reconstruct((*p_roi)->roiWord());
+  m_recRPCRoiSvc->reconstruct(p_roi->roiWord());
   double roiEtaMinLow = 0.;
   double roiEtaMaxLow = 0.;
   double roiEtaMinHigh = 0.;
diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcDataPreparator.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcDataPreparator.cxx
index 1d91362e76a..71bc93b4201 100644
--- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcDataPreparator.cxx
+++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcDataPreparator.cxx
@@ -49,6 +49,7 @@ TrigL2MuonSA::RpcDataPreparator::RpcDataPreparator(const std::string& type,
 {
    declareInterface<TrigL2MuonSA::RpcDataPreparator>(this);
    declareProperty("RpcPrepDataProvider", m_rpcPrepDataProvider);
+   declareProperty("EmulateNoRpcHit", m_emulateNoRpcHit=false);
 }
 
 // --------------------------------------------------------------------------------
@@ -170,6 +171,9 @@ StatusCode TrigL2MuonSA::RpcDataPreparator::prepareData(const TrigRoiDescriptor*
   // set to false the flag indicating whether the roi is a fake one.
   m_isFakeRoi = false;
 
+  if( m_emulateNoRpcHit )
+    return StatusCode::SUCCESS;
+
   // check the roi ID
   
   //  decode  roIWord
diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcRoadDefiner.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcRoadDefiner.cxx
index db8e8bafe3c..fd1a9279f36 100644
--- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcRoadDefiner.cxx
+++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcRoadDefiner.cxx
@@ -154,13 +154,24 @@ StatusCode TrigL2MuonSA::RpcRoadDefiner::defineRoad(const LVL1::RecMuonRoI*
   
   for (int i_station=0; i_station<6; i_station++) {
     for (int i_layer=0; i_layer<8; i_layer++) {
-      if (i_station==0)      muonRoad.rWidth[i_station][i_layer] = 400;//for inner
-      else if (i_station==1) muonRoad.rWidth[i_station][i_layer] = 200;//for middle
-      else if (i_station==2) muonRoad.rWidth[i_station][i_layer] = 400;//for outer
-      else if (i_station==3) muonRoad.rWidth[i_station][i_layer] = 400;//EndcapInner
-      else if (i_station==4) muonRoad.rWidth[9][i_layer] = m_rWidth_RPC_Failed;//BME
-      else if (i_station==5) muonRoad.rWidth[10][i_layer] = m_rWidth_RPC_Failed;//BMG
-      else muonRoad.rWidth[i_station][i_layer] = m_rWidth_RPC_Failed;
+      if(!rpcFitResult.isSuccess) {
+	if (i_station==0)      muonRoad.rWidth[i_station][i_layer] = 500;//for inner
+	else if (i_station==1) muonRoad.rWidth[i_station][i_layer] = 650;//for middle
+	else if (i_station==2) muonRoad.rWidth[i_station][i_layer] = 800;//for outer
+	else if (i_station==3) muonRoad.rWidth[i_station][i_layer] = 500;//EndcapInner
+	else if (i_station==4) muonRoad.rWidth[9][i_layer] = 650;//BME
+	else if (i_station==5) muonRoad.rWidth[10][i_layer] = 650;//BMG
+	else muonRoad.rWidth[i_station][i_layer] = m_rWidth_RPC_Failed;
+      }
+      else {
+	if (i_station==0)      muonRoad.rWidth[i_station][i_layer] = 400;//for inner
+	else if (i_station==1) muonRoad.rWidth[i_station][i_layer] = 200;//for middle
+	else if (i_station==2) muonRoad.rWidth[i_station][i_layer] = 400;//for outer
+	else if (i_station==3) muonRoad.rWidth[i_station][i_layer] = 400;//EndcapInner
+	else if (i_station==4) muonRoad.rWidth[9][i_layer] = m_rWidth_RPC_Failed;//BME
+	else if (i_station==5) muonRoad.rWidth[10][i_layer] = m_rWidth_RPC_Failed;//BMG
+	else muonRoad.rWidth[i_station][i_layer] = m_rWidth_RPC_Failed;
+      }
     }
   }
   
-- 
GitLab