go-hep.org/x/hep@v0.38.1/heppdt/utils.go (about)

     1  // Copyright ©2017 The go-hep Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package heppdt
     6  
     7  func calcWidthFromLifetime(lt float64) float64 {
     8  	// totalwidth = hbar / lifetime
     9  	const epsilon = 1.0e-20
    10  	const hbar = 6.58211889e-25 // in GeV s
    11  	if lt < epsilon {
    12  		return 0.
    13  	}
    14  	return hbar / lt
    15  }