#ifndef __JPHYSICS__JPHYSICSTOOLKIT__ #define __JPHYSICS__JPHYSICSTOOLKIT__ #include /** * \file * Auxiliary methods for physics calculations. * \author bjung */ namespace JPHYSICS {} namespace JPP { using namespace JPHYSICS; } namespace JPHYSICS { /** * Get kinetic energy of particle with given energy and mass. * * \param E energy [GeV] * \param m mass [GeV] * \return kinetic energy [GeV] */ inline double getKineticEnergy(const double E, const double m) { if (E > m) { return sqrt((E - m) * (E + m)); } else { return 0.0; } } } #endif