Skip to content
Snippets Groups Projects
Commit fc93c154 authored by Eric Torrence's avatar Eric Torrence
Browse files

Merge branch 'faserrec-procdev' into 'master'

Updates for creating alignment DB

See merge request !319
parents 64e23583 2230e858
No related branches found
No related tags found
No related merge requests found
......@@ -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", {})
......
# 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()))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment