Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGeometry.cxx
Go to the documentation of this file.
1// @(#)root/g3d:$Id$
2// Author: Rene Brun 22/09/95
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#include "TROOT.h"
13#include "TBuffer.h"
14#include "THashList.h"
15#include "TObjArray.h"
16#include "TGeometry.h"
17#include "TNode.h"
18#include "TMaterial.h"
19#include "TBrowser.h"
20
22
23
24/** \class TGeometry
25\ingroup g3d
26TGeometry description.
27
28The Geometry class describes the geometry of a detector.
29The current implementation supports the GEANT3 style description.
30A special program provided in the ROOT utilities (toroot) can be used
31to automatically translate a GEANT detector geometry into a ROOT geometry.
32
33a Geometry object is entered into the list of geometries into the
34ROOT main object (see TROOT description) when the TGeometry
35constructor is invoked.
36Several geometries may coexist in memory.
37/
38A Geometry object consist of the following linked lists:
39
40 - the TMaterial list (material definition only).
41 - the TRotmatrix list (Rotation matrices definition only).
42 - the TShape list (volume definition only).
43 - the TNode list assembling all detector elements.
44
45Only the Build and Draw functions for a geometry are currently supported.
46
47The conversion program from Geant to Root has been added in the list
48of utilities in utils directory.(see g2root)
49The executable module of g2root can be found in $ROOTSYS/bin/g2root.
50
51To use this conversion program, type the shell command:
52
53~~~ {.cpp}
54 g2root geant_rzfile macro_name
55~~~
56
57for example
58
59~~~ {.cpp}
60 g2root na49.geom na49.C
61~~~
62
63will convert the GEANT RZ file na49.geom into a ROOT macro na49.C
64
65To generate the Geometry structure within Root, do:
66
67~~~ {.cpp}
68 Root > .x na49.C
69 Root > na49.Draw()
70 Root > wh.x3d() (this invokes the 3-d Root viewer)
71 Root > TFile gna49("na49.root","NEW") //open a new root file
72 Root > na49.Write() //Write the na49 geometry structure
73 Root > gna49.Write() //Write all keys (in this case only one)
74~~~
75
76Note: all keys are also written on closing of the file, gna49.Close or
77when the program exits, Root closes all open files correctly.
78Once this file has been written, in a subsequent session, simply do:
79
80~~~ {.cpp}
81 Root > TFile gna49("na49.root")
82 Root > na49.Draw()
83~~~
84
85The figure below shows the geometry above using the x3d viewer.
86This x3d viewer is invoked by selecting "View x3d" in the View menu
87of a canvas (See example of this tool bar in TCanvas).
88
89\image html g3d_na49.png
90*/
91
92////////////////////////////////////////////////////////////////////////////////
93/// Geometry default constructor.
94
96{
97 fMaterials = new THashList(100,3);
98 fMatrices = new THashList(100,3);
99 fShapes = new THashList(500,3);
100 fNodes = new TList;
101 fCurrentNode = nullptr;
102 fMaterialPointer = nullptr;
103 fMatrixPointer = nullptr;
104 fShapePointer = nullptr;
105 gGeometry = this;
106 fBomb = 1;
107 fMatrix = nullptr;
108 fX=fY=fZ =0.0;
109 fGeomLevel =0;
111}
112
113////////////////////////////////////////////////////////////////////////////////
114/// Geometry normal constructor.
115
116TGeometry::TGeometry(const char *name,const char *title ) : TNamed (name, title)
117{
118 fMaterials = new THashList(1000,3);
119 fMatrices = new THashList(1000,3);
120 fShapes = new THashList(5000,3);
121 fNodes = new TList;
122 fCurrentNode = nullptr;
123 fMaterialPointer = nullptr;
124 fMatrixPointer = nullptr;
125 fShapePointer = nullptr;
126 gGeometry = this;
127 fBomb = 1;
128 fMatrix = nullptr;
129 fX=fY=fZ =0.0;
130 gROOT->GetListOfGeometries()->Add(this);
131 fGeomLevel =0;
133}
134
135////////////////////////////////////////////////////////////////////////////////
136/// copy constructor
137
139 TNamed(geo),
140 fMaterials(geo.fMaterials),
141 fMatrices(geo.fMatrices),
142 fShapes(geo.fShapes),
143 fNodes(geo.fNodes),
144 fMatrix(geo.fMatrix),
145 fCurrentNode(geo.fCurrentNode),
146 fMaterialPointer(geo.fMaterialPointer),
147 fMatrixPointer(geo.fMatrixPointer),
148 fShapePointer(geo.fShapePointer),
149 fBomb(geo.fBomb),
150 fGeomLevel(geo.fGeomLevel),
151 fX(geo.fX),
152 fY(geo.fY),
153 fZ(geo.fZ)
154{
155 for(Int_t i=0; i<kMAXLEVELS; i++) {
156 for(Int_t j=0; j<kVectorSize; j++)
157 fTranslation[i][j]=geo.fTranslation[i][j];
158 for(Int_t j=0; j<kMatrixSize; j++)
159 fRotMatrix[i][j]=geo.fRotMatrix[i][j];
160 fIsReflection[i]=geo.fIsReflection[i];
161 }
162}
163
164////////////////////////////////////////////////////////////////////////////////
165/// assignment operator
166
168{
169 if(this!=&geo) {
171 fMaterials=geo.fMaterials;
172 fMatrices=geo.fMatrices;
173 fShapes=geo.fShapes;
174 fNodes=geo.fNodes;
175 fMatrix=geo.fMatrix;
176 fCurrentNode=geo.fCurrentNode;
177 fMaterialPointer=geo.fMaterialPointer;
178 fMatrixPointer=geo.fMatrixPointer;
179 fShapePointer=geo.fShapePointer;
180 fBomb=geo.fBomb;
181 fGeomLevel=geo.fGeomLevel;
182 fX=geo.fX;
183 fY=geo.fY;
184 fZ=geo.fZ;
185 for(Int_t i=0; i<kMAXLEVELS; i++) {
186 for(Int_t j=0; j<kVectorSize; j++)
187 fTranslation[i][j]=geo.fTranslation[i][j];
188 for(Int_t j=0; j<kMatrixSize; j++)
189 fRotMatrix[i][j]=geo.fRotMatrix[i][j];
190 fIsReflection[i]=geo.fIsReflection[i];
191 }
192 }
193 return *this;
194}
195
196////////////////////////////////////////////////////////////////////////////////
197/// Geometry default destructor.
198
200{
201 if (!fMaterials) return;
203 fMatrices->Delete();
204 fShapes->Delete();
205 fNodes->Delete();
206 delete fMaterials;
207 delete fMatrices;
208 delete fShapes;
209 delete fNodes;
210 delete [] fMaterialPointer;
211 delete [] fMatrixPointer;
212 delete [] fShapePointer;
213 fMaterials = nullptr;
214 fMatrices = nullptr;
215 fShapes = nullptr;
216 fNodes = nullptr;
217 fMaterialPointer = nullptr;
218 fMatrixPointer = nullptr;
219 fShapePointer = nullptr;
220
221 if (gGeometry == this) {
222 gGeometry = (TGeometry*) gROOT->GetListOfGeometries()->First();
223 if (gGeometry == this)
224 gGeometry = (TGeometry*) gROOT->GetListOfGeometries()->After(gGeometry);
225 }
226 gROOT->GetListOfGeometries()->Remove(this);
227}
228
229////////////////////////////////////////////////////////////////////////////////
230/// Browse.
231
233{
234 if( b ) {
235 b->Add( fMaterials, "Materials" );
236 b->Add( fMatrices, "Rotation Matrices" );
237 b->Add( fShapes, "Shapes" );
238 b->Add( fNodes, "Nodes" );
239 }
240}
241
242////////////////////////////////////////////////////////////////////////////////
243/// Change Current Geometry to this.
244
245void TGeometry::cd(const char *)
246{
247 gGeometry = this;
248}
249
250////////////////////////////////////////////////////////////////////////////////
251/// Draw this Geometry.
252
254{
255 TNode *node1 = (TNode*)fNodes->First();
256 if (node1) node1->Draw(option);
257
258}
259
260////////////////////////////////////////////////////////////////////////////////
261/// Find object in a geometry node, material, etc
262
264{
265 Error("FindObject","Not yet implemented");
266 return nullptr;
267}
268
269////////////////////////////////////////////////////////////////////////////////
270/// Search object identified by name in the geometry tree
271
273{
275 if (loc) return loc->At(0);
276 return nullptr;
277}
278
279////////////////////////////////////////////////////////////////////////////////
280/// Static function called by TROOT to search name in the geometry.
281/// Returns a TObjArray containing a pointer to the found object
282/// and a pointer to the container where the object was found.
283
285{
286 static TObjArray *locs = nullptr;
287 if (!locs) locs = new TObjArray(2);
288 TObjArray &loc = *locs;
289 loc[0] = nullptr;
290 loc[1] = nullptr;
291
292 if (!gGeometry) return &loc;
293
294 TObject *temp;
295 TObject *where;
296
299
300 if (!temp) {
303 }
304 if (!temp) {
307 }
308 if (!temp) {
309 temp = gGeometry->GetNode(name);
311 }
312 loc[0] = temp;
313 loc[1] = where;
314
315 return &loc;
316}
317
318////////////////////////////////////////////////////////////////////////////////
319/// Return pointer to Material with name.
320
322{
324}
325
326////////////////////////////////////////////////////////////////////////////////
327/// Return pointer to Material with number.
328
330{
331 TMaterial *mat;
332 if (number < 0 || number >= fMaterials->GetSize()) return nullptr;
333 if (fMaterialPointer) return fMaterialPointer[number];
334 TIter next(fMaterials);
335 while ((mat = (TMaterial*) next())) {
336 if (mat->GetNumber() == number) return mat;
337 }
338 return nullptr;
339}
340
341////////////////////////////////////////////////////////////////////////////////
342/// Return pointer to node with name in the geometry tree.
343
344TNode *TGeometry::GetNode(const char *name) const
345{
346 TNode *node= (TNode*)GetListOfNodes()->First();
347 if (!node) return nullptr;
348 if (!ROOT::Detail::HasBeenDeleted(node)) return node->GetNode(name);
349 return nullptr;
350}
351
352////////////////////////////////////////////////////////////////////////////////
353/// Return pointer to RotMatrix with name.
354
356{
358}
359
360////////////////////////////////////////////////////////////////////////////////
361/// Return pointer to RotMatrix with number.
362
364{
366 if (number < 0 || number >= fMatrices->GetSize()) return nullptr;
367 if (fMatrixPointer) return fMatrixPointer[number];
368 TIter next(fMatrices);
369 while ((matrix = (TRotMatrix*) next())) {
370 if (matrix->GetNumber() == number) return matrix;
371 }
372 return nullptr;
373}
374
375////////////////////////////////////////////////////////////////////////////////
376/// Return pointer to Shape with name.
377
378TShape *TGeometry::GetShape(const char *name) const
379{
380 return (TShape*)fShapes->FindObject(name);
381}
382
383////////////////////////////////////////////////////////////////////////////////
384/// Return pointer to Shape with number.
385
387{
388 TShape *shape;
389 if (number < 0 || number >= fShapes->GetSize()) return nullptr;
390 if (fShapePointer) return fShapePointer[number];
391 TIter next(fShapes);
392 while ((shape = (TShape*) next())) {
393 if (shape->GetNumber() == number) return shape;
394 }
395 return nullptr;
396}
397
398////////////////////////////////////////////////////////////////////////////////
399/// Convert one point from local system to master reference system.
400///
401/// Note that before invoking this function, the global rotation matrix
402/// and translation vector for this node must have been computed.
403/// This is automatically done by the Paint functions.
404/// Otherwise TNode::UpdateMatrix should be called before.
405
407{
408 if (GeomLevel()) {
409 Double_t x,y,z;
412 x = bomb*fX
413 + local[0]*matrix[0]
414 + local[1]*matrix[3]
415 + local[2]*matrix[6];
416
417 y = bomb*fY
418 + local[0]*matrix[1]
419 + local[1]*matrix[4]
420 + local[2]*matrix[7];
421
422 z = bomb*fZ
423 + local[0]*matrix[2]
424 + local[1]*matrix[5]
425 + local[2]*matrix[8];
426 master[0] = x; master[1] = y; master[2] = z;
427 }
428 else
429 for (Int_t i=0;i<3;i++) master[i] = local[i];
430}
431
432////////////////////////////////////////////////////////////////////////////////
433/// Convert one point from local system to master reference system.
434///
435/// Note that before invoking this function, the global rotation matrix
436/// and translation vector for this node must have been computed.
437/// This is automatically done by the Paint functions.
438/// Otherwise TNode::UpdateMatrix should be called before.
439
441{
442 if (GeomLevel()) {
443 Float_t x,y,z;
444 Float_t bomb = GetBomb();
445
447
448 x = bomb*fX
449 + local[0]*matrix[0]
450 + local[1]*matrix[3]
451 + local[2]*matrix[6];
452
453 y = bomb*fY
454 + local[0]*matrix[1]
455 + local[1]*matrix[4]
456 + local[2]*matrix[7];
457
458 z = bomb*fZ
459 + local[0]*matrix[2]
460 + local[1]*matrix[5]
461 + local[2]*matrix[8];
462
463 master[0] = x; master[1] = y; master[2] = z;
464 }
465 else
466 for (Int_t i=0;i<3;i++) master[i] = local[i];
467}
468
469////////////////////////////////////////////////////////////////////////////////
470/// List this geometry.
471
473{
474 TString opt = option;
475 opt.ToLower();
476 if (opt.Contains("m")) {
477 Printf("=================List of Materials================");
479 }
480 if (opt.Contains("r")) {
481 Printf("=================List of RotationMatrices================");
483 }
484 if (opt.Contains("s")) {
485 Printf("=================List of Shapes==========================");
486 fShapes->ls(option);
487 }
488 if (opt.Contains("n")) {
489 Printf("=================List of Nodes===========================");
490 fNodes->ls(option);
491 }
492}
493
494////////////////////////////////////////////////////////////////////////////////
495/// Convert one point from master system to local reference system.
496///
497/// Note that before invoking this function, the global rotation matrix
498/// and translation vector for this node must have been computed.
499/// This is automatically done by the Paint functions.
500/// Otherwise TNode::UpdateMatrix should be called before.
501
503{
504 if (GeomLevel()) {
505 Double_t x,y,z;
508
509 Double_t xms = master[0] - bomb*fX;
510 Double_t yms = master[1] - bomb*fY;
511 Double_t zms = master[2] - bomb*fZ;
512
513 x = xms*matrix[0] + yms*matrix[1] + zms*matrix[2];
514 y = xms*matrix[3] + yms*matrix[4] + zms*matrix[5];
515 z = xms*matrix[6] + yms*matrix[7] + zms*matrix[8];
516
517 local[0] = x; local[1] = y; local[2] = z;
518 }
519 else
521}
522
523////////////////////////////////////////////////////////////////////////////////
524/// Convert one point from master system to local reference system.
525///
526/// Note that before invoking this function, the global rotation matrix
527/// and translation vector for this node must have been computed.
528/// This is automatically done by the Paint functions.
529/// Otherwise TNode::UpdateMatrix should be called before.
530
532{
533 if (GeomLevel()) {
534 Float_t x,y,z;
535 Float_t bomb = GetBomb();
536
538
539 Double_t xms = master[0] - bomb*fX;
540 Double_t yms = master[1] - bomb*fY;
541 Double_t zms = master[2] - bomb*fZ;
542
543 x = xms*matrix[0] + yms*matrix[1] + zms*matrix[2];
544 y = xms*matrix[3] + yms*matrix[4] + zms*matrix[5];
545 z = xms*matrix[6] + yms*matrix[7] + zms*matrix[8];
546
547 local[0] = x; local[1] = y; local[2] = z;
548 }
549 else
551}
552
553////////////////////////////////////////////////////////////////////////////////
554/// Add a node to the current node in this geometry.
555
556void TGeometry::Node(const char *name, const char *title, const char *shapename, Double_t x, Double_t y, Double_t z, const char *matrixname, Option_t *option)
557{
558 new TNode(name,title,shapename,x,y,z,matrixname,option);
559}
560
561////////////////////////////////////////////////////////////////////////////////
562/// Recursively remove object from a Geometry list.
563
568
569////////////////////////////////////////////////////////////////////////////////
570/// Stream a class object.
571
573{
574 if (b.IsReading()) {
576 Version_t R__v = b.ReadVersion(&R__s, &R__c);
577 if (R__v > 1) {
578 b.ReadClassBuffer(TGeometry::Class(), this, R__v, R__s, R__c);
579 } else {
580 //====process old versions before automatic schema evolution
585 fNodes->Streamer(b);
586 b >> fBomb;
587 b.CheckByteCount(R__s, R__c, TGeometry::IsA());
588 //====end of old versions
589 }
590 // Build direct access pointers to individual materials,matrices and shapes
591 Int_t i;
596 if (nmat) fMaterialPointer = new TMaterial* [nmat];
598 i = 0;
599 while ((onemat = (TMaterial*) nextmat())) {
601 i++;
602 }
603
605 if (nrot) fMatrixPointer = new TRotMatrix* [nrot];
607 i = 0;
608 while ((onematrix = (TRotMatrix*) nextmatrix())) {
610 i++;
611 }
612
614 if (nsha) fShapePointer = new TShape* [nsha];
616 i = 0;
617 while ((oneshape = (TShape*) nextshape())) {
619 i++;
620 }
621
622 gROOT->GetListOfGeometries()->Add(this);
623
625 } else {
626 b.WriteClassBuffer(TGeometry::Class(),this);
627 }
628}
629
630////////////////////////////////////////////////////////////////////////////////
631/// Update global rotation matrix/translation vector for this node
632/// this function must be called before invoking Local2Master
633
635{
636 TNode *nodes[kMAXLEVELS];
637 for (Int_t i=0;i<kVectorSize;i++) fTranslation[0][i] = 0;
638 for (Int_t i=0;i<kMatrixSize;i++) fRotMatrix[0][i] = 0;
639 fRotMatrix[0][0] = 1; fRotMatrix[0][4] = 1; fRotMatrix[0][8] = 1;
640
641 fGeomLevel = 0;
642 //build array of parent nodes
643 while (node) {
644 nodes[fGeomLevel] = node;
645 node = node->GetParent();
646 fGeomLevel++;
647 }
648 fGeomLevel--;
650 //Update matrices in the hierarchy
652 node = nodes[fGeomLevel-1];
653 UpdateTempMatrix(node->GetX(),node->GetY(),node->GetZ(),node->GetMatrix());
654 }
655}
656
657////////////////////////////////////////////////////////////////////////////////
658/// Update temp matrix.
659
661{
662 Double_t *matrix = nullptr;
664 if (rotMatrix && rotMatrix->GetType()) {
665 matrix = rotMatrix->GetMatrix();
666 isReflection = rotMatrix->IsReflection();
667 }
669}
670
671////////////////////////////////////////////////////////////////////////////////
672/// Update temp matrix.
673
675{
676 Int_t i=GeomLevel();
677 if (i) {
678 if(matrix) {
679 UpdateTempMatrix(&(fTranslation[i-1][0]),&fRotMatrix[i-1][0]
680 ,x,y,z,matrix
681 ,&fTranslation[i][0],&fRotMatrix[i][0]);
682 fX = fTranslation[i][0];
683 fY = fTranslation[i][1];
684 fZ = fTranslation[i][2];
686 } else {
687 fX = fTranslation[i][0] = fTranslation[i-1][0] + x;
688 fY = fTranslation[i][1] = fTranslation[i-1][1] + y;
689 fZ = fTranslation[i][2] = fTranslation[i-1][2] + z;
690 }
691 } else {
692 fX=fY=fZ=0;
694 for (i=0;i<kVectorSize;i++) fTranslation[0][i] = 0;
695 for (i=0;i<kMatrixSize;i++) fRotMatrix[0][i] = 0;
696 fRotMatrix[0][0] = 1; fRotMatrix[0][4] = 1; fRotMatrix[0][8] = 1;
697 }
698}
699
700////////////////////////////////////////////////////////////////////////////////
701/// Compute new translation vector and global matrix.
702///
703/// - dx old translation vector
704/// - rmat old global matrix
705/// - x,y,z offset of new local system with respect to mother
706/// - dxnew new translation vector
707/// - rmatnew new global rotation matrix
708
712{
713 dxnew[0] = dx[0] + x*rmat[0] + y*rmat[3] + z*rmat[6];
714 dxnew[1] = dx[1] + x*rmat[1] + y*rmat[4] + z*rmat[7];
715 dxnew[2] = dx[2] + x*rmat[2] + y*rmat[5] + z*rmat[8];
716
717 rmatnew[0] = rmat[0]*matrix[0] + rmat[3]*matrix[1] + rmat[6]*matrix[2];
718 rmatnew[1] = rmat[1]*matrix[0] + rmat[4]*matrix[1] + rmat[7]*matrix[2];
719 rmatnew[2] = rmat[2]*matrix[0] + rmat[5]*matrix[1] + rmat[8]*matrix[2];
720 rmatnew[3] = rmat[0]*matrix[3] + rmat[3]*matrix[4] + rmat[6]*matrix[5];
721 rmatnew[4] = rmat[1]*matrix[3] + rmat[4]*matrix[4] + rmat[7]*matrix[5];
722 rmatnew[5] = rmat[2]*matrix[3] + rmat[5]*matrix[4] + rmat[8]*matrix[5];
723 rmatnew[6] = rmat[0]*matrix[6] + rmat[3]*matrix[7] + rmat[6]*matrix[8];
724 rmatnew[7] = rmat[1]*matrix[6] + rmat[4]*matrix[7] + rmat[7]*matrix[8];
725 rmatnew[8] = rmat[2]*matrix[6] + rmat[5]*matrix[7] + rmat[8]*matrix[8];
726}
#define b(i)
Definition RSha256.hxx:100
short Version_t
Class version identifier (short)
Definition RtypesCore.h:79
float Float_t
Float 4 bytes (float)
Definition RtypesCore.h:71
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
const char Option_t
Option string (const char)
Definition RtypesCore.h:80
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t option
char name[80]
Definition TGX11.cxx:110
TGeometry * gGeometry
Definition TGeometry.cxx:21
const Int_t kVectorSize
Definition TGeometry.h:28
const Int_t kMAXLEVELS
Definition TGeometry.h:27
const Int_t kMatrixSize
Definition TGeometry.h:29
R__EXTERN TGeometry * gGeometry
Definition TGeometry.h:158
#define gROOT
Definition TROOT.h:411
void Printf(const char *fmt,...)
Formats a string in a circular formatting buffer and prints the string.
Definition TString.cxx:2509
Using a TBrowser one can browse all ROOT objects.
Definition TBrowser.h:37
Buffer base class used for serializing objects.
Definition TBuffer.h:43
void ls(Option_t *option="") const override
List (ls) all objects in this collection.
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
TGeometry description.
Definition TGeometry.h:39
TShape * GetShapeByNumber(Int_t number) const
Return pointer to Shape with number.
Double_t fZ
The global translation of the current node.
Definition TGeometry.h:55
Double_t fRotMatrix[kMAXLEVELS][kMatrixSize]
Definition TGeometry.h:57
void Draw(Option_t *option="") override
Draw this Geometry.
Float_t GetBomb() const
Definition TGeometry.h:73
TMaterial * GetMaterialByNumber(Int_t number) const
Return pointer to Material with number.
TGeometry & operator=(const TGeometry &)
assignment operator
virtual void Local2Master(Double_t *local, Double_t *master)
Convert one point from local system to master reference system.
Int_t GeomLevel() const
Definition TGeometry.h:74
TRotMatrix * fMatrix
Definition TGeometry.h:46
TMaterial ** fMaterialPointer
Pointer to current node.
Definition TGeometry.h:48
TMaterial * GetMaterial(const char *name) const
Return pointer to Material with name.
void ls(Option_t *option="rsn2") const override
List this geometry.
virtual void Master2Local(Double_t *master, Double_t *local)
Convert one point from master system to local reference system.
TGeometry()
Geometry default constructor.
Definition TGeometry.cxx:95
THashList * fMaterials
Definition TGeometry.h:42
TRotMatrix ** fMatrixPointer
Pointers to materials.
Definition TGeometry.h:49
TShape ** fShapePointer
Pointers to rotation matrices.
Definition TGeometry.h:50
void RecursiveRemove(TObject *obj) override
Recursively remove object from a Geometry list.
THashList * GetListOfShapes() const
Definition TGeometry.h:75
void Streamer(TBuffer &) override
Stream a class object.
TRotMatrix * GetRotMatrixByNumber(Int_t number) const
Return pointer to RotMatrix with number.
TList * fNodes
Definition TGeometry.h:45
static TClass * Class()
TNode * fCurrentNode
Pointers to current rotation matrices.
Definition TGeometry.h:47
Int_t fGeomLevel
Definition TGeometry.h:52
Bool_t fIsReflection[kMAXLEVELS]
Definition TGeometry.h:58
THashList * fMatrices
Definition TGeometry.h:43
TObject * FindObject(const char *name) const override
Search object identified by name in the geometry tree.
Double_t fY
Definition TGeometry.h:54
void Browse(TBrowser *b) override
Browse.
~TGeometry() override
Geometry default destructor.
THashList * fShapes
Definition TGeometry.h:44
THashList * GetListOfMatrices() const
Definition TGeometry.h:78
THashList * GetListOfMaterials() const
Definition TGeometry.h:77
Float_t fBomb
Pointers to shapes.
Definition TGeometry.h:51
static TObjArray * Get(const char *name)
Static function called by TROOT to search name in the geometry.
virtual void UpdateTempMatrix(Double_t x=0, Double_t y=0, Double_t z=0, TRotMatrix *matrix=nullptr)
Update temp matrix.
TRotMatrix * GetRotMatrix(const char *name) const
Return pointer to RotMatrix with name.
virtual void Node(const char *name, const char *title, const char *shapename, Double_t x=0, Double_t y=0, Double_t z=0, const char *matrixname="", Option_t *option="")
Add a node to the current node in this geometry.
TShape * GetShape(const char *name) const
Return pointer to Shape with name.
virtual void UpdateMatrix(TNode *node)
Update global rotation matrix/translation vector for this node this function must be called before in...
virtual void cd(const char *path=nullptr)
Change Current Geometry to this.
TClass * IsA() const override
Definition TGeometry.h:119
TList * GetListOfNodes() const
Definition TGeometry.h:76
Double_t fX
Definition TGeometry.h:53
TNode * GetNode(const char *name) const
Return pointer to node with name in the geometry tree.
Double_t fTranslation[kMAXLEVELS][kVectorSize]
Definition TGeometry.h:56
THashList implements a hybrid collection class consisting of a hash table and a list to store TObject...
Definition THashList.h:34
void Delete(Option_t *option="") override
Remove all objects from the list AND delete all heap based objects.
void Streamer(TBuffer &) override
Stream all objects in the collection to or from the I/O buffer.
TObject * FindObject(const char *name) const override
Find object using its name.
A doubly linked list.
Definition TList.h:38
void Streamer(TBuffer &) override
Stream all objects in the collection to or from the I/O buffer.
Definition TList.cxx:1190
void RecursiveRemove(TObject *obj) override
Remove object from this collection and recursively remove the object from all other objects (and coll...
Definition TList.cxx:761
TObject * First() const override
Return the first object in the list. Returns 0 when list is empty.
Definition TList.cxx:656
void Delete(Option_t *option="") override
Remove all objects from the list AND delete all heap based objects.
Definition TList.cxx:467
Manages a detector material.
Definition TMaterial.h:28
The TNamed class is the base class for all named ROOT classes.
Definition TNamed.h:29
void Streamer(TBuffer &) override
Stream an object of class TObject.
TNamed & operator=(const TNamed &rhs)
TNamed assignment operator.
Definition TNamed.cxx:50
TNode description.
Definition TNode.h:33
virtual TNode * GetParent() const
Definition TNode.h:70
virtual Double_t GetY() const
Definition TNode.h:74
virtual Double_t GetX() const
Definition TNode.h:73
virtual TRotMatrix * GetMatrix() const
Definition TNode.h:66
virtual Double_t GetZ() const
Definition TNode.h:75
virtual TNode * GetNode(const char *name) const
Return pointer to node with name in the node tree.
Definition TNode.cxx:376
An array of TObjects.
Definition TObjArray.h:31
Mother of all ROOT objects.
Definition TObject.h:41
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition TObject.cxx:1071
Manages a detector rotation matrix.
Definition TRotMatrix.h:28
This is the base class for all geometry shapes.
Definition TShape.h:35
virtual Int_t GetNumber() const
Definition TShape.h:57
Basic string class.
Definition TString.h:138
void ToLower()
Change string to lower-case.
Definition TString.cxx:1189
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition TString.h:640
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
R__ALWAYS_INLINE bool HasBeenDeleted(const TObject *obj)
Check if the TObject's memory has been deleted.
Definition TObject.h:405