diff --git a/Control/CalypsoConfiguration/python/GeoModelConfigFlags.py b/Control/CalypsoConfiguration/python/GeoModelConfigFlags.py index 448d65d80fad40f7a16501b4720853ed4bddae11..69d280a85975a9785e4ceaaef704d190bdca9434 100644 --- a/Control/CalypsoConfiguration/python/GeoModelConfigFlags.py +++ b/Control/CalypsoConfiguration/python/GeoModelConfigFlags.py @@ -10,6 +10,8 @@ def createGeoModelConfigFlags(): GetFileMD(prevFlags.Input.Files).get("GeoFaser",None)) or "FASER-01")) gcf.addFlag("GeoModel.GeoExportFile","") + gcf.addFlag("GeoModel.Align.Disable", False) # Hack to avoid loading alignment when we want to create it from scratch + return gcf diff --git a/Control/CalypsoExample/GeoModelTest/CMakeLists.txt b/Control/CalypsoExample/GeoModelTest/CMakeLists.txt index 5c4205019552d4db08974473329ba6fdca37cb44..9db978f852f7d3ae840297d164670b9c6ba9aa00 100644 --- a/Control/CalypsoExample/GeoModelTest/CMakeLists.txt +++ b/Control/CalypsoExample/GeoModelTest/CMakeLists.txt @@ -15,11 +15,17 @@ atlas_add_component( GeoModelTest INCLUDE_DIRS ${GEOMODEL_INCLUDE_DIRS} LINK_LIBRARIES ${GEOMODEL_LIBRARIES} AthenaBaseComps GeoModelFaserUtilities ScintReadoutGeometry TrackerReadoutGeometry MagFieldInterfaces MagFieldElements MagFieldConditions ) -atlas_add_test( GeoModelCheck - SCRIPT python ${CMAKE_CURRENT_SOURCE_DIR}/python/GeoModelTestConfig.py +atlas_add_test( Faser01GeoCheck + SCRIPT python ${CMAKE_CURRENT_SOURCE_DIR}/python/Faser01TestConfig.py PROPERTIES WORKING_DIRECTORY ${CMAKE_BINARY_DIR} PROPERTIES TIMEOUT 300 ) +atlas_add_test( Faser02GeoCheck + SCRIPT python ${CMAKE_CURRENT_SOURCE_DIR}/python/Faser02TestConfig.py + PROPERTIES WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + PROPERTIES TIMEOUT 300 ) + + atlas_add_test( TestBeamGeoCheck SCRIPT python ${CMAKE_CURRENT_SOURCE_DIR}/python/TestBeamTestConfig.py PROPERTIES WORKING_DIRECTORY ${CMAKE_BINARY_DIR} diff --git a/Control/CalypsoExample/GeoModelTest/python/GeoModelTestConfig.py b/Control/CalypsoExample/GeoModelTest/python/Faser01TestConfig.py similarity index 87% rename from Control/CalypsoExample/GeoModelTest/python/GeoModelTestConfig.py rename to Control/CalypsoExample/GeoModelTest/python/Faser01TestConfig.py index ad33f2cf97c66ba18a5d1902fdc1f9d8b58cb85f..69a57833523e460b1ab5465312f410ae9e2509d6 100644 --- a/Control/CalypsoExample/GeoModelTest/python/GeoModelTestConfig.py +++ b/Control/CalypsoExample/GeoModelTest/python/Faser01TestConfig.py @@ -17,7 +17,9 @@ def GeoModelTestCfg(flags, name="GeoModelTestAlg", **kwargs): # Configure the algorithm itself GeoModelTestAlg = CompFactory.GeoModelTestAlg - a.addEventAlgo(GeoModelTestAlg(name, **kwargs)) + a.addEventAlgo(GeoModelTestAlg(name, FirstSCTStation=1, + LastSCTStation=3, + **kwargs)) return a @@ -32,7 +34,7 @@ if __name__ == "__main__": ConfigFlags.Input.isMC = True # Needed to bypass autoconfig ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-01" # Always needed; must match FaserVersion ConfigFlags.GeoModel.FaserVersion = "FASER-01" # Default FASER geometry - ConfigFlags.GeoModel.GeoExportFile = "faserGeo.db" # Writes out a GeoModel file with the full geometry tree (optional, comment out to skip) + # ConfigFlags.GeoModel.GeoExportFile = "faserGeo01.db" # Writes out a GeoModel file with the full geometry tree (optional, comment out to skip) # ConfigFlags.Detector.EnableVeto = True # ConfigFlags.Detector.EnableTrigger = True # ConfigFlags.Detector.EnablePreshower= True diff --git a/Control/CalypsoExample/GeoModelTest/python/Faser02TestConfig.py b/Control/CalypsoExample/GeoModelTest/python/Faser02TestConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..03913db74587b020b24c290fc6a2928eb965e22d --- /dev/null +++ b/Control/CalypsoExample/GeoModelTest/python/Faser02TestConfig.py @@ -0,0 +1,66 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +#!/usr/bin/env python +import sys +from AthenaCommon.Constants import VERBOSE, INFO +from AthenaConfiguration.ComponentFactory import CompFactory + +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)) + + # Configure the algorithm itself + GeoModelTestAlg = CompFactory.GeoModelTestAlg + a.addEventAlgo(GeoModelTestAlg(name, FirstSCTStation=0, + LastSCTStation=3, + PrintSctIDs=True, + **kwargs)) + + return a + +if __name__ == "__main__": + from AthenaCommon.Logging import log#, logging + from AthenaCommon.Configurable import Configurable + from CalypsoConfiguration.AllConfigFlags import ConfigFlags + + Configurable.configurableRun3Behavior = True + +# Flags for this job + ConfigFlags.Input.isMC = True # Needed to bypass autoconfig + ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-02" # Always needed; must match FaserVersion + ConfigFlags.GeoModel.FaserVersion = "FASERNU-02" # Default FASER geometry + # ConfigFlags.GeoModel.GeoExportFile = "faserGeoNu02.db" # Writes out a GeoModel file with the full geometry tree (optional, comment out to skip) + # ConfigFlags.Detector.EnableVeto = True + # ConfigFlags.Detector.EnableTrigger = True + # ConfigFlags.Detector.EnablePreshower= True + # ConfigFlags.Detector.EnableFaserSCT = True + # ConfigFlags.Detector.EnableUpstreamDipole = True + # ConfigFlags.Detector.EnableCentralDipole = True + # ConfigFlags.Detector.EnableDownstreamDipole = True + # ConfigFlags.Detector.EnableEcal = True + ConfigFlags.lock() + +# Configure components + from CalypsoConfiguration.MainServicesConfig import MainServicesCfg + acc = MainServicesCfg(ConfigFlags) + +# Set up algorithm + acc.merge(GeoModelTestCfg(ConfigFlags)) + +# Configure verbosity + msgSvc = acc.getService("MessageSvc") + msgSvc.Format = "% F%30W%S%7W%R%T %0W%M" + # ConfigFlags.dump() + # logging.getLogger('forcomps').setLevel(VERBOSE) + acc.foreach_component("*").OutputLevel = VERBOSE + acc.foreach_component("*ClassID*").OutputLevel = INFO + log.setLevel(VERBOSE) + +# Execute and finish + sys.exit(int(acc.run(maxEvents=1).isFailure())) diff --git a/Control/CalypsoExample/GeoModelTest/python/TestBeamTestConfig.py b/Control/CalypsoExample/GeoModelTest/python/TestBeamTestConfig.py index 91a2d33ebe08c431961a8fc52bf3b15e864396fd..d590b125b0570e1628481ecbcaad312c357aa021 100644 --- a/Control/CalypsoExample/GeoModelTest/python/TestBeamTestConfig.py +++ b/Control/CalypsoExample/GeoModelTest/python/TestBeamTestConfig.py @@ -42,7 +42,7 @@ if __name__ == "__main__": ConfigFlags.Input.isMC = True # Needed to bypass autoconfig ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-TB00" # Always needed; must match FaserVersion ConfigFlags.GeoModel.FaserVersion = "FASER-TB00" # Default FASER geometry - ConfigFlags.GeoModel.GeoExportFile = "faserTestBeamGeo.db" # Writes out a GeoModel file with the full geometry tree (optional, comment out to skip) + # ConfigFlags.GeoModel.GeoExportFile = "faserTestBeamGeo.db" # Writes out a GeoModel file with the full geometry tree (optional, comment out to skip) # ConfigFlags.Detector.EnableVeto = True # ConfigFlags.Detector.EnableTrigger = True # ConfigFlags.Detector.EnablePreshower= True diff --git a/Control/CalypsoExample/TrackerDataAccessExample/python/TrackerDataAccessExampleConfig.py b/Control/CalypsoExample/TrackerDataAccessExample/python/TrackerDataAccessExampleConfig.py index 066f8560b4df98fae490fc79a876c21ae1332313..7a0df38c43f4348ef13c84b5f5af7348c468a0ae 100755 --- a/Control/CalypsoExample/TrackerDataAccessExample/python/TrackerDataAccessExampleConfig.py +++ b/Control/CalypsoExample/TrackerDataAccessExample/python/TrackerDataAccessExampleConfig.py @@ -53,7 +53,6 @@ if __name__ == "__main__": acc.merge(PoolWriteCfg(ConfigFlags)) # Configure output - from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg itemList = [ "xAOD::EventInfo#*", "xAOD::EventAuxInfo#*", @@ -65,6 +64,13 @@ if __name__ == "__main__": # Set up algorithm acc.merge(TrackerDataAccessExampleCfg(ConfigFlags)) +# Hack to avoid problem with our use of MC databases when isMC = False + replicaSvc = acc.getService("DBReplicaSvc") + replicaSvc.COOLSQLiteVetoPattern = "" + replicaSvc.UseCOOLSQLite = True + replicaSvc.UseCOOLFrontier = False + replicaSvc.UseGeomSQLite = True + # Configure verbosity # ConfigFlags.dump() logging.getLogger('forcomps').setLevel(WARNING) diff --git a/Control/CalypsoExample/TriggerDataAccessExample/python/TriggerDataAccessExampleConfig.py b/Control/CalypsoExample/TriggerDataAccessExample/python/TriggerDataAccessExampleConfig.py index 737d03721f09409e6d88e83dadd2e618cbedd600..add815c7f67c8d705be76b635104ffe21ce24c31 100755 --- a/Control/CalypsoExample/TriggerDataAccessExample/python/TriggerDataAccessExampleConfig.py +++ b/Control/CalypsoExample/TriggerDataAccessExample/python/TriggerDataAccessExampleConfig.py @@ -52,7 +52,6 @@ if __name__ == "__main__": acc.merge(PoolWriteCfg(ConfigFlags)) # Configure output - from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg itemList = [ "xAOD::EventInfo#*", "xAOD::EventAuxInfo#*", @@ -64,6 +63,13 @@ if __name__ == "__main__": # Set up algorithm acc.merge(TriggerDataAccessExampleCfg(ConfigFlags)) +# Hack to avoid problem with our use of MC databases when isMC = False + replicaSvc = acc.getService("DBReplicaSvc") + replicaSvc.COOLSQLiteVetoPattern = "" + replicaSvc.UseCOOLSQLite = True + replicaSvc.UseCOOLFrontier = False + replicaSvc.UseGeomSQLite = True + # Configure verbosity # ConfigFlags.dump() # logging.getLogger('forcomps').setLevel(VERBOSE) diff --git a/Control/CalypsoExample/WaveformDataAccessExample/python/WaveformDataAccessExampleConfig.py b/Control/CalypsoExample/WaveformDataAccessExample/python/WaveformDataAccessExampleConfig.py index 1151c74dffc7ddaa0182df025e82dd243c36684a..e360be84e063b25d99ce129819562b33f6223e37 100755 --- a/Control/CalypsoExample/WaveformDataAccessExample/python/WaveformDataAccessExampleConfig.py +++ b/Control/CalypsoExample/WaveformDataAccessExample/python/WaveformDataAccessExampleConfig.py @@ -52,7 +52,6 @@ if __name__ == "__main__": acc.merge(PoolWriteCfg(ConfigFlags)) # Configure output - from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg itemList = [ "xAOD::EventInfo#*", "xAOD::EventAuxInfo#*", @@ -64,6 +63,13 @@ if __name__ == "__main__": # Set up algorithm acc.merge(WaveformDataAccessExampleCfg(ConfigFlags)) +# Hack to avoid problem with our use of MC databases when isMC = False + replicaSvc = acc.getService("DBReplicaSvc") + replicaSvc.COOLSQLiteVetoPattern = "" + replicaSvc.UseCOOLSQLite = True + replicaSvc.UseCOOLFrontier = False + replicaSvc.UseGeomSQLite = True + # Configure verbosity # ConfigFlags.dump() # logging.getLogger('forcomps').setLevel(VERBOSE) diff --git a/Control/CalypsoExample/WriteAlignment/python/WriteAlignmentConfig.py b/Control/CalypsoExample/WriteAlignment/python/WriteAlignmentConfig_Faser01.py similarity index 73% rename from Control/CalypsoExample/WriteAlignment/python/WriteAlignmentConfig.py rename to Control/CalypsoExample/WriteAlignment/python/WriteAlignmentConfig_Faser01.py index de5a92acd49f221666e3d4ff053b1af43183526f..675f61f5b77cea6bc6fac3c42eb01f17bfc492b8 100644 --- a/Control/CalypsoExample/WriteAlignment/python/WriteAlignmentConfig.py +++ b/Control/CalypsoExample/WriteAlignment/python/WriteAlignmentConfig_Faser01.py @@ -12,11 +12,11 @@ def WriteAlignmentCfg(flags, name="WriteAlignmentAlg", **kwargs): a = FaserGeometryCfg(flags) # 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) + from IOVDbSvc.IOVDbSvcConfig import IOVDbSvcCfg + result = IOVDbSvcCfg(flags) + iovDbSvc = result.getPrimary() + iovDbSvc.dbConnection=flags.IOVDb.DBConnection + a.merge(result) AthenaPoolCnvSvc=CompFactory.AthenaPoolCnvSvc apcs=AthenaPoolCnvSvc() @@ -28,7 +28,7 @@ def WriteAlignmentCfg(flags, name="WriteAlignmentAlg", **kwargs): # Configure the algorithm itself WriteAlignmentAlg = CompFactory.WriteAlignmentAlg - outputTool = CompFactory.AthenaOutputStreamTool("DbStreamTool", OutputFile = "FaserSCT_AlignDb.pool.root", + outputTool = CompFactory.AthenaOutputStreamTool("DbStreamTool", OutputFile = flags.WriteAlignment.PoolFileName, PoolContainerPrefix="ConditionsContainer", TopLevelContainerName = "<type>", SubLevelBranchName= "<key>" ) @@ -48,10 +48,11 @@ if __name__ == "__main__": # Flags for this job ConfigFlags.Input.isMC = True # Needed to bypass autoconfig - ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-01" # Always needed; must match FaserVersion ConfigFlags.GeoModel.FaserVersion = "FASER-01" # Default FASER geometry - ConfigFlags.GeoModel.GeoExportFile = "faserGeo.db" # Writes out a GeoModel file with the full geometry tree (optional, comment out to skip) - ConfigFlags.IOVDb.DBConnection = "sqlite://;schema=ALLP200.db;dbname=OFLP200" + ConfigFlags.IOVDb.GlobalTag = "OFLCOND-"+ ConfigFlags.GeoModel.FaserVersion # Always needed; must match FaserVersion + ConfigFlags.IOVDb.DBConnection = "sqlite://;schema=" + ConfigFlags.GeoModel.FaserVersion + "_ALLP200.db;dbname=OFLP200" + ConfigFlags.GeoModel.Align.Disable = True # Hack to avoid loading alignment when we want to create it from scratch + ConfigFlags.addFlag("WriteAlignment.PoolFileName", ConfigFlags.GeoModel.FaserVersion + "_Align.pool.root") ConfigFlags.lock() # Configure components @@ -59,7 +60,7 @@ if __name__ == "__main__": acc = MainServicesCfg(ConfigFlags) # Set things up to create a conditions DB with neutral Tracker alignment transforms - acc.merge(WriteAlignmentCfg(ConfigFlags)) + acc.merge(WriteAlignmentCfg(ConfigFlags, ValidRunStart=1, ValidEvtStart=0, ValidRunEnd=9999999, ValidEvtEnd=9999999, CondTag=ConfigFlags.GeoModel.FaserVersion.replace("FASER", "TRACKER-ALIGN"))) # Configure verbosity # ConfigFlags.dump() diff --git a/Control/CalypsoExample/WriteAlignment/python/WriteAlignmentConfig_Faser02.py b/Control/CalypsoExample/WriteAlignment/python/WriteAlignmentConfig_Faser02.py new file mode 100644 index 0000000000000000000000000000000000000000..b05c15632415e873e301a08d9f63332175ebfe20 --- /dev/null +++ b/Control/CalypsoExample/WriteAlignment/python/WriteAlignmentConfig_Faser02.py @@ -0,0 +1,73 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +#!/usr/bin/env python +import sys +from AthenaCommon.Constants import VERBOSE, INFO +from AthenaConfiguration.ComponentFactory import CompFactory + +def WriteAlignmentCfg(flags, name="WriteAlignmentAlg", **kwargs): + + # Initialize GeoModel + from FaserGeoModel.FaserGeoModelConfig import FaserGeometryCfg + a = FaserGeometryCfg(flags) + + # 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=flags.IOVDb.DBConnection + 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 + WriteAlignmentAlg = CompFactory.WriteAlignmentAlg + outputTool = CompFactory.AthenaOutputStreamTool("DbStreamTool", OutputFile = flags.WriteAlignment.PoolFileName, + PoolContainerPrefix="ConditionsContainer", + TopLevelContainerName = "<type>", + SubLevelBranchName= "<key>" ) + kwargs.setdefault("AlignDbTool", CompFactory.TrackerAlignDBTool("AlignDbTool", OutputTool = outputTool, OutputLevel=VERBOSE)) + a.addEventAlgo(WriteAlignmentAlg(name, **kwargs)) + + return a + + +if __name__ == "__main__": + # from AthenaCommon.Logging import log, logging + from AthenaCommon.Configurable import Configurable + # from AthenaConfiguration.ComponentFactory import CompFactory + from CalypsoConfiguration.AllConfigFlags import ConfigFlags + + Configurable.configurableRun3Behavior = True + +# Flags for this job + ConfigFlags.Input.isMC = True # Needed to bypass autoconfig + ConfigFlags.GeoModel.FaserVersion = "FASER-02" # Default FASER geometry + ConfigFlags.IOVDb.GlobalTag = "OFLCOND-"+ ConfigFlags.GeoModel.FaserVersion # Always needed; must match FaserVersion + ConfigFlags.IOVDb.DBConnection = "sqlite://;schema=" + ConfigFlags.GeoModel.FaserVersion + "_ALLP200.db;dbname=OFLP200" + ConfigFlags.GeoModel.Align.Disable = True # Hack to avoid loading alignment when we want to create it from scratch + ConfigFlags.addFlag("WriteAlignment.PoolFileName", ConfigFlags.GeoModel.FaserVersion + "_Align.pool.root") + ConfigFlags.lock() + +# Configure components + from CalypsoConfiguration.MainServicesConfig import MainServicesCfg + acc = MainServicesCfg(ConfigFlags) + +# Set things up to create a conditions DB with neutral Tracker alignment transforms + acc.merge(WriteAlignmentCfg(ConfigFlags, ValidRunStart=1, ValidEvtStart=0, ValidRunEnd=9999999, ValidEvtEnd=9999999, CondTag=ConfigFlags.GeoModel.FaserVersion.replace("FASER", "TRACKER-ALIGN"))) + +# Configure verbosity + # ConfigFlags.dump() + # logging.getLogger('forcomps').setLevel(VERBOSE) + acc.foreach_component("*").OutputLevel = VERBOSE + acc.foreach_component("*ClassID*").OutputLevel = INFO + # log.setLevel(VERBOSE) + +# Execute and finish + sys.exit(int(acc.run(maxEvents=1).isFailure())) diff --git a/Control/CalypsoExample/WriteAlignment/python/WriteAlignmentConfig_FaserTB00.py b/Control/CalypsoExample/WriteAlignment/python/WriteAlignmentConfig_FaserTB00.py new file mode 100644 index 0000000000000000000000000000000000000000..d57092f2dd8b8c1dcb3bd6568fdb3dac636d3cf2 --- /dev/null +++ b/Control/CalypsoExample/WriteAlignment/python/WriteAlignmentConfig_FaserTB00.py @@ -0,0 +1,73 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +#!/usr/bin/env python +import sys +from AthenaCommon.Constants import VERBOSE, INFO +from AthenaConfiguration.ComponentFactory import CompFactory + +def WriteAlignmentCfg(flags, name="WriteAlignmentAlg", **kwargs): + + # Initialize GeoModel + from FaserGeoModel.FaserGeoModelConfig import FaserGeometryCfg + a = FaserGeometryCfg(flags) + + # 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=flags.IOVDb.DBConnection + 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 + WriteAlignmentAlg = CompFactory.WriteAlignmentAlg + outputTool = CompFactory.AthenaOutputStreamTool("DbStreamTool", OutputFile = flags.WriteAlignment.PoolFileName, + PoolContainerPrefix="ConditionsContainer", + TopLevelContainerName = "<type>", + SubLevelBranchName= "<key>" ) + kwargs.setdefault("AlignDbTool", CompFactory.TrackerAlignDBTool("AlignDbTool", OutputTool = outputTool, OutputLevel=VERBOSE)) + a.addEventAlgo(WriteAlignmentAlg(name, **kwargs)) + + return a + + +if __name__ == "__main__": + # from AthenaCommon.Logging import log, logging + from AthenaCommon.Configurable import Configurable + # from AthenaConfiguration.ComponentFactory import CompFactory + from CalypsoConfiguration.AllConfigFlags import ConfigFlags + + Configurable.configurableRun3Behavior = True + +# Flags for this job + ConfigFlags.Input.isMC = True # Needed to bypass autoconfig + ConfigFlags.GeoModel.FaserVersion = "FASER-TB00" # Default FASER geometry + ConfigFlags.IOVDb.GlobalTag = "OFLCOND-"+ ConfigFlags.GeoModel.FaserVersion # Always needed; must match FaserVersion + ConfigFlags.IOVDb.DBConnection = "sqlite://;schema=" + ConfigFlags.GeoModel.FaserVersion + "_ALLP200.db;dbname=OFLP200" + ConfigFlags.GeoModel.Align.Disable = True # Hack to avoid loading alignment when we want to create it from scratch + ConfigFlags.addFlag("WriteAlignment.PoolFileName", ConfigFlags.GeoModel.FaserVersion + "_Align.pool.root") + ConfigFlags.lock() + +# Configure components + from CalypsoConfiguration.MainServicesConfig import MainServicesCfg + acc = MainServicesCfg(ConfigFlags) + +# Set things up to create a conditions DB with neutral Tracker alignment transforms + acc.merge(WriteAlignmentCfg(ConfigFlags, ValidRunStart=1, ValidEvtStart=0, ValidRunEnd=9999999, ValidEvtEnd=9999999, CondTag=ConfigFlags.GeoModel.FaserVersion.replace("FASER", "TRACKER-ALIGN"))) + +# Configure verbosity + # ConfigFlags.dump() + # logging.getLogger('forcomps').setLevel(VERBOSE) + acc.foreach_component("*").OutputLevel = VERBOSE + acc.foreach_component("*ClassID*").OutputLevel = INFO + # log.setLevel(VERBOSE) + +# Execute and finish + sys.exit(int(acc.run(maxEvents=1).isFailure())) diff --git a/Control/CalypsoExample/WriteAlignment/scripts/CopyAlignFolder.sh b/Control/CalypsoExample/WriteAlignment/scripts/CopyAlignFolder.sh index ce694ce4759a48ba872a9f1e57a6798b9601095c..4ed49f4d4162bdf40cb4b72aacfc066fa993576b 100644 --- a/Control/CalypsoExample/WriteAlignment/scripts/CopyAlignFolder.sh +++ b/Control/CalypsoExample/WriteAlignment/scripts/CopyAlignFolder.sh @@ -1,5 +1,18 @@ #!/bin/sh -AtlCoolCopy "sqlite://;schema=./ALLP200.db;dbname=OFLP200" "sqlite://;schema=data/ALLP200.db;dbname=OFLP200" -a -fnp -ot "TRACKER-ALIGN-01" -cp -n PoolFileCatalog.xml data/ -cp -n FaserSCT_AlignDb.pool.root data/ \ No newline at end of file +rm -f *_Align.pool.root +rm -f *_ALLP200.db +rm -f PoolFileCatalog.xml +rm -f writeAlignment_*.log + +python python/WriteAlignment/WriteAlignmentConfig_Faser01.py >& writeAlignment_Faser01.log +python python/WriteAlignment/WriteAlignmentConfig_Faser02.py >& writeAlignment_Faser02.log +python python/WriteAlignment/WriteAlignmentConfig_FaserTB00.py >& writeAlignment_FaserTB00.log + +AtlCoolCopy "sqlite://;schema=./FASER-01_ALLP200.db;dbname=OFLP200" "sqlite://;schema=data/sqlite200/ALLP200.db;dbname=OFLP200" -fnp -ot "TRACKER-ALIGN-01" +AtlCoolCopy "sqlite://;schema=./FASER-02_ALLP200.db;dbname=OFLP200" "sqlite://;schema=data/sqlite200/ALLP200.db;dbname=OFLP200" -fnp -ot "TRACKER-ALIGN-02" +AtlCoolCopy "sqlite://;schema=./FASER-TB00_ALLP200.db;dbname=OFLP200" "sqlite://;schema=data/sqlite200/ALLP200.db;dbname=OFLP200" -fnp -ot "TRACKER-ALIGN-TB00" +mkdir data/poolcond +cp -n PoolFileCatalog.xml data/poolcond/ +ln -s ${PWD}/data/poolcond/PoolFileCatalog.xml ${PWD}/data/poolcond/PoolCat_oflcond.xml +cp -n *_Align.pool.root data/poolcond/ \ No newline at end of file diff --git a/Control/CalypsoExample/WriteAlignment/src/WriteAlignmentAlg.cxx b/Control/CalypsoExample/WriteAlignment/src/WriteAlignmentAlg.cxx index 6efcb9b457f0e03096c1067059657b26fa8de4b5..38accc36b69349bf63b2fe8a8d983dbccf7bb08b 100644 --- a/Control/CalypsoExample/WriteAlignment/src/WriteAlignmentAlg.cxx +++ b/Control/CalypsoExample/WriteAlignment/src/WriteAlignmentAlg.cxx @@ -73,7 +73,7 @@ StatusCode WriteAlignmentAlg::execute(const EventContext&) const ATH_CHECK(m_alignTool->createDB()); ATH_CHECK(m_alignTool->sortTrans()); ATH_CHECK(m_alignTool->outputObjs()); - ATH_CHECK(m_alignTool->fillDB("",1,0,9999999,9999999)); + ATH_CHECK(m_alignTool->fillDB(m_conditionsTag, m_validRunStart, m_validEvtStart , m_validRunEnd, m_validEvtEnd)); return StatusCode::SUCCESS; } diff --git a/Control/CalypsoExample/WriteAlignment/src/WriteAlignmentAlg.h b/Control/CalypsoExample/WriteAlignment/src/WriteAlignmentAlg.h index 0797a34fdb88cdecb14021d10f4c188c5134d430..37d8b9033e084e437205dcebb408302234ece576 100644 --- a/Control/CalypsoExample/WriteAlignment/src/WriteAlignmentAlg.h +++ b/Control/CalypsoExample/WriteAlignment/src/WriteAlignmentAlg.h @@ -41,6 +41,13 @@ class WriteAlignmentAlg : public AthReentrantAlgorithm Gaudi::Property<int> m_numSctModulesPerRow {this, "NumSCTModulesPerRow", 2, "Number of modules per row in the SCT detector"}; Gaudi::Property<int> m_numSctStripsPerSensor {this, "NumSCTStripsPerSensor", 768,"Number of readout strips per sensor in the SCT detector"}; + Gaudi::Property<int> m_validRunStart {this, "ValidRunStart", 1, "Run number of IOV start"}; + Gaudi::Property<int> m_validRunEnd {this, "ValidRunEnd", 9999999, "Run number of IOV end"}; + Gaudi::Property<int> m_validEvtStart {this, "ValidEvtStart", 0, "Event number of IOV start"}; + Gaudi::Property<int> m_validEvtEnd {this, "ValidEvtEnd", 9999999, "Event number of IOV end"}; + + Gaudi::Property<std::string> m_conditionsTag {this, "CondTag", "", "Conditions tag for created alignment"}; + int m_numSctStations; ToolHandle<ITrackerAlignDBTool> m_alignTool { this, "AlignDbTool", "TrackerAlignDBTool" }; diff --git a/Database/ConnectionManagement/FaserAuthentication/data/dblookup.xml b/Database/ConnectionManagement/FaserAuthentication/data/dblookup.xml index 91ba81751aec848daa4b45e63b874fb288d013a0..5b309fd7cccc278ab1f10a2010bbdaaea3eaf124 100644 --- a/Database/ConnectionManagement/FaserAuthentication/data/dblookup.xml +++ b/Database/ConnectionManagement/FaserAuthentication/data/dblookup.xml @@ -2,18 +2,22 @@ <servicelist> <logicalservice name="FASERDD"> + <service name="sqlite_file:data/geomDB/geomDB_sqlite" accessMode="read" /> <service name="sqlite_file:///cvmfs/faser.cern.ch/repo/sw/database/DBRelease/current/geomDB/geomDB_sqlite" accessMode="read" /> </logicalservice> <logicalservice name="COOLOFL_SCT"> + <service name="sqlite_file:data/sqlite200/ALLP200.db" accessMode="read" /> <service name="sqlite_file:///cvmfs/faser.cern.ch/repo/sw/database/DBRelease/current/sqlite200/ALLP200.db" accessMode="read" /> </logicalservice> <logicalservice name="COOLOFL_DCS"> + <service name="sqlite_file:data/sqlite200/ALLP200.db" accessMode="read" /> <service name="sqlite_file:///cvmfs/faser.cern.ch/repo/sw/database/DBRelease/current/sqlite200/ALLP200.db" accessMode="read" /> </logicalservice> <logicalservice name="COOLOFL_GLOBAL"> + <service name="sqlite_file:data/sqlite200/ALLP200.db" accessMode="read" /> <service name="sqlite_file:///cvmfs/faser.cern.ch/repo/sw/database/DBRelease/current/sqlite200/ALLP200.db" accessMode="read" /> </logicalservice> diff --git a/Tracker/TrackerAlignTools/TrackerAlignGenTools/src/TrackerAlignDBTool.cxx b/Tracker/TrackerAlignTools/TrackerAlignGenTools/src/TrackerAlignDBTool.cxx index a92e78dc3d2c3aa62464256aaeab5c38caa0072a..77714ac0974d54b0f6292a74a174cc86a6c7cf29 100644 --- a/Tracker/TrackerAlignTools/TrackerAlignGenTools/src/TrackerAlignDBTool.cxx +++ b/Tracker/TrackerAlignTools/TrackerAlignGenTools/src/TrackerAlignDBTool.cxx @@ -99,7 +99,6 @@ StatusCode TrackerAlignDBTool::initialize() for (int i=0;i<3;++i) chan[i]=100*i; - int minStation = 3; std::string man_name; for (const TrackerDD::SiDetectorElement* element : *(m_sctman->getDetectorElementCollection())) { @@ -112,7 +111,7 @@ StatusCode TrackerAlignDBTool::initialize() std::string level[3]; for (int i=TransfLevel_low; i<3; ++i) { - minStation = std::min(station, minStation); + m_stations.insert(station); level[i]=dirkey(station, layer, 1+i, phi); // add this to list if not seen already std::vector<std::string>::const_iterator ix = @@ -130,9 +129,8 @@ StatusCode TrackerAlignDBTool::initialize() ATH_MSG_ERROR("Error translating element identifier." ); } } - } - m_ift =(minStation == 0); - ATH_CHECK(m_outputTool.retrieve()); + } + ATH_CHECK(m_outputTool.retrieve()); if (msgLvl(MSG::DEBUG)) { @@ -246,21 +244,11 @@ StatusCode TrackerAlignDBTool::createDB() const { Amg::Transform3D globshift; globshift.setIdentity(); - // Tracker interface - if (m_ift) + for (int station : m_stations) { - ident1 = m_sctid->wafer_id(0, 0, 0, 0, 0); - pat->add(ident1, Amg::EigenTransformToCLHEP(globshift)); + ident1 = m_sctid->wafer_id(station, 0, 0, 0, 0); + pat->add(ident1, Amg::EigenTransformToCLHEP(globshift)); } - // Tracker upstream - ident1 = m_sctid->wafer_id(1, 0, 0, 0, 0); - pat->add(ident1, Amg::EigenTransformToCLHEP(globshift)); - // Tracker central - ident1 = m_sctid->wafer_id(2, 0, 0, 0, 0); - pat->add(ident1, Amg::EigenTransformToCLHEP(globshift)); - // Tracker downstream - ident1 = m_sctid->wafer_id(3, 0, 0, 0, 0); - pat->add(ident1, Amg::EigenTransformToCLHEP(globshift)); } else { @@ -328,6 +316,7 @@ std::string TrackerAlignDBTool::dirkey(const int station, if (station == 3 ) result << "Downstream"; if (station == 2 ) result << "Central"; if (station == 1 ) result << "Upstream"; + if (station == 0 ) result << "Interface"; result << 1+layer; } } diff --git a/Tracker/TrackerAlignTools/TrackerAlignGenTools/src/TrackerAlignDBTool.h b/Tracker/TrackerAlignTools/TrackerAlignGenTools/src/TrackerAlignDBTool.h index 9ff680075934e2702c4bb8a3aa3902eeaf030a65..2c82c20a10baffab0b01d6c00af036b6adabaa11 100644 --- a/Tracker/TrackerAlignTools/TrackerAlignGenTools/src/TrackerAlignDBTool.h +++ b/Tracker/TrackerAlignTools/TrackerAlignGenTools/src/TrackerAlignDBTool.h @@ -185,8 +185,8 @@ class TrackerAlignDBTool: virtual public ITrackerAlignDBTool, public AthAlgTool const AlignableTransform* cgetTransPtr(const std::string key) const; bool m_dynamicDB; bool m_forceUserDBConfig; - bool m_ift {false}; - + std::set<int> m_stations; + mutable ToolHandle<IAthenaOutputStreamTool> m_outputTool { this, "OutputTool", "AthenaOutputStreamTool/CondStream1"} ; }; diff --git a/Tracker/TrackerConditions/FaserSCT_ConditionsData/CMakeLists.txt b/Tracker/TrackerConditions/FaserSCT_ConditionsData/CMakeLists.txt index 9c0b2c7bbd1870169862b8e1279e873840671c9c..f13ae3272499c4b66d5dab008bff2a1b92081f88 100644 --- a/Tracker/TrackerConditions/FaserSCT_ConditionsData/CMakeLists.txt +++ b/Tracker/TrackerConditions/FaserSCT_ConditionsData/CMakeLists.txt @@ -24,6 +24,6 @@ if (INSTALL_CONDB) # Install the generated file: install( FILES ${CMAKE_CURRENT_BINARY_DIR}/ALLP200.db - DESTINATION ${CMAKE_INSTALL_DATADIR} + DESTINATION ${CMAKE_INSTALL_DATADIR}/sqlite200 ) endif() \ No newline at end of file diff --git a/Tracker/TrackerConditions/FaserSCT_ConditionsData/data/SCT_Conditions.py b/Tracker/TrackerConditions/FaserSCT_ConditionsData/data/SCT_Conditions.py index d68e69348629a624e4042046b65a51e7cdda37f5..0fb2802c9c0a4135ff3db369038177e2fc1bdb7e 100644 --- a/Tracker/TrackerConditions/FaserSCT_ConditionsData/data/SCT_Conditions.py +++ b/Tracker/TrackerConditions/FaserSCT_ConditionsData/data/SCT_Conditions.py @@ -32,6 +32,8 @@ 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="256" clid="1170039409" /></addrHeader><typeName>AlignableTransformContainer</typeName>' + from PyCool import cool, coral dbSvc = cool.DatabaseSvcFactory.databaseService() @@ -41,24 +43,32 @@ print('recreating database') dbSvc.dropDatabase( connectString ) db = dbSvc.createDatabase( connectString ) +alignSpec = cool.RecordSpecification() +alignSpec.extend( 'PoolRef', cool.StorageType.String4k ) +alignFolderSpec = cool.FolderSpecification(cool.FolderVersioning.MULTI_VERSION, alignSpec, cool.PayloadMode.INLINEPAYLOAD) + tracker = db.createFolderSet("/Tracker") +align = db.createFolder("/Tracker/Align", alignFolderSpec, descriptionAlign, True) sct = db.createFolderSet("/SCT") sct_dcs = db.createFolderSet("/SCT/DCS") sct_daq = db.createFolderSet("/SCT/DAQ") sct_daq_calibration = db.createFolderSet("/SCT/DAQ/Calibration") +align.createTagRelation("TRACKER-01","TRACKER-ALIGN-01") tracker.createTagRelation("OFLCOND-FASER-01","TRACKER-01") sct_daq_calibration.createTagRelation("SCT-DAQ-01", "SCT-DAQ-Calibration-01") sct_daq.createTagRelation("SCT-01", "SCT-DAQ-01") sct_dcs.createTagRelation("SCT-01", "SCT-DCS-01") sct.createTagRelation("OFLCOND-FASER-01", "SCT-01") +align.createTagRelation("TRACKER-02","TRACKER-ALIGN-02") tracker.createTagRelation("OFLCOND-FASER-02","TRACKER-02") sct_daq_calibration.createTagRelation("SCT-DAQ-02", "SCT-DAQ-Calibration-02") sct_daq.createTagRelation("SCT-02", "SCT-DAQ-02") sct_dcs.createTagRelation("SCT-02", "SCT-DCS-02") sct.createTagRelation("OFLCOND-FASER-02", "SCT-02") +align.createTagRelation("TRACKER-TB00","TRACKER-ALIGN-TB00") tracker.createTagRelation("OFLCOND-FASER-TB00","TRACKER-TB00") sct_daq_calibration.createTagRelation("SCT-DAQ-TB00", "SCT-DAQ-Calibration-TB00") sct_daq.createTagRelation("SCT-TB00", "SCT-DAQ-TB00") diff --git a/Tracker/TrackerDetDescr/FaserSCT_GeoModel/python/FaserSCT_GeoModelConfig.py b/Tracker/TrackerDetDescr/FaserSCT_GeoModel/python/FaserSCT_GeoModelConfig.py index 88a5b7b1e8b32c6ebf0555a8c485b0cea9ef1677..26dff64f141ad9f22ff4ac430ef2fbdf98065f7e 100644 --- a/Tracker/TrackerDetDescr/FaserSCT_GeoModel/python/FaserSCT_GeoModelConfig.py +++ b/Tracker/TrackerDetDescr/FaserSCT_GeoModel/python/FaserSCT_GeoModelConfig.py @@ -24,6 +24,9 @@ def FaserSCT_GeometryCfg( flags ): sctDetectorTool.useDynamicAlignFolders = flags.GeoModel.Align.Dynamic geoModelSvc.DetectorTools += [ sctDetectorTool ] + if flags.GeoModel.Align.Disable: + return acc + if flags.GeoModel.Align.Dynamic: # acc.merge(addFoldersSplitOnline(flags,"INDET","/Indet/Onl/AlignL1/ID","/Indet/AlignL1/ID",className="CondAttrListCollection")) # acc.merge(addFoldersSplitOnline(flags,"INDET","/Indet/Onl/AlignL2/SCT","/Indet/AlignL2/SCT",className="CondAttrListCollection")) diff --git a/Tracker/TrackerDetDescr/FaserSCT_GeoModel/src/SCT_DetectorFactory.cxx b/Tracker/TrackerDetDescr/FaserSCT_GeoModel/src/SCT_DetectorFactory.cxx index 003173e935bc1e3fd421c99fe6affb574934558f..63763a9aa5d9c7a2dd60cc5fdf5144d8f9078a4d 100644 --- a/Tracker/TrackerDetDescr/FaserSCT_GeoModel/src/SCT_DetectorFactory.cxx +++ b/Tracker/TrackerDetDescr/FaserSCT_GeoModel/src/SCT_DetectorFactory.cxx @@ -182,7 +182,10 @@ void SCT_DetectorFactory::create(GeoPhysVol *world) m_detectorManager->addFolder("/Tracker/Align"); m_detectorManager->addChannel("/Tracker/Align/Stations", 3, TrackerDD::global); // Stations in world m_detectorManager->addChannel("/Tracker/Align/Planes", 2, TrackerDD::global); // Planes in world - m_detectorManager->addChannel("/Tracker/Align/Upstream1", 1, TrackerDD::local); // Modules in planes and wafers in modules + m_detectorManager->addChannel("/Tracker/Align/Interface1", 1, TrackerDD::local); // Modules in planes + m_detectorManager->addChannel("/Tracker/Align/Interface2", 1, TrackerDD::local); + m_detectorManager->addChannel("/Tracker/Align/Interface3", 1, TrackerDD::local); + m_detectorManager->addChannel("/Tracker/Align/Upstream1", 1, TrackerDD::local); m_detectorManager->addChannel("/Tracker/Align/Upstream2", 1, TrackerDD::local); m_detectorManager->addChannel("/Tracker/Align/Upstream3", 1, TrackerDD::local); m_detectorManager->addChannel("/Tracker/Align/Central1" , 1, TrackerDD::local); diff --git a/Tracker/TrackerDetDescr/TrackerReadoutGeometry/src/TrackerDetectorManager.cxx b/Tracker/TrackerDetDescr/TrackerReadoutGeometry/src/TrackerDetectorManager.cxx index 41c0ab6061de1a7862abc476b86378bb19196039..ae76706e4b249d815e1e64477a352b073be0823d 100755 --- a/Tracker/TrackerDetDescr/TrackerReadoutGeometry/src/TrackerDetectorManager.cxx +++ b/Tracker/TrackerDetDescr/TrackerReadoutGeometry/src/TrackerDetectorManager.cxx @@ -8,6 +8,7 @@ #include "StoreGate/StoreGateSvc.h" #include "DetDescrConditions/AlignableTransform.h" #include "FaserDetDescr/FaserDetectorID.h" +#include "Identifier/IdentifierHash.h" #include "GeoPrimitives/CLHEPtoEigenConverter.h" #include "AthenaPoolUtilities/CondAttrListCollection.h" #include "AthenaBaseComps/AthMsgStreamMacros.h"