コード例 #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 AthenaServices.AthenaServicesConf import AthenaOutputStreamTool
    toolname = name + "Tool"
    myAlg.StreamName = toolname
    condstream = AthenaOutputStreamTool(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
コード例 #2
0

myOCAHT=OutputConditionsAlg(outputFile=outputFileHT,name="myOCAHT")
myOCAHT.ObjectList=objectListHT
myOCAHT.IOVTagList=tagListHT
myOCAHT.Run1=0
myOCAHT.LB1=0
myOCAHT.Run2=2147483647
myOCAHT.LB2=0
myOCAHT.WriteIOV=True
topSequence+=myOCAHT


from AthenaServices.AthenaServicesConf import AthenaOutputStreamTool
TRTCondStream=AthenaOutputStreamTool('myOCATool')
TRTCondStream.PoolContainerPrefix='ConditionsTree'

TRTCondStream=AthenaOutputStreamTool('myOCAPerTool')
TRTCondStream.PoolContainerPrefix='ConditionsTree'

TRTCondStream=AthenaOutputStreamTool('myOCAHTTool')
TRTCondStream.PoolContainerPrefix='ConditionsTree'


ToolSvc += TRTCondStream
print TRTCondStream
svcMgr = Service( "IOVRegistrationSvc" )
svcMgr.UseGlobalIOVForCollections = True


print "#########################################################################################################################################"