Logo ROOT   6.08/07
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 // TGeoTranslation - class describing translations. A translation is //
125 // basically an array of 3 doubles matching the positions 12, 13 //
126 // and 14 in the homogenous matrix description. //
127 // //
128 // //
129 ////////////////////////////////////////////////////////////////////////////
130 
132 {
133 protected:
134  Double_t fTranslation[3]; // translation vector
135 public :
136  TGeoTranslation();
137  TGeoTranslation(const TGeoTranslation &other);
138  TGeoTranslation(const TGeoMatrix &other);
140  TGeoTranslation(const char *name, Double_t dx, Double_t dy, Double_t dz);
141  virtual ~TGeoTranslation() {}
142 
143  TGeoTranslation& operator=(const TGeoMatrix &matrix);
144  TGeoTranslation& operator=(const TGeoTranslation &other) {return operator=((const TGeoMatrix&)other);};
145 
146  void Add(const TGeoTranslation *other);
147  virtual TGeoMatrix& Inverse() const;
148  virtual void LocalToMaster(const Double_t *local, Double_t *master) const;
149  virtual void LocalToMasterVect(const Double_t *local, Double_t *master) const;
150  virtual void LocalToMasterBomb(const Double_t *local, Double_t *master) const;
151  virtual TGeoMatrix *MakeClone() const;
152  virtual void MasterToLocal(const Double_t *master, Double_t *local) const;
153  virtual void MasterToLocalVect(const Double_t *master, Double_t *local) const;
154  virtual void MasterToLocalBomb(const Double_t *master, Double_t *local) const;
155  virtual void RotateX(Double_t angle);
156  virtual void RotateY(Double_t angle);
157  virtual void RotateZ(Double_t angle);
158  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
159  void Subtract(const TGeoTranslation *other);
160  void SetTranslation(Double_t dx, Double_t dy, Double_t dz);
161  void SetTranslation(const TGeoMatrix &other);
162  virtual void SetDx(Double_t dx) {SetTranslation(dx, fTranslation[1], fTranslation[2]);}
163  virtual void SetDy(Double_t dy) {SetTranslation(fTranslation[0], dy, fTranslation[2]);}
164  virtual void SetDz(Double_t dz) {SetTranslation(fTranslation[0], fTranslation[1], dz);}
165 
166  virtual const Double_t *GetTranslation() const {return &fTranslation[0];}
167  virtual const Double_t *GetRotationMatrix() const {return &kIdentityMatrix[0];}
168  virtual const Double_t *GetScale() const {return &kUnitScale[0];}
169 
170  ClassDef(TGeoTranslation, 1) // translation class
171 };
172 
173 ////////////////////////////////////////////////////////////////////////////
174 // //
175 // TGeoRotation - class describing rotations. A rotation is a 3*3 array //
176 // Column vectors has to be orthogonal unit vectors. //
177 // //
178 ////////////////////////////////////////////////////////////////////////////
179 
180 class TGeoRotation : public TGeoMatrix
181 {
182 protected:
183  Double_t fRotationMatrix[3*3]; // rotation matrix
184 
185  void CheckMatrix();
186 public :
187  TGeoRotation();
188  TGeoRotation(const TGeoRotation &other);
189  TGeoRotation(const TGeoMatrix &other);
190  TGeoRotation(const char *name);
191 // TGeoRotation(const char *name, Double_t *matrix) ;
192  TGeoRotation(const char *name, Double_t phi, Double_t theta, Double_t psi);
193  TGeoRotation(const char *name, Double_t theta1, Double_t phi1, Double_t theta2, Double_t phi2,
194  Double_t theta3, Double_t phi3);
195  virtual ~TGeoRotation() {}
196 
197  TGeoRotation& operator=(const TGeoMatrix &matrix);
198  TGeoRotation& operator=(const TGeoRotation &other) {return operator=((const TGeoMatrix&)other);};
199 
200  Bool_t IsValid() const;
201  virtual TGeoMatrix& Inverse() const;
202  void Clear(Option_t *option ="");
203  Double_t Determinant() const;
204  void FastRotZ(const Double_t *sincos);
205  void GetAngles(Double_t &theta1, Double_t &phi1, Double_t &theta2, Double_t &phi2,
206  Double_t &theta3, Double_t &phi3) const;
207  void GetAngles(Double_t &phi, Double_t &theta, Double_t &psi) const;
208  Double_t GetPhiRotation(Bool_t fixX=kFALSE) const;
209  virtual void LocalToMaster(const Double_t *local, Double_t *master) const;
210  virtual void LocalToMasterVect(const Double_t *local, Double_t *master) const {TGeoRotation::LocalToMaster(local, master);}
211  virtual void LocalToMasterBomb(const Double_t *local, Double_t *master) const {TGeoRotation::LocalToMaster(local, master);}
212  virtual TGeoMatrix *MakeClone() const;
213  virtual void MasterToLocal(const Double_t *master, Double_t *local) const;
214  virtual void MasterToLocalVect(const Double_t *master, Double_t *local) const {TGeoRotation::MasterToLocal(master, local);}
215  virtual void MasterToLocalBomb(const Double_t *master, Double_t *local) const {TGeoRotation::MasterToLocal(master, local);}
216  void MultiplyBy(TGeoRotation *rot, Bool_t after=kTRUE);
217  virtual void RotateX(Double_t angle);
218  virtual void RotateY(Double_t angle);
219  virtual void RotateZ(Double_t angle);
220  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
221  virtual void ReflectX(Bool_t leftside, Bool_t rotonly=kFALSE);
222  virtual void ReflectY(Bool_t leftside, Bool_t rotonly=kFALSE);
223  virtual void ReflectZ(Bool_t leftside, Bool_t rotonly=kFALSE);
224  void SetAngles(Double_t phi, Double_t theta, Double_t psi);
225  void SetAngles(Double_t theta1, Double_t phi1, Double_t theta2, Double_t phi2,
226  Double_t theta3, Double_t phi3);
227  void SetMatrix(const Double_t *rot) {memcpy(&fRotationMatrix[0], rot, 9*sizeof(Double_t));CheckMatrix();}
228  void SetRotation(const TGeoMatrix &other);
229  void GetInverse(Double_t *invmat) const;
230 
231  virtual const Double_t *GetTranslation() const {return &kNullVector[0];}
232  virtual const Double_t *GetRotationMatrix() const {return &fRotationMatrix[0];}
233  virtual const Double_t *GetScale() const {return &kUnitScale[0];}
234 
235  ClassDef(TGeoRotation, 1) // rotation class
236 };
237 
238 ////////////////////////////////////////////////////////////////////////////
239 // //
240 // TGeoScale - class describing scale transformations. A scale is an //
241 // array of 3 doubles (sx, sy, sz) multiplying elements 0, 5 and 10 //
242 // of the homogenous matrix. A scale is normalized : sx*sy*sz = 1 //
243 // //
244 ////////////////////////////////////////////////////////////////////////////
245 
246 class TGeoScale : public TGeoMatrix
247 {
248 protected:
249  Double_t fScale[3]; // scale (x, y, z)
250 public :
251  TGeoScale();
252  TGeoScale(const TGeoScale &other);
253  TGeoScale(Double_t sx, Double_t sy, Double_t sz);
254  TGeoScale(const char *name, Double_t sx, Double_t sy, Double_t sz);
255  virtual ~TGeoScale();
256 
257  TGeoScale& operator=(const TGeoScale &other);
258  virtual TGeoMatrix& Inverse() const;
259  void SetScale(Double_t sx, Double_t sy, Double_t sz);
260  virtual void LocalToMaster(const Double_t *local, Double_t *master) const;
261  Double_t LocalToMaster(Double_t dist, const Double_t *dir=0) const;
262  virtual void LocalToMasterVect(const Double_t *local, Double_t *master) const {TGeoScale::LocalToMaster(local, master);}
263  virtual TGeoMatrix *MakeClone() const;
264  virtual void MasterToLocal(const Double_t *master, Double_t *local) const;
265  Double_t MasterToLocal(Double_t dist, const Double_t *dir=0) const;
266  virtual void MasterToLocalVect(const Double_t *master, Double_t *local) const {TGeoScale::MasterToLocal(master, local);}
267  virtual void ReflectX(Bool_t, Bool_t) {fScale[0]=-fScale[0]; SetBit(kGeoReflection, !IsReflection());}
268  virtual void ReflectY(Bool_t, Bool_t) {fScale[1]=-fScale[1]; SetBit(kGeoReflection, !IsReflection());}
269  virtual void ReflectZ(Bool_t, Bool_t) {fScale[2]=-fScale[2]; SetBit(kGeoReflection, !IsReflection());}
270 
271  virtual const Double_t *GetTranslation() const {return &kNullVector[0];}
272  virtual const Double_t *GetRotationMatrix() const {return &kIdentityMatrix[0];}
273  virtual const Double_t *GetScale() const {return &fScale[0];}
274 
275  ClassDef(TGeoScale, 1) // scaling class
276 };
277 
278 ////////////////////////////////////////////////////////////////////////////
279 // //
280 // TGeoCombiTrans - class describing rotation + translation. Most //
281 // frequently used in the description of TGeoNode 's //
282 // //
283 ////////////////////////////////////////////////////////////////////////////
284 
286 {
287 protected:
288  Double_t fTranslation[3]; // translation vector
289  TGeoRotation *fRotation; // rotation matrix
290 public :
291  TGeoCombiTrans();
292  TGeoCombiTrans(const TGeoCombiTrans &other);
293  TGeoCombiTrans(const TGeoMatrix &other);
294  TGeoCombiTrans(const TGeoTranslation &tr, const TGeoRotation &rot);
295  TGeoCombiTrans(const char *name);
297  TGeoCombiTrans(const char *name, Double_t dx, Double_t dy, Double_t dz, TGeoRotation *rot);
298 
299  TGeoCombiTrans& operator=(const TGeoMatrix &matrix);
300  TGeoCombiTrans& operator=(const TGeoCombiTrans &other) {return operator=((const TGeoMatrix&)other);};
301 
302  virtual ~TGeoCombiTrans();
303 
304  void Clear(Option_t *option ="");
305  virtual TGeoMatrix& Inverse() const;
306  virtual TGeoMatrix *MakeClone() const;
307  virtual void RegisterYourself();
308  virtual void RotateX(Double_t angle);
309  virtual void RotateY(Double_t angle);
310  virtual void RotateZ(Double_t angle);
311  virtual void ReflectX(Bool_t leftside, Bool_t rotonly=kFALSE);
312  virtual void ReflectY(Bool_t leftside, Bool_t rotonly=kFALSE);
313  virtual void ReflectZ(Bool_t leftside, Bool_t rotonly=kFALSE);
314  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
315  virtual void SetDx(Double_t dx) {SetTranslation(dx, fTranslation[1], fTranslation[2]);}
316  virtual void SetDy(Double_t dy) {SetTranslation(fTranslation[0], dy, fTranslation[2]);}
317  virtual void SetDz(Double_t dz) {SetTranslation(fTranslation[0], fTranslation[1], dz);}
318  void SetTranslation(const TGeoTranslation &tr);
319  void SetTranslation(Double_t dx, Double_t dy, Double_t dz);
320  void SetTranslation(Double_t *vect);
321  void SetRotation(const TGeoRotation &other);
322  void SetRotation(const TGeoRotation *rot);
323 
324  TGeoRotation *GetRotation() const {return fRotation;}
325 
326  virtual const Double_t *GetTranslation() const {return &fTranslation[0];}
327  virtual const Double_t *GetRotationMatrix() const;
328  virtual const Double_t *GetScale() const {return &kUnitScale[0];}
329 
330  ClassDef(TGeoCombiTrans, 1) // rotation + translation
331 };
332 
333 ////////////////////////////////////////////////////////////////////////////
334 // //
335 // TGeoGenTrans - most general transformation, holding a translation, //
336 // a rotation and a scale //
337 // //
338 ////////////////////////////////////////////////////////////////////////////
339 
341 {
342 protected:
343  Double_t fScale[3]; // scale (x, y, z)
344 public :
345  TGeoGenTrans();
346  TGeoGenTrans(const char *name);
348  Double_t sx, Double_t sy, Double_t sz, TGeoRotation *rot);
349  TGeoGenTrans(const char *name, Double_t dx, Double_t dy, Double_t dz,
350  Double_t sx, Double_t sy, Double_t sz, TGeoRotation *rot);
351  virtual ~TGeoGenTrans();
352 
353  void Clear(Option_t *option ="");
354  virtual TGeoMatrix& Inverse() const;
355  void SetScale(Double_t sx, Double_t sy, Double_t sz);
356  void SetScale(Double_t *scale) {memcpy(&fScale[0], scale, 3*sizeof(Double_t));}
357  virtual TGeoMatrix *MakeClone() const {return NULL;}
358  Bool_t Normalize();
359 
360  virtual const Double_t *GetScale() const {return &fScale[0];}
361 
362  ClassDef(TGeoGenTrans, 1) // rotation + translation + scale
363 };
364 
365 ////////////////////////////////////////////////////////////////////////////
366 // //
367 // TGeoIdentity - an identity transformation. It holds no data member //
368 // and returns pointers to static null translation and identity //
369 // transformations for rotation and scale //
370 // //
371 ////////////////////////////////////////////////////////////////////////////
372 
373 class TGeoIdentity : public TGeoMatrix
374 {
375 private:
376  // no data members
377 public :
378  TGeoIdentity();
379  TGeoIdentity(const char *name);
380  virtual ~TGeoIdentity() {}
381 
382  virtual TGeoMatrix& Inverse() const;
383  virtual void LocalToMaster(const Double_t *local, Double_t *master) const {memcpy(master, local, 3*sizeof(Double_t));}
384  virtual void LocalToMasterVect(const Double_t *local, Double_t *master) const {memcpy(master, local, 3*sizeof(Double_t));}
385  virtual void LocalToMasterBomb(const Double_t *local, Double_t *master) const {TGeoIdentity::LocalToMaster(local, master);}
386  virtual TGeoMatrix *MakeClone() const {return NULL;}
387  virtual void MasterToLocal(const Double_t *master, Double_t *local) const {memcpy(local, master, 3*sizeof(Double_t));}
388  virtual void MasterToLocalVect(const Double_t *master, Double_t *local) const {memcpy(local, master, 3*sizeof(Double_t));}
389  virtual void MasterToLocalBomb(const Double_t *master, Double_t *local) const {TGeoIdentity::MasterToLocal(master, local);}
390 
391  virtual const Double_t *GetTranslation() const {return &kNullVector[0];}
392  virtual const Double_t *GetRotationMatrix() const {return &kIdentityMatrix[0];}
393  virtual const Double_t *GetScale() const {return &kUnitScale[0];}
394  virtual void SavePrimitive(std::ostream &, Option_t * = "") {;}
395 
396  ClassDef(TGeoIdentity, 1) // identity transformation class
397 };
398 
399 
400 
401 ////////////////////////////////////////////////////////////////////////////
402 // //
403 // TGeoHMatrix - Matrix class used for computing global transformations //
404 // Should NOT be used for node definition. An instance of this class //
405 // is generally used to pile-up local transformations starting from //
406 // the top level physical node, down to the current node. //
407 // //
408 ////////////////////////////////////////////////////////////////////////////
409 
410 class TGeoHMatrix : public TGeoMatrix
411 {
412 private:
413  Double_t fTranslation[3]; // translation component
414  Double_t fRotationMatrix[9]; // rotation matrix
415  Double_t fScale[3]; // scale component
416 
417 public :
418  TGeoHMatrix();
419  TGeoHMatrix(const TGeoMatrix &matrix);
420  TGeoHMatrix(const char *name);
421  virtual ~TGeoHMatrix();
422 
423  TGeoHMatrix& operator=(const TGeoMatrix *matrix);
424  TGeoHMatrix& operator=(const TGeoMatrix &matrix);
425  TGeoHMatrix& operator=(const TGeoHMatrix &other) {return operator=((const TGeoMatrix&)other);};
426 
427  TGeoHMatrix& operator*=(const TGeoMatrix &matrix) {Multiply(&matrix);return(*this);}
428 
429  void Clear(Option_t *option ="");
430  void CopyFrom(const TGeoMatrix *other);
431  Double_t Determinant() const;
432  void FastRotZ(const Double_t *sincos);
433  virtual TGeoMatrix& Inverse() const;
434  virtual TGeoMatrix *MakeClone() const;
435  void Multiply(const TGeoMatrix *right);
436  void MultiplyLeft(const TGeoMatrix *left);
437 
438  virtual void RotateX(Double_t angle);
439  virtual void RotateY(Double_t angle);
440  virtual void RotateZ(Double_t angle);
441  virtual void ReflectX(Bool_t leftside, Bool_t rotonly=kFALSE);
442  virtual void ReflectY(Bool_t leftside, Bool_t rotonly=kFALSE);
443  virtual void ReflectZ(Bool_t leftside, Bool_t rotonly=kFALSE);
444  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
445  virtual void SetDx(Double_t dx) {fTranslation[0] = dx; SetBit(kGeoTranslation);}
446  virtual void SetDy(Double_t dy) {fTranslation[1] = dy; SetBit(kGeoTranslation);}
447  virtual void SetDz(Double_t dz) {fTranslation[2] = dz; SetBit(kGeoTranslation);}
448  void SetTranslation(const Double_t *vect) {SetBit(kGeoTranslation); memcpy(&fTranslation[0], vect, 3*sizeof(Double_t));}
449  void SetRotation(const Double_t *matrix) {SetBit(kGeoRotation); memcpy(&fRotationMatrix[0], matrix, 9*sizeof(Double_t));}
450  void SetScale(const Double_t *scale) {SetBit(kGeoScale); memcpy(&fScale[0], scale, 3*sizeof(Double_t));}
451 
452 
453  virtual const Double_t *GetTranslation() const {return &fTranslation[0];}
454  virtual const Double_t *GetRotationMatrix() const {return &fRotationMatrix[0];}
455  virtual const Double_t *GetScale() const {return &fScale[0];}
456 
457  virtual Double_t *GetTranslation() {return &fTranslation[0];}
458  virtual Double_t *GetRotationMatrix() {return &fRotationMatrix[0];}
459  virtual Double_t *GetScale() {return &fScale[0];}
460  ClassDef(TGeoHMatrix, 1) // global matrix class
461 };
462 
463 
465 
466 #endif
467 
void SetShared(Bool_t flag=kTRUE)
Definition: TGeoMatrix.h:117
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:28
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:85
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:163
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:266
const char Option_t
Definition: RtypesCore.h:62
Geometrical transformation package.
Definition: TGeoMatrix.h:40
virtual const Double_t * GetScale() const
Definition: TGeoMatrix.h:360
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:383
virtual const Double_t * GetRotationMatrix() const
Definition: TGeoMatrix.h:454
TGeoMatrix & operator*(const TGeoMatrix &right) const
Multiplication.
Definition: TGeoMatrix.cxx:280
virtual const Double_t * GetTranslation() const
Definition: TGeoMatrix.h:453
virtual void SetDy(Double_t dy)
Definition: TGeoMatrix.h:316
Bool_t TestBit(UInt_t f) const
Definition: TObject.h:157
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 MasterToLocal(const Double_t *master, Double_t *local) const
Convert a global point to local frame.
An identity transformation.
Definition: TGeoMatrix.h:373
Most general transformation, holding a translation, a rotation and a scale.
Definition: TGeoMatrix.h:340
void SetTranslation(const Double_t *vect)
Definition: TGeoMatrix.h:448
virtual void SetDx(Double_t dx)
Definition: TGeoMatrix.h:315
virtual void SetDz(Double_t)
Definition: TGeoMatrix.h:116
Class describing translations.
Definition: TGeoMatrix.h:131
virtual Double_t * GetTranslation()
Definition: TGeoMatrix.h:457
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:455
virtual void RotateZ(Double_t)
Definition: TGeoMatrix.h:108
Matrix class used for computing global transformations Should NOT be used for node definition...
Definition: TGeoMatrix.h:410
virtual void SetDx(Double_t)
Definition: TGeoMatrix.h:114
virtual void SetDx(Double_t dx)
Definition: TGeoMatrix.h:445
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:164
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:262
const Double_t kUnitScale[3]
Definition: TGeoMatrix.h:32
virtual const Double_t * GetScale() const
Definition: TGeoMatrix.h:273
virtual const Double_t * GetTranslation() const
Definition: TGeoMatrix.h:271
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition: TObject.cxx:739
TGeoRotation & operator=(const TGeoRotation &other)
Definition: TGeoMatrix.h:198
virtual const Double_t * GetScale() const
Definition: TGeoMatrix.h:233
virtual const Double_t * GetTranslation() const
Definition: TGeoMatrix.h:231
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:427
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:215
virtual TGeoMatrix * MakeClone() const =0
#define ClassDef(name, id)
Definition: Rtypes.h:254
virtual void RotateY(Double_t)
Definition: TGeoMatrix.h:107
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
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:388
virtual void SetDz(Double_t dz)
Definition: TGeoMatrix.h:317
void Add(THist< DIMENSIONS, PRECISION_TO, STAT_TO... > &to, THist< DIMENSIONS, PRECISION_FROM, STAT_FROM... > &from)
Add two histograms.
Definition: THist.hxx:327
Bool_t IsShared() const
Definition: TGeoMatrix.h:82
Bool_t IsIdentity() const
Definition: TGeoMatrix.h:77
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:387
virtual const Double_t * GetTranslation() const
Definition: TGeoMatrix.h:166
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:211
virtual Double_t * GetScale()
Definition: TGeoMatrix.h:459
virtual void SetDx(Double_t dx)
Definition: TGeoMatrix.h:162
virtual const Double_t * GetRotationMatrix() const
Definition: TGeoMatrix.h:232
virtual void ReflectY(Bool_t, Bool_t)
Multiply by a reflection respect to ZX.
Definition: TGeoMatrix.h:268
virtual const Double_t * GetRotationMatrix() const
Definition: TGeoMatrix.h:392
virtual TGeoMatrix * MakeClone() const
Make a clone of this matrix.
Definition: TGeoMatrix.h:357
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:285
virtual Double_t * GetRotationMatrix()
Definition: TGeoMatrix.h:458
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:210
Bool_t IsRegistered() const
Definition: TGeoMatrix.h:87
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:144
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:326
TGeoRotation * GetRotation() const
Definition: TGeoMatrix.h:324
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&#39;s and visualization...
Definition: TGeoMatrix.cxx:364
virtual const Double_t * GetRotationMatrix() const
Definition: TGeoMatrix.h:272
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:328
Class describing rotations.
Definition: TGeoMatrix.h:180
virtual void SetDy(Double_t dy)
Definition: TGeoMatrix.h:446
Bool_t IsRotation() const
Definition: TGeoMatrix.h:79
void SetScale(Double_t *scale)
Definition: TGeoMatrix.h:356
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:246
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:83
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:385
Bool_t IsScale() const
Definition: TGeoMatrix.h:81
virtual void ReflectZ(Bool_t, Bool_t)
Multiply by a reflection respect to XY.
Definition: TGeoMatrix.h:269
virtual void ReflectX(Bool_t, Bool_t)
Multiply by a reflection respect to YZ.
Definition: TGeoMatrix.h:267
TGeoCombiTrans & operator=(const TGeoCombiTrans &other)
Definition: TGeoMatrix.h:300
virtual void RotateX(Double_t)
Definition: TGeoMatrix.h:106
Bool_t IsReflection() const
Definition: TGeoMatrix.h:80
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:214
void SetScale(const Double_t *scale)
Definition: TGeoMatrix.h:450
void SetMatrix(const Double_t *rot)
Definition: TGeoMatrix.h:227
TGeoHMatrix & operator=(const TGeoHMatrix &other)
Definition: TGeoMatrix.h:425
virtual void SavePrimitive(std::ostream &, Option_t *="")
Save a primitive as a C++ statement(s) on output stream "out".
Definition: TGeoMatrix.h:394
virtual ~TGeoRotation()
Definition: TGeoMatrix.h:195
#define R__EXTERN
Definition: DllImport.h:27
R__EXTERN TGeoIdentity * gGeoIdentity
Definition: TGeoMatrix.h:464
virtual void SetDy(Double_t)
Definition: TGeoMatrix.h:115
virtual const Double_t * GetScale() const
Definition: TGeoMatrix.h:393
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:389
void SetRotation(const Double_t *matrix)
Definition: TGeoMatrix.h:449
virtual ~TGeoMatrix()
Destructor.
Definition: TGeoMatrix.cxx:255
virtual ~TGeoIdentity()
Definition: TGeoMatrix.h:380
TGeoRotation * fRotation
Definition: TGeoMatrix.h:289
#define NULL
Definition: Rtypes.h:82
virtual const Double_t * GetTranslation() const
Definition: TGeoMatrix.h:391
Bool_t IsTranslation() const
Definition: TGeoMatrix.h:78
virtual const Double_t * GetRotationMatrix() const
Definition: TGeoMatrix.h:167
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:386
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:168
const Bool_t kTRUE
Definition: Rtypes.h:91
virtual const Double_t * GetTranslation() const =0
virtual void SetDz(Double_t dz)
Definition: TGeoMatrix.h:447
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
char name[80]
Definition: TGX11.cxx:109
virtual ~TGeoTranslation()
Definition: TGeoMatrix.h:141
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
Definition: TObject.cxx:709
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:384