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


Python Constants.gcc方法代码示例

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


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

示例1: Fixlowenergy

# 需要导入模块: import Constants [as 别名]
# 或者: from Constants import gcc [as 别名]
def Fixlowenergy(lop): # If gluon has too small an energy that it cannot be fed into PyLund after decaying, its absorbed into its neighbours.

    maxqmass = 0.6 # mass of the ud diquark pair WAS
    no_parts = len(lop)
    finished = False
    while True:
        if finished == True:
            #print "final number of particles", len(lop)
            return lop
            break
        no_parts = len(lop)
        #rint no_parts, "number particles"
        # go over the list. combine the low energy gluons absorbed into their neighbours.
        for i in range(no_parts):
            #print i, "i nubmer"
            if lop[i].Checkgluon() == True:
                vec_g = copy.deepcopy(lop[i].Getvector4D())
                vecleft = copy.deepcopy(lop[i-1].Getvector4D())
                vecright = copy.deepcopy(lop[i+1].Getvector4D())
                testleft = numpy.sqrt((vec_g + vecleft) * (vec_g + vecleft)) # invariant mass of the gluon and the partner on the left
                testright = numpy.sqrt((vec_g + vecright) * (vec_g + vecright)) # invariant mass of the gluon and the partner on the right
                Eg = vec_g.Getvector()[0]
                x = Constants.gmm() * maxqmass / Eg
                #print testleft, "testleft"
                #print testright, "testright"

                #print vec_g, "vec g into the code"
                
                if 1 < x:
                    newgluons = Absorbgluons(lop[i-1],lop[i],lop[i+1])
                    lop[i-1] = newgluons[0]
                    lop[i+1] = newgluons[1]
                    lop.pop(i) # remove the quark from the list. then need to go back to start of while to get the newest len (as it has changed)
                    #print "list popped, check if we go back to start"
                    break
                
                if testleft < (Constants.gcc()*maxqmass): # inv mass with left too small. GEt absorbed into neighbours
                    newgluons = Absorbgluons(lop[i-1],lop[i],lop[i+1])
                    lop[i-1] = newgluons[0]
                    lop[i+1] = newgluons[1]
                    lop.pop(i) # remove the quark from the list. then need to go back to start of while to get the newest len (as it has changed)
                    #print "list popped, check if we go back to start"
                    break
                if testright < (Constants.gcc()*maxqmass): # inv mass with the right too small. Get absorbed into neighbours
                    newgluons = Absorbgluons(lop[i-1],lop[i],lop[i+1])
                    lop[i-1] = newgluons[0]
                    lop[i+1] = newgluons[1]
                    lop.pop(i) # remove the quark from the list. then need to go back to start of while to get the newest len (as it has changed)
                    #print "list popped, check if we go back to start"
                    break
                else: # inv mass with neightbours is high enough. move to next gluon.
                    pass
        # get to this point once finished the lot?
            if i == (no_parts-1):
                finished = True
开发者ID:PyLund-MC,项目名称:PyLund,代码行数:57,代码来源:Hepmcconverter.py


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