2 // ---------------------------------------------------------------------------
4 // This file is a part of the CLHEP - a Class Library for High Energy Physics.
6 // This is the definitions of the inline member functions of the
14 // ---------- Constructors and Assignment:
16 inline HepBoostX::HepBoostX() : beta_(0.0), gamma_(1.0) {}
18 inline HepBoostX::HepBoostX(const HepBoostX & b) :
22 inline HepBoostX & HepBoostX::operator = (const HepBoostX & b) {
28 inline HepBoostX::HepBoostX(double bbeta) { set(bbeta); }
30 // - Protected method:
31 inline HepBoostX::HepBoostX( double bbeta, double ggamma ) :
32 beta_(bbeta), gamma_(ggamma) {}
34 // ---------- Accessors:
36 inline double HepBoostX::beta() const {
40 inline double HepBoostX::gamma() const {
44 inline Hep3Vector HepBoostX::boostVector() const {
45 return Hep3Vector( beta_, 0, 0 );
48 inline Hep3Vector HepBoostX::getDirection() const {
49 return Hep3Vector(1.0, 0.0, 0.0);
52 inline double HepBoostX::xx() const { return gamma();}
53 inline double HepBoostX::xy() const { return 0.0;}
54 inline double HepBoostX::xz() const { return 0.0;}
55 inline double HepBoostX::xt() const { return beta()*gamma();}
56 inline double HepBoostX::yx() const { return 0.0;}
57 inline double HepBoostX::yy() const { return 1.0;}
58 inline double HepBoostX::yz() const { return 0.0;}
59 inline double HepBoostX::yt() const { return 0.0;}
60 inline double HepBoostX::zx() const { return 0.0;}
61 inline double HepBoostX::zy() const { return 0.0;}
62 inline double HepBoostX::zz() const { return 1.0;}
63 inline double HepBoostX::zt() const { return 0.0;}
64 inline double HepBoostX::tx() const { return beta()*gamma();}
65 inline double HepBoostX::ty() const { return 0.0;}
66 inline double HepBoostX::tz() const { return 0.0;}
67 inline double HepBoostX::tt() const { return gamma();}
69 inline HepLorentzVector HepBoostX::col1() const {
70 return HepLorentzVector ( gamma(), 0, 0, beta()*gamma() );
72 inline HepLorentzVector HepBoostX::col2() const {
73 return HepLorentzVector ( 0, 1, 0, 0 );
75 inline HepLorentzVector HepBoostX::col3() const {
76 return HepLorentzVector ( 0, 0, 1, 0 );
78 inline HepLorentzVector HepBoostX::col4() const {
79 return HepLorentzVector ( beta()*gamma(), 0, 0, gamma() );
82 inline HepLorentzVector HepBoostX::row1() const {
83 return HepLorentzVector ( col1() );
85 inline HepLorentzVector HepBoostX::row2() const {
86 return HepLorentzVector ( col2() );
88 inline HepLorentzVector HepBoostX::row3() const {
89 return HepLorentzVector ( col3() );
91 inline HepLorentzVector HepBoostX::row4() const {
92 return HepLorentzVector ( col4() );
95 // ---------- Comparisons:
97 inline int HepBoostX::compare( const HepBoostX & b ) const {
98 if (beta() < b.beta()) {
100 } else if (beta() > b.beta()) {
107 inline bool HepBoostX::operator == ( const HepBoostX & b ) const {
108 return beta_ == b.beta_;
110 inline bool HepBoostX::operator != ( const HepBoostX & b ) const {
111 return beta_ != b.beta_;
113 inline bool HepBoostX::operator <= ( const HepBoostX & b ) const {
114 return beta_ <= b.beta_;
116 inline bool HepBoostX::operator >= ( const HepBoostX & b ) const {
117 return beta_ >= b.beta_;
119 inline bool HepBoostX::operator < ( const HepBoostX & b ) const {
120 return beta_ < b.beta_;
122 inline bool HepBoostX::operator > ( const HepBoostX & b ) const {
123 return beta_ > b.beta_;
126 inline bool HepBoostX::isIdentity() const {
127 return ( beta() == 0 );
130 inline double HepBoostX::distance2( const HepBoostX & b ) const {
131 double d = beta()*gamma() - b.beta()*b.gamma();
135 inline double HepBoostX::howNear(const HepBoostX & b) const {
136 return std::sqrt(distance2(b)); }
137 inline double HepBoostX::howNear(const HepBoost & b) const {
138 return std::sqrt(distance2(b)); }
139 inline double HepBoostX::howNear(const HepRotation & r) const {
140 return std::sqrt(distance2(r)); }
141 inline double HepBoostX::howNear(const HepLorentzRotation & lt) const {
142 return std::sqrt(distance2(lt)); }
144 inline bool HepBoostX::isNear(const HepBoostX & b,
145 double epsilon) const {
146 return (distance2(b) <= epsilon*epsilon);
148 inline bool HepBoostX::isNear(const HepBoost & b,
149 double epsilon) const {
150 return (distance2(b) <= epsilon*epsilon);
153 // ---------- Properties:
155 inline double HepBoostX::norm2() const {
156 register double bg = beta_*gamma_;
160 // ---------- Application:
162 inline HepLorentzVector
163 HepBoostX::operator * (const HepLorentzVector & p) const {
164 double bg = beta_*gamma_;
165 return HepLorentzVector(gamma_*p.x() + bg*p.t(),
168 gamma_*p.t() + bg*p.x());
171 inline HepLorentzVector
172 HepBoostX::operator() (const HepLorentzVector & w) const {
176 // ---------- Operations in the group of 4-Rotations
178 inline HepBoostX HepBoostX::inverse() const {
179 return HepBoostX( -beta(), gamma() );
182 inline HepBoostX inverseOf ( const HepBoostX & b ) {
183 return HepBoostX( -b.beta(), b.gamma());
186 inline HepBoostX & HepBoostX::invert() {
191 // ---------- Tolerance:
193 inline double HepBoostX::getTolerance() {
194 return Hep4RotationInterface::tolerance;
196 inline double HepBoostX::setTolerance(double tol) {
197 return Hep4RotationInterface::setTolerance(tol);