Exemple #1
0
###############################
# from
# include( "ByteStreamCnvSvc/BSEventStorageEventSelector_jobOptions.py" )
# Services
from ByteStreamCnvSvc.ByteStreamCnvSvcConf import ByteStreamEventStorageInputSvc
ServiceMgr += ByteStreamEventStorageInputSvc("ByteStreamInputSvc")
from ByteStreamCnvSvcBase.ByteStreamCnvSvcBaseConf import ROBDataProviderSvc
ServiceMgr += ROBDataProviderSvc()
from ByteStreamCnvSvc.ByteStreamCnvSvcConf import EventSelectorByteStream
ServiceMgr += EventSelectorByteStream("EventSelector")

# for EventType
from ByteStreamCnvSvc.ByteStreamCnvSvcConf import ByteStreamCnvSvc
ServiceMgr += ByteStreamCnvSvc()

# Properties
ServiceMgr.EventSelector.ByteStreamInputSvc = "ByteStreamInputSvc"
ServiceMgr.EventPersistencySvc.CnvServices += ["ByteStreamCnvSvc"]

# ByteStreamAddressProviderSvc
from ByteStreamCnvSvcBase.ByteStreamCnvSvcBaseConf import ByteStreamAddressProviderSvc
ServiceMgr += ByteStreamAddressProviderSvc()

# proxy provider
from SGComps.SGCompsConf import ProxyProviderSvc
ServiceMgr += ProxyProviderSvc()
ServiceMgr.ProxyProviderSvc = svcMgr.ProxyProviderSvc
ServiceMgr.ProxyProviderSvc.ProviderNames += ["ByteStreamAddressProviderSvc"]

###############################
# from
Exemple #2
0
def getStream(type, name):
    # globals in this module
    global svcMgr
    global _streamMap

    # type check
    type = type.upper()
    if type not in ['EVENTSTORAGE', 'TRANSIENT']:
        raise RuntimeError("unsupported StreamType:%s" % type)

    # return existing stream
    if (type, name) in _streamMap:
        return _streamMap[(type, name)]

    # EventStorage
    if type == 'EVENTSTORAGE':
        # OutputSvc
        if not hasattr(svcMgr, "ByteStreamEventStorageOutputSvc"):
            from ByteStreamCnvSvc.ByteStreamCnvSvcConf import ByteStreamEventStorageOutputSvc
            svcMgr += ByteStreamEventStorageOutputSvc()

        # Properties
        ByteStreamCnvSvc = svcMgr.ByteStreamCnvSvc
        ByteStreamCnvSvc.ByteStreamOutputSvcList += [
            "ByteStreamEventStorageOutputSvc"
        ]

        # OutputStream
        from AthenaServices.AthenaServicesConf import AthenaOutputStream
        StreamBS = AthenaOutputStream(
            name,
            EvtConversionSvc="ByteStreamCnvSvc",
            OutputFile="ByteStreamEventStorageOutputSvc",
        )
        theApp.addOutputStream(StreamBS)
        theApp.OutStreamType = "AthenaOutputStream"

        # Define the output as follows:
        ByteStreamEventStorageOutputSvc = svcMgr.ByteStreamEventStorageOutputSvc

        ByteStreamEventStorageOutputSvc.MaxFileMB = 15000
        # maximum number of event (beyond which it creates a new file)
        ByteStreamEventStorageOutputSvc.MaxFileNE = 15000000
        ByteStreamEventStorageOutputSvc.OutputDirectory = "./"
        ByteStreamEventStorageOutputSvc.AppName = "Athena"
        # release variable depends the way the env is configured
        #svcMgr.ByteStreamEventStorageOutputSvc.FileTag = release
        svcMgr.ByteStreamEventStorageOutputSvc.RunNumber = 0
        # does not work
        if hasattr(svcMgr.EventSelector, 'RunNumber'):
            svcMgr.ByteStreamEventStorageOutputSvc.RunNumber = svcMgr.EventSelector.RunNumber

        # decode BSRDOOutput property and overwrite some OutputStream properties if things are there defined
        from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
        props = athenaCommonFlags.BSRDOOutput().split(",")
        if len(props) > 1:
            for p in props:
                if "AppName" in p:
                    svcMgr.ByteStreamEventStorageOutputSvc.AppName = p.split(
                        "=")[1]
                if "OutputDirectory" in p:
                    svcMgr.ByteStreamEventStorageOutputSvc.OutputDirectory = p.split(
                        "=")[1]
                if "FileTag" in p:
                    svcMgr.ByteStreamEventStorageOutputSvc.FileTag = p.split(
                        "=")[1]
                if "Run" in p:
                    svcMgr.ByteStreamEventStorageOutputSvc.RunNumber = int(
                        p.split("=")[1])
        else:
            svcMgr.ByteStreamEventStorageOutputSvc.SimpleFileName = athenaCommonFlags.BSRDOOutput(
            )
        # append
        _streamMap[(type, name)] = StreamBS
        return StreamBS

    elif type == 'TRANSIENT':
        # OutputSvc
        if not hasattr(svcMgr, "ROBDataProviderSvc"):
            from ByteStreamCnvSvcBase.ByteStreamCnvSvcBaseConf import ROBDataProviderSvc
            svcMgr += ROBDataProviderSvc()
        if not hasattr(svcMgr, "ByteStreamRDP_OutputSvc"):
            from ByteStreamCnvSvc.ByteStreamCnvSvcConf import ByteStreamRDP_OutputSvc
            svcMgr += ByteStreamRDP_OutputSvc()

        # Properties
        ByteStreamCnvSvc = svcMgr.ByteStreamCnvSvc
        ByteStreamCnvSvc.ByteStreamOutputSvcList += ["ByteStreamRDP_OutputSvc"]

        # This output stream is created as a regular OutputStream
        from AthenaServices.AthenaServicesConf import AthenaOutputStream
        StreamBS = AthenaOutputStream(
            name,
            EvtConversionSvc="ByteStreamCnvSvc",
            OutputFile="ByteStreamRDP_OutputSvc",
        )
        from AthenaCommon.AlgSequence import AlgSequence
        topSequence = AlgSequence()
        topSequence += StreamBS

        # ByteStreamCnvSvc is an input CnvSvc now.
        EventPersistencySvc = svcMgr.EventPersistencySvc
        EventPersistencySvc.CnvServices += ["ByteStreamCnvSvc"]

        # append
        _streamMap[(type, name)] = StreamBS
        return StreamBS

    else:
        raise RuntimeError("unsupported StreamType:%s" % type)
Exemple #3
0
BSFileList = [
    "/afs/cern.ch/user/g/gencomm/w0/cote/NightlyTestInput/data09_cos.00121244.physics_IDCosmic.daq.RAW._lb0000._SFO-5._0017.data"
]
edmCheck = True
MessageSvc.OutputLevel = INFO
EvtMax = -1

##############################
# Services
from ByteStreamCnvSvc.ByteStreamCnvSvcConf import ByteStreamEventStorageInputSvc
svcMgr += ByteStreamEventStorageInputSvc("ByteStreamInputSvc")

svcMgr.EventSelector.Input = BSFileList

from ByteStreamCnvSvcBase.ByteStreamCnvSvcBaseConf import ROBDataProviderSvc
svcMgr += ROBDataProviderSvc()

from ByteStreamCnvSvc.ByteStreamCnvSvcConf import EventSelectorByteStream
svcMgr += EventSelectorByteStream("EventSelector")
theApp.EvtSel = "EventSelector"
theApp.EvtMax = EvtMax

# for EventType
from ByteStreamCnvSvc.ByteStreamCnvSvcConf import ByteStreamCnvSvc
svcMgr += ByteStreamCnvSvc()

# Properties
EventSelector = svcMgr.EventSelector
EventSelector.ByteStreamInputSvc = "ByteStreamInputSvc"
EventPersistencySvc = svcMgr.EventPersistencySvc
EventPersistencySvc.CnvServices += ["ByteStreamCnvSvc"]
Exemple #4
0
ServiceMgr += ByteStreamInputSvc
print ByteStreamInputSvc

# get EventSelector
from ByteStreamCnvSvc.ByteStreamCnvSvcConf import EventSelectorByteStream
EventSelector = EventSelectorByteStream(
    "EventSelector",
    Input=["RawEvent.re"],
    ByteStreamInputSvc="ByteStreamInputSvc")
ServiceMgr += EventSelector
# declare EventSelector to theApp
theApp.EvtSel = "EventSelector"

# ROBDataProvider
from ByteStreamCnvSvcBase.ByteStreamCnvSvcBaseConf import ROBDataProviderSvc
ROBDataProviderSvc = ROBDataProviderSvc()
ServiceMgr += ROBDataProviderSvc
print ROBDataProviderSvc

# Conversion Service instance
from ByteStreamCnvSvc.ByteStreamCnvSvcConf import ByteStreamCnvSvc
ByteStreamCnvSvc = ByteStreamCnvSvc("ByteStreamCnvSvc", IsSimulation=True)
ByteStreamCnvSvc.InitCnvs += ["PixelRDO_Container", "PixelRDO_TB04_Collection"]
ByteStreamCnvSvc.InitCnvs += ["SCT_RDO_Container", "SCT_RDO_Collection"]
ByteStreamCnvSvc.InitCnvs += [
    "TRT_RDO_Container", "InDetRawDataCollection<TRT_RDORawData>"
]
ServiceMgr += ByteStreamCnvSvc
print ByteStreamCnvSvc

# and ByteStreamCnvSvc persistency service