44 std::cerr <<
"HepLorentzVector::plus() - "
45 <<
"A zero vector used as reference to LorentzVector plus-part"
49 return ee + pp.
dot(ref)/r;
55 std::cerr <<
"HepLorentzVector::minus() - "
56 <<
"A zero vector used as reference to LorentzVector minus-part"
60 return ee - pp.
dot(ref)/r;
77 std::cerr <<
"HepLorentzVector::beta() - "
78 <<
"beta computed for HepLorentzVector with t=0 -- infinite result"
88 return std::sqrt (pp.
mag2() / (ee*ee)) ;
92 double v2 = pp.
mag2();
98 std::cerr <<
"HepLorentzVector::gamma() - "
99 <<
"gamma computed for HepLorentzVector with t=0 -- zero result"
105 std::cerr <<
"HepLorentzVector::gamma() - "
106 <<
"gamma computed for a spacelike HepLorentzVector -- imaginary result"
115 return 1./std::sqrt(1. - v2/t2 );
126 double z1 = pp.
getZ();
132 if (std::fabs(ee) < std::fabs(z1)) {
133 std::cerr <<
"HepLorentzVector::rapidity() - "
134 <<
"rapidity for spacelike 4-vector with |E| < |Pz| -- undefined"
138 double q = (ee + z1) / (ee - z1);
141 return .5 * std::log(q);
145 double r = ref.
mag2();
147 std::cerr <<
"HepLorentzVector::rapidity() - "
148 <<
"A zero vector used as reference to LorentzVector rapidity"
152 double vdotu = pp.
dot(ref)/std::sqrt(r);
158 if (std::fabs(ee) < std::fabs(vdotu)) {
159 std::cerr <<
"HepLorentzVector::rapidity() - "
160 <<
"rapidity for spacelike 4-vector with |E| < |P*ref| -- undefined "
164 double q = (ee + vdotu) / (ee - vdotu);
165 return .5 * std::log(q);
169 double v1 = pp.
mag();
175 if (std::fabs(ee) < std::fabs(v1)) {
176 std::cerr <<
"HepLorentzVector::coLinearRapidity() - "
177 <<
"co-linear rapidity for spacelike 4-vector -- undefined"
181 double q = (ee + v1) / (ee - v1);
182 return .5 * std::log(q);
193 if ( ee * w.ee < 0 ) {
194 std::cerr <<
"HepLorentzVector::invariantMass() - "
195 <<
"invariant mass meaningless: \n"
196 <<
"a negative-mass input led to spacelike 4-vector sum" << std::endl;
200 std::cerr <<
"HepLorentzVector::invariantMass() - "
201 <<
"invariant mass meaningless because of spacelike input"
213 return (ee+w.ee >=0 ) ? std::sqrt(m1) : - std::sqrt(m1);
225 double t1 = ee + w.ee;
228 if (v1.
mag2() == 0) {
231 std::cerr <<
"HepLorentzVector::findBoostToCM() - "
232 <<
"boostToCM computed for two 4-vectors with combined t=0 -- "
233 <<
"infinite result" << std::endl;
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 met)