if i == 32: bsCopyTool.ByteStreamOutputSvc32 = bsOutputSvc
    if i == 33: bsCopyTool.ByteStreamOutputSvc33 = bsOutputSvc
    if i == 34: bsCopyTool.ByteStreamOutputSvc34 = bsOutputSvc
    if i == 35: bsCopyTool.ByteStreamOutputSvc35 = bsOutputSvc
    if i == 36: bsCopyTool.ByteStreamOutputSvc36 = bsOutputSvc
    if i == 37: bsCopyTool.ByteStreamOutputSvc37 = bsOutputSvc
    if i == 38: bsCopyTool.ByteStreamOutputSvc38 = bsOutputSvc
    if i == 39: bsCopyTool.ByteStreamOutputSvc39 = bsOutputSvc
    if i == 40: bsCopyTool.ByteStreamOutputSvc40 = bsOutputSvc
    if i == 41: bsCopyTool.ByteStreamOutputSvc41 = bsOutputSvc
    if i == 42: bsCopyTool.ByteStreamOutputSvc42 = bsOutputSvc
    if i == 43: bsCopyTool.ByteStreamOutputSvc43 = bsOutputSvc
    if i == 44: bsCopyTool.ByteStreamOutputSvc44 = bsOutputSvc
    if i == 45: bsCopyTool.ByteStreamOutputSvc45 = bsOutputSvc
    if i == 46: bsCopyTool.ByteStreamOutputSvc46 = bsOutputSvc
    if i == 47: bsCopyTool.ByteStreamOutputSvc47 = bsOutputSvc
    if i == 48: bsCopyTool.ByteStreamOutputSvc48 = bsOutputSvc
    if i == 49: bsCopyTool.ByteStreamOutputSvc49 = bsOutputSvc

# BS InputStream
bsCopyTool.ByteStreamInputSvc = svcMgr.ByteStreamInputSvc

# create AthenaOutputStream for BS Copy
from AthenaServices.AthenaServicesConf import AthenaOutputStream
OutputStreamBSCopy = AthenaOutputStream("OutputStreamBSCopy",
                                        WritingTool=bsCopyTool)
topSequence += OutputStreamBSCopy

# apply prescale to the OutputStream
OutputStreamBSCopy.AcceptAlgs = ["BSFilter"]
bsCopyTool = ByteStreamOutputStreamCopyTool("OutputStreamBSCopyTool")
svcMgr.ToolSvc += bsCopyTool

# BS output Svc
from ByteStreamCnvSvc.ByteStreamCnvSvcConf import ByteStreamEventStorageOutputSvc

bsOutputSvc = ByteStreamEventStorageOutputSvc(
    "BSESOutputSvc",
    OutputDirectory=".",
    SimpleFileName="PrescaledEvents.data")
svcMgr += bsOutputSvc

# Set BS OutputSvc/InputSvc  to BS OutputStream Tool
bsCopyTool.ByteStreamOutputSvc = bsOutputSvc
bsCopyTool.ByteStreamInputSvc = svcMgr.ByteStreamInputSvc

# create AthenaOutputStream for BS Copy
from AthenaServices.AthenaServicesConf import AthenaOutputStream

OutputStreamBSCopy = AthenaOutputStream(OutStreamName, WritingTool=bsCopyTool)
topSequence += OutputStreamBSCopy

# apply prescale to the OutputStream
OutputStreamBSCopy.AcceptAlgs = [Prescaler.getName()]

MessageSvc.OutputLevel = DEBUG
svcMgr.EventSelector.OutputLevel = DEBUG
svcMgr.ByteStreamInputSvc.OutputLevel = DEBUG
svcMgr.ByteStreamCnvSvc.OutputLevel = DEBUG
svcMgr.ByteStreamAddressProviderSvc.OutputLevel = DEBUG