70 #ifndef ST_LORENTZ_VECTOR_HH
71 #define ST_LORENTZ_VECTOR_HH
73 #include "StThreeVector.hh"
97 T operator() (
size_t)
const;
98 T operator[] (
size_t)
const;
100 T& operator() (
size_t);
101 T& operator[] (
size_t);
114 #if !defined(ST_NO_MEMBER_TEMPLATES) && !defined(__CINT__)
123 T pseudoRapidity()
const;
137 #if !defined(ST_NO_MEMBER_TEMPLATES) && !defined(__CINT__)
149 #if !defined(ST_NO_MEMBER_TEMPLATES) && !defined(__CINT__)
179 : mThreeVector(0, 0, 0), mX4(0) { }
183 : mThreeVector(X, Y, Z), mX4(Time) { }
197 return (mX4*mX4 - mThreeVector*mThreeVector);
211 return -::sqrt(-mass2);
213 return ::sqrt(mass2);
219 return this->perp2() + m2();
230 return -::sqrt(-massPerp2);
232 return ::sqrt(massPerp2);
305 return mThreeVector(i);
309 #ifndef ST_NO_EXCEPTIONS
310 throw out_of_range(
"StLorentzVector<T>::operator(): bad index");
312 cerr <<
"StLorentzVector<T>::operator(): bad index." << endl;
322 return mThreeVector(i);
326 #ifndef ST_NO_EXCEPTIONS
327 throw out_of_range(
"StLorentzVector<T>::operator(): bad index");
329 cerr <<
"StLorentzVector<T>::operator(): bad index." << endl;
339 return mThreeVector[i];
343 #ifndef ST_NO_EXCEPTIONS
344 throw out_of_range(
"StLorentzVector<T>::operator[]: bad index");
346 cerr <<
"StLorentzVector<T>::operator[]: bad index." << endl;
356 return mThreeVector[i];
360 #ifndef ST_NO_EXCEPTIONS
361 throw out_of_range(
"StLorentzVector<T>::operator[]: bad index");
363 cerr <<
"StLorentzVector<T>::operator[]: bad index." << endl;
372 return 0.5*::log((mX4+mThreeVector.z())/(mX4-mThreeVector.z())+1e-20);
403 #if !defined(ST_NO_MEMBER_TEMPLATES) && !defined(__CINT__)
408 : mThreeVector(vec), mX4(Time) { }
413 : mThreeVector(vec), mX4(Time) { }
418 : mThreeVector(vec.vect()), mX4(vec.t()) { }
425 T mass = abs(pframe);
427 T gamma = fabs(pframe.e())/mass;
430 this->vect() + (gamma-1.)*pl - this->e()*eta);
445 mThreeVector = vec.vect();
455 return (mThreeVector == v.vect()) && (mX4 == v.t());
463 return !(*
this == v);
471 mThreeVector += v.vect();
481 mThreeVector -= v.vect();
490 : mThreeVector(vec), mX4(t) { }
494 : mThreeVector(vec), mX4(t) { }
498 : mThreeVector(vec), mX4(t) { }
502 : mThreeVector(vec), mX4(t) { }
506 : mThreeVector(vec.vect()), mX4(vec.t()) { }
510 : mThreeVector(vec.vect()), mX4(vec.t()) { }
516 T mass = abs(pframe);
518 T gamma = fabs(pframe.e())/mass;
521 this->vect() + (gamma-1.)*pl - this->e()*eta);
528 T mass = abs(pframe);
530 T gamma = fabs(pframe.e())/mass;
533 this->vect() + (gamma-1.)*pl - this->e()*eta);
552 mThreeVector = vec.vect();
561 mThreeVector = vec.vect();
570 return (this->vect() == v.vect()) && (mX4 == v.t());
577 return (mThreeVector == v.vect()) && (mX4 == v.t());
584 return !(*
this == v);
591 return !(*
this == v);
598 mThreeVector += v.vect();
607 mThreeVector += v.vect();
616 mThreeVector -= v.vect();
625 mThreeVector -= v.vect();
630 #endif // ST_NO_MEMBER_TEMPLATES
636 template<
class T,
class X>
643 template<
class T,
class X>
650 template<
class T,
class X>
653 return v1.t()*v2.t() - v1.vect()*v2.vect();
669 template<
class T,
class X>
676 ostream& operator<< (ostream& os, const StLorentzVector<T>& v)
678 return os << v.vect() <<
"\t\t" << v.t();
685 is >> x >> y >> z >> t;