12 #ifndef ROOT_TLorentzRotation
13 #define ROOT_TLorentzRotation
20 class TLorentzRotation :
public TObject {
25 class TLorentzRotationRow {
27 inline TLorentzRotationRow(
const TLorentzRotation &,
int);
28 inline Double_t operator [] (
int)
const;
30 const TLorentzRotation * fRR;
38 TLorentzRotation(
const TRotation &);
41 TLorentzRotation(
const TLorentzRotation &);
44 TLorentzRotation(Double_t, Double_t, Double_t);
45 TLorentzRotation(
const TVector3 &);
48 inline Double_t XX()
const;
49 inline Double_t XY()
const;
50 inline Double_t XZ()
const;
51 inline Double_t XT()
const;
52 inline Double_t YX()
const;
53 inline Double_t YY()
const;
54 inline Double_t YZ()
const;
55 inline Double_t YT()
const;
56 inline Double_t ZX()
const;
57 inline Double_t ZY()
const;
58 inline Double_t ZZ()
const;
59 inline Double_t ZT()
const;
60 inline Double_t TX()
const;
61 inline Double_t TY()
const;
62 inline Double_t TZ()
const;
63 inline Double_t TT()
const;
66 inline TLorentzRotationRow operator [] (
int)
const;
70 Double_t operator () (
int,
int)
const;
74 inline TLorentzRotation & operator = (
const TLorentzRotation &);
75 inline TLorentzRotation & operator = (
const TRotation &);
78 inline Bool_t operator == (
const TLorentzRotation &)
const;
79 inline Bool_t operator != (
const TLorentzRotation &)
const;
82 inline Bool_t IsIdentity()
const;
85 inline TLorentzVector VectorMultiplication(
const TLorentzVector&)
const;
86 inline TLorentzVector operator * (
const TLorentzVector &)
const;
89 TLorentzRotation MatrixMultiplication(
const TLorentzRotation &)
const;
90 inline TLorentzRotation operator * (
const TLorentzRotation &)
const;
91 inline TLorentzRotation & operator *= (
const TLorentzRotation &);
92 inline TLorentzRotation & Transform(
const TLorentzRotation &);
93 inline TLorentzRotation & Transform(
const TRotation &);
97 inline TLorentzRotation Inverse()
const;
100 inline TLorentzRotation & Invert();
103 inline TLorentzRotation & Boost(Double_t, Double_t, Double_t);
104 inline TLorentzRotation & Boost(
const TVector3 &);
107 inline TLorentzRotation & RotateX(Double_t);
110 inline TLorentzRotation & RotateY(Double_t);
113 inline TLorentzRotation & RotateZ(Double_t);
116 inline TLorentzRotation & Rotate(Double_t,
const TVector3 &);
117 inline TLorentzRotation & Rotate(Double_t,
const TVector3 *);
122 Double_t fxx, fxy, fxz, fxt,
128 void SetBoost(Double_t, Double_t, Double_t);
131 TLorentzRotation(Double_t, Double_t, Double_t, Double_t,
132 Double_t, Double_t, Double_t, Double_t,
133 Double_t, Double_t, Double_t, Double_t,
134 Double_t, Double_t, Double_t, Double_t);
137 ClassDef(TLorentzRotation,1)
143 inline Double_t TLorentzRotation::XX()
const {
return fxx; }
144 inline Double_t TLorentzRotation::XY()
const {
return fxy; }
145 inline Double_t TLorentzRotation::XZ()
const {
return fxz; }
146 inline Double_t TLorentzRotation::XT()
const {
return fxt; }
147 inline Double_t TLorentzRotation::YX()
const {
return fyx; }
148 inline Double_t TLorentzRotation::YY()
const {
return fyy; }
149 inline Double_t TLorentzRotation::YZ()
const {
return fyz; }
150 inline Double_t TLorentzRotation::YT()
const {
return fyt; }
151 inline Double_t TLorentzRotation::ZX()
const {
return fzx; }
152 inline Double_t TLorentzRotation::ZY()
const {
return fzy; }
153 inline Double_t TLorentzRotation::ZZ()
const {
return fzz; }
154 inline Double_t TLorentzRotation::ZT()
const {
return fzt; }
155 inline Double_t TLorentzRotation::TX()
const {
return ftx; }
156 inline Double_t TLorentzRotation::TY()
const {
return fty; }
157 inline Double_t TLorentzRotation::TZ()
const {
return ftz; }
158 inline Double_t TLorentzRotation::TT()
const {
return ftt; }
160 inline TLorentzRotation::TLorentzRotationRow::TLorentzRotationRow
161 (
const TLorentzRotation & r,
int i) : fRR(&r), fII(i) {}
163 inline Double_t TLorentzRotation::TLorentzRotationRow::operator [] (
int jj)
const {
164 return fRR->operator()(fII,jj);
167 inline TLorentzRotation::TLorentzRotationRow TLorentzRotation::operator [] (
int i)
const {
168 return TLorentzRotationRow(*
this, i);
171 inline TLorentzRotation & TLorentzRotation::operator = (
const TLorentzRotation & r) {
172 fxx = r.fxx; fxy = r.fxy; fxz = r.fxz; fxt = r.fxt;
173 fyx = r.fyx; fyy = r.fyy; fyz = r.fyz; fyt = r.fyt;
174 fzx = r.fzx; fzy = r.fzy; fzz = r.fzz; fzt = r.fzt;
175 ftx = r.ftx; fty = r.fty; ftz = r.ftz; ftt = r.ftt;
188 inline TLorentzRotation & TLorentzRotation::operator = (
const TRotation & r) {
189 fxx = r.XX(); fxy = r.XY(); fxz = r.XZ(); fxt = 0.0;
190 fyx = r.YX(); fyy = r.YY(); fyz = r.YZ(); fyt = 0.0;
191 fzx = r.ZX(); fzy = r.ZY(); fzz = r.ZZ(); fzt = 0.0;
192 ftx = 0.0; fty = 0.0; ftz = 0.0; ftt = 1.0;
206 inline Bool_t TLorentzRotation::operator == (
const TLorentzRotation & r)
const {
207 return (fxx == r.fxx && fxy == r.fxy && fxz == r.fxz && fxt == r.fxt &&
208 fyx == r.fyx && fyy == r.fyy && fyz == r.fyz && fyt == r.fyt &&
209 fzx == r.fzx && fzy == r.fzy && fzz == r.fzz && fzt == r.fzt &&
210 ftx == r.ftx && fty == r.fty && ftz == r.ftz && ftt == r.ftt)
223 inline Bool_t TLorentzRotation::operator != (
const TLorentzRotation & r)
const {
224 return (fxx != r.fxx || fxy != r.fxy || fxz != r.fxz || fxt != r.fxt ||
225 fyx != r.fyx || fyy != r.fyy || fyz != r.fyz || fyt != r.fyt ||
226 fzx != r.fzx || fzy != r.fzy || fzz != r.fzz || fzt != r.fzt ||
227 ftx != r.ftx || fty != r.fty || ftz != r.ftz || ftt != r.ftt)
231 inline Bool_t TLorentzRotation::IsIdentity()
const {
232 return (fxx == 1.0 && fxy == 0.0 && fxz == 0.0 && fxt == 0.0 &&
233 fyx == 0.0 && fyy == 1.0 && fyz == 0.0 && fyt == 0.0 &&
234 fzx == 0.0 && fzy == 0.0 && fzz == 1.0 && fzt == 0.0 &&
235 ftx == 0.0 && fty == 0.0 && ftz == 0.0 && ftt == 1.0)
240 inline TLorentzVector TLorentzRotation::VectorMultiplication(
const TLorentzVector & p)
const {
241 return TLorentzVector(fxx*p.X()+fxy*p.Y()+fxz*p.Z()+fxt*p.T(),
242 fyx*p.X()+fyy*p.Y()+fyz*p.Z()+fyt*p.T(),
243 fzx*p.X()+fzy*p.Y()+fzz*p.Z()+fzt*p.T(),
244 ftx*p.X()+fty*p.Y()+ftz*p.Z()+ftt*p.T());
247 inline TLorentzVector TLorentzRotation::operator * (
const TLorentzVector & p)
const {
248 return VectorMultiplication(p);
251 inline TLorentzRotation TLorentzRotation::operator * (
const TLorentzRotation & m)
const {
252 return MatrixMultiplication(m);
255 inline TLorentzRotation & TLorentzRotation::operator *= (
const TLorentzRotation & m) {
256 return *
this = MatrixMultiplication(m);
259 inline TLorentzRotation & TLorentzRotation::Transform(
const TLorentzRotation & m) {
260 return *
this = m.MatrixMultiplication(*
this);
263 inline TLorentzRotation & TLorentzRotation::Transform(
const TRotation & m){
264 return Transform(TLorentzRotation(m));
267 inline TLorentzRotation TLorentzRotation::Inverse()
const {
268 return TLorentzRotation( fxx, fyx, fzx, -ftx,
271 -fxt, -fyt, -fzt, ftt);
274 inline TLorentzRotation & TLorentzRotation::Invert() {
275 return *
this = Inverse();
278 inline TLorentzRotation & TLorentzRotation::Boost(Double_t bx, Double_t by, Double_t bz) {
279 return Transform(TLorentzRotation(bx, by, bz));
282 inline TLorentzRotation & TLorentzRotation::Boost(
const TVector3 & b) {
283 return Transform(TLorentzRotation(b));
286 inline TLorentzRotation & TLorentzRotation::RotateX(Double_t angle) {
287 return Transform(TRotation().RotateX(angle));
290 inline TLorentzRotation & TLorentzRotation::RotateY(Double_t angle) {
291 return Transform(TRotation().RotateY(angle));
294 inline TLorentzRotation & TLorentzRotation::RotateZ(Double_t angle) {
295 return Transform(TRotation().RotateZ(angle));
298 inline TLorentzRotation & TLorentzRotation::Rotate(Double_t angle,
const TVector3 & axis) {
299 return Transform(TRotation().Rotate(angle, axis));
302 inline TLorentzRotation & TLorentzRotation::Rotate(Double_t angle,
const TVector3 * axis) {
303 return Transform(TRotation().Rotate(angle, axis));