11#include "CLHEP/Vector/defs.h"
12#include "CLHEP/Vector/LorentzVector.h"
13#include "CLHEP/Vector/ZMxpv.h"
47 "A zero vector used as reference to LorentzVector plus-part"));
50 return ee + pp.
dot(ref)/r;
57 "A zero vector used as reference to LorentzVector minus-part"));
60 return ee - pp.
dot(ref)/r;
78 "beta computed for HepLorentzVector with t=0 -- infinite result"));
84 "beta computed for a non-timelike HepLorentzVector"));
87 return std::sqrt (pp.
mag2() / (ee*ee)) ;
91 double v2 = pp.
mag2();
98 "gamma computed for HepLorentzVector with t=0 -- zero result"));
104 "gamma computed for a spacelike HepLorentzVector -- imaginary result"));
107 }
else if ( t2 == v2 ) {
109 "gamma computed for a lightlike HepLorentzVector -- infinite result"));
111 return 1./std::sqrt(1. - v2/t2 );
122 double z1 = pp.
getZ();
123 if (std::fabs(ee) == std::fabs(z1)) {
125 "rapidity for 4-vector with |E| = |Pz| -- infinite result"));
127 if (std::fabs(ee) < std::fabs(z1)) {
129 "rapidity for spacelike 4-vector with |E| < |Pz| -- undefined"));
132 double q = (ee + z1) / (ee - z1);
135 return .5 * std::log(q);
139 double r = ref.
mag2();
142 "A zero vector used as reference to LorentzVector rapidity"));
145 double vdotu = pp.
dot(ref)/std::sqrt(r);
146 if (std::fabs(ee) == std::fabs(vdotu)) {
148 "rapidity for 4-vector with |E| = |Pu| -- infinite result"));
150 if (std::fabs(ee) < std::fabs(vdotu)) {
152 "rapidity for spacelike 4-vector with |E| < |P*ref| -- undefined "));
155 double q = (ee + vdotu) / (ee - vdotu);
156 return .5 * std::log(q);
160 double v1 = pp.
mag();
161 if (std::fabs(ee) == std::fabs(v1)) {
163 "co-Linear rapidity for 4-vector with |E| = |P| -- infinite result"));
165 if (std::fabs(ee) < std::fabs(v1)) {
167 "co-linear rapidity for spacelike 4-vector -- undefined"));
170 double q = (ee + v1) / (ee - v1);
171 return .5 * std::log(q);
182 if ( ee * w.ee < 0 ) {
184 "invariant mass meaningless: \n"
185 "a negative-mass input led to spacelike 4-vector sum" ));
190 "invariant mass meaningless because of spacelike input"));
201 return (ee+w.ee >=0 ) ? std::sqrt(m1) : - std::sqrt(m1);
213 double t1 = ee + w.ee;
216 if (v1.
mag2() == 0) {
220 "boostToCM computed for two 4-vectors with combined t=0 -- "
225 if (t1*t1 - v1.
mag2() <= 0) {
227 "boostToCM computed for pair of HepLorentzVectors with non-timelike sum"));
double dot(const Hep3Vector &) const
double invariantMass() const
Hep3Vector boostVector() const
HepLorentzVector rest4Vector() const
static ZMpvMetric_t getMetric()
bool isLightlike(double epsilon=tolerance) const
double invariantMass2() const
double coLinearRapidity() const
Hep3Vector findBoostToCM() const
static ZMpvMetric_t setMetric(ZMpvMetric_t a1)