Jpp  19.0.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JPhysicsToolkit.hh
Go to the documentation of this file.
1 #ifndef __JPHYSICS__JPHYSICSTOOLKIT__
2 #define __JPHYSICS__JPHYSICSTOOLKIT__
3 
4 #include <cmath>
5 
6 /**
7  * \file
8  * Auxiliary methods for physics calculations.
9  * \author bjung
10  */
11 
12 namespace JPHYSICS {}
13 namespace JPP { using namespace JPHYSICS; }
14 
15 namespace JPHYSICS {
16 
17  /**
18  * Get kinetic energy of particle with given energy and mass.
19  *
20  * \param E energy [GeV]
21  * \param m mass [GeV]
22  * \return kinetic energy [GeV]
23  */
24  inline double getKineticEnergy(const double E, const double m)
25  {
26  if (E > m) {
27  return sqrt((E - m) * (E + m));
28  } else {
29  return 0.0;
30  }
31  }
32 }
33 
34 #endif
then usage $script< input file >[option[primary[working directory]]] nWhere option can be E
Definition: JMuonPostfit.sh:40
double getKineticEnergy(const Trk &trk)
Get track kinetic energy.