예제 #1
0
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
    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