示例#1
0
def ApplyPrescale(arg):
    #Supported args are 'SET_StreamName_Value' where arg is a string and value is an integer
    if isinstance(arg,str):
        if arg.startswith('SET_'):
            name_val=arg[4:]
            try:
                i=name_val.rindex('_')
            except:
                raise SyntaxError("ApplyPrescale arg needs to have the form 'SET_StreamName_val', arg= "+arg)
            name=name_val[:i]
            val=name_val[i+1:]
            try:
                prescale=int(val)
            except:
                raise TypeError("ApplyPrescale val needs to be an integer: val= "+val)
        else:
            raise SyntaxError("ApplyPrescale arg needs to start with 'SET_'. arg= "+arg)
    else:
        raise TypeError("ApplyPrescale arg of %s has to be a string. "%type(arg)+arg)

    from OutputStreamAthenaPool.MultipleStreamManager import MSMgr 
    if MSMgr.StreamExists( name ):
        stream=MSMgr.GetStream( name )
        origVal=stream.GetPrescale()
        stream.SetPrescale( prescale )
        print ("INFO ApplyPrescale - SET prescale value %i to stream"%prescale,name,"(original value:",origVal,")")
    else:
        print ("WARNING ApplyPrescale - unable to get stream "+name+". No additional prescale applied.")
    return
示例#2
0
if primDPD.MakePrimaryDPD():
    from OutputStreamAthenaPool.MultipleStreamManager import MSMgr
    from PrimaryDPDMaker.PrimaryDPDFlags import listESDtoDPD, listAODtoDPD

    for stream in listESDtoDPD + listAODtoDPD:
        if MSMgr.StreamExists(stream):
            StreamESD = MSMgr.GetStream(stream)
            StreamESD.AddItem(["JetCollection#*"])
            StreamESD.AddItem(["MissingET#*"])
示例#3
0
# modify ESD for 2013 p+Pb run
from OutputStreamAthenaPool.MultipleStreamManager import MSMgr
if MSMgr.StreamExists("StreamESD"):
    myStream = MSMgr.GetStream("StreamESD")
    myStream.AddItem("CaloClusterContainer#CaloTopoCluster")
    print 'CaloTopoClusterContainer added to ESD'