12 #pragma implementation
47 std::cerr <<
"HepLorentzVector::plus() - "
48 <<
"A zero vector used as reference to LorentzVector plus-part"
52 return ee + pp.
dot(ref)/
r;
58 std::cerr <<
"HepLorentzVector::minus() - "
59 <<
"A zero vector used as reference to LorentzVector minus-part"
63 return ee - pp.
dot(ref)/
r;
80 std::cerr <<
"HepLorentzVector::beta() - "
81 <<
"beta computed for HepLorentzVector with t=0 -- infinite result"
91 return std::sqrt (pp.
mag2() / (ee*ee)) ;
95 double v2 = pp.
mag2();
101 std::cerr <<
"HepLorentzVector::gamma() - "
102 <<
"gamma computed for HepLorentzVector with t=0 -- zero result"
108 std::cerr <<
"HepLorentzVector::gamma() - "
109 <<
"gamma computed for a spacelike HepLorentzVector -- imaginary result"
118 return 1./std::sqrt(1. - v2/t2 );
129 register double z1 = pp.
getZ();
135 if (std::fabs(ee) < std::fabs(z1)) {
136 std::cerr <<
"HepLorentzVector::rapidity() - "
137 <<
"rapidity for spacelike 4-vector with |E| < |Pz| -- undefined"
141 double q = (ee + z1) / (ee - z1);
144 return .5 * std::log(q);
148 register double r = ref.
mag2();
150 std::cerr <<
"HepLorentzVector::rapidity() - "
151 <<
"A zero vector used as reference to LorentzVector rapidity"
155 register double vdotu = pp.
dot(ref)/std::sqrt(r);
161 if (std::fabs(ee) < std::fabs(vdotu)) {
162 std::cerr <<
"HepLorentzVector::rapidity() - "
163 <<
"rapidity for spacelike 4-vector with |E| < |P*ref| -- undefined "
167 double q = (ee + vdotu) / (ee - vdotu);
168 return .5 * std::log(q);
172 register double v1 = pp.
mag();
178 if (std::fabs(ee) < std::fabs(v1)) {
179 std::cerr <<
"HepLorentzVector::coLinearRapidity() - "
180 <<
"co-linear rapidity for spacelike 4-vector -- undefined"
184 double q = (ee + v1) / (ee - v1);
185 return .5 * std::log(q);
196 if ( ee * w.ee < 0 ) {
197 std::cerr <<
"HepLorentzVector::invariantMass() - "
198 <<
"invariant mass meaningless: \n"
199 <<
"a negative-mass input led to spacelike 4-vector sum" << std::endl;
203 std::cerr <<
"HepLorentzVector::invariantMass() - "
204 <<
"invariant mass meaningless because of spacelike input"
216 return (ee+w.ee >=0 ) ? std::sqrt(m1) : - std::sqrt(m1);
228 double t1 = ee + w.ee;
231 if (v1.
mag2() == 0) {
234 std::cerr <<
"HepLorentzVector::findBoostToCM() - "
235 <<
"boostToCM computed for two 4-vectors with combined t=0 -- "
236 <<
"infinite result" << std::endl;
Hep3Vector boostVector() const
double dot(const Hep3Vector &) const
double coLinearRapidity() const
double invariantMass() const
static ZMpvMetric_t setMetric(ZMpvMetric_t met)
double invariantMass2() const
Hep3Vector findBoostToCM() const
bool isLightlike(double epsilon=tolerance) const
HepLorentzVector rest4Vector() const
static ZMpvMetric_t getMetric()