示例#1
0
                             OutputFile="ByteStreamEventStorageOutputSvc")
theApp.addOutputStream(oStream)
theApp.OutStreamType = "AthenaOutputStream"
# Define the output as follows:
ByteStreamEventStorageOutputSvc = svcMgr.ByteStreamEventStorageOutputSvc
ByteStreamEventStorageOutputSvc.OutputDirectory = "./"
ByteStreamEventStorageOutputSvc.AppName = "Athena"
ByteStreamEventStorageOutputSvc.FileTag = "csc13"

# read LArRawChannel from G4, write to BS

theApp.Dlls += ["LArCalibUtils"]
theApp.Dlls += ["LArByteStream"]

oStream.ItemList += ["2721#*"]
oStream.ForceRead = True

#--------------------------------------------------------------
# Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL )
#--------------------------------------------------------------
MessageSvc = svcMgr.MessageSvc
MessageSvc.OutputLevel = INFO
#--------------------------------------------------------------
# Event related parameters
#--------------------------------------------------------------
# Number of events to be processed (default is 10)
theApp.EvtMax = 50

ByteStreamEventStorageOutputSvc.FileTag = "csc12"
from LArByteStream.LArByteStreamConfig import LArRawDataContByteStreamToolConfig
ByteStreamFileOutputSvc = ByteStreamFileOutputSvc("ByteStreamFileOutputSvc",
                                                  OutputFiles=["RawEvent.re"])
ServiceMgr += ByteStreamFileOutputSvc
print ByteStreamFileOutputSvc

# Conversion Service instance
from ByteStreamCnvSvc.ByteStreamCnvSvcConf import ByteStreamCnvSvc
ByteStreamCnvSvc = ByteStreamCnvSvc(
    "ByteStreamCnvSvc",
    IsSimulation=True,
    ByteStreamOutputSvc="ByteStreamFileOutputSvc")
ByteStreamCnvSvc.InitCnvs += ["PixelRDO_Container"]
#ByteStreamCnvSvc.InitCnvs += ["SCT_RDO_Container"]
#ByteStreamCnvSvc.InitCnvs += ["TRT_RDO_Container"]
ServiceMgr += ByteStreamCnvSvc
print ByteStreamCnvSvc

# OutputStream
from AthenaServices.AthenaServicesConf import AthenaOutputStream
StreamBS = AthenaOutputStream("StreamBS", EvtConversionSvc="ByteStreamCnvSvc")
# Force reading of output stream (ostream set externally)
StreamBS.ForceRead = TRUE
#StreamBS.ItemList += [ "TRT_RDO_Container#*" ]
#StreamBS.ItemList += [ "SCT_RDO_Container#*" ]
StreamBS.ItemList += ["PixelRDO_Container#*"]
print StreamBS

# add stream
theApp.addOutputStream(StreamBS)
theApp.OutStreamType = "AthenaOutputStream"
  ByteStreamCnvSvc.InitCnvs += ["SCT_RDO_Container"]
if DetFlags.haveRIO.TRT_on():
  ByteStreamCnvSvc.InitCnvs += ["TRT_RDO_Container"]
if DetFlags.haveRIO.BCM_on():
  ByteStreamCnvSvc.InitCnvs += ["BCM_RDO_Container"]
print              ByteStreamCnvSvc

# OutputStream
from AthenaServices.AthenaServicesConf import AthenaOutputStream
oStream = AthenaOutputStream(
    "StreamBS",
    EvtConversionSvc = "ByteStreamCnvSvc",
    OutputFile = "ByteStreamEventStorageOutputSvc"
    )

oStream.ForceRead = TRUE
if DetFlags.haveRIO.pixel_on():
  oStream.ItemList += [ "PixelRDO_Container#*" ]
if DetFlags.haveRIO.SCT_on():
  oStream.ItemList += [ "SCT_RDO_Container#*" ]
if DetFlags.haveRIO.TRT_on():
  oStream.ItemList += [ "TRT_RDO_Container#*" ]
if DetFlags.haveRIO.BCM_on():
  oStream.ItemList += [ "BCM_RDO_Container#*" ]
print oStream

# add stream
theApp.addOutputStream( oStream )
theApp.OutStreamType ="AthenaOutputStream"

ByteStreamEventStorageOutputSvc = svcMgr.ByteStreamEventStorageOutputSvc