Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGeoMatrix Class Referenceabstract

Geometrical transformation package.

All geometrical transformations handled by the modeller are provided as a built-in package. This was designed to minimize memory requirements and optimize performance of point/vector master-to-local and local-to-master computation. We need to have in mind that a transformation in TGeo has 2 major use-cases. The first one is for defining the placement of a volume with respect to its container reference frame. This frame will be called 'master' and the frame of the positioned volume - 'local'. If T is a transformation used for positioning volume daughters, then:

MASTER = T * LOCAL

Therefore a local-to-master conversion will be performed by using T, while a master-to-local by using its inverse. The second use case is the computation of the global transformation of a given object in the geometry. Since the geometry is built as 'volumes-inside-volumes', this global transformation represent the pile-up of all local transformations in the corresponding branch. The conversion from the global reference frame and the given object is also called master-to-local, but it is handled by the manager class. A general homogenous transformation is defined as a 4x4 matrix embedding a rotation, a translation and a scale. The advantage of this description is that each basic transformation can be represented as a homogenous matrix, composition being performed as simple matrix multiplication.

Rotation: Inverse rotation:

r11 r12 r13 0 r11 r21 r31 0
r21 r22 r23 0 r12 r22 r32 0
r31 r32 r33 0 r13 r23 r33 0
0 0 0 1 0 0 0 1

Translation: Inverse translation:

1 0 0 tx 1 0 0 -tx
0 1 0 ty 0 1 0 -ty
0 0 1 tz 0 0 1 -tz
0 0 0 1 0 0 0 1

Scale: Inverse scale:

sx 0 0 0 1/sx 0 0 0
0 sy 0 0 0 1/sy 0 0
0 0 sz 0 0 0 1/sz 0
0 0 0 1 0 0 0 1

where:

  • rij are the 3x3 rotation matrix components,
  • tx, ty, tz are the translation components
  • sx, sy, sz are arbitrary scale constants on each axis,

The disadvantage in using this approach is that computation for 4x4 matrices is expensive. Even combining two translation would become a multiplication of their corresponding matrices, which is quite an undesired effect. On the other hand, it is not a good idea to store a translation as a block of 16 numbers. We have therefore chosen to implement each basic transformation type as a class deriving from the same basic abstract class and handling its specific data and point/vector transformation algorithms.

The base class TGeoMatrix defines abstract metods for:

translation, rotation and scale getters. Every derived class stores only

its specific data, e.g. a translation stores an array of 3 doubles and a rotation an array of 9. However, asking which is the rotation array of a TGeoTranslation through the base TGeoMatrix interface is a legal operation. The answer in this case is a pointer to a global constant array representing an identity rotation.

Double_t *TGeoMatrix::GetRotation()
Geometrical transformation package.
Definition TGeoMatrix.h:38
virtual const Double_t * GetTranslation() const =0
virtual const Double_t * GetScale() const =0

MasterToLocal() and LocalToMaster() point and vector transformations :

void TGeoMatrix::MasterToLocal(const Double_t *master, Double_t *local)
void TGeoMatrix::LocalToMaster(const Double_t *local, Double_t *master)
void TGeoMatrix::MasterToLocalVect(const Double_t *master, Double_t *local)
void TGeoMatrix::LocalToMasterVect(const Double_t *local, Double_t *master)
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
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
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
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

These allow correct conversion also for reflections.

Transformation type getters :

Bool_t TGeoMatrix::IsCombi() (translation + rotation)
Bool_t TGeoMatrix::IsGeneral() (translation + rotation + scale)
Bool_t IsScale() const
Definition TGeoMatrix.h:67
Bool_t IsGeneral() const
Definition TGeoMatrix.h:71
Bool_t IsTranslation() const
Definition TGeoMatrix.h:64
Bool_t IsRotation() const
Definition TGeoMatrix.h:65
Bool_t IsIdentity() const
Definition TGeoMatrix.h:63
Bool_t IsCombi() const
Definition TGeoMatrix.h:70

Combinations of basic transformations are represented by specific classes deriving from TGeoMatrix. In order to define a matrix as a combination of several others, a special class TGeoHMatrix is provided. Here is an example of matrix creation :

Matrix creation example:

root[0] TGeoRotation r1,r2;
r1.SetAngles(90,0,30); // rotation defined by Euler angles
r2.SetAngles(90,90,90,180,0,0); // rotation defined by GEANT3 angles
TGeoTranslation t1(-10,10,0);
TGeoTranslation t2(10,-10,5);
TGeoHMatrix h = c1 * c2; // composition is done via TGeoHMatrix class
root[7] TGeoHMatrix *ph = new TGeoHMatrix(hm); // this is the one we want to
// use for positioning a volume
root[8] ph->Print();
...
pVolume->AddNode(pVolDaughter,id,ph) // now ph is owned by the manager
#define h(i)
Definition RSha256.hxx:106
Class describing rotation + translation.
Definition TGeoMatrix.h:317
Matrix class used for computing global transformations Should NOT be used for node definition.
Definition TGeoMatrix.h:458
Class describing rotations.
Definition TGeoMatrix.h:168
void SetAngles(Double_t phi, Double_t theta, Double_t psi)
Set matrix elements according to Euler angles.
Class describing translations.
Definition TGeoMatrix.h:116
return c1
Definition legend1.C:41
return c2
Definition legend2.C:14
auto * t1
Definition textangle.C:20

Rule for matrix creation:

Unless explicitly used for positioning nodes (TGeoVolume::AddNode()) all matrices deletion have to be managed by users. Matrices passed to geometry have to be created by using new() operator and their deletion is done by TGeoManager class.

Available geometrical transformations

TGeoTranslation

Represent a (dx,dy,dz) translation. Data members: Double_t fTranslation[3]. Translations can be added/subtracted.

t1->SetTranslation(-5,10,4);
TGeoTranslation *t2 = new TGeoTranslation(4,3,10);
t2->Subtract(&t1);
void SetTranslation(Double_t dx, Double_t dy, Double_t dz)
Set translation components.
void Subtract(const TGeoTranslation *other)
Subtracting a translation from this one.

Rotations

Represent a pure rotation. Data members: Double_t fRotationMatrix[3*3]. Rotations can be defined either by Euler angles, either, by GEANT3 angles :

r1->SetAngles(phi, theta, psi); // all angles in degrees

This represent the composition of : first a rotation about Z axis with angle phi, then a rotation with theta about the rotated X axis, and finally a rotation with psi about the new Z axis.

r1->SetAngles(th1,phi1, th2,phi2, th3,phi3)
auto * th3
Definition textalign.C:22
auto * th2
Definition textalign.C:18
auto * th1
Definition textalign.C:14

This is a rotation defined in GEANT3 style. Theta and phi are the spherical angles of each axis of the rotated coordinate system with respect to the initial one. This construction allows definition of malformed rotations, e.g. not orthogonal. A check is performed and an error message is issued in this case.

Specific utilities : determinant, inverse.

Scale transformations

Represent a scale shrinking/enlargement. Data members :Double_t fScale[3]. Not fully implemented yet.

Combined transformations

Represent a rotation followed by a translation. Data members: Double_t fTranslation[3], TGeoRotation *fRotation.

TGeoRotation *rot = new TGeoRotation("rot",10,20,30);
...
TGeoCombiTrans *c1 = new TGeoCombiTrans(trans, rot);
TGeoCombiTrans *c2 = new TGeoCombiTrans("somename",10,20,30,rot)

TGeoGenTrans

Combined transformations including a scale. Not implemented.

TGeoIdentity

A generic singleton matrix representing a identity transformation NOTE: identified by the global variable gGeoIdentity.

Definition at line 38 of file TGeoMatrix.h.

Public Types

enum  EGeoTransfTypes {
  kGeoIdentity = 0 , kGeoShared = (1ULL << ( 14 )) , kGeoTranslation = (1ULL << ( 17 )) , kGeoRotation = (1ULL << ( 18 )) ,
  kGeoScale = (1ULL << ( 19 )) , kGeoReflection = (1ULL << ( 20 )) , kGeoRegistered = (1ULL << ( 21 )) , kGeoSavePrimitive = (1ULL << ( 22 )) ,
  kGeoMatrixOwned = (1ULL << ( 23 )) , kGeoCombiTrans = kGeoTranslation | kGeoRotation , kGeoGenTrans = kGeoTranslation | kGeoRotation | kGeoScale , kGeoMatrixBits = kGeoShared | kGeoGenTrans | kGeoReflection | kGeoRegistered | kGeoSavePrimitive | kGeoMatrixOwned
}
 
- Public Types inherited from TObject
enum  {
  kIsOnHeap = 0x01000000 , kNotDeleted = 0x02000000 , kZombie = 0x04000000 , kInconsistent = 0x08000000 ,
  kBitMask = 0x00ffffff
}
 
enum  { kSingleKey = (1ULL << ( 0 )) , kOverwrite = (1ULL << ( 1 )) , kWriteDelete = (1ULL << ( 2 )) }
 
enum  EDeprecatedStatusBits { kObjInCanvas = (1ULL << ( 3 )) }
 
enum  EStatusBits {
  kCanDelete = (1ULL << ( 0 )) , kMustCleanup = (1ULL << ( 3 )) , kIsReferenced = (1ULL << ( 4 )) , kHasUUID = (1ULL << ( 5 )) ,
  kCannotPick = (1ULL << ( 6 )) , kNoContextMenu = (1ULL << ( 8 )) , kInvalidObject = (1ULL << ( 13 ))
}
 

Public Member Functions

 TGeoMatrix ()
 dummy constructor
 
 TGeoMatrix (const char *name)
 Constructor.
 
 ~TGeoMatrix () override
 Destructor.
 
virtual Int_t GetByteCount () const
 Get total size in bytes of this.
 
void GetHomogenousMatrix (Double_t *hmat) const
 The homogenous matrix associated with the transformation is used for piling up's and visualization.
 
const char * GetPointerName () const
 Provide a pointer name containing uid.
 
virtual const Double_tGetRotationMatrix () const =0
 
virtual const Double_tGetScale () const =0
 
virtual const Double_tGetTranslation () const =0
 
virtual TGeoHMatrix Inverse () const =0
 
TClassIsA () const override
 
Bool_t IsCombi () const
 
Bool_t IsGeneral () const
 
Bool_t IsIdentity () const
 
Bool_t IsOwned () const
 
Bool_t IsReflection () const
 
Bool_t IsRegistered () const
 
Bool_t IsRotAboutZ () const
 Returns true if no rotation or the rotation is about Z axis.
 
Bool_t IsRotation () const
 
Bool_t IsScale () const
 
Bool_t IsShared () const
 
Bool_t IsTranslation () const
 
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
 
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
 
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
 
virtual TGeoMatrixMakeClone () const =0
 
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
 
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
 
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
 
void Print (Option_t *option="") const override
 print the matrix in 4x4 format
 
virtual void ReflectX (Bool_t leftside, Bool_t rotonly=kFALSE)
 Multiply by a reflection respect to YZ.
 
virtual void ReflectY (Bool_t leftside, Bool_t rotonly=kFALSE)
 Multiply by a reflection respect to ZX.
 
virtual void ReflectZ (Bool_t leftside, Bool_t rotonly=kFALSE)
 Multiply by a reflection respect to XY.
 
virtual void RegisterYourself ()
 Register the matrix in the current manager, which will become the owner.
 
virtual void RotateX (Double_t)
 
virtual void RotateY (Double_t)
 
virtual void RotateZ (Double_t)
 
void SetDefaultName ()
 If no name was supplied in the ctor, the type of transformation is checked.
 
virtual void SetDx (Double_t)
 
virtual void SetDy (Double_t)
 
virtual void SetDz (Double_t)
 
void SetShared (Bool_t flag=kTRUE)
 
void Streamer (TBuffer &) override
 Stream an object of class TObject.
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
- Public Member Functions inherited from TNamed
 TNamed ()
 
 TNamed (const char *name, const char *title)
 
 TNamed (const TNamed &named)
 TNamed copy ctor.
 
 TNamed (const TString &name, const TString &title)
 
virtual ~TNamed ()
 TNamed destructor.
 
void Clear (Option_t *option="") override
 Set name and title to empty strings ("").
 
TObjectClone (const char *newname="") const override
 Make a clone of an object using the Streamer facility.
 
Int_t Compare (const TObject *obj) const override
 Compare two TNamed objects.
 
void Copy (TObject &named) const override
 Copy this to obj.
 
virtual void FillBuffer (char *&buffer)
 Encode TNamed into output buffer.
 
const char * GetName () const override
 Returns name of object.
 
const char * GetTitle () const override
 Returns title of object.
 
ULong_t Hash () const override
 Return hash value for this object.
 
TClassIsA () const override
 
Bool_t IsSortable () const override
 
void ls (Option_t *option="") const override
 List TNamed name and title.
 
TNamedoperator= (const TNamed &rhs)
 TNamed assignment operator.
 
void Print (Option_t *option="") const override
 Print TNamed name and title.
 
virtual void SetName (const char *name)
 Set the name of the TNamed.
 
virtual void SetNameTitle (const char *name, const char *title)
 Set all the TNamed parameters (name and title).
 
virtual void SetTitle (const char *title="")
 Set the title of the TNamed.
 
virtual Int_t Sizeof () const
 Return size of the TNamed part of the TObject.
 
void Streamer (TBuffer &) override
 Stream an object of class TObject.
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
- Public Member Functions inherited from TObject
 TObject ()
 TObject constructor.
 
 TObject (const TObject &object)
 TObject copy ctor.
 
virtual ~TObject ()
 TObject destructor.
 
void AbstractMethod (const char *method) const
 Use this method to implement an "abstract" method that you don't want to leave purely abstract.
 
virtual void AppendPad (Option_t *option="")
 Append graphics object to current pad.
 
virtual void Browse (TBrowser *b)
 Browse object. May be overridden for another default action.
 
ULong_t CheckedHash ()
 Check and record whether this class has a consistent Hash/RecursiveRemove setup (*) and then return the regular Hash value for this object.
 
virtual const char * ClassName () const
 Returns name of class to which the object belongs.
 
virtual void Delete (Option_t *option="")
 Delete this object.
 
virtual Int_t DistancetoPrimitive (Int_t px, Int_t py)
 Computes distance from point (px,py) to the object.
 
virtual void Draw (Option_t *option="")
 Default Draw method for all objects.
 
virtual void DrawClass () const
 Draw class inheritance tree of the class to which this object belongs.
 
virtual TObjectDrawClone (Option_t *option="") const
 Draw a clone of this object in the current selected pad with: gROOT->SetSelectedPad(c1).
 
virtual void Dump () const
 Dump contents of object on stdout.
 
virtual void Error (const char *method, const char *msgfmt,...) const
 Issue error message.
 
virtual void Execute (const char *method, const char *params, Int_t *error=nullptr)
 Execute method on this object with the given parameter string, e.g.
 
virtual void Execute (TMethod *method, TObjArray *params, Int_t *error=nullptr)
 Execute method on this object with parameters stored in the TObjArray.
 
virtual void ExecuteEvent (Int_t event, Int_t px, Int_t py)
 Execute action corresponding to an event at (px,py).
 
virtual void Fatal (const char *method, const char *msgfmt,...) const
 Issue fatal error message.
 
virtual TObjectFindObject (const char *name) const
 Must be redefined in derived classes.
 
virtual TObjectFindObject (const TObject *obj) const
 Must be redefined in derived classes.
 
virtual Option_tGetDrawOption () const
 Get option used by the graphics system to draw this object.
 
virtual const char * GetIconName () const
 Returns mime type name of object.
 
virtual char * GetObjectInfo (Int_t px, Int_t py) const
 Returns string containing info about the object at position (px,py).
 
virtual Option_tGetOption () const
 
virtual UInt_t GetUniqueID () const
 Return the unique object id.
 
virtual Bool_t HandleTimer (TTimer *timer)
 Execute action in response of a timer timing out.
 
Bool_t HasInconsistentHash () const
 Return true is the type of this object is known to have an inconsistent setup for Hash and RecursiveRemove (i.e.
 
virtual void Info (const char *method, const char *msgfmt,...) const
 Issue info message.
 
virtual Bool_t InheritsFrom (const char *classname) const
 Returns kTRUE if object inherits from class "classname".
 
virtual Bool_t InheritsFrom (const TClass *cl) const
 Returns kTRUE if object inherits from TClass cl.
 
virtual void Inspect () const
 Dump contents of this object in a graphics canvas.
 
void InvertBit (UInt_t f)
 
Bool_t IsDestructed () const
 IsDestructed.
 
virtual Bool_t IsEqual (const TObject *obj) const
 Default equal comparison (objects are equal if they have the same address in memory).
 
virtual Bool_t IsFolder () const
 Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).
 
R__ALWAYS_INLINE Bool_t IsOnHeap () const
 
R__ALWAYS_INLINE Bool_t IsZombie () const
 
void MayNotUse (const char *method) const
 Use this method to signal that a method (defined in a base class) may not be called in a derived class (in principle against good design since a child class should not provide less functionality than its parent, however, sometimes it is necessary).
 
virtual Bool_t Notify ()
 This method must be overridden to handle object notification (the base implementation is no-op).
 
void Obsolete (const char *method, const char *asOfVers, const char *removedFromVers) const
 Use this method to declare a method obsolete.
 
void operator delete (void *ptr)
 Operator delete.
 
void operator delete (void *ptr, void *vp)
 Only called by placement new when throwing an exception.
 
void operator delete[] (void *ptr)
 Operator delete [].
 
void operator delete[] (void *ptr, void *vp)
 Only called by placement new[] when throwing an exception.
 
void * operator new (size_t sz)
 
void * operator new (size_t sz, void *vp)
 
void * operator new[] (size_t sz)
 
void * operator new[] (size_t sz, void *vp)
 
TObjectoperator= (const TObject &rhs)
 TObject assignment operator.
 
virtual void Paint (Option_t *option="")
 This method must be overridden if a class wants to paint itself.
 
virtual void Pop ()
 Pop on object drawn in a pad to the top of the display list.
 
virtual Int_t Read (const char *name)
 Read contents of object with specified name from the current directory.
 
virtual void RecursiveRemove (TObject *obj)
 Recursively remove this object from a list.
 
void ResetBit (UInt_t f)
 
virtual void SaveAs (const char *filename="", Option_t *option="") const
 Save this object in the file specified by filename.
 
virtual void SavePrimitive (std::ostream &out, Option_t *option="")
 Save a primitive as a C++ statement(s) on output stream "out".
 
void SetBit (UInt_t f)
 
void SetBit (UInt_t f, Bool_t set)
 Set or unset the user status bits as specified in f.
 
virtual void SetDrawOption (Option_t *option="")
 Set drawing option for object.
 
virtual void SetUniqueID (UInt_t uid)
 Set the unique object id.
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
virtual void SysError (const char *method, const char *msgfmt,...) const
 Issue system error message.
 
R__ALWAYS_INLINE Bool_t TestBit (UInt_t f) const
 
Int_t TestBits (UInt_t f) const
 
virtual void UseCurrentStyle ()
 Set current style settings in this object This function is called when either TCanvas::UseCurrentStyle or TROOT::ForceStyle have been invoked.
 
virtual void Warning (const char *method, const char *msgfmt,...) const
 Issue warning message.
 
virtual Int_t Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0)
 Write this object to the current directory.
 
virtual Int_t Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0) const
 Write this object to the current directory.
 

Static Public Member Functions

static TClassClass ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static const char * DeclFileName ()
 
static void Normalize (Double_t *vect)
 Normalize a vector.
 
- Static Public Member Functions inherited from TNamed
static TClassClass ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static const char * DeclFileName ()
 
- Static Public Member Functions inherited from TObject
static TClassClass ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static const char * DeclFileName ()
 
static Longptr_t GetDtorOnly ()
 Return destructor only flag.
 
static Bool_t GetObjectStat ()
 Get status of object stat flag.
 
static void SetDtorOnly (void *obj)
 Set destructor only flag.
 
static void SetObjectStat (Bool_t stat)
 Turn on/off tracking of objects in the TObjectTable.
 

Protected Member Functions

 TGeoMatrix (const TGeoMatrix &other)
 copy constructor
 
- Protected Member Functions inherited from TObject
virtual void DoError (int level, const char *location, const char *fmt, va_list va) const
 Interface to ErrorHandler (protected).
 
void MakeZombie ()
 

Additional Inherited Members

- Protected Types inherited from TObject
enum  { kOnlyPrepStep = (1ULL << ( 3 )) }
 
- Protected Attributes inherited from TNamed
TString fName
 
TString fTitle
 

#include <TGeoMatrix.h>

Inheritance diagram for TGeoMatrix:
[legend]

Member Enumeration Documentation

◆ EGeoTransfTypes

Enumerator
kGeoIdentity 
kGeoShared 
kGeoTranslation 
kGeoRotation 
kGeoScale 
kGeoReflection 
kGeoRegistered 
kGeoSavePrimitive 
kGeoMatrixOwned 
kGeoCombiTrans 
kGeoGenTrans 
kGeoMatrixBits 

Definition at line 40 of file TGeoMatrix.h.

Constructor & Destructor Documentation

◆ TGeoMatrix() [1/3]

TGeoMatrix::TGeoMatrix ( const TGeoMatrix other)
protected

copy constructor

Definition at line 239 of file TGeoMatrix.cxx.

◆ TGeoMatrix() [2/3]

TGeoMatrix::TGeoMatrix ( )

dummy constructor

Definition at line 231 of file TGeoMatrix.cxx.

◆ TGeoMatrix() [3/3]

TGeoMatrix::TGeoMatrix ( const char *  name)

Constructor.

Definition at line 247 of file TGeoMatrix.cxx.

◆ ~TGeoMatrix()

TGeoMatrix::~TGeoMatrix ( )
override

Destructor.

Definition at line 252 of file TGeoMatrix.cxx.

Member Function Documentation

◆ Class()

static TClass * TGeoMatrix::Class ( )
static
Returns
TClass describing this class

◆ Class_Name()

static const char * TGeoMatrix::Class_Name ( )
static
Returns
Name of this class

◆ Class_Version()

static constexpr Version_t TGeoMatrix::Class_Version ( )
inlinestaticconstexpr
Returns
Version of this class

Definition at line 104 of file TGeoMatrix.h.

◆ DeclFileName()

static const char * TGeoMatrix::DeclFileName ( )
inlinestatic
Returns
Name of the file containing the class declaration

Definition at line 104 of file TGeoMatrix.h.

◆ GetByteCount()

Int_t TGeoMatrix::GetByteCount ( ) const
virtual

Get total size in bytes of this.

Definition at line 282 of file TGeoMatrix.cxx.

◆ GetHomogenousMatrix()

void TGeoMatrix::GetHomogenousMatrix ( Double_t hmat) const

The homogenous matrix associated with the transformation is used for piling up's and visualization.

A homogenous matrix is a 4*4 array containing the translation, the rotation and the scale components

| R00*sx R01 R02 dx |
| R10 R11*sy R12 dy |
| R20 R21 R22*sz dz |
| 0 0 0 1 |

where Rij is the rotation matrix, (sx, sy, sz) is the scale transformation and (dx, dy, dz) is the translation.

Definition at line 317 of file TGeoMatrix.cxx.

◆ GetPointerName()

const char * TGeoMatrix::GetPointerName ( ) const

Provide a pointer name containing uid.

Definition at line 297 of file TGeoMatrix.cxx.

◆ GetRotationMatrix()

virtual const Double_t * TGeoMatrix::GetRotationMatrix ( ) const
pure virtual

◆ GetScale()

virtual const Double_t * TGeoMatrix::GetScale ( ) const
pure virtual

◆ GetTranslation()

virtual const Double_t * TGeoMatrix::GetTranslation ( ) const
pure virtual

◆ Inverse()

virtual TGeoHMatrix TGeoMatrix::Inverse ( ) const
pure virtual

◆ IsA()

TClass * TGeoMatrix::IsA ( ) const
inlineoverridevirtual
Returns
TClass describing current object

Reimplemented from TObject.

Reimplemented in TGeoTranslation, TGeoRotation, and TGeoScale.

Definition at line 104 of file TGeoMatrix.h.

◆ IsCombi()

Bool_t TGeoMatrix::IsCombi ( ) const
inline

Definition at line 70 of file TGeoMatrix.h.

◆ IsGeneral()

Bool_t TGeoMatrix::IsGeneral ( ) const
inline

Definition at line 71 of file TGeoMatrix.h.

◆ IsIdentity()

Bool_t TGeoMatrix::IsIdentity ( ) const
inline

Definition at line 63 of file TGeoMatrix.h.

◆ IsOwned()

Bool_t TGeoMatrix::IsOwned ( ) const
inline

Definition at line 69 of file TGeoMatrix.h.

◆ IsReflection()

Bool_t TGeoMatrix::IsReflection ( ) const
inline

Definition at line 66 of file TGeoMatrix.h.

◆ IsRegistered()

Bool_t TGeoMatrix::IsRegistered ( ) const
inline

Definition at line 72 of file TGeoMatrix.h.

◆ IsRotAboutZ()

Bool_t TGeoMatrix::IsRotAboutZ ( ) const

Returns true if no rotation or the rotation is about Z axis.

Definition at line 265 of file TGeoMatrix.cxx.

◆ IsRotation()

Bool_t TGeoMatrix::IsRotation ( ) const
inline

Definition at line 65 of file TGeoMatrix.h.

◆ IsScale()

Bool_t TGeoMatrix::IsScale ( ) const
inline

Definition at line 67 of file TGeoMatrix.h.

◆ IsShared()

Bool_t TGeoMatrix::IsShared ( ) const
inline

Definition at line 68 of file TGeoMatrix.h.

◆ IsTranslation()

Bool_t TGeoMatrix::IsTranslation ( ) const
inline

Definition at line 64 of file TGeoMatrix.h.

◆ LocalToMaster()

void TGeoMatrix::LocalToMaster ( const Double_t local,
Double_t master 
) const
virtual

convert a point by multiplying its column vector (x, y, z, 1) to matrix inverse

Reimplemented in TGeoTranslation, TGeoRotation, TGeoScale, and TGeoIdentity.

Definition at line 342 of file TGeoMatrix.cxx.

◆ LocalToMasterBomb()

void TGeoMatrix::LocalToMasterBomb ( const Double_t local,
Double_t master 
) const
virtual

convert a point by multiplying its column vector (x, y, z, 1) to matrix inverse

Reimplemented in TGeoTranslation, TGeoRotation, and TGeoIdentity.

Definition at line 379 of file TGeoMatrix.cxx.

◆ LocalToMasterVect()

void TGeoMatrix::LocalToMasterVect ( const Double_t local,
Double_t master 
) const
virtual

convert a vector by multiplying its column vector (x, y, z, 1) to matrix inverse

Reimplemented in TGeoTranslation, TGeoRotation, TGeoScale, and TGeoIdentity.

Definition at line 364 of file TGeoMatrix.cxx.

◆ MakeClone()

virtual TGeoMatrix * TGeoMatrix::MakeClone ( ) const
pure virtual

◆ MasterToLocal()

void TGeoMatrix::MasterToLocal ( const Double_t master,
Double_t local 
) const
virtual

convert a point by multiplying its column vector (x, y, z, 1) to matrix

Reimplemented in TGeoTranslation, TGeoRotation, TGeoScale, and TGeoIdentity.

Definition at line 403 of file TGeoMatrix.cxx.

◆ MasterToLocalBomb()

void TGeoMatrix::MasterToLocalBomb ( const Double_t master,
Double_t local 
) const
virtual

convert a point by multiplying its column vector (x, y, z, 1) to matrix

Reimplemented in TGeoTranslation, TGeoRotation, and TGeoIdentity.

Definition at line 443 of file TGeoMatrix.cxx.

◆ MasterToLocalVect()

void TGeoMatrix::MasterToLocalVect ( const Double_t master,
Double_t local 
) const
virtual

convert a point by multiplying its column vector (x, y, z, 1) to matrix

Reimplemented in TGeoTranslation, TGeoRotation, TGeoScale, and TGeoIdentity.

Definition at line 428 of file TGeoMatrix.cxx.

◆ Normalize()

void TGeoMatrix::Normalize ( Double_t vect)
static

Normalize a vector.

Definition at line 468 of file TGeoMatrix.cxx.

◆ Print()

void TGeoMatrix::Print ( Option_t option = "") const
overridevirtual

print the matrix in 4x4 format

Reimplemented from TObject.

Definition at line 482 of file TGeoMatrix.cxx.

◆ ReflectX()

void TGeoMatrix::ReflectX ( Bool_t  leftside,
Bool_t  rotonly = kFALSE 
)
virtual

Multiply by a reflection respect to YZ.

Reimplemented in TGeoRotation, TGeoCombiTrans, TGeoHMatrix, and TGeoScale.

Definition at line 501 of file TGeoMatrix.cxx.

◆ ReflectY()

void TGeoMatrix::ReflectY ( Bool_t  leftside,
Bool_t  rotonly = kFALSE 
)
virtual

Multiply by a reflection respect to ZX.

Reimplemented in TGeoRotation, TGeoCombiTrans, TGeoHMatrix, and TGeoScale.

Definition at line 506 of file TGeoMatrix.cxx.

◆ ReflectZ()

void TGeoMatrix::ReflectZ ( Bool_t  leftside,
Bool_t  rotonly = kFALSE 
)
virtual

Multiply by a reflection respect to XY.

Reimplemented in TGeoRotation, TGeoCombiTrans, TGeoHMatrix, and TGeoScale.

Definition at line 511 of file TGeoMatrix.cxx.

◆ RegisterYourself()

void TGeoMatrix::RegisterYourself ( )
virtual

Register the matrix in the current manager, which will become the owner.

Reimplemented in TGeoCombiTrans.

Definition at line 516 of file TGeoMatrix.cxx.

◆ RotateX()

virtual void TGeoMatrix::RotateX ( Double_t  )
inlinevirtual

Reimplemented in TGeoTranslation, TGeoRotation, TGeoCombiTrans, and TGeoHMatrix.

Definition at line 91 of file TGeoMatrix.h.

◆ RotateY()

virtual void TGeoMatrix::RotateY ( Double_t  )
inlinevirtual

Reimplemented in TGeoTranslation, TGeoRotation, TGeoCombiTrans, and TGeoHMatrix.

Definition at line 92 of file TGeoMatrix.h.

◆ RotateZ()

virtual void TGeoMatrix::RotateZ ( Double_t  )
inlinevirtual

Reimplemented in TGeoTranslation, TGeoRotation, TGeoCombiTrans, and TGeoHMatrix.

Definition at line 93 of file TGeoMatrix.h.

◆ SetDefaultName()

void TGeoMatrix::SetDefaultName ( )

If no name was supplied in the ctor, the type of transformation is checked.

A letter will be prepended to the name :

  • t - translation
  • r - rotation
  • s - scale
  • c - combi (translation + rotation)
  • g - general (tr+rot+scale) The index of the transformation in gGeoManager list of transformations will be appended.

Definition at line 539 of file TGeoMatrix.cxx.

◆ SetDx()

virtual void TGeoMatrix::SetDx ( Double_t  )
inlinevirtual

Reimplemented in TGeoTranslation, TGeoCombiTrans, and TGeoHMatrix.

Definition at line 99 of file TGeoMatrix.h.

◆ SetDy()

virtual void TGeoMatrix::SetDy ( Double_t  )
inlinevirtual

Reimplemented in TGeoTranslation, TGeoCombiTrans, and TGeoHMatrix.

Definition at line 100 of file TGeoMatrix.h.

◆ SetDz()

virtual void TGeoMatrix::SetDz ( Double_t  )
inlinevirtual

Reimplemented in TGeoTranslation, TGeoCombiTrans, and TGeoHMatrix.

Definition at line 101 of file TGeoMatrix.h.

◆ SetShared()

void TGeoMatrix::SetShared ( Bool_t  flag = kTRUE)
inline

Definition at line 102 of file TGeoMatrix.h.

◆ Streamer()

void TGeoMatrix::Streamer ( TBuffer R__b)
overridevirtual

Stream an object of class TObject.

Reimplemented from TObject.

Reimplemented in TGeoTranslation, TGeoRotation, and TGeoScale.

◆ StreamerNVirtual()

void TGeoMatrix::StreamerNVirtual ( TBuffer ClassDef_StreamerNVirtual_b)
inline

Definition at line 104 of file TGeoMatrix.h.

Libraries for TGeoMatrix:

The documentation for this class was generated from the following files: