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


Python Constants.detector_limit方法代码示例

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


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

示例1: Decayparticlelist

# 需要导入模块: import Constants [as 别名]
# 或者: from Constants import detector_limit [as 别名]
    def Decayparticlelist(self,particlelist):
        
        stableparticles = []
        templist = particlelist # use a psudeo third list to get around pythons inability to edits lists that its iterating over.
        c = Constants.speedoflight()
        unstableparticles = particlelist # guilty until proven innocent!
        twobodyclass = Twobodydecay.twobodydecay4D()
        numberdecays = 1 # if a particle decays and forms products - then the products may decay further. this counter tells whether to keep looping or not.
        
        while numberdecays != 0:
            particlelist = templist
            templist = [] # reinitialise the templist to contain the next set of prodcut
            numberdecays = 0 # set to zero. if different that means that somethihng has decayed
            for i in range(len(particlelist)):
                
                self.Checkforkaons(particlelist[i])
                
                particlecode = particlelist[i].Getcode()
                print particlecode, "PARTICLECODE"
                
                
                
                if abs(particlecode) <= 100:
                    stableparticles.append(particlelist[i])
                    continue
                
                particlelifetime = particlelist[i].Getlifetime()
                Time = Radioactivedecay.radioactivedecay4D(particlelifetime)
                
                distance = Time * c
                #print distance, "Distacne"
                
                
                if distance >= Constants.detector_limit():  #check particle stability. if the particle gets past the detector 10CM, LIMIT, then it doesnt decay. add it to the final list.
                    stableparticles.append(particlelist[i])
                    continue
                    
                ''' If the particle decays quick enough, it will create some products. Kinematics held using standard 2/3 body decayers '''

                particledecayproducts = self.Choosehadrondecay(particlecode) # choose one of the decay routes for the unstable particle
                
                
                decayedproductlist = self.Performhadrondecay(particlelist[i],particledecayproducts)
                
                templist += decayedproductlist
                numberdecays += 1
        
        return stableparticles
开发者ID:PyLund-MC,项目名称:PyLund,代码行数:50,代码来源:Hadrondecay.py


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