16 inline HepBoost::HepBoost() : rep_() {}
18 inline HepBoost::HepBoost(
const HepBoost & m1) : rep_(m1.rep_) {}
20 inline HepBoost & HepBoost::operator = (
const HepBoost & m1) {
25 inline HepBoost::HepBoost(
double betaX,
double betaY,
double betaZ)
27 set(betaX, betaY, betaZ);
30 inline HepBoost::HepBoost(
const HepRep4x4Symmetric & m1) : rep_(m1) {}
32 inline HepBoost::HepBoost(Hep3Vector ddirection,
double bbeta)
34 double length = ddirection.mag();
36 ZMthrowC ( ZMxpvZeroVector(
"HepBoost constructed using a zero vector as direction") );
39 set(bbeta*ddirection.x()/length,
40 bbeta*ddirection.y()/length,
41 bbeta*ddirection.z()/length);
44 inline HepBoost::HepBoost(
const Hep3Vector & boost)
46 set(boost.x(), boost.y(), boost.z());
49 inline HepBoost::HepBoost(
const HepBoostX & boost) {
set(boost.boostVector());}
50 inline HepBoost::HepBoost(
const HepBoostY & boost) {
set(boost.boostVector());}
51 inline HepBoost::HepBoost(
const HepBoostZ & boost) {
set(boost.boostVector());}
52 inline HepBoost & HepBoost::set(
const HepBoostX & boost)
53 {
return set(boost.boostVector());}
54 inline HepBoost & HepBoost::set(
const HepBoostY & boost)
55 {
return set(boost.boostVector());}
56 inline HepBoost & HepBoost::set(
const HepBoostZ & boost)
57 {
return set(boost.boostVector());}
60 inline HepBoost::HepBoost (
61 double xx1,
double xy1,
double xz1,
double xt1,
62 double yy1,
double yz1,
double yt1,
63 double zz1,
double zt1,
65 rep_ ( xx1, xy1, xz1, xt1, yy1, yz1, yt1, zz1, zt1, tt1 ) {}
69 inline double HepBoost::beta()
const {
70 return std::sqrt( 1.0 - 1.0 / (rep_.tt_ * rep_.tt_) );
73 inline double HepBoost::gamma()
const {
77 inline Hep3Vector HepBoost::boostVector()
const {
78 return (1.0/rep_.tt_) * Hep3Vector( rep_.xt_, rep_.yt_, rep_.zt_ );
81 inline Hep3Vector HepBoost::getDirection()
const {
82 double norm = 1.0/beta();
83 return (norm*boostVector());
86 inline Hep3Vector HepBoost::direction()
const {
87 return getDirection();
90 inline double HepBoost::xx()
const {
return rep_.xx_; }
91 inline double HepBoost::xy()
const {
return rep_.xy_; }
92 inline double HepBoost::xz()
const {
return rep_.xz_; }
93 inline double HepBoost::xt()
const {
return rep_.xt_; }
94 inline double HepBoost::yx()
const {
return rep_.xy_; }
95 inline double HepBoost::yy()
const {
return rep_.yy_; }
96 inline double HepBoost::yz()
const {
return rep_.yz_; }
97 inline double HepBoost::yt()
const {
return rep_.yt_; }
98 inline double HepBoost::zx()
const {
return rep_.xz_; }
99 inline double HepBoost::zy()
const {
return rep_.yz_; }
100 inline double HepBoost::zz()
const {
return rep_.zz_; }
101 inline double HepBoost::zt()
const {
return rep_.zt_; }
102 inline double HepBoost::tx()
const {
return rep_.xt_; }
103 inline double HepBoost::ty()
const {
return rep_.yt_; }
104 inline double HepBoost::tz()
const {
return rep_.zt_; }
105 inline double HepBoost::tt()
const {
return rep_.tt_; }
107 inline HepLorentzVector HepBoost::col1()
const {
108 return HepLorentzVector ( xx(), yx(), zx(), tx() );
110 inline HepLorentzVector HepBoost::col2()
const {
111 return HepLorentzVector ( xy(), yy(), zy(), ty() );
113 inline HepLorentzVector HepBoost::col3()
const {
114 return HepLorentzVector ( xz(), yz(), zz(), tz() );
116 inline HepLorentzVector HepBoost::col4()
const {
117 return HepLorentzVector ( xt(), yt(), zt(), tt() );
120 inline HepLorentzVector HepBoost::row1()
const {
121 return HepLorentzVector ( col1() );
123 inline HepLorentzVector HepBoost::row2()
const {
124 return HepLorentzVector ( col2() );
126 inline HepLorentzVector HepBoost::row3()
const {
127 return HepLorentzVector ( col3() );
129 inline HepLorentzVector HepBoost::row4()
const {
130 return HepLorentzVector ( col4() );
133 inline HepRep4x4 HepBoost::rep4x4()
const {
134 return HepRep4x4( rep_ );
137 inline HepRep4x4Symmetric HepBoost::rep4x4Symmetric()
const {
142 inline void HepBoost::setBoost(
double bx,
double by,
double bz) {
149 int HepBoost::compare (
const HepBoost & b )
const {
150 const HepRep4x4Symmetric & s1 = b.rep4x4Symmetric();
151 if (rep_.tt_ < s1.tt_)
return -1;
else if (rep_.tt_ > s1.tt_)
return 1;
152 else if (rep_.zt_ < s1.zt_)
return -1;
else if (rep_.zt_ > s1.zt_)
return 1;
153 else if (rep_.zz_ < s1.zz_)
return -1;
else if (rep_.zz_ > s1.zz_)
return 1;
154 else if (rep_.yt_ < s1.yt_)
return -1;
else if (rep_.yt_ > s1.yt_)
return 1;
155 else if (rep_.yz_ < s1.yz_)
return -1;
else if (rep_.yz_ > s1.yz_)
return 1;
156 else if (rep_.yy_ < s1.yy_)
return -1;
else if (rep_.yy_ > s1.yy_)
return 1;
157 else if (rep_.xt_ < s1.xt_)
return -1;
else if (rep_.xt_ > s1.xt_)
return 1;
158 else if (rep_.xz_ < s1.xz_)
return -1;
else if (rep_.xz_ > s1.xz_)
return 1;
159 else if (rep_.xy_ < s1.xy_)
return -1;
else if (rep_.xy_ > s1.xy_)
return 1;
160 else if (rep_.xx_ < s1.xx_)
return -1;
else if (rep_.xx_ > s1.xx_)
return 1;
165 HepBoost::operator == (
const HepBoost & b)
const {
166 const HepRep4x4Symmetric & s1 = b.rep4x4Symmetric();
168 rep_.xx_==s1.xx_ && rep_.xy_==s1.xy_ && rep_.xz_==s1.xz_ && rep_.xt_==s1.xt_
169 && rep_.yy_==s1.yy_ && rep_.yz_==s1.yz_ && rep_.yt_==s1.yt_
170 && rep_.zz_==s1.zz_ && rep_.zt_==s1.zt_
176 HepBoost::operator != (
const HepBoost & r)
const {
177 return ( !(
operator==(r)) );
179 inline bool HepBoost::operator <= (
const HepBoost & b )
const 180 {
return compare(b)<= 0; }
181 inline bool HepBoost::operator >= (
const HepBoost & b )
const 182 {
return compare(b)>= 0; }
183 inline bool HepBoost::operator < (
const HepBoost & b )
const 184 {
return compare(b)< 0; }
185 inline bool HepBoost::operator > (
const HepBoost & b )
const 186 {
return compare(b)> 0; }
188 inline bool HepBoost::isIdentity()
const {
189 return (xx() == 1.0 && xy() == 0.0 && xz() == 0.0 && xt() == 0.0
190 && yy() == 1.0 && yz() == 0.0 && yt() == 0.0
191 && zz() == 1.0 && zt() == 0.0
195 inline double HepBoost::distance2(
const HepBoost & b )
const {
196 double bgx = rep_.xt_ - b.rep_.xt_;
197 double bgy = rep_.yt_ - b.rep_.yt_;
198 double bgz = rep_.zt_ - b.rep_.zt_;
199 return bgx*bgx+bgy*bgy+bgz*bgz;
202 inline double HepBoost::distance2(
const HepBoostX & bx )
const {
203 double bgx = rep_.xt_ - bx.beta()*bx.gamma();
204 double bgy = rep_.yt_;
205 double bgz = rep_.zt_;
206 return bgx*bgx+bgy*bgy+bgz*bgz;
209 inline double HepBoost::distance2(
const HepBoostY & by )
const {
210 double bgy = rep_.xt_;
211 double bgx = rep_.yt_ - by.beta()*by.gamma();
212 double bgz = rep_.zt_;
213 return bgx*bgx+bgy*bgy+bgz*bgz;
216 inline double HepBoost::distance2(
const HepBoostZ & bz )
const {
217 double bgz = rep_.xt_;
218 double bgy = rep_.yt_;
219 double bgx = rep_.zt_ - bz.beta()*bz.gamma();
220 return bgx*bgx+bgy*bgy+bgz*bgz;
223 inline double HepBoost::howNear (
const HepBoost & b )
const {
224 return std::sqrt(distance2(b));
227 inline bool HepBoost::isNear(
const HepBoost & b,
double epsilon)
const{
228 return (distance2(b) <= epsilon*epsilon);
234 inline HepLorentzVector
235 HepBoost::vectorMultiplication(
const HepLorentzVector & p)
const {
240 return HepLorentzVector( rep_.xx_*x + rep_.xy_*y + rep_.xz_*z + rep_.xt_*t,
241 rep_.xy_*x + rep_.yy_*y + rep_.yz_*z + rep_.yt_*t,
242 rep_.xz_*x + rep_.yz_*y + rep_.zz_*z + rep_.zt_*t,
243 rep_.xt_*x + rep_.yt_*y + rep_.zt_*z + rep_.tt_*t);
246 inline HepLorentzVector
247 HepBoost::operator () (
const HepLorentzVector & p)
const {
248 return vectorMultiplication(p);
251 inline HepLorentzVector
253 return vectorMultiplication(p);
259 inline HepBoost HepBoost::inverse()
const {
260 return HepBoost( xx(), yx(), zx(), -tx(),
267 return HepBoost( lt.xx(), lt.yx(), lt.zx(), -lt.tx(),
268 lt.yy(), lt.zy(), -lt.ty(),
273 inline HepBoost & HepBoost::invert() {
274 rep_.xt_ = -rep_.xt_;
275 rep_.yt_ = -rep_.yt_;
276 rep_.zt_ = -rep_.zt_;
282 inline double HepBoost::getTolerance() {
283 return Hep4RotationInterface::tolerance;
285 inline double HepBoost::setTolerance(
double tol) {
286 return Hep4RotationInterface::setTolerance(tol);
HepLorentzVector operator*(const HepLorentzVector &p, double a)
HepBoost inverseOf(const HepBoost <)