Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
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
12namespace JPHYSICS {}
13namespace JPP { using namespace JPHYSICS; }
14
15namespace 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
Auxiliary methods for light properties of deep-sea water.
double getKineticEnergy(const double E, const double m)
Get kinetic energy of particle with given energy and mass.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).