diff --git a/Control/CalypsoExample/WriteAlignment/python/WriteAlignmentConfig_Faser02.py b/Control/CalypsoExample/WriteAlignment/python/WriteAlignmentConfig_Faser02.py index 2e944e3fc88b76d6794a7df7b9ce4469fc763d51..56b856fa824564a1368675eb45bb1d6166a7949d 100644 --- a/Control/CalypsoExample/WriteAlignment/python/WriteAlignmentConfig_Faser02.py +++ b/Control/CalypsoExample/WriteAlignment/python/WriteAlignmentConfig_Faser02.py @@ -53,11 +53,11 @@ if __name__ == "__main__": # 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.FaserVersion = "FASERNU-03" # Default FASER geometry + ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-02" # Old field map + ConfigFlags.IOVDb.DBConnection = "sqlite://;schema=FASER-02_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.addFlag("WriteAlignment.PoolFileName", "FASER-02_Align.pool.root") # Parse flags from command line and lock ConfigFlags.addFlag("AlignDbTool.AlignmentConstants", {}) diff --git a/Control/CalypsoExample/WriteAlignment/python/WriteAlignmentConfig_Faser03.py b/Control/CalypsoExample/WriteAlignment/python/WriteAlignmentConfig_Faser03.py new file mode 100755 index 0000000000000000000000000000000000000000..2bbddc7cde737cfd5506c0c4bc6610ca820fb55b --- /dev/null +++ b/Control/CalypsoExample/WriteAlignment/python/WriteAlignmentConfig_Faser03.py @@ -0,0 +1,82 @@ +# 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", alignmentConstants={}, **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>" ) + + trackerAlignDBTool = CompFactory.TrackerAlignDBTool("AlignDbTool", OutputTool = outputTool, + OutputLevel=VERBOSE, + AlignmentConstants = {}) + kwargs.setdefault("AlignDbTool", trackerAlignDBTool) + trackerAlignDBTool.AlignmentConstants = alignmentConstants + 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 = "FASERNU-03" # Default FASER geometry + ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-03" + ConfigFlags.IOVDb.DBConnection = "sqlite://;schema=FASER-03_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", "FASER-03_Align.pool.root") + +# Parse flags from command line and lock + ConfigFlags.addFlag("AlignDbTool.AlignmentConstants", {}) + ConfigFlags.fillFromArgs(sys.argv[1:]) + 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, alignmentConstants=ConfigFlags.AlignDbTool.AlignmentConstants, 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()))