From e851aab10bd1916c959d3221e4124498272ba6fb Mon Sep 17 00:00:00 2001
From: schaffer <R.D.Schaffer@cern.ch>
Date: Wed, 22 Apr 2020 18:22:22 +0200
Subject: [PATCH] added solenoidOn/toroidOn to AtlasFieldCache for clients, and
 removed excess execute_r from previous MR

---
 .../MagFieldElements/MagFieldElements/AtlasFieldCache.h     | 6 +++++-
 .../MuonCalibPatRec/MuonSegmentToCalibSegment.h             | 3 ---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/MagneticField/MagFieldElements/MagFieldElements/AtlasFieldCache.h b/MagneticField/MagFieldElements/MagFieldElements/AtlasFieldCache.h
index c61d4e776d5..6e52e4c7e37 100644
--- a/MagneticField/MagFieldElements/MagFieldElements/AtlasFieldCache.h
+++ b/MagneticField/MagFieldElements/MagFieldElements/AtlasFieldCache.h
@@ -59,6 +59,10 @@ namespace MagField {
                                double* ATH_RESTRICT bxyz, 
                                double* ATH_RESTRICT deriv = nullptr);
     
+        /** status of the magnets */
+        bool solenoidOn() const { return m_fieldMap ? m_fieldMap->solenoidOn() : false; }
+        bool toroidOn() const   { return m_fieldMap ? m_fieldMap->toroidOn()   : false; }
+
     private:
     
         AtlasFieldCache(const AtlasFieldCache& other)             = delete;
@@ -105,7 +109,7 @@ bool
 MagField::AtlasFieldCache::fillFieldCache(double z, double r, double phi) 
 {
     // search for the zone
-    const BFieldZone* zone = m_fieldMap->findBFieldZone( z, r, phi );
+    const BFieldZone* zone = m_fieldMap ? m_fieldMap->findBFieldZone( z, r, phi ) : nullptr;
     if ( zone == nullptr ) {
         // outsize all zones
         return false;
diff --git a/MuonSpectrometer/MuonCalib/MuonCalibPatRec/MuonCalibPatRec/MuonSegmentToCalibSegment.h b/MuonSpectrometer/MuonCalib/MuonCalibPatRec/MuonCalibPatRec/MuonSegmentToCalibSegment.h
index 225baf1a2b8..35424b282b3 100644
--- a/MuonSpectrometer/MuonCalib/MuonCalibPatRec/MuonCalibPatRec/MuonSegmentToCalibSegment.h
+++ b/MuonSpectrometer/MuonCalib/MuonCalibPatRec/MuonCalibPatRec/MuonSegmentToCalibSegment.h
@@ -47,9 +47,6 @@ output the muon calibration input.
 
   private:
 
-    // temporary execute until migration to re-entrant alg  
-    StatusCode execute_r (const EventContext& ctx) const;
-      
     /** retrieve patterns and segments from storegate */
     //    const Muon::MuonSegmentCollection* retrieveSegments();
   
-- 
GitLab