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