From 1d8fbc34c472dc1d8d0d5d346ae569f74349e7f9 Mon Sep 17 00:00:00 2001
From: Dave Casper <dcasper@uci.edu>
Date: Mon, 5 Oct 2020 16:20:08 -0700
Subject: [PATCH] Create and use Faser MainServicesConfig.py

---
 .../python/MainServicesConfig.py              | 154 ++++++++++++++++++
 .../GeoModelTest/python/GeoModelTestConfig.py |   2 +-
 .../python/RDOReadExampleConfig.py            |   2 +-
 .../python/TrackerDataAccessExampleConfig.py  |   2 +-
 .../python/TriggerDataAccessExampleConfig.py  |   2 +-
 .../python/WaveformDataAccessExampleConfig.py |   2 +-
 .../python/WriteAlignmentConfig.py            |   2 +-
 .../FaserGeoModel/python/DipoleGMConfig.py    |   2 +-
 .../FaserGeoModel/python/GeoModelConfig.py    |   2 +-
 .../FaserGeoModel/python/SCTGMConfig.py       |   2 +-
 .../FaserGeoModel/python/ScintGMConfig.py     |   2 +-
 .../test/FaserGeometryConfig_EVNT_test.py     |   2 +-
 README.md                                     |   2 +-
 Simulation/G4Faser/G4FaserAlg/test/runG4.py   |   2 +-
 .../test/FaserISF_ServicesConfigNew_test.py   |   2 +-
 .../test/FaserSCT_DigitizationDbg.py          |   2 +-
 .../test/SCT_DigitizationConfigNew_test.py    |   2 +-
 .../test/FaserSCT_ClusterizationDbg.py        |   2 +-
 .../test/StatisticsDbg.py                     |   2 +-
 .../test/TrackerSpacePointFormationDbg.py     |   2 +-
 .../test/TruthSeededTrackFinderDbg.py         |   2 +-
 .../test/FaserActsExtrapolationAlg.py         |   2 +-
 .../test/FaserActsWriteTrackingGeometry.py    |   2 +-
 .../test/FaserActsKalmanFilterAlg.py          |   2 +-
 24 files changed, 177 insertions(+), 23 deletions(-)
 create mode 100644 Control/CalypsoConfiguration/python/MainServicesConfig.py

diff --git a/Control/CalypsoConfiguration/python/MainServicesConfig.py b/Control/CalypsoConfiguration/python/MainServicesConfig.py
new file mode 100644
index 00000000..447b89a4
--- /dev/null
+++ b/Control/CalypsoConfiguration/python/MainServicesConfig.py
@@ -0,0 +1,154 @@
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+
+from __future__ import print_function
+from AthenaConfiguration.ComponentFactory import CompFactory
+
+from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+AthSequencer=CompFactory.AthSequencer
+
+def MainServicesMiniCfg(loopMgr='AthenaEventLoopMgr', masterSequence='AthAlgSeq'):
+    #Mininmal basic config, just good enough for HelloWorld and alike
+    cfg=ComponentAccumulator(masterSequence)
+    cfg.setAsTopLevel()
+    cfg.setAppProperty('TopAlg',['AthSequencer/'+masterSequence])
+    cfg.setAppProperty('MessageSvcType', 'MessageSvc')
+    cfg.setAppProperty('EventLoop', loopMgr)
+    cfg.setAppProperty('ExtSvcCreates', 'False')
+    cfg.setAppProperty('JobOptionsSvcType', 'JobOptionsSvc')
+    cfg.setAppProperty('JobOptionsType', 'NONE')
+    cfg.setAppProperty('JobOptionsPostAction', '')
+    cfg.setAppProperty('JobOptionsPreAction', '')
+    cfg.setAppProperty('PrintAlgsSequence', True)
+    return cfg
+
+
+def MainServicesCfg(cfgFlags):
+    # Run a serial job for threads=0
+    LoopMgr = 'AthenaEventLoopMgr'
+    if cfgFlags.Concurrency.NumThreads>0:
+        if cfgFlags.Concurrency.NumConcurrentEvents==0:
+            # In a threaded job this will mess you up because no events will be processed
+            raise Exception("Requested Concurrency.NumThreads>0 and Concurrency.NumConcurrentEvents==0, which will not process events!")
+        LoopMgr = "AthenaHiveEventLoopMgr"
+
+    ########################################################################
+    # Core components needed for serial and threaded jobs
+    cfg=MainServicesMiniCfg(loopMgr=LoopMgr, masterSequence='AthMasterSeq')
+    cfg.setAppProperty('OutStreamType', 'AthenaOutputStream')
+
+    #Build standard sequences:
+    cfg.addSequence(AthSequencer('AthAlgEvtSeq',Sequential=True, StopOverride=True),parentName="AthMasterSeq") 
+    cfg.addSequence(AthSequencer('AthOutSeq',StopOverride=True),parentName="AthMasterSeq")
+
+    cfg.addSequence(AthSequencer('AthBeginSeq',Sequential=True),parentName='AthAlgEvtSeq')
+    cfg.addSequence(AthSequencer('AthAllAlgSeq',StopOverride=True),parentName='AthAlgEvtSeq') 
+
+    if cfgFlags.Concurrency.NumThreads==0:
+        # For serial execution, we need the CondAlgs to execute first.
+        cfg.addSequence(AthSequencer('AthCondSeq',StopOverride=True),parentName='AthAllAlgSeq')
+        cfg.addSequence(AthSequencer('AthAlgSeq',IgnoreFilterPassed=True,StopOverride=True),parentName='AthAllAlgSeq')
+    else:
+        # In MT, the order of execution is irrelevant (determined by data deps).
+        # We add the conditions sequence later such that the CondInputLoader gets
+        # initialized after all other user Algorithms for MT, so the base classes
+        # of data deps can be correctly determined. 
+        cfg.addSequence(AthSequencer('AthAlgSeq',IgnoreFilterPassed=True,StopOverride=True),parentName='AthAllAlgSeq')
+        cfg.addSequence(AthSequencer('AthCondSeq',StopOverride=True),parentName='AthAllAlgSeq')
+
+    cfg.addSequence(AthSequencer('AthEndSeq',Sequential=True),parentName='AthAlgEvtSeq') 
+    cfg.setAppProperty('PrintAlgsSequence', True)
+    
+    #Set up incident firing:
+    AthIncFirerAlg=CompFactory.AthIncFirerAlg
+    IncidentProcAlg=CompFactory.IncidentProcAlg
+
+    cfg.addEventAlgo(AthIncFirerAlg("BeginIncFiringAlg",FireSerial=False,Incidents=['BeginEvent']),sequenceName='AthBeginSeq')
+    cfg.addEventAlgo(IncidentProcAlg('IncidentProcAlg1'),sequenceName='AthBeginSeq')
+
+    cfg.addEventAlgo(AthIncFirerAlg('EndIncFiringAlg',FireSerial=False,Incidents=['EndEvent']), sequenceName="AthEndSeq")
+    cfg.addEventAlgo(IncidentProcAlg('IncidentProcAlg2'),sequenceName="AthEndSeq")
+
+    #Basic services:
+    ClassIDSvc=CompFactory.ClassIDSvc
+    cfg.addService(ClassIDSvc(CLIDDBFiles= ['clid.db',"Gaudi_clid.db" ]))
+
+    StoreGateSvc=CompFactory.StoreGateSvc
+    cfg.addService(StoreGateSvc())
+    cfg.addService(StoreGateSvc("DetectorStore"))
+    cfg.addService(StoreGateSvc("HistoryStore"))
+    cfg.addService(StoreGateSvc("ConditionStore"))
+
+    from FaserGeoModel.GeoModelConfig import GeoModelCfg
+    cfg.merge( GeoModelCfg(cfgFlags) )
+    cfg.addService(CompFactory.DetDescrCnvSvc(), create=True)
+    cfg.addService(CompFactory.CoreDumpSvc(), create=True)
+
+    cfg.setAppProperty('InitializationLoopCheck',False)
+
+    cfg.setAppProperty('EvtMax',cfgFlags.Exec.MaxEvents)
+
+    msgsvc=CompFactory.MessageSvc()
+    msgsvc.OutputLevel=cfgFlags.Exec.OutputLevel
+    cfg.addService(msgsvc)
+
+    if cfgFlags.Exec.DebugStage != "":
+        cfg.setDebugStage(cfgFlags.Exec.DebugStage)
+
+
+    ########################################################################
+    # Additional components needed for threaded jobs only
+    if cfgFlags.Concurrency.NumThreads>0:
+
+        # Migrated code from AtlasThreadedJob.py
+        AuditorSvc=CompFactory.AuditorSvc
+        msgsvc.defaultLimit = 0
+        msgsvc.Format = "% F%40W%S%4W%R%e%s%8W%R%T %0W%M"
+
+        SG__HiveMgrSvc=CompFactory.SG.HiveMgrSvc
+        hivesvc = SG__HiveMgrSvc("EventDataSvc")
+        hivesvc.NSlots = cfgFlags.Concurrency.NumConcurrentEvents
+        cfg.addService( hivesvc )
+
+        AlgResourcePool=CompFactory.AlgResourcePool
+        from AthenaCommon.Constants import INFO
+        arp=AlgResourcePool( OutputLevel = INFO )
+        arp.TopAlg=["AthMasterSeq"] #this should enable control flow
+        cfg.addService( arp )
+
+        AvalancheSchedulerSvc=CompFactory.AvalancheSchedulerSvc
+        scheduler = AvalancheSchedulerSvc()
+        scheduler.CheckDependencies    = cfgFlags.Scheduler.CheckDependencies
+        scheduler.ShowDataDependencies = cfgFlags.Scheduler.ShowDataDeps
+        scheduler.ShowDataFlow         = cfgFlags.Scheduler.ShowDataFlow
+        scheduler.ShowControlFlow      = cfgFlags.Scheduler.ShowControlFlow
+        scheduler.ThreadPoolSize       = cfgFlags.Concurrency.NumThreads
+        cfg.addService(scheduler)
+
+        SGInputLoader=CompFactory.SGInputLoader
+        # FailIfNoProxy=False makes it a warning, not an error, if unmet data
+        # dependencies are not found in the store.  It should probably be changed
+        # to True eventually.
+        inputloader = SGInputLoader (FailIfNoProxy = False)
+        cfg.addEventAlgo( inputloader, "AthAlgSeq" )
+        scheduler.DataLoaderAlg = inputloader.getName()
+
+        AthenaHiveEventLoopMgr=CompFactory.AthenaHiveEventLoopMgr
+
+        elmgr = AthenaHiveEventLoopMgr()
+        elmgr.WhiteboardSvc = "EventDataSvc"
+        elmgr.SchedulerSvc = scheduler.getName()
+        cfg.addService( elmgr )
+
+        # enable timeline recording
+        TimelineSvc=CompFactory.TimelineSvc
+        cfg.addService( TimelineSvc( RecordTimeline = True, Partial = False ) )
+
+        #
+        ## Setup SGCommitAuditor to sweep new DataObjects at end of Alg execute
+        #
+        SGCommitAuditor=CompFactory.SGCommitAuditor
+        cfg.addService( AuditorSvc(Auditors=[SGCommitAuditor().getFullJobOptName(),]))
+        cfg.setAppProperty("AuditAlgorithms", True)
+
+    return cfg
+    
diff --git a/Control/CalypsoExample/GeoModelTest/python/GeoModelTestConfig.py b/Control/CalypsoExample/GeoModelTest/python/GeoModelTestConfig.py
index 9f96c024..20fe76c9 100644
--- a/Control/CalypsoExample/GeoModelTest/python/GeoModelTestConfig.py
+++ b/Control/CalypsoExample/GeoModelTest/python/GeoModelTestConfig.py
@@ -66,7 +66,7 @@ if __name__ == "__main__":
     ConfigFlags.lock()
 
 # Configure components
-    from AthenaConfiguration.MainServicesConfig import MainServicesCfg
+    from CalypsoConfiguration.MainServicesConfig import MainServicesCfg
     acc = MainServicesCfg(ConfigFlags)
 
 # Set things up to create a conditions DB with neutral Tracker alignment transforms
diff --git a/Control/CalypsoExample/RDOReadExample/python/RDOReadExampleConfig.py b/Control/CalypsoExample/RDOReadExample/python/RDOReadExampleConfig.py
index 0b01cd33..e94f6364 100644
--- a/Control/CalypsoExample/RDOReadExample/python/RDOReadExampleConfig.py
+++ b/Control/CalypsoExample/RDOReadExample/python/RDOReadExampleConfig.py
@@ -33,7 +33,7 @@ if __name__ == "__main__":
     ConfigFlags.lock()
 
 # Configure components
-    from AthenaConfiguration.MainServicesConfig import MainServicesCfg
+    from CalypsoConfiguration.MainServicesConfig import MainServicesCfg
     from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
     acc = MainServicesCfg(ConfigFlags)
     acc.merge(PoolReadCfg(ConfigFlags))
diff --git a/Control/CalypsoExample/TrackerDataAccessExample/python/TrackerDataAccessExampleConfig.py b/Control/CalypsoExample/TrackerDataAccessExample/python/TrackerDataAccessExampleConfig.py
index 48ec2674..e54397f4 100644
--- a/Control/CalypsoExample/TrackerDataAccessExample/python/TrackerDataAccessExampleConfig.py
+++ b/Control/CalypsoExample/TrackerDataAccessExample/python/TrackerDataAccessExampleConfig.py
@@ -41,7 +41,7 @@ if __name__ == "__main__":
     ConfigFlags.lock()
 
 # Configure components
-    from AthenaConfiguration.MainServicesConfig import MainServicesCfg
+    from CalypsoConfiguration.MainServicesConfig import MainServicesCfg
     from AthenaPoolCnvSvc.PoolWriteConfig import PoolWriteCfg
     
     acc = MainServicesCfg(ConfigFlags)
diff --git a/Control/CalypsoExample/TriggerDataAccessExample/python/TriggerDataAccessExampleConfig.py b/Control/CalypsoExample/TriggerDataAccessExample/python/TriggerDataAccessExampleConfig.py
index 70c2f3bf..5de3a332 100644
--- a/Control/CalypsoExample/TriggerDataAccessExample/python/TriggerDataAccessExampleConfig.py
+++ b/Control/CalypsoExample/TriggerDataAccessExample/python/TriggerDataAccessExampleConfig.py
@@ -41,7 +41,7 @@ if __name__ == "__main__":
     ConfigFlags.lock()
 
 # Configure components
-    from AthenaConfiguration.MainServicesConfig import MainServicesCfg
+    from CalypsoConfiguration.MainServicesConfig import MainServicesCfg
     from AthenaPoolCnvSvc.PoolWriteConfig import PoolWriteCfg
     
     acc = MainServicesCfg(ConfigFlags)
diff --git a/Control/CalypsoExample/WaveformDataAccessExample/python/WaveformDataAccessExampleConfig.py b/Control/CalypsoExample/WaveformDataAccessExample/python/WaveformDataAccessExampleConfig.py
index ed97248d..91a59126 100644
--- a/Control/CalypsoExample/WaveformDataAccessExample/python/WaveformDataAccessExampleConfig.py
+++ b/Control/CalypsoExample/WaveformDataAccessExample/python/WaveformDataAccessExampleConfig.py
@@ -41,7 +41,7 @@ if __name__ == "__main__":
     ConfigFlags.lock()
 
 # Configure components
-    from AthenaConfiguration.MainServicesConfig import MainServicesCfg
+    from CalypsoConfiguration.MainServicesConfig import MainServicesCfg
     from AthenaPoolCnvSvc.PoolWriteConfig import PoolWriteCfg
     
     acc = MainServicesCfg(ConfigFlags)
diff --git a/Control/CalypsoExample/WriteAlignment/python/WriteAlignmentConfig.py b/Control/CalypsoExample/WriteAlignment/python/WriteAlignmentConfig.py
index ac23e5c3..a1944cee 100644
--- a/Control/CalypsoExample/WriteAlignment/python/WriteAlignmentConfig.py
+++ b/Control/CalypsoExample/WriteAlignment/python/WriteAlignmentConfig.py
@@ -58,7 +58,7 @@ if __name__ == "__main__":
     ConfigFlags.lock()
 
 # Configure components
-    from AthenaConfiguration.MainServicesConfig import MainServicesCfg
+    from CalypsoConfiguration.MainServicesConfig import MainServicesCfg
     acc = MainServicesCfg(ConfigFlags)
 
 # Set things up to create a conditions DB with neutral Tracker alignment transforms
diff --git a/DetectorDescription/GeoModel/FaserGeoModel/python/DipoleGMConfig.py b/DetectorDescription/GeoModel/FaserGeoModel/python/DipoleGMConfig.py
index 6593f728..32c67118 100644
--- a/DetectorDescription/GeoModel/FaserGeoModel/python/DipoleGMConfig.py
+++ b/DetectorDescription/GeoModel/FaserGeoModel/python/DipoleGMConfig.py
@@ -17,7 +17,7 @@ if __name__ == "__main__":
   from AthenaCommon.Constants import DEBUG
   from AthenaCommon.Configurable import Configurable
   from CalypsoConfiguration.AllConfigFlags import ConfigFlags
-  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
+  from CalypsoConfiguration.MainServicesConfig import MainServicesCfg
   from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
   # Set up logging and new style config
   log.setLevel(DEBUG)
diff --git a/DetectorDescription/GeoModel/FaserGeoModel/python/GeoModelConfig.py b/DetectorDescription/GeoModel/FaserGeoModel/python/GeoModelConfig.py
index 907eae5b..d4bcd520 100644
--- a/DetectorDescription/GeoModel/FaserGeoModel/python/GeoModelConfig.py
+++ b/DetectorDescription/GeoModel/FaserGeoModel/python/GeoModelConfig.py
@@ -26,7 +26,7 @@ def GeoModelCfg(configFlags):
     if configFlags.Detector.Simulate:
         ## Protects GeoModelSvc in the simulation from the AlignCallbacks
         gms.AlignCallbacks = False
-    result.addService(gms,primary=True)
+    result.addService(gms,primary=True,create=True)
 
 
     #Get DetDescrCnvSvc (for identifier dictionaries (identifier helpers)
diff --git a/DetectorDescription/GeoModel/FaserGeoModel/python/SCTGMConfig.py b/DetectorDescription/GeoModel/FaserGeoModel/python/SCTGMConfig.py
index cc8e5051..fcc96ff8 100644
--- a/DetectorDescription/GeoModel/FaserGeoModel/python/SCTGMConfig.py
+++ b/DetectorDescription/GeoModel/FaserGeoModel/python/SCTGMConfig.py
@@ -16,7 +16,7 @@ if __name__ == "__main__":
   from AthenaCommon.Constants import DEBUG
   from AthenaCommon.Configurable import Configurable
   from CalypsoConfiguration.AllConfigFlags import ConfigFlags
-  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
+  from CalypsoConfiguration.MainServicesConfig import MainServicesCfg
   from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
   # Set up logging and new style config
   log.setLevel(DEBUG)
diff --git a/DetectorDescription/GeoModel/FaserGeoModel/python/ScintGMConfig.py b/DetectorDescription/GeoModel/FaserGeoModel/python/ScintGMConfig.py
index abc23011..e78a59b9 100644
--- a/DetectorDescription/GeoModel/FaserGeoModel/python/ScintGMConfig.py
+++ b/DetectorDescription/GeoModel/FaserGeoModel/python/ScintGMConfig.py
@@ -25,7 +25,7 @@ if __name__ == "__main__":
   from AthenaCommon.Constants import DEBUG
   from AthenaCommon.Configurable import Configurable
   from AthenaConfiguration.AllConfigFlags import ConfigFlags
-  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
+  from CalypsoConfiguration.MainServicesConfig import MainServicesCfg
   from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
   # Set up logging and new style config
   log.setLevel(DEBUG)
diff --git a/DetectorDescription/GeoModel/FaserGeoModel/test/FaserGeometryConfig_EVNT_test.py b/DetectorDescription/GeoModel/FaserGeoModel/test/FaserGeometryConfig_EVNT_test.py
index 5563398d..4fd94d72 100644
--- a/DetectorDescription/GeoModel/FaserGeoModel/test/FaserGeometryConfig_EVNT_test.py
+++ b/DetectorDescription/GeoModel/FaserGeoModel/test/FaserGeometryConfig_EVNT_test.py
@@ -10,7 +10,7 @@ if __name__ == "__main__":
     from AthenaCommon.Constants import VERBOSE, INFO
     from AthenaCommon.Configurable import Configurable
     from CalypsoConfiguration.AllConfigFlags import ConfigFlags
-    from AthenaConfiguration.MainServicesConfig import MainServicesCfg
+    from CalypsoConfiguration.MainServicesConfig import MainServicesCfg
     from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
     # Set up logging and new style config
     from FaserGeoModel.FaserGeoModelConfig import FaserGeometryCfg
diff --git a/README.md b/README.md
index 7b6282d1..d0d61975 100644
--- a/README.md
+++ b/README.md
@@ -10,7 +10,7 @@ git clone --recursive https://:@gitlab.cern.ch:8443/$USERNAME/calypso.git
 #The next three lines are used to setup the ATLAS release environment
 export ATLAS_LOCAL_ROOT_BASE=/cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase 
 source ${ATLAS_LOCAL_ROOT_BASE}/user/atlasLocalSetup.sh
-asetup --input=calypso/asetup.faser master,latest,Athena
+asetup --input=calypso/asetup.faser Athena,22.0.18
 
 #create build directory
 mkdir build
diff --git a/Simulation/G4Faser/G4FaserAlg/test/runG4.py b/Simulation/G4Faser/G4FaserAlg/test/runG4.py
index 257b07a2..88c0c4be 100644
--- a/Simulation/G4Faser/G4FaserAlg/test/runG4.py
+++ b/Simulation/G4Faser/G4FaserAlg/test/runG4.py
@@ -13,7 +13,7 @@ if __name__ == "__main__":
     from AthenaCommon.Constants import VERBOSE, INFO
     from AthenaCommon.Configurable import Configurable
     from CalypsoConfiguration.AllConfigFlags import ConfigFlags
-    from AthenaConfiguration.MainServicesConfig import MainServicesCfg
+    from CalypsoConfiguration.MainServicesConfig import MainServicesCfg
     from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
     from McEventSelector.McEventSelectorConfig import McEventSelectorCfg
     from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
diff --git a/Simulation/ISF/ISF_Core/FaserISF_Services/test/FaserISF_ServicesConfigNew_test.py b/Simulation/ISF/ISF_Core/FaserISF_Services/test/FaserISF_ServicesConfigNew_test.py
index e32a6a81..828aef6d 100644
--- a/Simulation/ISF/ISF_Core/FaserISF_Services/test/FaserISF_ServicesConfigNew_test.py
+++ b/Simulation/ISF/ISF_Core/FaserISF_Services/test/FaserISF_ServicesConfigNew_test.py
@@ -4,7 +4,7 @@
 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 """
 if __name__ == '__main__':
-  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
+  from CalypsoConfiguration.MainServicesConfig import MainServicesCfg
   import os
 
   # Set up logging and config behaviour
diff --git a/Tracker/TrackerDigitization/FaserSCT_Digitization/test/FaserSCT_DigitizationDbg.py b/Tracker/TrackerDigitization/FaserSCT_Digitization/test/FaserSCT_DigitizationDbg.py
index b1832fd2..b4715bf9 100644
--- a/Tracker/TrackerDigitization/FaserSCT_Digitization/test/FaserSCT_DigitizationDbg.py
+++ b/Tracker/TrackerDigitization/FaserSCT_Digitization/test/FaserSCT_DigitizationDbg.py
@@ -9,7 +9,7 @@ from AthenaCommon.Constants import DEBUG, VERBOSE, INFO
 from AthenaCommon.Configurable import Configurable
 from CalypsoConfiguration.AllConfigFlags import ConfigFlags
 from AthenaConfiguration.TestDefaults import defaultTestFiles
-from AthenaConfiguration.MainServicesConfig import MainServicesCfg
+from CalypsoConfiguration.MainServicesConfig import MainServicesCfg
 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
 from AthenaPoolCnvSvc.PoolWriteConfig import PoolWriteCfg
 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
diff --git a/Tracker/TrackerDigitization/FaserSCT_Digitization/test/SCT_DigitizationConfigNew_test.py b/Tracker/TrackerDigitization/FaserSCT_Digitization/test/SCT_DigitizationConfigNew_test.py
index 9f111942..b880cc07 100644
--- a/Tracker/TrackerDigitization/FaserSCT_Digitization/test/SCT_DigitizationConfigNew_test.py
+++ b/Tracker/TrackerDigitization/FaserSCT_Digitization/test/SCT_DigitizationConfigNew_test.py
@@ -8,7 +8,7 @@ from AthenaCommon.Constants import DEBUG
 from AthenaCommon.Configurable import Configurable
 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 from AthenaConfiguration.AllConfigFlags import ConfigFlags
-from AthenaConfiguration.MainServicesConfig import MainServicesCfg
+from CalypsoConfiguration.MainServicesConfig import MainServicesCfg
 from AthenaConfiguration.TestDefaults import defaultTestFiles
 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
 from AtlasGeoModel.InDetGMConfig import InDetGeometryCfg
diff --git a/Tracker/TrackerRecAlgs/TrackerPrepRawDataFormation/test/FaserSCT_ClusterizationDbg.py b/Tracker/TrackerRecAlgs/TrackerPrepRawDataFormation/test/FaserSCT_ClusterizationDbg.py
index 8ba8dece..ee9db620 100644
--- a/Tracker/TrackerRecAlgs/TrackerPrepRawDataFormation/test/FaserSCT_ClusterizationDbg.py
+++ b/Tracker/TrackerRecAlgs/TrackerPrepRawDataFormation/test/FaserSCT_ClusterizationDbg.py
@@ -9,7 +9,7 @@ from AthenaCommon.Constants import DEBUG, VERBOSE, INFO
 from AthenaCommon.Configurable import Configurable
 from CalypsoConfiguration.AllConfigFlags import ConfigFlags
 from AthenaConfiguration.TestDefaults import defaultTestFiles
-from AthenaConfiguration.MainServicesConfig import MainServicesCfg
+from CalypsoConfiguration.MainServicesConfig import MainServicesCfg
 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
 from AthenaPoolCnvSvc.PoolWriteConfig import PoolWriteCfg
 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
diff --git a/Tracker/TrackerRecAlgs/TrackerSpacePointFormation/test/StatisticsDbg.py b/Tracker/TrackerRecAlgs/TrackerSpacePointFormation/test/StatisticsDbg.py
index 8b995c3c..1fb37bb3 100644
--- a/Tracker/TrackerRecAlgs/TrackerSpacePointFormation/test/StatisticsDbg.py
+++ b/Tracker/TrackerRecAlgs/TrackerSpacePointFormation/test/StatisticsDbg.py
@@ -9,7 +9,7 @@ from AthenaCommon.Constants import DEBUG, VERBOSE, INFO
 from AthenaCommon.Configurable import Configurable
 from CalypsoConfiguration.AllConfigFlags import ConfigFlags
 from AthenaConfiguration.TestDefaults import defaultTestFiles
-from AthenaConfiguration.MainServicesConfig import MainServicesCfg
+from CalypsoConfiguration.MainServicesConfig import MainServicesCfg
 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
 from AthenaPoolCnvSvc.PoolWriteConfig import PoolWriteCfg
 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
diff --git a/Tracker/TrackerRecAlgs/TrackerSpacePointFormation/test/TrackerSpacePointFormationDbg.py b/Tracker/TrackerRecAlgs/TrackerSpacePointFormation/test/TrackerSpacePointFormationDbg.py
index ad608c89..b7ac51e0 100644
--- a/Tracker/TrackerRecAlgs/TrackerSpacePointFormation/test/TrackerSpacePointFormationDbg.py
+++ b/Tracker/TrackerRecAlgs/TrackerSpacePointFormation/test/TrackerSpacePointFormationDbg.py
@@ -9,7 +9,7 @@ from AthenaCommon.Constants import DEBUG, VERBOSE, INFO
 from AthenaCommon.Configurable import Configurable
 from CalypsoConfiguration.AllConfigFlags import ConfigFlags
 from AthenaConfiguration.TestDefaults import defaultTestFiles
-from AthenaConfiguration.MainServicesConfig import MainServicesCfg
+from CalypsoConfiguration.MainServicesConfig import MainServicesCfg
 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
 from AthenaPoolCnvSvc.PoolWriteConfig import PoolWriteCfg
 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
diff --git a/Tracker/TrackerRecAlgs/TruthSeededTrackFinder/test/TruthSeededTrackFinderDbg.py b/Tracker/TrackerRecAlgs/TruthSeededTrackFinder/test/TruthSeededTrackFinderDbg.py
index eab4d204..cd284784 100644
--- a/Tracker/TrackerRecAlgs/TruthSeededTrackFinder/test/TruthSeededTrackFinderDbg.py
+++ b/Tracker/TrackerRecAlgs/TruthSeededTrackFinder/test/TruthSeededTrackFinderDbg.py
@@ -9,7 +9,7 @@ from AthenaCommon.Constants import DEBUG, VERBOSE, INFO
 from AthenaCommon.Configurable import Configurable
 from CalypsoConfiguration.AllConfigFlags import ConfigFlags
 from AthenaConfiguration.TestDefaults import defaultTestFiles
-from AthenaConfiguration.MainServicesConfig import MainServicesCfg
+from CalypsoConfiguration.MainServicesConfig import MainServicesCfg
 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
 from AthenaPoolCnvSvc.PoolWriteConfig import PoolWriteCfg
 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
diff --git a/Tracking/Acts/FaserActsGeometry/test/FaserActsExtrapolationAlg.py b/Tracking/Acts/FaserActsGeometry/test/FaserActsExtrapolationAlg.py
index 136742de..41a481b6 100644
--- a/Tracking/Acts/FaserActsGeometry/test/FaserActsExtrapolationAlg.py
+++ b/Tracking/Acts/FaserActsGeometry/test/FaserActsExtrapolationAlg.py
@@ -6,7 +6,7 @@ from AthenaCommon.Constants import DEBUG, VERBOSE, INFO
 from AthenaCommon.Configurable import Configurable
 from CalypsoConfiguration.AllConfigFlags import ConfigFlags
 from AthenaConfiguration.TestDefaults import defaultTestFiles
-from AthenaConfiguration.MainServicesConfig import MainServicesCfg
+from CalypsoConfiguration.MainServicesConfig import MainServicesCfg
 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
 from AthenaPoolCnvSvc.PoolWriteConfig import PoolWriteCfg
 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
diff --git a/Tracking/Acts/FaserActsGeometry/test/FaserActsWriteTrackingGeometry.py b/Tracking/Acts/FaserActsGeometry/test/FaserActsWriteTrackingGeometry.py
index d7aa806a..f2bc11f5 100644
--- a/Tracking/Acts/FaserActsGeometry/test/FaserActsWriteTrackingGeometry.py
+++ b/Tracking/Acts/FaserActsGeometry/test/FaserActsWriteTrackingGeometry.py
@@ -6,7 +6,7 @@ from AthenaCommon.Constants import DEBUG, VERBOSE, INFO
 from AthenaCommon.Configurable import Configurable
 from CalypsoConfiguration.AllConfigFlags import ConfigFlags
 from AthenaConfiguration.TestDefaults import defaultTestFiles
-from AthenaConfiguration.MainServicesConfig import MainServicesCfg
+from CalypsoConfiguration.MainServicesConfig import MainServicesCfg
 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
 from AthenaPoolCnvSvc.PoolWriteConfig import PoolWriteCfg
 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
diff --git a/Tracking/Acts/FaserActsKalmanFilter/test/FaserActsKalmanFilterAlg.py b/Tracking/Acts/FaserActsKalmanFilter/test/FaserActsKalmanFilterAlg.py
index 20e97d74..a0f8db8f 100644
--- a/Tracking/Acts/FaserActsKalmanFilter/test/FaserActsKalmanFilterAlg.py
+++ b/Tracking/Acts/FaserActsKalmanFilter/test/FaserActsKalmanFilterAlg.py
@@ -6,7 +6,7 @@ from AthenaCommon.Constants import DEBUG, VERBOSE, INFO
 from AthenaCommon.Configurable import Configurable
 from CalypsoConfiguration.AllConfigFlags import ConfigFlags
 from AthenaConfiguration.TestDefaults import defaultTestFiles
-from AthenaConfiguration.MainServicesConfig import MainServicesCfg
+from CalypsoConfiguration.MainServicesConfig import MainServicesCfg
 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
 from AthenaPoolCnvSvc.PoolWriteConfig import PoolWriteCfg
 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
-- 
GitLab