ROOT  6.06/09
Reference Guide
TGeoMatrix.h
Go to the documentation of this file.
1 // @(#)root/geom:$Id$
2 // Author: Andrei Gheata 25/10/01
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TGeoMatrix
13 #define ROOT_TGeoMatrix
14 
15 /*************************************************************************
16  * Geometrical transformations. TGeoMatrix - base class, TGeoTranslation *
17  * TGeoRotation, TGeoScale, TGeoCombiTrans, TGeoGenTrans . *
18  * *
19  *************************************************************************/
20 
21 #ifndef ROOT_TNamed
22 #include "TNamed.h"
23 #endif
24 
25 //--- globals
26 const Double_t kNullVector[3] = {0.0, 0.0, 0.0};
27 
28 const Double_t kIdentityMatrix[3*3] = {1.0, 0.0, 0.0,
29  0.0, 1.0, 0.0,
30  0.0, 0.0, 1.0};
31 
32 const Double_t kUnitScale[3] = {1.0, 1.0, 1.0};
33 
34 ////////////////////////////////////////////////////////////////////////////
35 // //
36 // TGeoMatrix - base class for geometrical transformations. //
37 // //
38 ////////////////////////////////////////////////////////////////////////////
39 
40 class TGeoMatrix : public TNamed
41 {
42 public:
45  kGeoShared = BIT(14),
48  kGeoScale = BIT(19),
55 };
56 
57 protected:
58  TGeoMatrix(const TGeoMatrix &other);
59 
60 public :
61  TGeoMatrix();
62  TGeoMatrix(const char *name);
63  virtual ~TGeoMatrix();
64 
65  TGeoMatrix& operator=(const TGeoMatrix &matrix);
66 // Preventing warnings with -Weffc++ in GCC since the behaviour of operator * was chosen so by design.
67 #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40600
68 #pragma GCC diagnostic push
69 #pragma GCC diagnostic ignored "-Weffc++"
70 #endif
71  TGeoMatrix& operator*(const TGeoMatrix &right) const;
72 #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40600
73 #pragma GCC diagnostic pop
74 #endif
75  Bool_t operator ==(const TGeoMatrix &other) const;
76 
77  Bool_t IsIdentity() const {return !TestBit(kGeoGenTrans);}
81  Bool_t IsScale() const {return TestBit(kGeoScale);}
82  Bool_t IsShared() const {return TestBit(kGeoShared);}
84  && TestBit(kGeoRotation));}
88  Bool_t IsRotAboutZ() const;
89  void GetHomogenousMatrix(Double_t *hmat) const;
90  char *GetPointerName() const;
91 
92  virtual Int_t GetByteCount() const;
93  virtual const Double_t *GetTranslation() const = 0;
94  virtual const Double_t *GetRotationMatrix() const = 0;
95  virtual const Double_t *GetScale() const = 0;
96  virtual TGeoMatrix& Inverse() const = 0;
97  virtual void LocalToMaster(const Double_t *local, Double_t *master) const;
98  virtual void LocalToMasterVect(const Double_t *local, Double_t *master) const;
99  virtual void LocalToMasterBomb(const Double_t *local, Double_t *master) const;
100  virtual TGeoMatrix *MakeClone() const = 0;
101  virtual void MasterToLocal(const Double_t *master, Double_t *local) const;
102  virtual void MasterToLocalVect(const Double_t *master, Double_t *local) const;
103  virtual void MasterToLocalBomb(const Double_t *master, Double_t *local) const;
104  static void Normalize(Double_t *vect);
105  void Print(Option_t *option="") const; // *MENU*
106  virtual void RotateX(Double_t) {}
107  virtual void RotateY(Double_t) {}
108  virtual void RotateZ(Double_t) {}
109  virtual void ReflectX(Bool_t leftside,Bool_t rotonly=kFALSE);
110  virtual void ReflectY(Bool_t leftside,Bool_t rotonly=kFALSE);
111  virtual void ReflectZ(Bool_t leftside,Bool_t rotonly=kFALSE);
112  virtual void RegisterYourself();
113  void SetDefaultName();
114  virtual void SetDx(Double_t) {}
115  virtual void SetDy(Double_t) {}
116  virtual void SetDz(Double_t) {}
117  void SetShared(Bool_t flag=kTRUE) {SetBit(kGeoShared, flag);}
118 
119  ClassDef(TGeoMatrix, 1) // base geometrical transformation class
120 };
121 
122 
123 
124 ////////////////////////////////////////////////////////////////////////////
125 // //
126 // TGeoTranslation - class describing translations. A translation is //
127 // basicaly an array of 3 doubles matching the positions 12, 13 //
128 // and 14 in the homogenous matrix description. //
129 // //
130 // //
131 ////////////////////////////////////////////////////////////////////////////
132 
134 {
135 protected:
136  Double_t fTranslation[3]; // translation vector
137 public :
138  TGeoTranslation();
139  TGeoTranslation(const TGeoTranslation &other);
140  TGeoTranslation(const TGeoMatrix &other);
142  TGeoTranslation(const char *name, Double_t dx, Double_t dy, Double_t dz);
143  virtual ~TGeoTranslation() {}
144 
145  TGeoTranslation& operator=(const TGeoMatrix &matrix);
146  TGeoTranslation& operator=(const TGeoTranslation &other) {return operator=((const TGeoMatrix&)other);};
147 
148  void Add(const TGeoTranslation *other);
149  virtual TGeoMatrix& Inverse() const;
150  virtual void LocalToMaster(const Double_t *local, Double_t *master) const;
151  virtual void LocalToMasterVect(const Double_t *local, Double_t *master) const;
152  virtual void LocalToMasterBomb(const Double_t *local, Double_t *master) const;
153  virtual TGeoMatrix *MakeClone() const;
154  virtual void MasterToLocal(const Double_t *master, Double_t *local) const;
155  virtual void MasterToLocalVect(const Double_t *master, Double_t *local) const;
156  virtual void MasterToLocalBomb(const Double_t *master, Double_t *local) const;
157  virtual void RotateX(Double_t angle);
158  virtual void RotateY(Double_t angle);
159  virtual void RotateZ(Double_t angle);
160  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
161  void Subtract(const TGeoTranslation *other);
162  void SetTranslation(Double_t dx, Double_t dy, Double_t dz);
163  void SetTranslation(const TGeoMatrix &other);
164  virtual void SetDx(Double_t dx) {SetTranslation(dx, fTranslation[1], fTranslation[2]);}
165  virtual void SetDy(Double_t dy) {SetTranslation(fTranslation[0], dy, fTranslation[2]);}
166  virtual void SetDz(Double_t dz) {SetTranslation(fTranslation[0], fTranslation[1], dz);}
167 
168  virtual const Double_t *GetTranslation() const {return &fTranslation[0];}
169  virtual const Double_t *GetRotationMatrix() const {return &kIdentityMatrix[0];}
170  virtual const Double_t *GetScale() const {return &kUnitScale[0];}
171 
172  ClassDef(TGeoTranslation, 1) // translation class
173 };
174 
175 ////////////////////////////////////////////////////////////////////////////
176 // //
177 // TGeoRotation - class describing rotations. A rotation is a 3*3 array //
178 // Column vectors has to be orthogonal unit vectors. //
179 // //
180 ////////////////////////////////////////////////////////////////////////////
181 
182 class TGeoRotation : public TGeoMatrix
183 {
184 protected:
185  Double_t fRotationMatrix[3*3]; // rotation matrix
186 
187  void CheckMatrix();
188 public :
189  TGeoRotation();
190  TGeoRotation(const TGeoRotation &other);
191  TGeoRotation(const TGeoMatrix &other);
192  TGeoRotation(const char *name);
193 // TGeoRotation(const char *name, Double_t *matrix) ;
194  TGeoRotation(const char *name, Double_t phi, Double_t theta, Double_t psi);
195  TGeoRotation(const char *name, Double_t theta1, Double_t phi1, Double_t theta2, Double_t phi2,
196  Double_t theta3, Double_t phi3);
197  virtual ~TGeoRotation() {}
198 
199  TGeoRotation& operator=(const TGeoMatrix &matrix);
200  TGeoRotation& operator=(const TGeoRotation &other) {return operator=((const TGeoMatrix&)other);};
201 
202  Bool_t IsValid() const;
203  virtual TGeoMatrix& Inverse() const;
204  void Clear(Option_t *option ="");
205  Double_t Determinant() const;
206  void FastRotZ(const Double_t *sincos);
207  void GetAngles(Double_t &theta1, Double_t &phi1, Double_t &theta2, Double_t &phi2,
208  Double_t &theta3, Double_t &phi3) const;
209  void GetAngles(Double_t &phi, Double_t &theta, Double_t &psi) const;
210  Double_t GetPhiRotation(Bool_t fixX=kFALSE) const;
211  virtual void LocalToMaster(const Double_t *local, Double_t *master) const;
212  virtual void LocalToMasterVect(const Double_t *local, Double_t *master) const {TGeoRotation::LocalToMaster(local, master);}
213  virtual void LocalToMasterBomb(const Double_t *local, Double_t *master) const {TGeoRotation::LocalToMaster(local, master);}
214  virtual TGeoMatrix *MakeClone() const;
215  virtual void MasterToLocal(const Double_t *master, Double_t *local) const;
216  virtual void MasterToLocalVect(const Double_t *master, Double_t *local) const {TGeoRotation::MasterToLocal(master, local);}
217  virtual void MasterToLocalBomb(const Double_t *master, Double_t *local) const {TGeoRotation::MasterToLocal(master, local);}
218  void MultiplyBy(TGeoRotation *rot, Bool_t after=kTRUE);
219  virtual void RotateX(Double_t angle);
220  virtual void RotateY(Double_t angle);
221  virtual void RotateZ(Double_t angle);
222  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
223  virtual void ReflectX(Bool_t leftside, Bool_t rotonly=kFALSE);
224  virtual void ReflectY(Bool_t leftside, Bool_t rotonly=kFALSE);
225  virtual void ReflectZ(Bool_t leftside, Bool_t rotonly=kFALSE);
226  void SetAngles(Double_t phi, Double_t theta, Double_t psi);
227  void SetAngles(Double_t theta1, Double_t phi1, Double_t theta2, Double_t phi2,
228  Double_t theta3, Double_t phi3);
229  void SetMatrix(const Double_t *rot) {memcpy(&fRotationMatrix[0], rot, 9*sizeof(Double_t));CheckMatrix();}
230  void SetRotation(const TGeoMatrix &other);
231  void GetInverse(Double_t *invmat) const;
232 
233  virtual const Double_t *GetTranslation() const {return &kNullVector[0];}
234  virtual const Double_t *GetRotationMatrix() const {return &fRotationMatrix[0];}
235  virtual const Double_t *GetScale() const {return &kUnitScale[0];}
236 
237  ClassDef(TGeoRotation, 1) // rotation class
238 };
239 
240 ////////////////////////////////////////////////////////////////////////////
241 // //
242 // TGeoScale - class describing scale transformations. A scale is an //
243 // array of 3 doubles (sx, sy, sz) multiplying elements 0, 5 and 10 //
244 // of the homogenous matrix. A scale is normalized : sx*sy*sz = 1 //
245 // //
246 ////////////////////////////////////////////////////////////////////////////
247 
248 class TGeoScale : public TGeoMatrix
249 {
250 protected:
251  Double_t fScale[3]; // scale (x, y, z)
252 public :
253  TGeoScale();
254  TGeoScale(const TGeoScale &other);
255  TGeoScale(Double_t sx, Double_t sy, Double_t sz);
256  TGeoScale(const char *name, Double_t sx, Double_t sy, Double_t sz);
257  virtual ~TGeoScale();
258 
259  TGeoScale& operator=(const TGeoScale &other);
260  virtual TGeoMatrix& Inverse() const;
261  void SetScale(Double_t sx, Double_t sy, Double_t sz);
262  virtual void LocalToMaster(const Double_t *local, Double_t *master) const;
263  Double_t LocalToMaster(Double_t dist, const Double_t *dir=0) const;
264  virtual void LocalToMasterVect(const Double_t *local, Double_t *master) const {TGeoScale::LocalToMaster(local, master);}
265  virtual TGeoMatrix *MakeClone() const;
266  virtual void MasterToLocal(const Double_t *master, Double_t *local) const;
267  Double_t MasterToLocal(Double_t dist, const Double_t *dir=0) const;
268  virtual void MasterToLocalVect(const Double_t *master, Double_t *local) const {TGeoScale::MasterToLocal(master, local);}
269  virtual void ReflectX(Bool_t, Bool_t) {fScale[0]=-fScale[0]; SetBit(kGeoReflection, !IsReflection());}
270  virtual void ReflectY(Bool_t, Bool_t) {fScale[1]=-fScale[1]; SetBit(kGeoReflection, !IsReflection());}
271  virtual void ReflectZ(Bool_t, Bool_t) {fScale[2]=-fScale[2]; SetBit(kGeoReflection, !IsReflection());}
272 
273  virtual const Double_t *GetTranslation() const {return &kNullVector[0];}
274  virtual const Double_t *GetRotationMatrix() const {return &kIdentityMatrix[0];}
275  virtual const Double_t *GetScale() const {return &fScale[0];}
276 
277  ClassDef(TGeoScale, 1) // scaling class
278 };
279 
280 ////////////////////////////////////////////////////////////////////////////
281 // //
282 // TGeoCombiTrans - class describing rotation + translation. Most //
283 // frequently used in the description of TGeoNode 's //
284 // //
285 ////////////////////////////////////////////////////////////////////////////
286 
288 {
289 protected:
290  Double_t fTranslation[3]; // translation vector
291  TGeoRotation *fRotation; // rotation matrix
292 public :
293  TGeoCombiTrans();
294  TGeoCombiTrans(const TGeoCombiTrans &other);
295  TGeoCombiTrans(const TGeoMatrix &other);
296  TGeoCombiTrans(const TGeoTranslation &tr, const TGeoRotation &rot);
297  TGeoCombiTrans(const char *name);
299  TGeoCombiTrans(const char *name, Double_t dx, Double_t dy, Double_t dz, TGeoRotation *rot);
300 
301  TGeoCombiTrans& operator=(const TGeoMatrix &matrix);
302  TGeoCombiTrans& operator=(const TGeoCombiTrans &other) {return operator=((const TGeoMatrix&)other);};
303 
304  virtual ~TGeoCombiTrans();
305 
306  void Clear(Option_t *option ="");
307  virtual TGeoMatrix& Inverse() const;
308  virtual TGeoMatrix *MakeClone() const;
309  virtual void RegisterYourself();
310  virtual void RotateX(Double_t angle);
311  virtual void RotateY(Double_t angle);
312  virtual void RotateZ(Double_t angle);
313  virtual void ReflectX(Bool_t leftside, Bool_t rotonly=kFALSE);
314  virtual void ReflectY(Bool_t leftside, Bool_t rotonly=kFALSE);
315  virtual void ReflectZ(Bool_t leftside, Bool_t rotonly=kFALSE);
316  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
317  virtual void SetDx(Double_t dx) {SetTranslation(dx, fTranslation[1], fTranslation[2]);}
318  virtual void SetDy(Double_t dy) {SetTranslation(fTranslation[0], dy, fTranslation[2]);}
319  virtual void SetDz(Double_t dz) {SetTranslation(fTranslation[0], fTranslation[1], dz);}
320  void SetTranslation(const TGeoTranslation &tr);
321  void SetTranslation(Double_t dx, Double_t dy, Double_t dz);
322  void SetTranslation(Double_t *vect);
323  void SetRotation(const TGeoRotation &other);
324  void SetRotation(const TGeoRotation *rot);
325 
326  TGeoRotation *GetRotation() const {return fRotation;}
327 
328  virtual const Double_t *GetTranslation() const {return &fTranslation[0];}
329  virtual const Double_t *GetRotationMatrix() const;
330  virtual const Double_t *GetScale() const {return &kUnitScale[0];}
331 
332  ClassDef(TGeoCombiTrans, 1) // rotation + translation
333 };
334 
335 ////////////////////////////////////////////////////////////////////////////
336 // //
337 // TGeoGenTrans - most general transformation, holding a translation, //
338 // a rotation and a scale //
339 // //
340 ////////////////////////////////////////////////////////////////////////////
341 
343 {
344 protected:
345  Double_t fScale[3]; // scale (x, y, z)
346 public :
347  TGeoGenTrans();
348  TGeoGenTrans(const char *name);
350  Double_t sx, Double_t sy, Double_t sz, TGeoRotation *rot);
351  TGeoGenTrans(const char *name, Double_t dx, Double_t dy, Double_t dz,
352  Double_t sx, Double_t sy, Double_t sz, TGeoRotation *rot);
353  virtual ~TGeoGenTrans();
354 
355  void Clear(Option_t *option ="");
356  virtual TGeoMatrix& Inverse() const;
357  void SetScale(Double_t sx, Double_t sy, Double_t sz);
358  void SetScale(Double_t *scale) {memcpy(&fScale[0], scale, 3*sizeof(Double_t));}
359  virtual TGeoMatrix *MakeClone() const {return NULL;}
360  Bool_t Normalize();
361 
362  virtual const Double_t *GetScale() const {return &fScale[0];}
363 
364  ClassDef(TGeoGenTrans, 1) // rotation + translation + scale
365 };
366 
367 ////////////////////////////////////////////////////////////////////////////
368 // //
369 // TGeoIdentity - an identity transformation. It holds no data member //
370 // and returns pointers to static null translation and identity //
371 // transformations for rotation and scale //
372 // //
373 ////////////////////////////////////////////////////////////////////////////
374 
375 class TGeoIdentity : public TGeoMatrix
376 {
377 private:
378  // no data members
379 public :
380  TGeoIdentity();
381  TGeoIdentity(const char *name);
382  virtual ~TGeoIdentity() {}
383 
384  virtual TGeoMatrix& Inverse() const;
385  virtual void LocalToMaster(const Double_t *local, Double_t *master) const {memcpy(master, local, 3*sizeof(Double_t));}
386  virtual void LocalToMasterVect(const Double_t *local, Double_t *master) const {memcpy(master, local, 3*sizeof(Double_t));}
387  virtual void LocalToMasterBomb(const Double_t *local, Double_t *master) const {TGeoIdentity::LocalToMaster(local, master);}
388  virtual TGeoMatrix *MakeClone() const {return NULL;}
389  virtual void MasterToLocal(const Double_t *master, Double_t *local) const {memcpy(local, master, 3*sizeof(Double_t));}
390  virtual void MasterToLocalVect(const Double_t *master, Double_t *local) const {memcpy(local, master, 3*sizeof(Double_t));}
391  virtual void MasterToLocalBomb(const Double_t *master, Double_t *local) const {TGeoIdentity::MasterToLocal(master, local);}
392 
393  virtual const Double_t *GetTranslation() const {return &kNullVector[0];}
394  virtual const Double_t *GetRotationMatrix() const {return &kIdentityMatrix[0];}
395  virtual const Double_t *GetScale() const {return &kUnitScale[0];}
396  virtual void SavePrimitive(std::ostream &, Option_t * = "") {;}
397 
398  ClassDef(TGeoIdentity, 1) // identity transformation class
399 };
400 
401 
402 
403 ////////////////////////////////////////////////////////////////////////////
404 // //
405 // TGeoHMatrix - Matrix class used for computing global transformations //
406 // Should NOT be used for node definition. An instance of this class //
407 // is generally used to pile-up local transformations starting from //
408 // the top level physical node, down to the current node. //
409 // //
410 ////////////////////////////////////////////////////////////////////////////
411 
412 class TGeoHMatrix : public TGeoMatrix
413 {
414 private:
415  Double_t fTranslation[3]; // translation component
416  Double_t fRotationMatrix[9]; // rotation matrix
417  Double_t fScale[3]; // scale component
418 
419 public :
420  TGeoHMatrix();
421  TGeoHMatrix(const TGeoMatrix &matrix);
422  TGeoHMatrix(const char *name);
423  virtual ~TGeoHMatrix();
424 
425  TGeoHMatrix& operator=(const TGeoMatrix *matrix);
426  TGeoHMatrix& operator=(const TGeoMatrix &matrix);
427  TGeoHMatrix& operator=(const TGeoHMatrix &other) {return operator=((const TGeoMatrix&)other);};
428 
429  TGeoHMatrix& operator*=(const TGeoMatrix &matrix) {Multiply(&matrix);return(*this);}
430 
431  void Clear(Option_t *option ="");
432  void CopyFrom(const TGeoMatrix *other);
433  Double_t Determinant() const;
434  void FastRotZ(const Double_t *sincos);
435  virtual TGeoMatrix& Inverse() const;
436  virtual TGeoMatrix *MakeClone() const;
437  void Multiply(const TGeoMatrix *right);
438  void MultiplyLeft(const TGeoMatrix *left);
439 
440  virtual void RotateX(Double_t angle);
441  virtual void RotateY(Double_t angle);
442  virtual void RotateZ(Double_t angle);
443  virtual void ReflectX(Bool_t leftside, Bool_t rotonly=kFALSE);
444  virtual void ReflectY(Bool_t leftside, Bool_t rotonly=kFALSE);
445  virtual void ReflectZ(Bool_t leftside, Bool_t rotonly=kFALSE);
446  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
447  virtual void SetDx(Double_t dx) {fTranslation[0] = dx; SetBit(kGeoTranslation);}
448  virtual void SetDy(Double_t dy) {fTranslation[1] = dy; SetBit(kGeoTranslation);}
449  virtual void SetDz(Double_t dz) {fTranslation[2] = dz; SetBit(kGeoTranslation);}
450  void SetTranslation(const Double_t *vect) {SetBit(kGeoTranslation); memcpy(&fTranslation[0], vect, 3*sizeof(Double_t));}
451  void SetRotation(const Double_t *matrix) {SetBit(kGeoRotation); memcpy(&fRotationMatrix[0], matrix, 9*sizeof(Double_t));}
452  void SetScale(const Double_t *scale) {SetBit(kGeoScale); memcpy(&fScale[0], scale, 3*sizeof(Double_t));}
453 
454 
455  virtual const Double_t *GetTranslation() const {return &fTranslation[0];}
456  virtual const Double_t *GetRotationMatrix() const {return &fRotationMatrix[0];}
457  virtual const Double_t *GetScale() const {return &fScale[0];}
458 
459  virtual Double_t *GetTranslation() {return &fTranslation[0];}
460  virtual Double_t *GetRotationMatrix() {return &fRotationMatrix[0];}
461  virtual Double_t *GetScale() {return &fScale[0];}
462  ClassDef(TGeoHMatrix, 1) // global matrix class
463 };
464 
465 
467 
468 #endif
469 
void SetShared(Bool_t flag=kTRUE)
Definition: TGeoMatrix.h:117
void Subtract(const TGeoTranslation *other)
Subtracting a translation from this one.
Definition: TGeoMatrix.cxx:693
virtual void MasterToLocalVect(const Double_t *master, Double_t *local) const
convert a vector from MARS to local
Definition: TGeoMatrix.cxx:765
double dist(Rotation3D const &r1, Rotation3D const &r2)
Definition: 3DDistances.cxx:48
virtual void LocalToMaster(const Double_t *local, Double_t *master) const
convert a point by multiplying its column vector (x, y, z, 1) to matrix inverse
Definition: TGeoMatrix.cxx:725
const Double_t kIdentityMatrix[3 *3]
Definition: TGeoMatrix.h:28
void SetRotation(const TGeoRotation &other)
Copy the rotation from another one.
virtual const Double_t * GetScale() const
Definition: TGeoMatrix.h:362
virtual void MasterToLocal(const Double_t *master, Double_t *local) const
convert a point by multiplying its column vector (x, y, z, 1) to matrix
Definition: TGeoMatrix.cxx:971
Double_t Determinant() const
computes determinant of the rotation matrix
Double_t fRotationMatrix[9]
Definition: TGeoMatrix.h:416
virtual TGeoMatrix * MakeClone() const
Definition: TGeoMatrix.h:388
TGeoMatrix & operator=(const TGeoMatrix &matrix)
Assignment operator.
Definition: TGeoMatrix.cxx:225
virtual void SetDy(Double_t dy)
Definition: TGeoMatrix.h:165
Bool_t IsScale() const
Definition: TGeoMatrix.h:81
virtual TGeoMatrix & Inverse() const
Return a temporary inverse of this.
Definition: TGeoMatrix.cxx:882
virtual TGeoMatrix & Inverse() const
Return a temporary inverse of this.
virtual TGeoMatrix & Inverse() const
Return a temporary inverse of this.
TGeoRotation & operator=(const TGeoMatrix &matrix)
Assignment from a general matrix.
Definition: TGeoMatrix.cxx:871
void FastRotZ(const Double_t *sincos)
Perform a rotation about Z having the sine/cosine of the rotation angle.
Definition: TGeoMatrix.cxx:932
void GetInverse(Double_t *invmat) const
Get the inverse rotation matrix (which is simply the transpose)
void FastRotZ(const Double_t *sincos)
Perform a rotation about Z having the sine/cosine of the rotation angle.
void MultiplyLeft(const TGeoMatrix *left)
multiply to the left with an other transformation if right is identity matrix, just return ...
virtual ~TGeoScale()
destructor
const char Option_t
Definition: RtypesCore.h:62
virtual void LocalToMasterVect(const Double_t *local, Double_t *master) const
convert a vector by multiplying its column vector (x, y, z, 1) to matrix inverse
Definition: TGeoMatrix.h:264
virtual void LocalToMasterVect(const Double_t *local, Double_t *master) const
convert a vector to MARS
Definition: TGeoMatrix.cxx:735
virtual const Double_t * GetRotationMatrix() const
Definition: TGeoMatrix.h:274
virtual void MasterToLocalBomb(const Double_t *master, Double_t *local) const
convert a point by multiplying its column vector (x, y, z, 1) to matrix
Definition: TGeoMatrix.h:217
virtual void SetDy(Double_t dy)
Definition: TGeoMatrix.h:318
virtual void ReflectX(Bool_t leftside, Bool_t rotonly=kFALSE)
Multiply by a reflection respect to YZ.
virtual const Double_t * GetRotationMatrix() const =0
const Double_t kNullVector[3]
Definition: TGeoMatrix.h:26
#define BIT(n)
Definition: Rtypes.h:120
virtual void LocalToMasterVect(const Double_t *local, Double_t *master) const
convert a vector by multiplying its column vector (x, y, z, 1) to matrix inverse
Definition: TGeoMatrix.h:386
virtual TGeoMatrix & Inverse() const
Return a temporary inverse of this.
virtual void ReflectZ(Bool_t leftside, Bool_t rotonly=kFALSE)
Multiply by a reflection respect to XY.
virtual void RotateX(Double_t angle)
Rotate about X axis of the master frame with angle expressed in degrees.
Definition: TGeoMatrix.cxx:993
virtual void LocalToMasterBomb(const Double_t *local, Double_t *master) const
convert a point by multiplying its column vector (x, y, z, 1) to matrix inverse
Definition: TGeoMatrix.h:387
void SetTranslation(const Double_t *vect)
Definition: TGeoMatrix.h:450
virtual void SetDx(Double_t dx)
Definition: TGeoMatrix.h:317
virtual void SetDz(Double_t)
Definition: TGeoMatrix.h:116
Double_t fScale[3]
Definition: TGeoMatrix.h:417
virtual Double_t * GetTranslation()
Definition: TGeoMatrix.h:459
Double_t fTranslation[3]
Definition: TGeoMatrix.h:415
virtual void RotateZ(Double_t)
Definition: TGeoMatrix.h:108
void Multiply(const TGeoMatrix *right)
multiply to the right with an other transformation if right is identity matrix, just return ...
virtual void MasterToLocal(const Double_t *master, Double_t *local) const
convert a point by multiplying its column vector (x, y, z, 1) to matrix
Definition: TGeoMatrix.h:389
virtual void SetDx(Double_t)
Definition: TGeoMatrix.h:114
virtual void SetDx(Double_t dx)
Definition: TGeoMatrix.h:447
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
virtual void SetDz(Double_t dz)
Definition: TGeoMatrix.h:166
virtual void LocalToMaster(const Double_t *local, Double_t *master) const
Convert a local point to the master frame.
Bool_t IsGeneral() const
Definition: TGeoMatrix.h:85
void Add(const TGeoTranslation *other)
Adding a translation to this one.
Definition: TGeoMatrix.cxx:650
const Double_t kUnitScale[3]
Definition: TGeoMatrix.h:32
virtual void LocalToMasterVect(const Double_t *local, Double_t *master) const
convert a vector by multiplying its column vector (x, y, z, 1) to matrix inverse
Definition: TGeoMatrix.cxx:370
virtual void RotateY(Double_t angle)
Rotate about Y axis with angle expressed in degrees.
void SetTranslation(const TGeoTranslation &tr)
copy the translation component
Bool_t IsReflection() const
Definition: TGeoMatrix.h:80
virtual const Double_t * GetRotationMatrix() const
Definition: TGeoMatrix.h:169
virtual ~TGeoCombiTrans()
destructor
void GetHomogenousMatrix(Double_t *hmat) const
The homogenous matrix associated with the transformation is used for piling up's and visualization...
Definition: TGeoMatrix.cxx:321
Bool_t IsRotation() const
Definition: TGeoMatrix.h:79
virtual TGeoMatrix * MakeClone() const
Make a clone of this matrix.
virtual void ReflectY(Bool_t leftside, Bool_t rotonly=kFALSE)
Multiply by a reflection respect to ZX.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition: TObject.cxx:732
virtual const Double_t * GetScale() const
Definition: TGeoMatrix.h:457
virtual void RotateY(Double_t angle)
Rotate about Y axis with angle expressed in degrees.
TGeoRotation & operator=(const TGeoRotation &other)
Definition: TGeoMatrix.h:200
virtual void RotateX(Double_t angle)
Rotate about X axis with angle expressed in degrees.
Double_t fTranslation[3]
Definition: TGeoMatrix.h:290
TGeoHMatrix & operator*=(const TGeoMatrix &matrix)
Definition: TGeoMatrix.h:429
virtual void RotateX(Double_t angle)
Rotate about X axis with angle expressed in degrees.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
Definition: TGeoMatrix.cxx:785
virtual void RotateZ(Double_t angle)
Rotate about Z axis with angle expressed in degrees.
virtual void ReflectY(Bool_t leftside, Bool_t rotonly=kFALSE)
Multiply by a reflection respect to ZX.
virtual const Double_t * GetScale() const
Definition: TGeoMatrix.h:170
virtual ~TGeoHMatrix()
destructor
virtual TGeoMatrix * MakeClone() const =0
#define ClassDef(name, id)
Definition: Rtypes.h:254
Double_t Determinant() const
computes determinant of the rotation matrix
virtual const Double_t * GetRotationMatrix() const
Definition: TGeoMatrix.h:394
virtual const Double_t * GetTranslation() const
Definition: TGeoMatrix.h:328
virtual void RotateY(Double_t)
Definition: TGeoMatrix.h:107
Bool_t Normalize()
A scale transformation should be normalized by sx*sy*sz factor.
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
virtual const Double_t * GetScale() const
Definition: TGeoMatrix.h:275
virtual void MasterToLocalVect(const Double_t *master, Double_t *local) const
convert a point by multiplying its column vector (x, y, z, 1) to matrix
Definition: TGeoMatrix.h:390
virtual void MasterToLocalBomb(const Double_t *master, Double_t *local) const
convert a point by multiplying its column vector (x, y, z, 1) to matrix
Definition: TGeoMatrix.h:391
virtual void ReflectZ(Bool_t leftside, Bool_t rotonly=kFALSE)
Multiply by a reflection respect to XY.
virtual void SetDz(Double_t dz)
Definition: TGeoMatrix.h:319
virtual TGeoMatrix & Inverse() const
Return a temporary inverse of this.
virtual ~TGeoGenTrans()
destructor
virtual TGeoMatrix * MakeClone() const
Make a clone of this matrix.
TGeoRotation * GetRotation() const
Definition: TGeoMatrix.h:326
Bool_t IsIdentity() const
Definition: TGeoMatrix.h:77
virtual void LocalToMasterBomb(const Double_t *local, Double_t *master) const
convert a point by multiplying its column vector (x, y, z, 1) to matrix inverse
Definition: TGeoMatrix.h:213
virtual void LocalToMasterVect(const Double_t *local, Double_t *master) const
convert a vector by multiplying its column vector (x, y, z, 1) to matrix inverse
Definition: TGeoMatrix.h:212
virtual const Double_t * GetRotationMatrix() const
Definition: TGeoMatrix.h:456
TGeoHMatrix & operator=(const TGeoMatrix *matrix)
assignment
Bool_t IsCombi() const
Definition: TGeoMatrix.h:83
void GetAngles(Double_t &theta1, Double_t &phi1, Double_t &theta2, Double_t &phi2, Double_t &theta3, Double_t &phi3) const
Retreive rotation angles.
virtual void MasterToLocal(const Double_t *master, Double_t *local) const
convert a point by multiplying its column vector (x, y, z, 1) to matrix
Definition: TGeoMatrix.cxx:413
virtual void LocalToMasterBomb(const Double_t *local, Double_t *master) const
convert a point by multiplying its column vector (x, y, z, 1) to matrix inverse
Definition: TGeoMatrix.cxx:743
void CopyFrom(const TGeoMatrix *other)
Fast copy method.
Bool_t IsTranslation() const
Definition: TGeoMatrix.h:78
virtual void RotateY(Double_t angle)
Rotate about Y axis of the master frame with angle expressed in degrees.
Bool_t IsShared() const
Definition: TGeoMatrix.h:82
virtual void ReflectX(Bool_t leftside, Bool_t rotonly=kFALSE)
Multiply by a reflection respect to YZ.
char * out
Definition: TBase64.cxx:29
Double_t GetPhiRotation(Bool_t fixX=kFALSE) const
— Returns rotation angle about Z axis in degrees.
Definition: TGeoMatrix.cxx:947
TGeoCombiTrans & operator=(const TGeoMatrix &matrix)
Assignment operator.
virtual Double_t * GetScale()
Definition: TGeoMatrix.h:461
virtual void SetDx(Double_t dx)
Definition: TGeoMatrix.h:164
Bool_t IsValid() const
Perform orthogonality test for rotation.
Definition: TGeoMatrix.cxx:903
virtual void ReflectY(Bool_t, Bool_t)
Multiply by a reflection respect to ZX.
Definition: TGeoMatrix.h:270
virtual void MasterToLocalVect(const Double_t *master, Double_t *local) const
convert a point by multiplying its column vector (x, y, z, 1) to matrix
Definition: TGeoMatrix.cxx:438
virtual TGeoMatrix * MakeClone() const
Make a clone of this matrix.
Definition: TGeoMatrix.h:359
void MultiplyBy(TGeoRotation *rot, Bool_t after=kTRUE)
Multiply this rotation with the one specified by ROT.
char * GetPointerName() const
Provide a pointer name containing uid.
Definition: TGeoMatrix.cxx:301
Double_t fScale[3]
Definition: TGeoMatrix.h:251
virtual void RegisterYourself()
Register the matrix in the current manager, which will become the owner.
void Clear(Option_t *option="")
clear the data for this matrix
void Clear(Option_t *option="")
clear the fields of this transformation
virtual Double_t * GetRotationMatrix()
Definition: TGeoMatrix.h:460
virtual const Double_t * GetRotationMatrix() const
get the rotation array
virtual const Double_t * GetTranslation() const
Definition: TGeoMatrix.h:168
void Clear(Option_t *option="")
reset data members
Definition: TGeoMatrix.cxx:923
virtual void MasterToLocal(const Double_t *master, Double_t *local) const
Convert a global point to local frame.
void SetDefaultName()
If no name was supplied in the ctor, the type of transformation is checked.
Definition: TGeoMatrix.cxx:555
void CheckMatrix()
performes an orthogonality check and finds if the matrix is a reflection Warning("CheckMatrix", "orthogonality check not performed yet");
virtual const Double_t * GetScale() const
Definition: TGeoMatrix.h:330
virtual void LocalToMaster(const Double_t *local, Double_t *master) const
convert a point by multiplying its column vector (x, y, z, 1) to matrix inverse
Definition: TGeoMatrix.cxx:346
virtual const Double_t * GetRotationMatrix() const
Definition: TGeoMatrix.h:234
Bool_t TestBit(UInt_t f) const
Definition: TObject.h:173
virtual void RegisterYourself()
Register the matrix in the current manager, which will become the owner.
Definition: TGeoMatrix.cxx:532
TGeoTranslation & operator=(const TGeoTranslation &other)
Definition: TGeoMatrix.h:146
virtual void ReflectY(Bool_t leftside, Bool_t rotonly=kFALSE)
Multiply by a reflection respect to ZX.
Definition: TGeoMatrix.cxx:518
static void Normalize(Double_t *vect)
Normalize a vector.
Definition: TGeoMatrix.cxx:480
void Clear(Option_t *option="")
Reset translation/rotation to identity.
virtual void ReflectY(Bool_t leftside, Bool_t rotonly=kFALSE)
Multiply by a reflection respect to ZX.
virtual TGeoMatrix * MakeClone() const
Make a clone of this matrix.
Definition: TGeoMatrix.cxx:984
virtual void RotateZ(Double_t angle)
Rotate about Z axis of the master frame with angle expressed in degrees.
virtual void RotateZ(Double_t angle)
Rotate about Z axis of the master frame with angle expressed in degrees.
Definition: TGeoMatrix.cxx:685
virtual void SetDy(Double_t dy)
Definition: TGeoMatrix.h:448
Double_t fRotationMatrix[3 *3]
Definition: TGeoMatrix.h:185
virtual void LocalToMaster(const Double_t *local, Double_t *master) const
convert a point by multiplying its column vector (x, y, z, 1) to matrix inverse
Definition: TGeoMatrix.h:385
TGeoMatrix & operator*(const TGeoMatrix &right) const
Multiplication.
Definition: TGeoMatrix.cxx:237
void SetScale(Double_t *scale)
Definition: TGeoMatrix.h:358
virtual void ReflectZ(Bool_t leftside, Bool_t rotonly=kFALSE)
Multiply by a reflection respect to XY.
Definition: TGeoMatrix.cxx:525
virtual void MasterToLocalBomb(const Double_t *master, Double_t *local) const
convert a point by multiplying its column vector (x, y, z, 1) to matrix
Definition: TGeoMatrix.cxx:773
TGeoScale & operator=(const TGeoScale &other)
Assignment operator.
virtual void ReflectX(Bool_t leftside, Bool_t rotonly=kFALSE)
Multiply by a reflection respect to YZ.
virtual const Double_t * GetScale() const
Definition: TGeoMatrix.h:235
double Double_t
Definition: RtypesCore.h:55
virtual TGeoMatrix & Inverse() const =0
Bool_t operator==(const TGeoMatrix &other) const
Is-equal operator.
Definition: TGeoMatrix.cxx:248
virtual void ReflectZ(Bool_t leftside, Bool_t rotonly=kFALSE)
Multiply by a reflection respect to XY.
virtual const Double_t * GetTranslation() const
Definition: TGeoMatrix.h:393
Bool_t IsRegistered() const
Definition: TGeoMatrix.h:87
TGeoTranslation & operator=(const TGeoMatrix &matrix)
Assignment from a general matrix.
Definition: TGeoMatrix.cxx:624
virtual const Double_t * GetScale() const
Definition: TGeoMatrix.h:395
virtual void MasterToLocalBomb(const Double_t *master, Double_t *local) const
convert a point by multiplying its column vector (x, y, z, 1) to matrix
Definition: TGeoMatrix.cxx:455
virtual void ReflectZ(Bool_t, Bool_t)
Multiply by a reflection respect to XY.
Definition: TGeoMatrix.h:271
virtual TGeoMatrix * MakeClone() const
Make a clone of this matrix.
Definition: TGeoMatrix.cxx:660
void SetRotation(const TGeoMatrix &other)
Copy rotation elements from other rotation matrix.
virtual void ReflectX(Bool_t, Bool_t)
Multiply by a reflection respect to YZ.
Definition: TGeoMatrix.h:269
TGeoCombiTrans & operator=(const TGeoCombiTrans &other)
Definition: TGeoMatrix.h:302
virtual void RotateX(Double_t)
Definition: TGeoMatrix.h:106
virtual void MasterToLocalVect(const Double_t *master, Double_t *local) const
convert a point by multiplying its column vector (x, y, z, 1) to matrix
Definition: TGeoMatrix.h:268
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
virtual void MasterToLocal(const Double_t *master, Double_t *local) const
convert a point by multiplying its column vector (x, y, z, 1) to matrix
Definition: TGeoMatrix.cxx:755
void Print(Option_t *option="") const
print the matrix in 4x4 format
Definition: TGeoMatrix.cxx:493
#define name(a, b)
Definition: linkTestLib0.cpp:5
void SetScale(const Double_t *scale)
Definition: TGeoMatrix.h:452
void SetMatrix(const Double_t *rot)
Definition: TGeoMatrix.h:229
TGeoHMatrix & operator=(const TGeoHMatrix &other)
Definition: TGeoMatrix.h:427
virtual void SavePrimitive(std::ostream &, Option_t *="")
Save a primitive as a C++ statement(s) on output stream "out".
Definition: TGeoMatrix.h:396
virtual ~TGeoRotation()
Definition: TGeoMatrix.h:197
#define R__EXTERN
Definition: DllImport.h:27
virtual TGeoMatrix & Inverse() const
Return a temporary inverse of this.
virtual void LocalToMaster(const Double_t *local, Double_t *master) const
convert a point by multiplying its column vector (x, y, z, 1) to matrix inverse
Definition: TGeoMatrix.cxx:958
R__EXTERN TGeoIdentity * gGeoIdentity
Definition: TGeoMatrix.h:466
virtual void SetDy(Double_t)
Definition: TGeoMatrix.h:115
virtual const Double_t * GetTranslation() const
Definition: TGeoMatrix.h:233
void SetRotation(const Double_t *matrix)
Definition: TGeoMatrix.h:451
virtual ~TGeoMatrix()
Destructor.
Definition: TGeoMatrix.cxx:212
virtual ~TGeoIdentity()
Definition: TGeoMatrix.h:382
TGeoRotation * fRotation
Definition: TGeoMatrix.h:291
virtual const Double_t * GetTranslation() const
Definition: TGeoMatrix.h:273
virtual void LocalToMasterBomb(const Double_t *local, Double_t *master) const
convert a point by multiplying its column vector (x, y, z, 1) to matrix inverse
Definition: TGeoMatrix.cxx:387
#define NULL
Definition: Rtypes.h:82
virtual void MasterToLocalVect(const Double_t *master, Double_t *local) const
convert a point by multiplying its column vector (x, y, z, 1) to matrix
Definition: TGeoMatrix.h:216
virtual void ReflectX(Bool_t leftside, Bool_t rotonly=kFALSE)
Multiply by a reflection respect to YZ.
Definition: TGeoMatrix.cxx:511
virtual TGeoMatrix & Inverse() const
Return a temporary inverse of this.
Definition: TGeoMatrix.cxx:635
void SetScale(Double_t sx, Double_t sy, Double_t sz)
scale setter
Bool_t IsRotAboutZ() const
Returns true if no rotation or the rotation is about Z axis.
Definition: TGeoMatrix.cxx:276
virtual void RotateX(Double_t angle)
Rotate about X axis of the master frame with angle expressed in degrees.
Definition: TGeoMatrix.cxx:669
virtual void RotateY(Double_t angle)
Rotate about Y axis of the master frame with angle expressed in degrees.
Definition: TGeoMatrix.cxx:677
void SetAngles(Double_t phi, Double_t theta, Double_t psi)
Set matrix elements according to Euler angles.
const Bool_t kTRUE
Definition: Rtypes.h:91
virtual void RotateZ(Double_t angle)
Rotate about Z axis with angle expressed in degrees.
virtual Int_t GetByteCount() const
Get total size in bytes of this.
Definition: TGeoMatrix.cxx:289
virtual const Double_t * GetTranslation() const
Definition: TGeoMatrix.h:455
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
virtual const Double_t * GetTranslation() const =0
virtual void SetDz(Double_t dz)
Definition: TGeoMatrix.h:449
virtual const Double_t * GetScale() const =0
virtual TGeoMatrix * MakeClone() const
Make a clone of this matrix.
void SetTranslation(Double_t dx, Double_t dy, Double_t dz)
Set translation components.
Definition: TGeoMatrix.cxx:703
virtual ~TGeoTranslation()
Definition: TGeoMatrix.h:143
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
Double_t fTranslation[3]
Definition: TGeoMatrix.h:136
void SetScale(Double_t sx, Double_t sy, Double_t sz)
set the scale
Double_t fScale[3]
Definition: TGeoMatrix.h:345