13#include "CLHEP/Vector/defs.h"
14#include "CLHEP/Vector/ThreeVector.h"
15#include "CLHEP/Vector/ZMxpv.h"
29 double b = std::sqrt(
mag2());
32 "Beta taken for Hep3Vector of at least unit length"));
38 double bbeta = std::sqrt(
mag2());
41 "Gamma taken for Hep3Vector of unit magnitude -- infinite result"));
45 "Gamma taken for Hep3Vector of more than unit magnitude -- "
46 "the sqrt function would return NAN" ));
48 return 1/std::sqrt(1-bbeta*bbeta);
52 if (std::fabs(
z()) == 1) {
54 "Rapidity in Z direction taken for Hep3Vector with |Z| = 1 -- \n"
55 "the log should return infinity"));
57 if (std::fabs(
z()) > 1) {
59 "Rapidity in Z direction taken for Hep3Vector with |Z| > 1 -- \n"
60 "the log would return a NAN" ));
63 return (.5 * std::log((1+
z())/(1-
z())) );
70 "Co-linear Rapidity taken for Hep3Vector of unit length -- "
71 "the log should return infinity"));
75 "Co-linear Rapidity taken for Hep3Vector of more than unit length -- "
76 "the log would return a NAN" ));
79 return (.5 * std::log((1+b)/(1-b)) );
87 double mag2v2 = v2.
mag2();
90 "Attempt to take projection of vector against zero reference vector "));
93 return ( v2 * (
dot(v2)/mag2v2) );
97 double vmag = v2.
mag();
100 "Rapidity taken with respect to zero vector" ));
103 double z1 =
dot(v2)/vmag;
104 if (std::fabs(z1) >= 1) {
106 "Rapidity taken for too large a Hep3Vector "
107 "-- would return infinity or NAN"));
110 return (.5 * std::log((1+z1)/(1-z1)) );
120 double v2r = v2.
mag();
121 if ( (r1 == 0) || (v2r == 0) ) {
123 "Cannot find pseudorapidity of a zero vector relative to a vector"));
126 double c =
dot(v2)/(r1*v2r);
130 "Pseudorapidity of vector relative to parallel vector -- "
131 "will give infinite result"));
138 "Pseudorapidity of vector relative to anti-parallel vector -- "
139 "will give negative infinite result"));
148 double tangent = std::sqrt (1-c*c) / ( 1 + c );
149 return (- std::log (tangent));
double dot(const Hep3Vector &) const
double negativeInfinity() const
double coLinearRapidity() const
Hep3Vector project() const