22#include <fastjet/internal/base.hh>
24FASTJET_BEGIN_NAMESPACE
29namespace inline_maths {
31const double PI = fabs(acos(-1.));
33const double TWOPI = 2*PI;
36inline double sqr(
double a) {
42inline double min(
double a,
double b) {
43 return (a < b) ? a : b;
48inline double delta_phi(
double phi1,
double phi2) {
49 double dphi = min(
double(fabs(phi1-phi2)),
double(2.*PI-fabs(phi1-phi2)) );
50 return (phi1 < phi2) ? -dphi : dphi;
55inline double phi(
double px,
double py) {
61inline double y(
double E,
double pz) {
65 if (fabs(E-pz) == 0.) {
72 y = 0.5*log((E+pz)/(E-pz));
81inline double eta(
double p,
double pz) {
85 if (fabs(p-pz) == 0.) {
92 eta = 0.5*log((p+pz)/(p-pz));
101 inline double eta(
double px,
double py,
double pz) {
105 double p = sqrt(px*px+py*py+pz*pz);
106 if (fabs(p-pz) == 0.) {
113 eta = 0.5*log((p+pz)/(p-pz));
121 inline double eta(
double theta) {
122 double eta = -log(tan(theta/2.));
128 inline double theta(
double eta) {
129 double theta = 2.*atan(exp(-eta));
134 inline double theta(
double px,
double py,
double pz) {
135 double Eta = eta(px, py, pz);
136 double theta = 2.*atan(exp(-Eta));
double theta(const PseudoJet &a, const PseudoJet &b)
returns the angle between a and b