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