CLHEP 2.4.7.1
C++ Class Library for High Energy Physics
LorentzRotation.icc
Go to the documentation of this file.
1// -*- C++ -*-
2// $Id: LorentzRotation.icc,v 1.2 2003/10/10 21:42:35 garren Exp $
3// ---------------------------------------------------------------------------
4//
5// This file is a part of the CLHEP - a Class Library for High Energy Physics.
6//
7// This is the definitions of the inline member functions of the
8// HepLorentzRotation class
9//
10
11namespace CLHEP {
12
13// ---------- Constructors and Assignment:
14
16 mxx(1.0), mxy(0.0), mxz(0.0), mxt(0.0),
17 myx(0.0), myy(1.0), myz(0.0), myt(0.0),
18 mzx(0.0), mzy(0.0), mzz(1.0), mzt(0.0),
19 mtx(0.0), mty(0.0), mtz(0.0), mtt(1.0) {}
20
22 mxx(r.mxx), mxy(r.mxy), mxz(r.mxz), mxt(r.mxt),
23 myx(r.myx), myy(r.myy), myz(r.myz), myt(r.myt),
24 mzx(r.mzx), mzy(r.mzy), mzz(r.mzz), mzt(r.mzt),
25 mtx(r.mtx), mty(r.mty), mtz(r.mtz), mtt(r.mtt) {}
26
39
52
53inline HepLorentzRotation &
55 mxx = r.mxx; mxy = r.mxy; mxz = r.mxz; mxt = r.mxt;
56 myx = r.myx; myy = r.myy; myz = r.myz; myt = r.myt;
57 mzx = r.mzx; mzy = r.mzy; mzz = r.mzz; mzt = r.mzt;
58 mtx = r.mtx; mty = r.mty; mtz = r.mtz; mtt = r.mtt;
59 return *this;
60}
61
62inline HepLorentzRotation &
64 return set (m1.rep4x4());
65}
66
67inline HepLorentzRotation &
69 return set (m1.rep4x4());
70}
71
73 return set (p.x(), p.y(), p.z());
74}
75
77 return set (r.rep4x4());
78}
80 return set (r.rep4x4());
81}
83 return set (r.rep4x4());
84}
86 return set (r.rep4x4());
87}
88
90 return set (bboost.rep4x4());
91}
93 return set (bboost.rep4x4());
94}
96 return set (bboost.rep4x4());
97}
99 return set (bboost.rep4x4());
100}
101
103 double by,
104 double bz)
105{
106 set(bx, by, bz);
107}
108
110{
111 set(p.x(), p.y(), p.z());
112}
113
115 const HepBoost & B, const HepRotation & R)
116{
117 set(B, R);
118}
119
121 const HepRotation & R, const HepBoost & B)
122{
123 set(R, B);
124}
125
127 mxx=rep.xx_; mxy=rep.xy_; mxz=rep.xz_; mxt=rep.xt_;
128 myx=rep.yx_; myy=rep.yy_; myz=rep.yz_; myt=rep.yt_;
129 mzx=rep.zx_; mzy=rep.zy_; mzz=rep.zz_; mzt=rep.zt_;
130 mtx=rep.tx_; mty=rep.ty_; mtz=rep.tz_; mtt=rep.tt_;
131 return *this;
132}
133
134inline HepLorentzRotation ::HepLorentzRotation ( const HepRep4x4 & rep ) :
135 mxx(rep.xx_), mxy(rep.xy_), mxz(rep.xz_), mxt(rep.xt_),
136 myx(rep.yx_), myy(rep.yy_), myz(rep.yz_), myt(rep.yt_),
137 mzx(rep.zx_), mzy(rep.zy_), mzz(rep.zz_), mzt(rep.zt_),
138 mtx(rep.tx_), mty(rep.ty_), mtz(rep.tz_), mtt(rep.tt_) {}
139
140// - Protected methods
141
143 double rxx, double rxy, double rxz, double rxt,
144 double ryx, double ryy, double ryz, double ryt,
145 double rzx, double rzy, double rzz, double rzt,
146 double rtx, double rty, double rtz, double rtt) :
147 mxx(rxx), mxy(rxy), mxz(rxz), mxt(rxt),
148 myx(ryx), myy(ryy), myz(ryz), myt(ryt),
149 mzx(rzx), mzy(rzy), mzz(rzz), mzt(rzt),
150 mtx(rtx), mty(rty), mtz(rtz), mtt(rtt) {}
151
153 (double bx, double by, double bz) {
154 set(bx, by, bz);
155}
156
157// ---------- Accessors:
158
159inline double HepLorentzRotation::xx() const { return mxx; }
160inline double HepLorentzRotation::xy() const { return mxy; }
161inline double HepLorentzRotation::xz() const { return mxz; }
162inline double HepLorentzRotation::xt() const { return mxt; }
163inline double HepLorentzRotation::yx() const { return myx; }
164inline double HepLorentzRotation::yy() const { return myy; }
165inline double HepLorentzRotation::yz() const { return myz; }
166inline double HepLorentzRotation::yt() const { return myt; }
167inline double HepLorentzRotation::zx() const { return mzx; }
168inline double HepLorentzRotation::zy() const { return mzy; }
169inline double HepLorentzRotation::zz() const { return mzz; }
170inline double HepLorentzRotation::zt() const { return mzt; }
171inline double HepLorentzRotation::tx() const { return mtx; }
172inline double HepLorentzRotation::ty() const { return mty; }
173inline double HepLorentzRotation::tz() const { return mtz; }
174inline double HepLorentzRotation::tt() const { return mtt; }
175
177 return HepLorentzVector ( mxx, myx, mzx, mtx );
178}
180 return HepLorentzVector ( mxy, myy, mzy, mty );
181}
183 return HepLorentzVector ( mxz, myz, mzz, mtz );
184}
186 return HepLorentzVector ( mxt, myt, mzt, mtt );
187}
188
190 return HepLorentzVector ( mxx, mxy, mxz, mxt );
191}
193 return HepLorentzVector ( myx, myy, myz, myt );
194}
196 return HepLorentzVector ( mzx, mzy, mzz, mzt );
197}
199 return HepLorentzVector ( mtx, mty, mtz, mtt );
200}
201
203 return HepRep4x4( mxx, mxy, mxz, mxt,
204 myx, myy, myz, myt,
205 mzx, mzy, mzz, mzt,
206 mtx, mty, mtz, mtt );
207}
208
209
210// ------------ Subscripting:
211
214
215inline double
217 return rr(ii,jj);
218}
219
222 return HepLorentzRotation_row(*this, i);
223}
224
225// ---------- Comparisons:
226
227inline bool
229 return (mxx == r.xx() && mxy == r.xy() && mxz == r.xz() && mxt == r.xt() &&
230 myx == r.yx() && myy == r.yy() && myz == r.yz() && myt == r.yt() &&
231 mzx == r.zx() && mzy == r.zy() && mzz == r.zz() && mzt == r.zt() &&
232 mtx == r.tx() && mty == r.ty() && mtz == r.tz() && mtt == r.tt());
233}
234
235inline bool
237 return ! operator==(r);
238}
239
240inline bool
242 { return compare(r)< 0; }
243inline bool
245 { return compare(r)<=0; }
246
247inline bool
249 { return compare(r)>=0; }
250inline bool
252 { return compare(r)> 0; }
253
255 return (mxx == 1.0 && mxy == 0.0 && mxz == 0.0 && mxt == 0.0 &&
256 myx == 0.0 && myy == 1.0 && myz == 0.0 && myt == 0.0 &&
257 mzx == 0.0 && mzy == 0.0 && mzz == 1.0 && mzt == 0.0 &&
258 mtx == 0.0 && mty == 0.0 && mtz == 0.0 && mtt == 1.0);
259}
260
261// ---------- Properties:
262
263// ---------- Application:
264
265inline HepLorentzVector
267 double x(p.x());
268 double y(p.y());
269 double z(p.z());
270 double t(p.t());
271 return HepLorentzVector(mxx*x + mxy*y + mxz*z + mxt*t,
272 myx*x + myy*y + myz*z + myt*t,
273 mzx*x + mzy*y + mzz*z + mzt*t,
274 mtx*x + mty*y + mtz*z + mtt*t);
275}
276
277inline HepLorentzVector
281
282inline HepLorentzVector
286
287// ---------- Operations in the group of 4-Rotations
288
289inline HepLorentzRotation
293inline HepLorentzRotation
297inline HepLorentzRotation
301
302inline HepLorentzRotation &
304 return *this = matrixMultiplication(b.rep4x4());
305}
306inline HepLorentzRotation &
310inline HepLorentzRotation &
314
315inline HepLorentzRotation &
319inline HepLorentzRotation &
323inline HepLorentzRotation &
327
328
329
330
331
332
333inline HepLorentzRotation &
334HepLorentzRotation::rotate(double angle, const Hep3Vector & axis) {
335 return transform(HepRotation().rotate(angle, axis));
336}
337
338inline HepLorentzRotation &
339HepLorentzRotation::rotate(double angle, const Hep3Vector * axis) {
340 return transform(HepRotation().rotate(angle, axis));
341}
342
343inline HepLorentzRotation &
344HepLorentzRotation::boost(double bx, double by, double bz) {
345 return transform(HepLorentzRotation(bx, by, bz));
346}
347
348inline HepLorentzRotation &
352
354 return HepLorentzRotation( mxx, myx, mzx, -mtx,
355 mxy, myy, mzy, -mty,
356 mxz, myz, mzz, -mtz,
357 -mxt, -myt, -mzt, mtt );
358}
359
361 return *this = inverse();
362}
363
365 return HepLorentzRotation(
366 HepRep4x4(
367 lt.mxx, lt.myx, lt.mzx, -lt.mtx,
368 lt.mxy, lt.myy, lt.mzy, -lt.mty,
369 lt.mxz, lt.myz, lt.mzz, -lt.mtz,
370 -lt.mxt, -lt.myt, -lt.mzt, lt.mtt ) );
371}
372
376inline double HepLorentzRotation::setTolerance(double tol) {
378}
379
380} // namespace CLHEP
double z() const
double x() const
double y() const
static double setTolerance(double tol)
HepRep4x4 rep4x4() const
HepRep4x4 rep4x4() const
HepRep4x4 rep4x4() const
HepRep4x4 rep4x4() const
Definition Boost.icc:133
HepLorentzRotation_row(const HepLorentzRotation &, int)
double operator()(int, int) const
HepLorentzVector col2() const
HepLorentzVector operator*(const HepLorentzVector &p) const
const HepLorentzRotation_row operator[](int) const
bool operator>=(const HepLorentzRotation &) const
int compare(const HepLorentzRotation &m) const
bool operator==(const HepLorentzRotation &) const
void setBoost(double, double, double)
static double setTolerance(double tol)
bool operator!=(const HepLorentzRotation &) const
HepLorentzRotation & operator=(HepLorentzRotation &&m)=default
bool operator<=(const HepLorentzRotation &) const
HepLorentzRotation & operator*=(const HepBoost &b)
HepLorentzVector col3() const
HepLorentzVector row3() const
bool operator>(const HepLorentzRotation &) const
HepLorentzVector col4() const
HepLorentzVector col1() const
HepLorentzRotation matrixMultiplication(const HepRep4x4 &m) const
HepLorentzRotation & boost(double, double, double)
HepLorentzVector row1() const
bool operator<(const HepLorentzRotation &) const
HepLorentzRotation & rotate(double delta, const Hep3Vector &axis)
HepLorentzVector row2() const
friend HepLorentzRotation inverseOf(const HepLorentzRotation &lt)
HepLorentzRotation inverse() const
HepLorentzVector row4() const
HepLorentzRotation & set(const HepRotationZ &r)
HepLorentzRotation & set(double bx, double by, double bz)
HepLorentzVector vectorMultiplication(const HepLorentzVector &) const
HepLorentzRotation & transform(const HepBoost &b)
HepLorentzRotation & invert()
HepRep4x4 rep4x4() const
HepRep4x4 rep4x4() const
HepRep4x4 rep4x4() const
HepRep4x4 rep4x4() const
Definition Rotation.icc:39