From b3d00f3a98c579b1fbec27fb6c417bc731b26c90 Mon Sep 17 00:00:00 2001
From: Will Leight <wleight@cern.ch>
Date: Thu, 29 Nov 2018 11:29:33 +0100
Subject: [PATCH] Add beamspot to muon standalone setup

Set up access to beamspot data in MuonRec_myTopOptions.py (technically the MS-only setup doesn't need it, but the TrackParticleCreatorTool requires it).
---
 .../share/MuonRec_myTopOptions.py             | 22 ++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonRec_myTopOptions.py b/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonRec_myTopOptions.py
index ce15d0f0ccc..079463111a7 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonRec_myTopOptions.py
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonRec_myTopOptions.py
@@ -21,12 +21,26 @@ from MuonCombinedRecExample.MuonCombinedRecFlags import muonCombinedRecFlags
 
 from MuonRecExample import MuonRecUtils
 from MuonRecExample.MuonRecUtils import assertCastorStager,hasJobPropertyBeenSet
+
+#Need the beam spot for the TrackParticleCreator
+if not ('conddb' in dir()):
+    IOVDbSvc = Service("IOVDbSvc")
+    from IOVDbSvc.CondDB import conddb
+conddb.addFolderSplitOnline("INDET", "/Indet/Onl/Beampos", "/Indet/Beampos", className="AthenaAttributeList")
+
+from AthenaCommon.AlgSequence import AthSequencer
+condSeq = AthSequencer("AthCondSeq")
+if not hasattr(condSeq, "BeamSpotCondAlg"):
+   from BeamSpotConditions.BeamSpotConditionsConf import BeamSpotCondAlg
+   condSeq += BeamSpotCondAlg( "BeamSpotCondAlg" )
+
+
 #--------------------------------------------------------------------------------
 # Input
 #--------------------------------------------------------------------------------
-if not 'InputRdoFile' in dir():
-    InputRdoFile="root://eosatlas//eos/atlas/atlasgroupdisk/det-muon/dq2/rucio/user/zhidong/14/a2/user.zhidong.12100112.EXT0._000001.RDO.pool.root"
-athenaCommonFlags.FilesInput = [InputRdoFile]
+athenaCommonFlags.FilesInput = [
+"root://eosatlas//eos/atlas/atlasgroupdisk/det-muon/dq2/rucio/user/zhidong/14/a2/user.zhidong.12100112.EXT0._000001.RDO.pool.root"
+]
 
 if not hasJobPropertyBeenSet(athenaCommonFlags.FilesInput):
     athenaCommonFlags.FilesInput = MuonRecUtils.FileList.readDirectory("root://castoratlas//castor/cern.ch/atlas/atlascerngroupdisk/det-muon/ReferenceDatasets/Digitization/Zmumu_15616/")
@@ -56,8 +70,6 @@ rec.doTruth=True
 rec.doTrigger = False
 #recFlags.doTruth.set_Value_and_Lock(False)
 muonRecFlags.doStandalone.set_Value_and_Lock(True)
-# Read geometry alignment corrections from DB
-#muonRecFlags.useAlignmentCorrections = True
 muonRecFlags.doTrackPerformance    = True
 muonRecFlags.TrackPerfSummaryLevel = 2
 muonRecFlags.TrackPerfDebugLevel   = 5
-- 
GitLab