From 98f3962e77dac8c38d04f9e4c01a2a1dd7169c59 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicolas=20K=C3=B6hler?= <nicolas.koehler@cern.ch>
Date: Wed, 30 Sep 2020 20:45:31 +0200
Subject: [PATCH] add support to give muon layout when making NSW blob

---
 .../MuonAGDD/share/NSWAGDD_BlobProduction.py     | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDD/share/NSWAGDD_BlobProduction.py b/MuonSpectrometer/MuonDetDescr/MuonAGDD/share/NSWAGDD_BlobProduction.py
index fe429325a2c..3b525ada886 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonAGDD/share/NSWAGDD_BlobProduction.py
+++ b/MuonSpectrometer/MuonDetDescr/MuonAGDD/share/NSWAGDD_BlobProduction.py
@@ -1,11 +1,23 @@
 # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
+try:
+    if muonLayout:
+        from GeoModelSvc.GeoModelSvcConf import GeoModelSvc
+        GeoModelSvc = GeoModelSvc()
+        GeoModelSvc.MuonVersionOverride=muonLayout
+except NameError:
+    pass
+
 from MuonAGDD.MuonAGDDConfig import NSWAGDDTool
 NSWAGDDDumper = NSWAGDDTool(name="NSWAGDDDumper")
 NSWAGDDDumper.WriteAGDDFile=True # creates Out.AmdcOracle.AM.AGDDtemp.data and Out.AmdcOracle.AM.AGDD.PREsql
 NSWAGDDDumper.Locked=False
-NSWAGDDDumper.ReadAGDD=False # turn off reading from data base (true means read from DB)
-NSWAGDDDumper.XMLFiles=[input_nsw_xml]
+try:
+    if input_nsw_xml:
+        NSWAGDDDumper.ReadAGDD = False # turn off reading from data base (true means read from DB)
+        NSWAGDDDumper.XMLFiles=[input_nsw_xml]
+except NameError:
+    pass
 NSWAGDDDumper.Volumes=["NewSmallWheel"] # for the NSWAGDDTool volumes must always be given ("NewSmallWheel" usually includes everything)
 NSWAGDDDumper.DefaultDetector="Muon"
 
-- 
GitLab