本文整理汇总了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