From 8aa4211149beca7c22888b422330e295961dc19a Mon Sep 17 00:00:00 2001
From: Dave Casper <dcasper@uci.edu>
Date: Wed, 12 Feb 2020 22:25:58 +0000
Subject: [PATCH] Remove references to DCS field conditions

---
 .../GeoModelTest/python/GeoModelTestConfig.py |  31 +++--
 .../python/MagFieldServicesConfig.py          |   6 +-
 .../data/SCT_Conditions.py                    | 107 +++---------------
 .../python/FaserSCT_LorentzAngleConfig.py     |   2 +-
 .../src/FaserSCT_SiLorentzAngleCondAlg.cxx    |  77 ++++++-------
 .../src/FaserSCT_SiLorentzAngleCondAlg.h      |   6 +-
 6 files changed, 83 insertions(+), 146 deletions(-)

diff --git a/Control/CalypsoExample/GeoModelTest/python/GeoModelTestConfig.py b/Control/CalypsoExample/GeoModelTest/python/GeoModelTestConfig.py
index a4bd4c09..f65f88e3 100644
--- a/Control/CalypsoExample/GeoModelTest/python/GeoModelTestConfig.py
+++ b/Control/CalypsoExample/GeoModelTest/python/GeoModelTestConfig.py
@@ -1,25 +1,46 @@
 #!/usr/bin/env python
 import sys
+from AthenaCommon.Constants import VERBOSE, INFO
 
 def GeoModelTestCfg(flags, name="GeoModelTestAlg", **kwargs):
 
+    # Initialize GeoModel
     from FaserGeoModel.FaserGeoModelConfig import FaserGeometryCfg
     a = FaserGeometryCfg(flags)
 
+    # Initialize field service
     from MagFieldServices.MagFieldServicesConfig import MagneticFieldSvcCfg
     a.merge(MagneticFieldSvcCfg(flags))
     fieldSvc = a.getService("FaserFieldSvc")
 
+    # This section is to allow alignment to be written to a conditions DB file
+    from IOVDbSvc.IOVDbSvcConfig import IOVDbSvcCfg
+    result = IOVDbSvcCfg(flags)
+    iovDbSvc = result.getPrimary()
+    iovDbSvc.dbConnection="sqlite://;schema=ALLP200.db;dbname=OFLP200"
+    a.merge(result)
+
+    AthenaPoolCnvSvc=CompFactory.AthenaPoolCnvSvc
+    apcs=AthenaPoolCnvSvc()
+    a.addService(apcs)
+    EvtPersistencySvc=CompFactory.EvtPersistencySvc
+    a.addService(EvtPersistencySvc("EventPersistencySvc",CnvServices=[apcs.getFullJobOptName(),]))
+
+    a.addService(CompFactory.IOVRegistrationSvc(PayloadTable=False,OutputLevel=VERBOSE))
+
+    # Configure the algorithm itself
     from GeoModelTest.GeoModelTestConf import GeoModelTestAlg
+    outputTool = CompFactory.AthenaOutputStreamTool("DbStreamTool", OutputFile = "FaserSCT_AlignDb.pool.root")
+    alignDbTool = CompFactory.TrackerAlignDBTool("AlignDbTool", OutputTool = outputTool)
     a.addEventAlgo(GeoModelTestAlg(name, **kwargs))
     a.getEventAlgo(name).FieldService = fieldSvc
+    a.getEventAlgo(name).AlignDbTool = alignDbTool
 
     return a
 
 
 if __name__ == "__main__":
     # from AthenaCommon.Logging import log, logging
-    from AthenaCommon.Constants import VERBOSE, INFO
     from AthenaCommon.Configurable import Configurable
     from AthenaConfiguration.ComponentFactory import CompFactory
     from CalypsoConfiguration.AllConfigFlags import ConfigFlags
@@ -45,13 +66,7 @@ if __name__ == "__main__":
     acc = MainServicesSerialCfg()
 
 # Set things up to create a conditions DB with neutral Tracker alignment transforms
-    acc.merge(GeoModelTestCfg(ConfigFlags, 
-                              AlignDbTool=CompFactory.TrackerAlignDBTool("AlignDbTool", 
-                                        OutputTool = CompFactory.AthenaOutputStreamTool("DbStreamTool", 
-                                                         OutputFile = "FaserSCT_AlignDb.pool.root"))))
-    acc.addService(CompFactory.IOVRegistrationSvc(PayloadTable=False))
-    acc.getService("IOVRegistrationSvc").OutputLevel = VERBOSE
-    acc.getService("IOVDbSvc").dbConnection = "sqlite://;schema=ALLP200.db;dbname=OFLP200" 
+    acc.merge(GeoModelTestCfg(ConfigFlags))
 
 # Configure verbosity    
     # ConfigFlags.dump()
diff --git a/MagneticField/MagFieldServices/python/MagFieldServicesConfig.py b/MagneticField/MagFieldServices/python/MagFieldServicesConfig.py
index 28c510b9..7ef8dacd 100644
--- a/MagneticField/MagFieldServices/python/MagFieldServicesConfig.py
+++ b/MagneticField/MagFieldServices/python/MagFieldServicesConfig.py
@@ -34,7 +34,7 @@ def MagneticFieldSvcCfg(flags, **kwargs):
     result.addService(poolSvc)
     
     # initialise required conditions DB folders
-    from IOVDbSvc.IOVDbSvcConfig import addFolders
+    # from IOVDbSvc.IOVDbSvcConfig import addFolders
     
     # This handles addFolderSplitMC https://gitlab.cern.ch/atlas/athena/blob/master/Database/IOVDbSvc/python/CondDB.py#L240
     # i.e. replaces conddb.addFolderSplitMC('GLOBAL','/GLOBAL/BField/Maps <noover/>','/GLOBAL/BField/Maps <noover/>')
@@ -46,8 +46,8 @@ def MagneticFieldSvcCfg(flags, **kwargs):
         
     # result.merge(addFolders(flags,['/GLOBAL/BField/Maps <noover/>'],detDb=db) )
         
-    if not flags.Common.isOnline:
-        result.merge(addFolders(flags, ['/EXT/DCS/MAGNETS/SENSORDATA'], detDb='DCS_OFL', className="CondAttrListCollection") )
+    # if not flags.Common.isOnline:
+    #     result.merge(addFolders(flags, ['/EXT/DCS/MAGNETS/SENSORDATA'], detDb='DCS_OFL', className="CondAttrListCollection") )
 
     # if flags.Common.isOnline:
     #   kwargs.setdefault( "UseDCS", False )
diff --git a/Tracker/TrackerConditions/FaserSCT_ConditionsData/data/SCT_Conditions.py b/Tracker/TrackerConditions/FaserSCT_ConditionsData/data/SCT_Conditions.py
index b679b251..8b4e1fa5 100644
--- a/Tracker/TrackerConditions/FaserSCT_ConditionsData/data/SCT_Conditions.py
+++ b/Tracker/TrackerConditions/FaserSCT_ConditionsData/data/SCT_Conditions.py
@@ -6,9 +6,7 @@ description = '<timeStamp>run-lumi</timeStamp><addrHeader><address_header clid="
 
 descriptionDCS = '<timeStamp>time</timeStamp><addrHeader><address_header service_type="71" clid="1238547719" /></addrHeader><typeName>CondAttrListCollection</typeName><cache>600</cache>'
 
-# descriptionAlign = '<timeStamp>run-lumi</timeStamp><addrHeader><address_header service_type="71" clid="1170039409" /></addrHeader><typeName>AlignableTransformContainer</typeName>'
-
-descriptionMagnet = '<timeStamp>time</timeStamp><addrHeader><address_header service_type="71" clid="1238547719" /></addrHeader><typeName>CondAttrListCollection</typeName><cache>600</cache><named/>'
+# descriptionMagnet = '<timeStamp>time</timeStamp><addrHeader><address_header service_type="71" clid="1238547719" /></addrHeader><typeName>CondAttrListCollection</typeName><cache>600</cache><named/>'
 
 from PyCool import cool, coral
 
@@ -19,83 +17,6 @@ print 'recreating database'
 dbSvc.dropDatabase( connectString )
 db = dbSvc.createDatabase( connectString )
 
-# alignSpec = cool.RecordSpecification()
-# alignSpec.extend( 'PoolRef', cool.StorageType.String4k )
-
-# alignRecord = cool.Record(alignSpec)
-
-# alignFolderSpec = cool.FolderSpecification(alignSpec)
-# alignFolder = db.createFolder('/Tracker/Align', alignFolderSpec, descriptionAlign, True)
-
-# alignRecord[ 'PoolRef' ] = '[DB=D0709FD7-6A55-E011-925D-002481043EC0][CNT=CollectionTreeAlignableTransform][CLID=E779C6B5-3F2A-473E-B35E-6CCB345E0665][TECH=00000202][OID=00000003-00000000]'
-# alignFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, alignRecord, 0) 
-# alignRecord[ 'PoolRef' ] = '[DB=D0709FD7-6A55-E011-925D-002481043EC0][CNT=CollectionTreeAlignableTransform][CLID=E779C6B5-3F2A-473E-B35E-6CCB345E0665][TECH=00000202][OID=00000003-00000001]'
-# alignFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, alignRecord, 100) 
-# alignRecord[ 'PoolRef' ] = '[DB=D0709FD7-6A55-E011-925D-002481043EC0][CNT=CollectionTreeAlignableTransform][CLID=E779C6B5-3F2A-473E-B35E-6CCB345E0665][TECH=00000202][OID=00000003-00000002]'
-# alignFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, alignRecord, 101) 
-# alignRecord[ 'PoolRef' ] = '[DB=D0709FD7-6A55-E011-925D-002481043EC0][CNT=CollectionTreeAlignableTransform][CLID=E779C6B5-3F2A-473E-B35E-6CCB345E0665][TECH=00000202][OID=00000003-00000003]'
-# alignFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, alignRecord, 200) 
-# alignRecord[ 'PoolRef' ] = '[DB=D0709FD7-6A55-E011-925D-002481043EC0][CNT=CollectionTreeAlignableTransform][CLID=E779C6B5-3F2A-473E-B35E-6CCB345E0665][TECH=00000202][OID=00000003-00000004]'
-# alignFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, alignRecord, 201) 
-# alignRecord[ 'PoolRef' ] = '[DB=D0709FD7-6A55-E011-925D-002481043EC0][CNT=CollectionTreeAlignableTransform][CLID=E779C6B5-3F2A-473E-B35E-6CCB345E0665][TECH=00000202][OID=00000003-00000005]'
-# alignFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, alignRecord, 202) 
-# alignRecord[ 'PoolRef' ] = '[DB=D0709FD7-6A55-E011-925D-002481043EC0][CNT=CollectionTreeAlignableTransform][CLID=E779C6B5-3F2A-473E-B35E-6CCB345E0665][TECH=00000202][OID=00000003-00000006]'
-# alignFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, alignRecord, 203) 
-# alignRecord[ 'PoolRef' ] = '[DB=D0709FD7-6A55-E011-925D-002481043EC0][CNT=CollectionTreeAlignableTransform][CLID=E779C6B5-3F2A-473E-B35E-6CCB345E0665][TECH=00000202][OID=00000003-00000007]'
-# alignFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, alignRecord, 204) 
-# alignRecord[ 'PoolRef' ] = '[DB=D0709FD7-6A55-E011-925D-002481043EC0][CNT=CollectionTreeAlignableTransform][CLID=E779C6B5-3F2A-473E-B35E-6CCB345E0665][TECH=00000202][OID=00000003-00000008]'
-# alignFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, alignRecord, 205) 
-# alignRecord[ 'PoolRef' ] = '[DB=D0709FD7-6A55-E011-925D-002481043EC0][CNT=CollectionTreeAlignableTransform][CLID=E779C6B5-3F2A-473E-B35E-6CCB345E0665][TECH=00000202][OID=00000003-00000009]'
-# alignFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, alignRecord, 206) 
-# alignRecord[ 'PoolRef' ] = '[DB=D0709FD7-6A55-E011-925D-002481043EC0][CNT=CollectionTreeAlignableTransform][CLID=E779C6B5-3F2A-473E-B35E-6CCB345E0665][TECH=00000202][OID=00000003-0000000A]'
-# alignFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, alignRecord, 207) 
-# alignRecord[ 'PoolRef' ] = '[DB=D0709FD7-6A55-E011-925D-002481043EC0][CNT=CollectionTreeAlignableTransform][CLID=E779C6B5-3F2A-473E-B35E-6CCB345E0665][TECH=00000202][OID=00000003-0000000B]'
-# alignFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, alignRecord, 208) 
-# alignRecord[ 'PoolRef' ] = '[DB=D0709FD7-6A55-E011-925D-002481043EC0][CNT=CollectionTreeAlignableTransform][CLID=E779C6B5-3F2A-473E-B35E-6CCB345E0665][TECH=00000202][OID=00000003-0000000C]'
-# alignFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, alignRecord, 209) 
-# alignRecord[ 'PoolRef' ] = '[DB=D0709FD7-6A55-E011-925D-002481043EC0][CNT=CollectionTreeAlignableTransform][CLID=E779C6B5-3F2A-473E-B35E-6CCB345E0665][TECH=00000202][OID=00000003-0000000D]'
-# alignFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, alignRecord, 210) 
-# alignRecord[ 'PoolRef' ] = '[DB=D0709FD7-6A55-E011-925D-002481043EC0][CNT=CollectionTreeAlignableTransform][CLID=E779C6B5-3F2A-473E-B35E-6CCB345E0665][TECH=00000202][OID=00000003-0000000E]'
-# alignFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, alignRecord, 211) 
-# alignRecord[ 'PoolRef' ] = '[DB=D0709FD7-6A55-E011-925D-002481043EC0][CNT=CollectionTreeAlignableTransform][CLID=E779C6B5-3F2A-473E-B35E-6CCB345E0665][TECH=00000202][OID=00000003-0000000F]'
-# alignFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, alignRecord, 212) 
-# alignRecord[ 'PoolRef' ] = '[DB=D0709FD7-6A55-E011-925D-002481043EC0][CNT=CollectionTreeAlignableTransform][CLID=E779C6B5-3F2A-473E-B35E-6CCB345E0665][TECH=00000202][OID=00000003-00000010]'
-# alignFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, alignRecord, 213) 
-# alignRecord[ 'PoolRef' ] = '[DB=D0709FD7-6A55-E011-925D-002481043EC0][CNT=CollectionTreeAlignableTransform][CLID=E779C6B5-3F2A-473E-B35E-6CCB345E0665][TECH=00000202][OID=00000003-00000011]'
-# alignFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, alignRecord, 214) 
-# alignRecord[ 'PoolRef' ] = '[DB=D0709FD7-6A55-E011-925D-002481043EC0][CNT=CollectionTreeAlignableTransform][CLID=E779C6B5-3F2A-473E-B35E-6CCB345E0665][TECH=00000202][OID=00000003-00000012]'
-# alignFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, alignRecord, 215) 
-# alignRecord[ 'PoolRef' ] = '[DB=D0709FD7-6A55-E011-925D-002481043EC0][CNT=CollectionTreeAlignableTransform][CLID=E779C6B5-3F2A-473E-B35E-6CCB345E0665][TECH=00000202][OID=00000003-00000013]'
-# alignFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, alignRecord, 216) 
-# alignRecord[ 'PoolRef' ] = '[DB=D0709FD7-6A55-E011-925D-002481043EC0][CNT=CollectionTreeAlignableTransform][CLID=E779C6B5-3F2A-473E-B35E-6CCB345E0665][TECH=00000202][OID=00000003-00000014]'
-# alignFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, alignRecord, 217) 
-# alignRecord[ 'PoolRef' ] = '[DB=D0709FD7-6A55-E011-925D-002481043EC0][CNT=CollectionTreeAlignableTransform][CLID=E779C6B5-3F2A-473E-B35E-6CCB345E0665][TECH=00000202][OID=00000003-00000015]'
-# alignFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, alignRecord, 218) 
-# alignRecord[ 'PoolRef' ] = '[DB=D0709FD7-6A55-E011-925D-002481043EC0][CNT=CollectionTreeAlignableTransform][CLID=E779C6B5-3F2A-473E-B35E-6CCB345E0665][TECH=00000202][OID=00000003-00000016]'
-# alignFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, alignRecord, 219) 
-# alignRecord[ 'PoolRef' ] = '[DB=D0709FD7-6A55-E011-925D-002481043EC0][CNT=CollectionTreeAlignableTransform][CLID=E779C6B5-3F2A-473E-B35E-6CCB345E0665][TECH=00000202][OID=00000003-00000017]'
-# alignFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, alignRecord, 220) 
-# alignRecord[ 'PoolRef' ] = '[DB=D0709FD7-6A55-E011-925D-002481043EC0][CNT=CollectionTreeAlignableTransform][CLID=E779C6B5-3F2A-473E-B35E-6CCB345E0665][TECH=00000202][OID=00000003-00000018]'
-# alignFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, alignRecord, 221) 
-# alignRecord[ 'PoolRef' ] = '[DB=D0709FD7-6A55-E011-925D-002481043EC0][CNT=CollectionTreeAlignableTransform][CLID=E779C6B5-3F2A-473E-B35E-6CCB345E0665][TECH=00000202][OID=00000003-00000019]'
-# alignFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, alignRecord, 222) 
-# alignRecord[ 'PoolRef' ] = '[DB=D0709FD7-6A55-E011-925D-002481043EC0][CNT=CollectionTreeAlignableTransform][CLID=E779C6B5-3F2A-473E-B35E-6CCB345E0665][TECH=00000202][OID=00000003-0000001A]'
-# alignFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, alignRecord, 223) 
-# alignRecord[ 'PoolRef' ] = '[DB=D0709FD7-6A55-E011-925D-002481043EC0][CNT=CollectionTreeAlignableTransform][CLID=E779C6B5-3F2A-473E-B35E-6CCB345E0665][TECH=00000202][OID=00000003-0000001B]'
-# alignFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, alignRecord, 224) 
-# alignRecord[ 'PoolRef' ] = '[DB=D0709FD7-6A55-E011-925D-002481043EC0][CNT=CollectionTreeAlignableTransform][CLID=E779C6B5-3F2A-473E-B35E-6CCB345E0665][TECH=00000202][OID=00000003-0000001C]'
-# alignFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, alignRecord, 225) 
-# alignRecord[ 'PoolRef' ] = '[DB=D0709FD7-6A55-E011-925D-002481043EC0][CNT=CollectionTreeAlignableTransform][CLID=E779C6B5-3F2A-473E-B35E-6CCB345E0665][TECH=00000202][OID=00000003-0000001D]'
-# alignFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, alignRecord, 226) 
-# alignRecord[ 'PoolRef' ] = '[DB=D0709FD7-6A55-E011-925D-002481043EC0][CNT=CollectionTreeAlignableTransform][CLID=E779C6B5-3F2A-473E-B35E-6CCB345E0665][TECH=00000202][OID=00000003-0000001E]'
-# alignFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, alignRecord, 227) 
-# alignRecord[ 'PoolRef' ] = '[DB=D0709FD7-6A55-E011-925D-002481043EC0][CNT=CollectionTreeAlignableTransform][CLID=E779C6B5-3F2A-473E-B35E-6CCB345E0665][TECH=00000202][OID=00000003-0000001F]'
-# alignFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, alignRecord, 228) 
-# alignRecord[ 'PoolRef' ] = '[DB=D0709FD7-6A55-E011-925D-002481043EC0][CNT=CollectionTreeAlignableTransform][CLID=E779C6B5-3F2A-473E-B35E-6CCB345E0665][TECH=00000202][OID=00000003-00000020]'
-# alignFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, alignRecord, 229) 
-# alignRecord[ 'PoolRef' ] = '[DB=D0709FD7-6A55-E011-925D-002481043EC0][CNT=CollectionTreeAlignableTransform][CLID=E779C6B5-3F2A-473E-B35E-6CCB345E0665][TECH=00000202][OID=00000003-00000021]'
-# alignFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, alignRecord, 230) 
-
 gainSpec = cool.RecordSpecification()
 gainSpec.extend( 'serialNumber'          , cool.StorageType.UInt63 )
 gainSpec.extend( 'runNumber'             , cool.StorageType.UInt32 )
@@ -147,22 +68,22 @@ noiseFolder = db.createFolder('/SCT/DAQ/Calibration/ChipNoise', noiseFolderSpec,
 for channel in sctChannels:
     noiseFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, noiseRecord, int(channel) )
 
-magnetSpec = cool.RecordSpecification()
-magnetSpec.extend( 'value' , cool.StorageType.Float )
-magnetSpec.extend( 'quality_invalid' , cool.StorageType.Bool )
+# magnetSpec = cool.RecordSpecification()
+# magnetSpec.extend( 'value' , cool.StorageType.Float )
+# magnetSpec.extend( 'quality_invalid' , cool.StorageType.Bool )
 
-magnetRecord = cool.Record(magnetSpec)
-magnetRecord[ 'quality_invalid'] = 1
+# magnetRecord = cool.Record(magnetSpec)
+# magnetRecord[ 'quality_invalid'] = 1
 
-magnetFolderSpec = cool.FolderSpecification(magnetSpec)
-magnetFolder = db.createFolder('/EXT/DCS/MAGNETS/SENSORDATA', magnetFolderSpec, descriptionMagnet, True)
+# magnetFolderSpec = cool.FolderSpecification(magnetSpec)
+# magnetFolder = db.createFolder('/EXT/DCS/MAGNETS/SENSORDATA', magnetFolderSpec, descriptionMagnet, True)
 
-magnetRecord[ 'value' ] = 7730.0
-magnetFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, magnetRecord, 1)
-magnetFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, magnetRecord, 2)
-magnetRecord[ 'value' ] = 20400.0
-magnetFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, magnetRecord, 3)
-magnetFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, magnetRecord, 4)
+# magnetRecord[ 'value' ] = 7730.0
+# magnetFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, magnetRecord, 1)
+# magnetFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, magnetRecord, 2)
+# magnetRecord[ 'value' ] = 20400.0
+# magnetFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, magnetRecord, 3)
+# magnetFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, magnetRecord, 4)
 
 chanstatSpec = cool.RecordSpecification()
 chanstatSpec.extend( 'LVCHSTAT_RECV' , cool.StorageType.Int32 )
diff --git a/Tracker/TrackerConditions/FaserSiLorentzAngleTool/python/FaserSCT_LorentzAngleConfig.py b/Tracker/TrackerConditions/FaserSiLorentzAngleTool/python/FaserSCT_LorentzAngleConfig.py
index 69fd84e5..5b66d7b5 100644
--- a/Tracker/TrackerConditions/FaserSiLorentzAngleTool/python/FaserSCT_LorentzAngleConfig.py
+++ b/Tracker/TrackerConditions/FaserSiLorentzAngleTool/python/FaserSCT_LorentzAngleConfig.py
@@ -44,7 +44,7 @@ def FaserSCT_LorentzAngleCfg(flags, name="FaserSCT_SiLorentzAngleCondAlg",
         acc.merge(SCAcc)
     # set up FaserSCT_SiLorentzAngleCondAlg
     kwargs.setdefault("UseMagFieldSvc", tool.UseMagFieldSvc)
-    kwargs.setdefault("UseMagFieldDcs", not flags.Common.isOnline)
+    # kwargs.setdefault("UseMagFieldDcs", not flags.Common.isOnline)
     kwargs.setdefault("UseGeoModel", forceUseGeoModel)
     kwargs.setdefault("useSctDefaults", False)
     acc.addCondAlgo(FaserSCT_SiLorentzAngleCondAlg(name, **kwargs))
diff --git a/Tracker/TrackerConditions/FaserSiLorentzAngleTool/src/FaserSCT_SiLorentzAngleCondAlg.cxx b/Tracker/TrackerConditions/FaserSiLorentzAngleTool/src/FaserSCT_SiLorentzAngleCondAlg.cxx
index 6328ed94..32f94286 100644
--- a/Tracker/TrackerConditions/FaserSiLorentzAngleTool/src/FaserSCT_SiLorentzAngleCondAlg.cxx
+++ b/Tracker/TrackerConditions/FaserSiLorentzAngleTool/src/FaserSCT_SiLorentzAngleCondAlg.cxx
@@ -50,12 +50,12 @@ StatusCode FaserSCT_SiLorentzAngleCondAlg::initialize()
     // MagFieldSvc
     ATH_CHECK(m_magFieldSvc.retrieve());
     // Read Cond handle
-    if (m_useMagFieldDcs.value()) {
-      ATH_CHECK(m_readKeyBFieldSensor.initialize());
-    }
-    else {
-      ATH_CHECK(m_readKeyBFieldSensor.initialize(false));
-    }
+    // if (m_useMagFieldDcs.value()) {
+    //   ATH_CHECK(m_readKeyBFieldSensor.initialize());
+    // }
+    // else {
+    //   ATH_CHECK(m_readKeyBFieldSensor.initialize(false));
+    // }
   }
 
   ATH_CHECK(m_SCTDetEleCollKey.initialize());
@@ -95,7 +95,7 @@ StatusCode FaserSCT_SiLorentzAngleCondAlg::execute(const EventContext& ctx) cons
   eidStop.set_time_stamp(EventIDBase::UNDEFNUM);
   eidStop.set_time_stamp_ns_offset(EventIDBase::UNDEFNUM);
   EventIDRange rangeSCT{eidStart, eidStop};
-  EventIDRange rangeBField{eidStart, eidStop};
+  // EventIDRange rangeBField{eidStart, eidStop};
 
   // Get SCT_DetectorElementCollection
   SG::ReadCondHandle<TrackerDD::SiDetectorElementCollection> sctDetEle(m_SCTDetEleCollKey, ctx);
@@ -149,39 +149,40 @@ StatusCode FaserSCT_SiLorentzAngleCondAlg::execute(const EventContext& ctx) cons
     validSCT = true;
   }
 
-  bool validBField{false};
-  if (m_useMagFieldSvc.value()) {
-    if (m_useMagFieldDcs.value()) {
-      // Read Cond Handle (B field sensor)
-      SG::ReadCondHandle<CondAttrListCollection> readHandleBFieldSensor{m_readKeyBFieldSensor, ctx};
-      const CondAttrListCollection* readCdoBFieldSensor{*readHandleBFieldSensor};
-      if (readCdoBFieldSensor==nullptr) {
-        ATH_MSG_FATAL("Null pointer to the read conditions object");
-        return StatusCode::FAILURE;
-      }
-      EventIDRange rangeBFieldSensor;
-      if (not readHandleBFieldSensor.range(rangeBFieldSensor)) {
-        ATH_MSG_FATAL("Failed to retrieve validity range for " << readHandleBFieldSensor.key());
-        return StatusCode::FAILURE;
-      }
-      ATH_MSG_INFO("Input is " << readHandleBFieldSensor.fullKey() << " with the range of " << rangeBFieldSensor);
-
-      // Set the validity ranges of sensor
-      rangeBField = rangeBFieldSensor;
-      if (rangeBField.stop().isValid() and rangeBField.start()>rangeBField.stop()) {
-        ATH_MSG_FATAL("Invalid intersection rangeBField: " << rangeBField);
-        return StatusCode::FAILURE;
-      }
-      validBField = true;
-    }
-  }
+  // bool validBField{false};
+  // if (m_useMagFieldSvc.value()) {
+  //   if (m_useMagFieldDcs.value()) {
+  //     // Read Cond Handle (B field sensor)
+  //     SG::ReadCondHandle<CondAttrListCollection> readHandleBFieldSensor{m_readKeyBFieldSensor, ctx};
+  //     const CondAttrListCollection* readCdoBFieldSensor{*readHandleBFieldSensor};
+  //     if (readCdoBFieldSensor==nullptr) {
+  //       ATH_MSG_FATAL("Null pointer to the read conditions object");
+  //       return StatusCode::FAILURE;
+  //     }
+  //     EventIDRange rangeBFieldSensor;
+  //     if (not readHandleBFieldSensor.range(rangeBFieldSensor)) {
+  //       ATH_MSG_FATAL("Failed to retrieve validity range for " << readHandleBFieldSensor.key());
+  //       return StatusCode::FAILURE;
+  //     }
+  //     ATH_MSG_INFO("Input is " << readHandleBFieldSensor.fullKey() << " with the range of " << rangeBFieldSensor);
+
+  //     // Set the validity ranges of sensor
+  //     rangeBField = rangeBFieldSensor;
+  //     if (rangeBField.stop().isValid() and rangeBField.start()>rangeBField.stop()) {
+  //       ATH_MSG_FATAL("Invalid intersection rangeBField: " << rangeBField);
+  //       return StatusCode::FAILURE;
+  //     }
+  //     validBField = true;
+  //   }
+  // }
 
   // Combined the validity ranges of temp and HV
-  EventIDRange rangeW{rangeBField};
-  if (validSCT) {
-    if (validBField) rangeW = EventIDRange::intersect(rangeSCT, rangeBField);
-    else rangeW = rangeSCT;
-  }
+  EventIDRange rangeW{rangeSCT};
+  // EventIDRange rangeW{rangeBField};
+  // if (validSCT) {
+  //   if (validBField) rangeW = EventIDRange::intersect(rangeSCT, rangeBField);
+  //   else rangeW = rangeSCT;
+  // }
   if (rangeW.stop().isValid() and rangeW.start()>rangeW.stop()) {
     ATH_MSG_FATAL("Invalid intersection rangeW: " << rangeW);
     return StatusCode::FAILURE;
diff --git a/Tracker/TrackerConditions/FaserSiLorentzAngleTool/src/FaserSCT_SiLorentzAngleCondAlg.h b/Tracker/TrackerConditions/FaserSiLorentzAngleTool/src/FaserSCT_SiLorentzAngleCondAlg.h
index 362edc6f..1fc9c8ee 100644
--- a/Tracker/TrackerConditions/FaserSiLorentzAngleTool/src/FaserSCT_SiLorentzAngleCondAlg.h
+++ b/Tracker/TrackerConditions/FaserSiLorentzAngleTool/src/FaserSCT_SiLorentzAngleCondAlg.h
@@ -12,7 +12,7 @@
 // Athena includes
 #include "AthenaBaseComps/AthReentrantAlgorithm.h"
 
-#include "AthenaPoolUtilities/CondAttrListCollection.h"
+// #include "AthenaPoolUtilities/CondAttrListCollection.h"
 #include "GeoPrimitives/GeoPrimitives.h"
 #include "InDetConditionsSummaryService/ISiliconConditionsTool.h"
 #include "TrackerReadoutGeometry/SiDetectorElementCollection.h"
@@ -52,7 +52,7 @@ class FaserSCT_SiLorentzAngleCondAlg: public AthReentrantAlgorithm
  private:
   SG::ReadCondHandleKey<FaserSCT_DCSFloatCondData> m_readKeyTemp{this, "ReadKeyTemp", "SCT_SiliconTempCondData", "Key of input SCT temperature"};
   SG::ReadCondHandleKey<FaserSCT_DCSFloatCondData> m_readKeyHV{this, "ReadKeyHV", "SCT_SiliconBiasVoltCondData", "Key of input SCT HV"};
-  SG::ReadCondHandleKey<CondAttrListCollection> m_readKeyBFieldSensor{this, "ReadKeyBFieldSensor", "/EXT/DCS/MAGNETS/SENSORDATA",  "Key of input B-field sensor"};
+  // SG::ReadCondHandleKey<CondAttrListCollection> m_readKeyBFieldSensor{this, "ReadKeyBFieldSensor", "/EXT/DCS/MAGNETS/SENSORDATA",  "Key of input B-field sensor"};
   // The /GLOBAL/BField/Maps folder is run-lumi folder and has just one IOV. The folder is not used for IOV determination.
   SG::ReadCondHandleKey<TrackerDD::SiDetectorElementCollection> m_SCTDetEleCollKey{this, "SCTDetEleCollKey", "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT"};
   SG::WriteCondHandleKey<FaserSiLorentzAngleCondData> m_writeKey{this, "WriteKey", "SCTSiLorentzAngleCondData", "Key of output SiLorentzAngleCondData"};
@@ -72,7 +72,7 @@ class FaserSCT_SiLorentzAngleCondAlg: public AthReentrantAlgorithm
   DoubleProperty           m_biasVoltage{this, "BiasVoltage", 150., "Default bias voltage in Volt."};
   DoubleProperty           m_nominalField{this, "NominalField", 2.0834*Gaudi::Units::tesla};
   BooleanProperty          m_useMagFieldSvc{this, "UseMagFieldSvc", true};
-  BooleanProperty          m_useMagFieldDcs{this, "UseMagFieldDcs", true};
+  // BooleanProperty          m_useMagFieldDcs{this, "UseMagFieldDcs", true};
   BooleanProperty          m_sctDefaults{this, "useSctDefaults", false};
   BooleanProperty          m_useGeoModel{this, "UseGeoModel", false};
   unsigned int             m_maxHash;
-- 
GitLab