def OutputConditionsAlg(name='OutputConditionsAlg',outputFile='condobjs.root', ObjectList=[],IOVTagList=[],WriteIOV=True): import AthenaCommon.AtlasUnixStandardJob # get a handle on the top-level Algorithm sequence from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() # Load POOL support import AthenaPoolCnvSvc.WriteAthenaPool from RegistrationServices.RegistrationServicesConf import OutputConditionsAlg as OPCAlg myAlg=OPCAlg(name, ObjectList=ObjectList,IOVTagList=IOVTagList,WriteIOV=WriteIOV) topSequence += myAlg # create outputStream tool with given filename and pass to myOCA from OutputStreamAthenaPool.OutputStreamAthenaPoolConf import AthenaPoolOutputStreamTool toolname=name+"Tool" myAlg.StreamName=toolname condstream=AthenaPoolOutputStreamTool(toolname) condstream.OutputFile=outputFile condstream.PoolContainerPrefix="ConditionsContainer" from AthenaCommon.AppMgr import ToolSvc ToolSvc+=condstream # return reference to algorithm so can configure further parameters return myAlg
topSequence = AlgSequence() from AthenaCommon.AppMgr import ToolSvc #------------------------------------------------ # Alignment tools #------------------------------------------------ from InDetAlignGenTools.InDetAlignGenToolsConf import InDetAlignDBTool ToolSvc += InDetAlignDBTool() from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_AlignDbSvc ServiceMgr += TRT_AlignDbSvc() # Needed for database-, Pool- and AlignableTransforms-Handling include("DetDescrCondAthenaPool/DetDescrCondAthenaPool_joboptions.py") from OutputStreamAthenaPool.OutputStreamAthenaPoolConf import AthenaPoolOutputStreamTool InDetCondStream = AthenaPoolOutputStreamTool(name="CondStream1", OutputFile=outFilename) ToolSvc += InDetCondStream print InDetCondStream # To produced a local SQLite DB with new Alignment Parameters include("RegistrationServices/IOVRegistrationSvc_jobOptions.py") regSvc = Service("IOVRegistrationSvc") regSvc.RecreateFolders = False IOVDbSvc = Service("IOVDbSvc") IOVDbSvc.dbConnection = "sqlite://;schema=%s;dbname=OFLP200" % outdbFilename #------------------------------------------------ # InDetAlignCog algorithm #------------------------------------------------ from InDetAlignGenAlgs.InDetAlignGenAlgsConf import InDetAlignCog InDetAlignCog = InDetAlignCog(
svcMgr.ProxyProviderSvc.ProviderNames += [ "CondProxyProvider" ] svcMgr += getConfigurable( "CondProxyProvider" )() #svcMgr.CondProxyProvider.InputCollections = [ "LArTTCellMap-DC3-05.pool.root" ] svcMgr.CondProxyProvider.InputCollections +=["LFN:oflcond.000002.conditions.simul.pool.v0000._0048.pool.root"] #svcMgr.CondProxyProvider.InputCollections +=["LFN:oflcond.000002.conditions.simul.pool.v0000._0047.pool.root"] # Load POOL support import AthenaPoolCnvSvc.WriteAthenaPool theApp.OutStream = [] #from AthenaCommon.AppMgr import ToolSvc from OutputStreamAthenaPool.OutputStreamAthenaPoolConf import AthenaPoolOutputStreamTool ToolSvc += AthenaPoolOutputStreamTool("CondStream1", OutputFile = "LArTTCellMap-HadFcalFix.pool.root") #-------------------------------------------------------------- # Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL ) #-------------------------------------------------------------- MessageSvc = Service( "MessageSvc" ) MessageSvc.OutputLevel = 2 MessageSvc.debugLimit = 200000 MessageSvc.useColors = TRUE theApp.EvtMax = 1 svcMgr.EventSelector.RunNumber=1 svcMgr.EventSelector.FirstEvent=1
svcMgr.EventSelector.EventsPerLB = 1 svcMgr.EventSelector.FirstLB = 1 svcMgr.EventSelector.InitialTimeStamp = 0 svcMgr.EventSelector.TimeStampInterval = 5 theApp.EvtMax = 1 #-------------------------------------------------------------- # Load POOL support #-------------------------------------------------------------- import AthenaPoolCnvSvc.WriteAthenaPool #-------------------------------------------------------------- # AthenaPool details #-------------------------------------------------------------- # Check the dictionary in memory for completeness svcMgr.AthenaSealSvc.CheckDictionary = TRUE #-------------------------------------------------------------- # Use AthenaOutputStreamTool to write # Must "turn off" standard AthenaOutputStream #-------------------------------------------------------------- theApp.OutStream = [] from AthenaCommon.AppMgr import ToolSvc mytestalg.StreamName = "AthenaPoolOutputStreamTool/CondStream2" from OutputStreamAthenaPool.OutputStreamAthenaPoolConf import AthenaPoolOutputStreamTool ToolSvc += AthenaPoolOutputStreamTool("CondStream2", OutputFile="SimplePoolFile.root")
signalStream.ItemList += ["LArTTL1Container#*"] signalStream.ItemList += ["TileTTL1Container#*"] signalStream.ItemList += [ "ROIB::RoIBResult#*", "MuCTPI_RDO#*", "CTP_RDO#*", "DataVector<LVL1::TriggerTower>#*", "DataVector<LVL1::CPMTower>#*", "DataVector<LVL1::JetElement>#*", "DataVector<LVL1::CPMHits>#*", "DataVector<LVL1::CPMRoI>#*", "DataVector<LVL1::CMMCPHits>#*", "DataVector<LVL1::CMMJetHits>#*", "DataVector<LVL1::CMMEtSums>#*", "DataVector<LVL1::JEMHits>#*", "DataVector<LVL1::JEMRoI>#*", "DataVector<LVL1::JEMEtSums>#*", "LVL1::CMMRoI#*" ] #options for writing the MetaData into the output file MetaDataStore = ServiceMgr.MetaDataStore from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream StreamRDO_MC_FH = AthenaPoolOutputStream("StreamRDO_MC_FH") from AthenaCommon.AthenaCommonFlags import jobproperties StreamRDO_MC_FH.OutputFile = "ROOTTREE:" + SignalCollection StreamRDO_MC_FH.Store = MetaDataStore StreamRDO_MC_FH.WriteOnExecute = False StreamRDO_MC_FH.WriteOnFinalize = True # Write all IOV meta data containers StreamRDO_MC_FH.ItemList += ["IOVMetaDataContainer#*"] StreamRDO_MC_FH.ItemList += ["LumiBlockCollection#*"] from OutputStreamAthenaPool.OutputStreamAthenaPoolConf import AthenaPoolOutputStreamTool StreamRDO_MC_FHTool = AthenaPoolOutputStreamTool("StreamRDO_MC_FHTool") StreamRDO_MC_FHTool.OutputCollection = "MetaDataHdr" StreamRDO_MC_FHTool.PoolContainerPrefix = "MetaData" StreamRDO_MC_FH.WritingTool = StreamRDO_MC_FHTool
from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_CalDbSvc TRTCalibDBSvc = TRT_CalDbSvc() ServiceMgr += TRTCalibDBSvc from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_StrawNeighbourSvc TRTStrawNeighbourSvc = TRT_StrawNeighbourSvc() ServiceMgr += TRTStrawNeighbourSvc from TRT_CalibTools.TRT_CalibToolsConf import FitTool TRTCalFitTool = FitTool(name='TRTCalFitTool') ToolSvc += TRTCalFitTool print TRTCalFitTool from OutputStreamAthenaPool.OutputStreamAthenaPoolConf import AthenaPoolOutputStreamTool TRTCondStream = AthenaPoolOutputStreamTool(name="CondStream1", OutputFile="trtcalibout.pool.root") ToolSvc += TRTCondStream print TRTCondStream from TRT_CalibTools.TRT_CalibToolsConf import FillAlignTrkInfo FillAlignTrkInfo = FillAlignTrkInfo(name='FillAlignTrkInfo', TrackSummaryTool=InDetTrackSummaryTool) ToolSvc += FillAlignTrkInfo print FillAlignTrkInfo from TRT_CalibTools.TRT_CalibToolsConf import FillAlignTRTHits FillAlignTRTHits = FillAlignTRTHits( name='FillAlignTRTHits', minTimebinsOverThreshold=0, NeighbourSvc=TRTStrawNeighbourSvc,
# 3) IOV = [11,infinity) job.AthExCreateCondAlg.IovRuns = [1, 4, 8, 13] #-------------------------------------------------------------- # Load POOL, IOVSvc, etc. #-------------------------------------------------------------- # POOL for reading/writing conditions import AthenaPoolCnvSvc.AthenaPool # To register conditions in IOV DB import RegistrationServices.IOVRegistrationSvc # Configure the DB connection import IOVDbSvc.IOVDb svcMgr.IOVDbSvc.dbConnection = "sqlite://;schema=mytest.db;dbname=TESTCOOL" # Only want to create conditions once theApp.EvtMax = 1 # Define output stream for POOL file theApp.OutStream = [] from AthenaCommon.AppMgr import ToolSvc from OutputStreamAthenaPool.OutputStreamAthenaPoolConf import AthenaPoolOutputStreamTool ToolSvc += AthenaPoolOutputStreamTool("AthExCondStream", OutputFile = "AthExCondStream.root") # Print job configuration print job
# Select the following to delete and recreate the folders. Default is # NOT to recreate - the content of a folder is delete before being recreated regSvc.RecreateFolders = L1CaloPedestalsMaker_RecreateCOOLFolders #-------------------------------------------------------------- # Use AthenaOutputStreamTool to write # Must "turn off" standard AthenaOutputStream #-------------------------------------------------------------- if L1CaloPedestalsMaker_Store2COOL: theApp.OutStream = [] from AthenaCommon.AppMgr import ToolSvc from OutputStreamAthenaPool.OutputStreamAthenaPoolConf import AthenaPoolOutputStreamTool ToolSvc += AthenaPoolOutputStreamTool("COOLStream", OutputFile="cool.pool.root") #-------------------------------------------------------------- # L1CaloCondSvc settings #-------------------------------------------------------------- from AthenaCommon.AppMgr import ServiceMgr from TrigT1CaloCondSvc.TrigT1CaloCondSvcConf import L1CaloCondSvc # note we can add a fully configured service in one statement ServiceMgr += L1CaloCondSvc() L1CaloCondSvc.OutputLevel = INFO # setup IOV range fro writing to COOL L1CaloCondSvc.BeginRun = IOVBeginRun L1CaloCondSvc.EndRun = IOVEndRun L1CaloCondSvc.BeginLB = IOVBeginLB
svcMgr.EventSelector.FirstLB = 1 svcMgr.EventSelector.InitialTimeStamp = 0 svcMgr.EventSelector.TimeStampInterval = 5 theApp.EvtMax = 100 #-------------------------------------------------------------- # Load POOL support #-------------------------------------------------------------- import AthenaPoolCnvSvc.WriteAthenaPool #-------------------------------------------------------------- # AthenaPool details #-------------------------------------------------------------- # Check the dictionary in memory for completeness svcMgr.AthenaSealSvc.CheckDictionary = TRUE #-------------------------------------------------------------- # Use AthenaOutputStreamTool to write # Must "turn off" standard AthenaOutputStream #-------------------------------------------------------------- theApp.OutStream = [] from AthenaCommon.AppMgr import ToolSvc IOVDbTestAlg.StreamName = "CondStream2" from OutputStreamAthenaPool.OutputStreamAthenaPoolConf import AthenaPoolOutputStreamTool ToolSvc += AthenaPoolOutputStreamTool("CondStream2", OutputFile=str(IOVDbTestAlg.run) + "-inf.root")