当前位置: 首页>>代码示例>>Python>>正文


Python DecayTreeTuple.Branches["Psi"]方法代码示例

本文整理汇总了Python中Configurables.DecayTreeTuple.Branches["Psi"]方法的典型用法代码示例。如果您正苦于以下问题:Python DecayTreeTuple.Branches["Psi"]方法的具体用法?Python DecayTreeTuple.Branches["Psi"]怎么用?Python DecayTreeTuple.Branches["Psi"]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Configurables.DecayTreeTuple的用法示例。


在下文中一共展示了DecayTreeTuple.Branches["Psi"]方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: addTuple

# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import Branches["Psi"] [as 别名]
def addTuple(name="", decay="", addendum="", head="/Event/Phys/", dtf=True, resonant=True, shortname="", verbose=[] ):
    from Configurables import DecayTreeTuple, PrintDecayTree, FilterDesktop, GaudiSequencer, PrintHeader, TESCheck
    
    if shortname == "": shortname = name
    shortname = shortname+"_Tuple"+addendum
    shortname = shortname.replace("MCMC","MC")
    seq = GaudiSequencer("Seq"+shortname)
    if ( not "/"==head[-1] ): head = head+'/'

    location = head+name+"/Particles" 
    from Configurables import LoKi__HDRFilter
    if ( "/Event/Phys/" == head ):
        filter = TESCheck("Check"+shortname,Inputs = [ location ], Stop = False)
    else :              # I am not running the selection, hence the stripping decision must be here     
        filter = LoKi__HDRFilter( "Check"+shortname,
                                  Code = "HLT_PASS('Stripping"+name+"Decision')",
                                  Location="/Event/Strip/Phys/DecReports" )

    #filter.OutputLevel = 1
    seq.Members += [  filter ] # PrintHeader(),
    tuple = DecayTreeTuple(shortname)
    isMDST = (addendum.upper()=="MDST")        
    if (isMDST):
        RIT = head.replace("/Phys","")
        print "RootInTES set to", RIT
        tuple.RootInTES = RIT
        tuple.Inputs = [ "Phys/"+name+"/Particles" ]
    else :
        tuple.Inputs = [ location ]

#    tuple.OutputLevel = 1
    tuple.ToolList =  []
        
    tuple.Decay = decay

    tg = tuple.addTupleTool("TupleToolGeometry")
    if not isMDST: tg.FillMultiPV = True


    tlist = []
    if ("e+" in decay):
        tlist = electronLines()            
    elif ("mu+" in decay):
        tlist = muonLines()

    if ( False ):
        tlist = allLines()
    print tlist
    
    if ( Jpsi2MuMu != decay ): bpsi = (decay.replace("^","")).replace("(J/psi(1S)","^(J/psi(1S)")
    else : bpsi = "^("+decay.replace("^","")+")"

    print "J/psi branch is `` ", bpsi, "''" 
    tuple.Branches["Psi"] = bpsi

    # sort out kstars
    if "892" in decay:
        bkstar = (decay.replace("^","")).replace("(K*(892)","^(K*(892)")
        tuple.Branches["Kstar"] = bkstar
        Kstar = tuple.addTupleTool("TupleToolDecay/Kstar")

    from Configurables import TupleToolTISTOS
    tistos = TupleToolTISTOS(TriggerList = tlist
            , VerboseHlt1 = True, VerboseHlt2 = True, VerboseL0 = True)
    
    Psi = tuple.addTupleTool("TupleToolDecay/Psi")
    Psi.addTool(tistos)
    Psi.ToolList += [ "TupleToolTISTOS" ]
#    if (not isMDST):
#        vi = tuple.Psi.addTupleTool("TupleToolVtxIsoln")
#        vi.InputParticles = [ "/Event/Phys/MyGoodPions" ]

    if ( Jpsi2MuMu == decay ):
        if (dtf):
            pvfit = tuple.Psi.addTupleTool("TupleToolDecayTreeFitter/PVFit")        # fit with all constraints I can think of
            pvfit.Verbose = True
            pvfit.constrainToOriginVertex = True
        
    else:       
        B = tuple.addTupleTool("TupleToolDecay/B")
        if ( Bs2JpsiPhi==decay ):
            p2vv = B.addTupleTool("TupleToolP2VV") 
            p2vv.Calculator = "Bs2JpsiPhiAngleCalculator"
        elif ( "K*(892)0" in decay and not Bd2MuMuKstSS==decay ):
            p2vv = B.addTupleTool("TupleToolP2VV") 
            p2vv.Calculator = "Bd2KstarMuMuAngleCalculator"
        if (Lambdab2Jpsippi==decay ): B.addTupleTool("TupleToolDalitz") 
 
        if ('Xi_b-' in decay ): bh = 'Xi_b-'
        elif ('Xi_b~+' in decay ): bh = 'Xi_b~+'
        elif ('Lambda_b0' in decay ): bh = 'Lambda_b0'
        elif ('B0' in decay): bh = 'B0'
        elif ('B+' in decay ): bh = 'B+'
        elif ('B_s0' in decay ): bh = 'B_s0'
        if ('CC' in decay): bh = '['+bh+']cc'
        print "Branch will be ``", bh+" : "+decay.replace("^",""), "''"

        tuple.Branches["B"] = "^("+decay.replace("^","")+")"
        
        # This is needed for ConstB
#.........这里部分代码省略.........
开发者ID:ibab,项目名称:lhcb-b2dmumu,代码行数:103,代码来源:DiLeptonTuple.py


注:本文中的Configurables.DecayTreeTuple.Branches["Psi"]方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。