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