Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGeoBuilder.cxx
Go to the documentation of this file.
1// @(#)root/geom:$Id$
2// Author: Mihaela Gheata 30/05/07
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/** \class TGeoBuilder
13\ingroup Geometry_classes
14
15Utility class for creating geometry objects.These will be associated
16with the current selected geometry manager object:
17
18`TGeoBuilder::Instance()->SetGeometry(gGeoManager);`
19
20The geometry builder is a singleton that may be used to build one or more
21geometries.
22*/
23
24#include "TList.h"
25#include "TObjArray.h"
26
27#include "TGeoManager.h"
28#include "TGeoElement.h"
29#include "TGeoMaterial.h"
30#include "TGeoMedium.h"
31#include "TGeoMatrix.h"
32#include "TGeoPara.h"
33#include "TGeoParaboloid.h"
34#include "TGeoTube.h"
35#include "TGeoEltu.h"
36#include "TGeoHype.h"
37#include "TGeoCone.h"
38#include "TGeoSphere.h"
39#include "TGeoArb8.h"
40#include "TGeoPgon.h"
41#include "TGeoTrd1.h"
42#include "TGeoTrd2.h"
43#include "TGeoTorus.h"
44#include "TGeoXtru.h"
45#include "TGeoNode.h"
46#include "TGeoVolume.h"
47
48#include "TGeoBuilder.h"
49
50
52
53////////////////////////////////////////////////////////////////////////////////
54/// Default constructor.
55
56TGeoBuilder::TGeoBuilder() : fGeometry(nullptr)
57{
58 fgInstance = this;
59}
60
61////////////////////////////////////////////////////////////////////////////////
62/// Destructor.
63
65{
66 fgInstance = nullptr;
67}
68
69////////////////////////////////////////////////////////////////////////////////
70/// Return pointer to singleton.
71
73{
74 if (!geom) {
75 printf("ERROR: Cannot create geometry builder with NULL geometry\n");
76 return nullptr;
77 }
78 if (!fgInstance)
79 fgInstance = new TGeoBuilder();
80 fgInstance->SetGeometry(geom);
81 return fgInstance;
82}
83
84////////////////////////////////////////////////////////////////////////////////
85/// Add a material to the list. Returns index of the material in list.
86
88{
89 if (!material)
90 return -1;
91 TList *materials = fGeometry->GetListOfMaterials();
92 Int_t index = materials->GetSize();
93 material->SetIndex(index);
94 materials->Add(material);
95 return index;
96}
97
98////////////////////////////////////////////////////////////////////////////////
99/// Add a matrix to the list. Returns index of the matrix in list.
100
102{
103 Int_t index = -1;
104 if (!matrix)
105 return -1;
107 index = matrices->GetEntriesFast();
108 matrices->AddAtAndExpand(matrix, index);
109 return index;
110}
111
112////////////////////////////////////////////////////////////////////////////////
113/// Add a shape to the list. Returns index of the shape in list.
114
116{
117 Int_t index = -1;
118 if (!shape)
119 return -1;
121 if (shape->IsRunTimeShape())
123 index = shapes->GetEntriesFast();
124 shapes->AddAtAndExpand(shape, index);
125 return index;
126}
127
128////////////////////////////////////////////////////////////////////////////////
129/// Register a matrix to the list of matrices. It will be cleaned-up at the
130/// destruction TGeoManager.
131
133{
134 if (matrix->IsRegistered())
135 return;
137 Int_t nmat = matrices->GetEntriesFast();
138 matrices->AddAtAndExpand(matrix, nmat);
139}
140
141////////////////////////////////////////////////////////////////////////////////
142/// Make an TGeoArb8 volume.
143
145{
146 TGeoArb8 *arb = new TGeoArb8(name, dz, vertices);
147 TGeoVolume *vol = new TGeoVolume(name, arb, medium);
148 return vol;
149}
150
151////////////////////////////////////////////////////////////////////////////////
152/// Make in one step a volume pointing to a box shape with given medium.
153
155{
156 TGeoBBox *box = new TGeoBBox(name, dx, dy, dz);
157 TGeoVolume *vol = nullptr;
158 if (box->IsRunTimeShape()) {
160 vol->SetShape(box);
161 } else {
162 vol = new TGeoVolume(name, box, medium);
163 }
164 return vol;
165}
166
167////////////////////////////////////////////////////////////////////////////////
168/// Make in one step a volume pointing to a parallelepiped shape with given medium.
169
171 Double_t alpha, Double_t theta, Double_t phi)
172{
173 if (std::abs(alpha) < TGeoShape::Tolerance() && std::abs(theta) < TGeoShape::Tolerance()) {
174 Warning("MakePara", "parallelepiped %s having alpha=0, theta=0 -> making box instead", name);
175 return MakeBox(name, medium, dx, dy, dz);
176 }
177 TGeoPara *para = nullptr;
178 para = new TGeoPara(name, dx, dy, dz, alpha, theta, phi);
179 TGeoVolume *vol = nullptr;
180 if (para->IsRunTimeShape()) {
182 vol->SetShape(para);
183 } else {
184 vol = new TGeoVolume(name, para, medium);
185 }
186 return vol;
187}
188
189////////////////////////////////////////////////////////////////////////////////
190/// Make in one step a volume pointing to a sphere shape with given medium
191
199
200////////////////////////////////////////////////////////////////////////////////
201/// Make in one step a volume pointing to a torus shape with given medium.
202
210
211////////////////////////////////////////////////////////////////////////////////
212/// Make in one step a volume pointing to a tube shape with given medium.
213
215{
216 if (rmin > rmax) {
217 Error("MakeTube", "tube %s, Rmin=%g greater than Rmax=%g", name, rmin, rmax);
218 }
219 TGeoTube *tube = new TGeoTube(name, rmin, rmax, dz);
220 TGeoVolume *vol = nullptr;
221 if (tube->IsRunTimeShape()) {
223 vol->SetShape(tube);
224 } else {
225 vol = new TGeoVolume(name, tube, medium);
226 }
227 return vol;
228}
229
230////////////////////////////////////////////////////////////////////////////////
231/// Make in one step a volume pointing to a tube segment shape with given medium.
232
235{
237 TGeoVolume *vol = nullptr;
238 if (tubs->IsRunTimeShape()) {
240 vol->SetShape(tubs);
241 } else {
242 vol = new TGeoVolume(name, tubs, medium);
243 }
244 return vol;
245}
246
247////////////////////////////////////////////////////////////////////////////////
248/// Make in one step a volume pointing to a tube shape with given medium
249
251{
252 TGeoEltu *eltu = new TGeoEltu(name, a, b, dz);
253 TGeoVolume *vol = nullptr;
254 if (eltu->IsRunTimeShape()) {
256 vol->SetShape(eltu);
257 } else {
258 vol = new TGeoVolume(name, eltu, medium);
259 }
260 return vol;
261}
262
263////////////////////////////////////////////////////////////////////////////////
264/// Make in one step a volume pointing to a tube shape with given medium
265
268{
270 TGeoVolume *vol = nullptr;
271 if (hype->IsRunTimeShape()) {
273 vol->SetShape(hype);
274 } else {
275 vol = new TGeoVolume(name, hype, medium);
276 }
277 return vol;
278}
279
280////////////////////////////////////////////////////////////////////////////////
281/// Make in one step a volume pointing to a tube shape with given medium
282
284{
286 TGeoVolume *vol = nullptr;
287 if (parab->IsRunTimeShape()) {
289 vol->SetShape(parab);
290 } else {
291 vol = new TGeoVolume(name, parab, medium);
292 }
293 return vol;
294}
295
296////////////////////////////////////////////////////////////////////////////////
297/// Make in one step a volume pointing to a tube segment shape with given medium
298
307
308////////////////////////////////////////////////////////////////////////////////
309/// Make in one step a volume pointing to a cone shape with given medium.
310
313{
315 TGeoVolume *vol = nullptr;
316 if (cone->IsRunTimeShape()) {
318 vol->SetShape(cone);
319 } else {
320 vol = new TGeoVolume(name, cone, medium);
321 }
322 return vol;
323}
324
325////////////////////////////////////////////////////////////////////////////////
326/// Make in one step a volume pointing to a cone segment shape with given medium
327
330{
332 TGeoVolume *vol = nullptr;
333 if (cons->IsRunTimeShape()) {
335 vol->SetShape(cons);
336 } else {
337 vol = new TGeoVolume(name, cons, medium);
338 }
339 return vol;
340}
341
342////////////////////////////////////////////////////////////////////////////////
343/// Make in one step a volume pointing to a polycone shape with given medium.
344
346{
347 TGeoPcon *pcon = new TGeoPcon(name, phi, dphi, nz);
348 TGeoVolume *vol = new TGeoVolume(name, pcon, medium);
349 return vol;
350}
351
352////////////////////////////////////////////////////////////////////////////////
353/// Make in one step a volume pointing to a polygone shape with given medium.
354
357{
358 TGeoPgon *pgon = new TGeoPgon(name, phi, dphi, nedges, nz);
359 TGeoVolume *vol = new TGeoVolume(name, pgon, medium);
360 return vol;
361}
362
363////////////////////////////////////////////////////////////////////////////////
364/// Make in one step a volume pointing to a TGeoTrd1 shape with given medium.
365
368{
369 TGeoTrd1 *trd1 = new TGeoTrd1(name, dx1, dx2, dy, dz);
370 TGeoVolume *vol = nullptr;
371 if (trd1->IsRunTimeShape()) {
373 vol->SetShape(trd1);
374 } else {
375 vol = new TGeoVolume(name, trd1, medium);
376 }
377 return vol;
378}
379
380////////////////////////////////////////////////////////////////////////////////
381/// Make in one step a volume pointing to a TGeoTrd2 shape with given medium.
382
385{
386 TGeoTrd2 *trd2 = new TGeoTrd2(name, dx1, dx2, dy1, dy2, dz);
387 TGeoVolume *vol = nullptr;
388 if (trd2->IsRunTimeShape()) {
390 vol->SetShape(trd2);
391 } else {
392 vol = new TGeoVolume(name, trd2, medium);
393 }
394 return vol;
395}
396
397////////////////////////////////////////////////////////////////////////////////
398/// Make in one step a volume pointing to a trapezoid shape with given medium.
399
408
409////////////////////////////////////////////////////////////////////////////////
410/// Make in one step a volume pointing to a twisted trapezoid shape with given medium.
411
420////////////////////////////////////////////////////////////////////////////////
421/// Make a TGeoXtru-shaped volume with nz planes
422
424{
425 TGeoXtru *xtru = new TGeoXtru(nz);
426 xtru->SetName(name);
427 TGeoVolume *vol = new TGeoVolume(name, xtru, medium);
428 return vol;
429}
430
431////////////////////////////////////////////////////////////////////////////////
432/// Make an assembly of volumes.
433
438
439////////////////////////////////////////////////////////////////////////////////
440/// Make a TGeoVolumeMulti handling a list of volumes.
441
446
447////////////////////////////////////////////////////////////////////////////////
448/// Create a new volume by dividing an existing one (GEANT3 like)
449///
450/// Divides MOTHER into NDIV divisions called NAME
451/// along axis IAXIS starting at coordinate value START
452/// and having size STEP. The created volumes will have tracking
453/// media ID=NUMED (if NUMED=0 -> same media as MOTHER)
454/// The behavior of the division operation can be triggered using OPTION (case insensitive):
455///
456/// - N - divide all range in NDIV cells (same effect as STEP<=0) (GSDVN in G3)
457/// - NX - divide range starting with START in NDIV cells (GSDVN2 in G3)
458/// - S - divide all range with given STEP. NDIV is computed and divisions will be centered
459/// in full range (same effect as NDIV<=0) (GSDVS, GSDVT in G3)
460/// - SX - same as DVS, but from START position. (GSDVS2, GSDVT2 in G3)
461
462TGeoVolume *TGeoBuilder::Division(const char *name, const char *mother, Int_t iaxis, Int_t ndiv, Double_t start,
464{
467 sname = sname.Strip();
468 const char *vname = sname.Data();
470 smname = smname.Strip();
471 const char *mname = smname.Data();
472
474 if (!amother)
476 if (amother)
477 return amother->Divide(vname, iaxis, ndiv, start, step, numed, option);
478
479 Error("Division", "VOLUME: \"%s\" not defined", mname);
480
481 return nullptr;
482}
483
484////////////////////////////////////////////////////////////////////////////////
485/// Create rotation matrix named 'mat<index>'.
486///
487/// - index rotation matrix number
488/// - theta1 polar angle for axis X
489/// - phi1 azimuthal angle for axis X
490/// - theta2 polar angle for axis Y
491/// - phi2 azimuthal angle for axis Y
492/// - theta3 polar angle for axis Z
493/// - phi3 azimuthal angle for axis Z
494///
495
503
504////////////////////////////////////////////////////////////////////////////////
505/// Create material with given A, Z and density, having an unique id.
506
509{
510 TGeoMaterial *material = new TGeoMaterial(name, a, z, dens, radlen, intlen);
511 material->SetUniqueID(uid);
512 return material;
513}
514
515////////////////////////////////////////////////////////////////////////////////
516/// Create mixture OR COMPOUND IMAT as composed by THE BASIC nelem
517/// materials defined by arrays A,Z and WMAT, having an unique id.
518
521{
522 TGeoMixture *mix = new TGeoMixture(name, nelem, dens);
523 mix->SetUniqueID(uid);
524 Int_t i;
525 for (i = 0; i < nelem; i++) {
526 mix->DefineElement(i, a[i], z[i], wmat[i]);
527 }
528 return (TGeoMaterial *)mix;
529}
530
531////////////////////////////////////////////////////////////////////////////////
532/// Create mixture OR COMPOUND IMAT as composed by THE BASIC nelem
533/// materials defined by arrays A,Z and WMAT, having an unique id.
534
537{
538 TGeoMixture *mix = new TGeoMixture(name, nelem, dens);
539 mix->SetUniqueID(uid);
540 Int_t i;
541 for (i = 0; i < nelem; i++) {
542 mix->DefineElement(i, a[i], z[i], wmat[i]);
543 }
544 return (TGeoMaterial *)mix;
545}
546
547////////////////////////////////////////////////////////////////////////////////
548/// Create tracking medium
549///
550/// - numed tracking medium number assigned
551/// - name tracking medium name
552/// - nmat material number
553/// - isvol sensitive volume flag
554/// - ifield magnetic field
555/// - fieldm max. field value (kilogauss)
556/// - tmaxfd max. angle due to field (deg/step)
557/// - stemax max. step allowed
558/// - deemax max. fraction of energy lost in a step
559/// - epsil tracking precision (cm)
560/// - stmin min. step due to continuous processes (cm)
561///
562/// - ifield = 0 if no magnetic field; ifield = -1 if user decision in guswim;
563/// - ifield = 1 if tracking performed with g3rkuta; ifield = 2 if tracking
564/// performed with g3helix; ifield = 3 if tracking performed with g3helx3.
565///
566
572
573////////////////////////////////////////////////////////////////////////////////
574/// Create a node called `<name_nr>` pointing to the volume called `<name>`
575/// as daughter of the volume called `<mother>` (gspos). The relative matrix is
576/// made of : a translation (x,y,z) and a rotation matrix named `<matIROT>`.
577/// In case npar>0, create the volume to be positioned in mother, according
578/// its actual parameters (gsposp).
579/// - NAME Volume name
580/// - NUMBER Copy number of the volume
581/// - MOTHER Mother volume name
582/// - X X coord. of the volume in mother ref. sys.
583/// - Y Y coord. of the volume in mother ref. sys.
584/// - Z Z coord. of the volume in mother ref. sys.
585/// - IROT Rotation matrix number w.r.t. mother ref. sys.
586/// - ISONLY ONLY/MANY flag
587
588void TGeoBuilder::Node(const char *name, Int_t nr, const char *mother, Double_t x, Double_t y, Double_t z, Int_t irot,
590{
591 TGeoVolume *amother = nullptr;
592 TGeoVolume *volume = nullptr;
593
594 // look into special volume list first
596 if (!amother)
598 if (!amother) {
600 mname = mname.Strip();
601 Error("Node", "Mother VOLUME \"%s\" not defined", mname.Data());
602 return;
603 }
604 Int_t i;
605 if (npar <= 0) {
606 //---> acting as G3 gspos
607 if (gDebug > 0)
608 Info("Node", "Calling gspos, mother=%s, name=%s, nr=%d, x=%g, y=%g, z=%g, irot=%d, konly=%i", mother, name, nr,
609 x, y, z, irot, (Int_t)isOnly);
610 // look into special volume list first
612 if (!volume)
613 volume = fGeometry->FindVolumeFast(name);
614 if (!volume) {
616 vname = vname.Strip();
617 Error("Node", "VOLUME: \"%s\" not defined", vname.Data());
618 return;
619 }
620 if (((TObject *)volume)->TestBit(TGeoVolume::kVolumeMulti) && !volume->GetShape()) {
621 Error("Node", "cannot add multiple-volume object %s as node", volume->GetName());
622 return;
623 }
624 } else {
625 //---> acting as G3 gsposp
627 if (!vmulti) {
628 volume = fGeometry->FindVolumeFast(name);
629 if (volume) {
630 Warning("Node", "volume: %s is defined as single -> ignoring shape parameters", volume->GetName());
631 Node(name, nr, mother, x, y, z, irot, isOnly, upar);
632 return;
633 }
635 vname = vname.Strip();
636 Error("Node", "VOLUME: \"%s\" not defined ", vname.Data());
637 return;
638 }
639 TGeoMedium *medium = vmulti->GetMedium();
640 TString sh = vmulti->GetTitle();
641 sh.ToLower();
642 if (sh.Contains("box")) {
643 volume = MakeBox(name, medium, upar[0], upar[1], upar[2]);
644 } else if (sh.Contains("trd1")) {
645 volume = MakeTrd1(name, medium, upar[0], upar[1], upar[2], upar[3]);
646 } else if (sh.Contains("trd2")) {
647 volume = MakeTrd2(name, medium, upar[0], upar[1], upar[2], upar[3], upar[4]);
648 } else if (sh.Contains("trap")) {
649 volume = MakeTrap(name, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5], upar[6], upar[7],
650 upar[8], upar[9], upar[10]);
651 } else if (sh.Contains("gtra")) {
652 volume = MakeGtra(name, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5], upar[6], upar[7],
653 upar[8], upar[9], upar[10], upar[11]);
654 } else if (sh.Contains("tube")) {
655 volume = MakeTube(name, medium, upar[0], upar[1], upar[2]);
656 } else if (sh.Contains("tubs")) {
657 volume = MakeTubs(name, medium, upar[0], upar[1], upar[2], upar[3], upar[4]);
658 } else if (sh.Contains("cone")) {
659 volume = MakeCone(name, medium, upar[0], upar[1], upar[2], upar[3], upar[4]);
660 } else if (sh.Contains("cons")) {
661 volume = MakeCons(name, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5], upar[6]);
662 } else if (sh.Contains("pgon")) {
663 volume = MakePgon(name, medium, upar[0], upar[1], (Int_t)upar[2], (Int_t)upar[3]);
664 Int_t nz = (Int_t)upar[3];
665 for (i = 0; i < nz; i++) {
666 ((TGeoPgon *)volume->GetShape())->DefineSection(i, upar[3 * i + 4], upar[3 * i + 5], upar[3 * i + 6]);
667 }
668 } else if (sh.Contains("pcon")) {
669 volume = MakePcon(name, medium, upar[0], upar[1], (Int_t)upar[2]);
670 Int_t nz = (Int_t)upar[2];
671 for (i = 0; i < nz; i++) {
672 ((TGeoPcon *)volume->GetShape())->DefineSection(i, upar[3 * i + 3], upar[3 * i + 4], upar[3 * i + 5]);
673 }
674 } else if (sh.Contains("eltu")) {
675 volume = MakeEltu(name, medium, upar[0], upar[1], upar[2]);
676 } else if (sh.Contains("sphe")) {
677 volume = MakeSphere(name, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5]);
678 } else if (sh.Contains("ctub")) {
679 volume = MakeCtub(name, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5], upar[6], upar[7],
680 upar[8], upar[9], upar[10]);
681 } else if (sh.Contains("para")) {
682 volume = MakePara(name, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5]);
683 } else {
684 Error("Node", "cannot create shape %s", sh.Data());
685 }
686
687 if (!volume)
688 return;
689 vmulti->AddVolume(volume);
690 }
691 if (irot) {
692 TGeoRotation *matrix = nullptr;
695 while ((mat = (TGeoMatrix *)next())) {
696 if (mat->GetUniqueID() == UInt_t(irot)) {
697 matrix = dynamic_cast<TGeoRotation *>(mat);
698 break;
699 }
700 }
701 if (!matrix) {
702 Fatal("Node", "Node %s/%s_%d rotation %i not found", mother, name, nr, irot);
703 return;
704 }
705 if (isOnly)
706 amother->AddNode(volume, nr, new TGeoCombiTrans(x, y, z, matrix));
707 else
708 amother->AddNodeOverlap(volume, nr, new TGeoCombiTrans(x, y, z, matrix));
709 } else {
710 if (std::abs(x) < TGeoShape::Tolerance() && std::abs(y) < TGeoShape::Tolerance() &&
711 std::abs(z) < TGeoShape::Tolerance()) {
712 if (isOnly)
713 amother->AddNode(volume, nr);
714 else
715 amother->AddNodeOverlap(volume, nr);
716 } else {
717 if (isOnly)
718 amother->AddNode(volume, nr, new TGeoTranslation(x, y, z));
719 else
720 amother->AddNodeOverlap(volume, nr, new TGeoTranslation(x, y, z));
721 }
722 }
723}
724
725////////////////////////////////////////////////////////////////////////////////
726/// Create a node called `<name_nr>` pointing to the volume called `<name>`
727/// as daughter of the volume called `<mother>` (gspos). The relative matrix is
728/// made of : a translation (x,y,z) and a rotation matrix named `<matIROT>`.
729/// In case npar>0, create the volume to be positioned in mother, according
730/// its actual parameters (gsposp).
731/// - NAME Volume name
732/// - NUMBER Copy number of the volume
733/// - MOTHER Mother volume name
734/// - X X coord. of the volume in mother ref. sys.
735/// - Y Y coord. of the volume in mother ref. sys.
736/// - Z Z coord. of the volume in mother ref. sys.
737/// - IROT Rotation matrix number w.r.t. mother ref. sys.
738/// - ISONLY ONLY/MANY flag
739
740void TGeoBuilder::Node(const char *name, Int_t nr, const char *mother, Double_t x, Double_t y, Double_t z, Int_t irot,
742{
743 TGeoVolume *amother = nullptr;
744 TGeoVolume *volume = nullptr;
745
746 // look into special volume list first
748 if (!amother)
750 if (!amother) {
752 mname = mname.Strip();
753 Error("Node", "Mother VOLUME \"%s\" not defined", mname.Data());
754 return;
755 }
756 Int_t i;
757 if (npar <= 0) {
758 //---> acting as G3 gspos
759 if (gDebug > 0)
760 Info("Node", "Calling gspos, mother=%s, name=%s, nr=%d, x=%g, y=%g, z=%g, irot=%d, konly=%i", mother, name, nr,
761 x, y, z, irot, (Int_t)isOnly);
762 // look into special volume list first
764 if (!volume)
765 volume = fGeometry->FindVolumeFast(name);
766 if (!volume) {
768 vname = vname.Strip();
769 Error("Node", "VOLUME: \"%s\" not defined", vname.Data());
770 return;
771 }
772 if (((TObject *)volume)->TestBit(TGeoVolume::kVolumeMulti) && !volume->GetShape()) {
773 Error("Node", "cannot add multiple-volume object %s as node", volume->GetName());
774 return;
775 }
776 } else {
777 //---> acting as G3 gsposp
779 if (!vmulti) {
780 volume = fGeometry->FindVolumeFast(name);
781 if (volume) {
782 Warning("Node", "volume: %s is defined as single -> ignoring shape parameters", volume->GetName());
783 Node(name, nr, mother, x, y, z, irot, isOnly, upar);
784 return;
785 }
787 vname = vname.Strip();
788 Error("Node", "VOLUME: \"%s\" not defined ", vname.Data());
789 return;
790 }
791 TGeoMedium *medium = vmulti->GetMedium();
792 TString sh = vmulti->GetTitle();
793 sh.ToLower();
794 if (sh.Contains("box")) {
795 volume = MakeBox(name, medium, upar[0], upar[1], upar[2]);
796 } else if (sh.Contains("trd1")) {
797 volume = MakeTrd1(name, medium, upar[0], upar[1], upar[2], upar[3]);
798 } else if (sh.Contains("trd2")) {
799 volume = MakeTrd2(name, medium, upar[0], upar[1], upar[2], upar[3], upar[4]);
800 } else if (sh.Contains("trap")) {
801 volume = MakeTrap(name, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5], upar[6], upar[7],
802 upar[8], upar[9], upar[10]);
803 } else if (sh.Contains("gtra")) {
804 volume = MakeGtra(name, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5], upar[6], upar[7],
805 upar[8], upar[9], upar[10], upar[11]);
806 } else if (sh.Contains("tube")) {
807 volume = MakeTube(name, medium, upar[0], upar[1], upar[2]);
808 } else if (sh.Contains("tubs")) {
809 volume = MakeTubs(name, medium, upar[0], upar[1], upar[2], upar[3], upar[4]);
810 } else if (sh.Contains("cone")) {
811 volume = MakeCone(name, medium, upar[0], upar[1], upar[2], upar[3], upar[4]);
812 } else if (sh.Contains("cons")) {
813 volume = MakeCons(name, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5], upar[6]);
814 } else if (sh.Contains("pgon")) {
815 volume = MakePgon(name, medium, upar[0], upar[1], (Int_t)upar[2], (Int_t)upar[3]);
816 Int_t nz = (Int_t)upar[3];
817 for (i = 0; i < nz; i++) {
818 ((TGeoPgon *)volume->GetShape())->DefineSection(i, upar[3 * i + 4], upar[3 * i + 5], upar[3 * i + 6]);
819 }
820 } else if (sh.Contains("pcon")) {
821 volume = MakePcon(name, medium, upar[0], upar[1], (Int_t)upar[2]);
822 Int_t nz = (Int_t)upar[2];
823 for (i = 0; i < nz; i++) {
824 ((TGeoPcon *)volume->GetShape())->DefineSection(i, upar[3 * i + 3], upar[3 * i + 4], upar[3 * i + 5]);
825 }
826 } else if (sh.Contains("eltu")) {
827 volume = MakeEltu(name, medium, upar[0], upar[1], upar[2]);
828 } else if (sh.Contains("sphe")) {
829 volume = MakeSphere(name, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5]);
830 } else if (sh.Contains("ctub")) {
831 volume = MakeCtub(name, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5], upar[6], upar[7],
832 upar[8], upar[9], upar[10]);
833 } else if (sh.Contains("para")) {
834 volume = MakePara(name, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5]);
835 } else {
836 Error("Node", "cannot create shape %s", sh.Data());
837 }
838
839 if (!volume)
840 return;
841 vmulti->AddVolume(volume);
842 }
843 if (irot) {
844 TGeoRotation *matrix = nullptr;
847 while ((mat = (TGeoMatrix *)next())) {
848 if (mat->GetUniqueID() == UInt_t(irot)) {
849 matrix = dynamic_cast<TGeoRotation *>(mat);
850 break;
851 }
852 }
853 if (!matrix) {
854 Fatal("Node", "Node %s/%s_%d rotation %i not found", mother, name, nr, irot);
855 return;
856 }
857 if (isOnly)
858 amother->AddNode(volume, nr, new TGeoCombiTrans(x, y, z, matrix));
859 else
860 amother->AddNodeOverlap(volume, nr, new TGeoCombiTrans(x, y, z, matrix));
861 } else {
862 if (std::abs(x) < TGeoShape::Tolerance() && std::abs(y) < TGeoShape::Tolerance() &&
863 std::abs(z) < TGeoShape::Tolerance()) {
864 if (isOnly)
865 amother->AddNode(volume, nr);
866 else
867 amother->AddNodeOverlap(volume, nr);
868 } else {
869 if (isOnly)
870 amother->AddNode(volume, nr, new TGeoTranslation(x, y, z));
871 else
872 amother->AddNodeOverlap(volume, nr, new TGeoTranslation(x, y, z));
873 }
874 }
875}
876
877////////////////////////////////////////////////////////////////////////////////
878/// Create a volume in GEANT3 style.
879/// - NAME Volume name
880/// - SHAPE Volume type
881/// - NMED Tracking medium number
882/// - NPAR Number of shape parameters
883/// - UPAR Vector containing shape parameters
884
885TGeoVolume *TGeoBuilder::Volume(const char *name, const char *shape, Int_t nmed, Float_t *upar, Int_t npar)
886{
887 Int_t i;
888 TGeoVolume *volume = nullptr;
890 if (!medium) {
891 Error("Volume", "cannot create volume: %s, medium: %d is unknown", name, nmed);
892 return nullptr;
893 }
894 TString sh = shape;
896 sname = sname.Strip();
897 const char *vname = sname.Data();
898 if (npar <= 0) {
899 //--- create a TGeoVolumeMulti
900 volume = MakeVolumeMulti(vname, medium);
901 volume->SetTitle(shape);
903 if (!vmulti) {
904 Error("Volume", "volume multi: %s not created", vname);
905 return nullptr;
906 }
907 return vmulti;
908 }
909 //---> create a normal volume
910 sh.ToLower();
911 if (sh.Contains("box")) {
912 volume = MakeBox(vname, medium, upar[0], upar[1], upar[2]);
913 } else if (sh.Contains("trd1")) {
914 volume = MakeTrd1(vname, medium, upar[0], upar[1], upar[2], upar[3]);
915 } else if (sh.Contains("trd2")) {
916 volume = MakeTrd2(vname, medium, upar[0], upar[1], upar[2], upar[3], upar[4]);
917 } else if (sh.Contains("trap")) {
918 volume = MakeTrap(vname, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5], upar[6], upar[7], upar[8],
919 upar[9], upar[10]);
920 } else if (sh.Contains("gtra")) {
921 volume = MakeGtra(vname, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5], upar[6], upar[7], upar[8],
922 upar[9], upar[10], upar[11]);
923 } else if (sh.Contains("tube")) {
924 volume = MakeTube(vname, medium, upar[0], upar[1], upar[2]);
925 } else if (sh.Contains("tubs")) {
926 volume = MakeTubs(vname, medium, upar[0], upar[1], upar[2], upar[3], upar[4]);
927 } else if (sh.Contains("cone")) {
928 volume = MakeCone(vname, medium, upar[0], upar[1], upar[2], upar[3], upar[4]);
929 } else if (sh.Contains("cons")) {
930 volume = MakeCons(vname, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5], upar[6]);
931 } else if (sh.Contains("pgon")) {
932 volume = MakePgon(vname, medium, upar[0], upar[1], (Int_t)upar[2], (Int_t)upar[3]);
933 Int_t nz = (Int_t)upar[3];
934 for (i = 0; i < nz; i++) {
935 ((TGeoPgon *)volume->GetShape())->DefineSection(i, upar[3 * i + 4], upar[3 * i + 5], upar[3 * i + 6]);
936 }
937 } else if (sh.Contains("pcon")) {
938 volume = MakePcon(vname, medium, upar[0], upar[1], (Int_t)upar[2]);
939 Int_t nz = (Int_t)upar[2];
940 for (i = 0; i < nz; i++) {
941 ((TGeoPcon *)volume->GetShape())->DefineSection(i, upar[3 * i + 3], upar[3 * i + 4], upar[3 * i + 5]);
942 }
943 } else if (sh.Contains("eltu")) {
944 volume = MakeEltu(vname, medium, upar[0], upar[1], upar[2]);
945 } else if (sh.Contains("sphe")) {
946 volume = MakeSphere(vname, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5]);
947 } else if (sh.Contains("ctub")) {
948 volume = MakeCtub(vname, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5], upar[6], upar[7], upar[8],
949 upar[9], upar[10]);
950 } else if (sh.Contains("para")) {
951 volume = MakePara(vname, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5]);
952 } else if (sh.Contains("tor")) {
953 volume = MakeTorus(vname, medium, upar[0], upar[1], upar[2], upar[3], upar[4]);
954 }
955
956 if (!volume) {
957 Error("Volume", "volume: %s not created", vname);
958 return nullptr;
959 }
960 return volume;
961}
962
963////////////////////////////////////////////////////////////////////////////////
964/// Create a volume in GEANT3 style.
965/// - NAME Volume name
966/// - SHAPE Volume type
967/// - NMED Tracking medium number
968/// - NPAR Number of shape parameters
969/// - UPAR Vector containing shape parameters
970
971TGeoVolume *TGeoBuilder::Volume(const char *name, const char *shape, Int_t nmed, Double_t *upar, Int_t npar)
972{
973 Int_t i;
974 TGeoVolume *volume = nullptr;
976 if (!medium) {
977 Error("Volume", "cannot create volume: %s, medium: %d is unknown", name, nmed);
978 return nullptr;
979 }
980 TString sh = shape;
982 sname = sname.Strip();
983 const char *vname = sname.Data();
984 if (npar <= 0) {
985 //--- create a TGeoVolumeMulti
986 volume = MakeVolumeMulti(vname, medium);
987 volume->SetTitle(shape);
989 if (!vmulti) {
990 Error("Volume", "volume multi: %s not created", vname);
991 return nullptr;
992 }
993 return vmulti;
994 }
995 //---> create a normal volume
996 sh.ToLower();
997 if (sh.Contains("box")) {
998 volume = MakeBox(vname, medium, upar[0], upar[1], upar[2]);
999 } else if (sh.Contains("trd1")) {
1000 volume = MakeTrd1(vname, medium, upar[0], upar[1], upar[2], upar[3]);
1001 } else if (sh.Contains("trd2")) {
1002 volume = MakeTrd2(vname, medium, upar[0], upar[1], upar[2], upar[3], upar[4]);
1003 } else if (sh.Contains("trap")) {
1004 volume = MakeTrap(vname, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5], upar[6], upar[7], upar[8],
1005 upar[9], upar[10]);
1006 } else if (sh.Contains("gtra")) {
1007 volume = MakeGtra(vname, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5], upar[6], upar[7], upar[8],
1008 upar[9], upar[10], upar[11]);
1009 } else if (sh.Contains("tube")) {
1010 volume = MakeTube(vname, medium, upar[0], upar[1], upar[2]);
1011 } else if (sh.Contains("tubs")) {
1012 volume = MakeTubs(vname, medium, upar[0], upar[1], upar[2], upar[3], upar[4]);
1013 } else if (sh.Contains("cone")) {
1014 volume = MakeCone(vname, medium, upar[0], upar[1], upar[2], upar[3], upar[4]);
1015 } else if (sh.Contains("cons")) {
1016 volume = MakeCons(vname, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5], upar[6]);
1017 } else if (sh.Contains("pgon")) {
1018 volume = MakePgon(vname, medium, upar[0], upar[1], (Int_t)upar[2], (Int_t)upar[3]);
1019 Int_t nz = (Int_t)upar[3];
1020 for (i = 0; i < nz; i++) {
1021 ((TGeoPgon *)volume->GetShape())->DefineSection(i, upar[3 * i + 4], upar[3 * i + 5], upar[3 * i + 6]);
1022 }
1023 } else if (sh.Contains("pcon")) {
1024 volume = MakePcon(vname, medium, upar[0], upar[1], (Int_t)upar[2]);
1025 Int_t nz = (Int_t)upar[2];
1026 for (i = 0; i < nz; i++) {
1027 ((TGeoPcon *)volume->GetShape())->DefineSection(i, upar[3 * i + 3], upar[3 * i + 4], upar[3 * i + 5]);
1028 }
1029 } else if (sh.Contains("eltu")) {
1030 volume = MakeEltu(vname, medium, upar[0], upar[1], upar[2]);
1031 } else if (sh.Contains("sphe")) {
1032 volume = MakeSphere(vname, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5]);
1033 } else if (sh.Contains("ctub")) {
1034 volume = MakeCtub(vname, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5], upar[6], upar[7], upar[8],
1035 upar[9], upar[10]);
1036 } else if (sh.Contains("para")) {
1037 volume = MakePara(vname, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5]);
1038 } else if (sh.Contains("tor")) {
1039 volume = MakeTorus(vname, medium, upar[0], upar[1], upar[2], upar[3], upar[4]);
1040 }
1041
1042 if (!volume) {
1043 Error("Volume", "volume: %s not created", vname);
1044 return nullptr;
1045 }
1046 return volume;
1047}
#define b(i)
Definition RSha256.hxx:100
#define a(i)
Definition RSha256.hxx:99
int Int_t
Signed integer 4 bytes (int)
Definition RtypesCore.h:59
float Float_t
Float 4 bytes (float)
Definition RtypesCore.h:71
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
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
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
char name[80]
Definition TGX11.cxx:110
Int_t gDebug
Global variable setting the debug level. Set to 0 to disable, increase it in steps of 1 to increase t...
Definition TROOT.cxx:627
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
An arbitrary trapezoid with less than 8 vertices standing on two parallel planes perpendicular to Z a...
Definition TGeoArb8.h:19
Box class.
Definition TGeoBBox.h:17
Utility class for creating geometry objects.These will be associated with the current selected geomet...
Definition TGeoBuilder.h:26
TGeoBuilder()
static pointer to singleton
void Node(const char *name, Int_t nr, const char *mother, Double_t x, Double_t y, Double_t z, Int_t irot, Bool_t isOnly, Float_t *upar, Int_t npar=0)
Create a node called <name_nr> pointing to the volume called <name> as daughter of the volume called ...
TGeoVolume * MakePgon(const char *name, TGeoMedium *medium, Double_t phi, Double_t dphi, Int_t nedges, Int_t nz)
Make in one step a volume pointing to a polygone shape with given medium.
TGeoVolume * MakeGtra(const char *name, TGeoMedium *medium, Double_t dz, Double_t theta, Double_t phi, Double_t twist, Double_t h1, Double_t bl1, Double_t tl1, Double_t alpha1, Double_t h2, Double_t bl2, Double_t tl2, Double_t alpha2)
Make in one step a volume pointing to a twisted trapezoid shape with given medium.
TGeoVolume * MakeXtru(const char *name, TGeoMedium *medium, Int_t nz)
Make a TGeoXtru-shaped volume with nz planes.
TGeoVolume * MakePcon(const char *name, TGeoMedium *medium, Double_t phi, Double_t dphi, Int_t nz)
Make in one step a volume pointing to a polycone shape with given medium.
TGeoVolume * MakeTrap(const char *name, TGeoMedium *medium, Double_t dz, Double_t theta, Double_t phi, Double_t h1, Double_t bl1, Double_t tl1, Double_t alpha1, Double_t h2, Double_t bl2, Double_t tl2, Double_t alpha2)
Make in one step a volume pointing to a trapezoid shape with given medium.
Int_t AddShape(TGeoShape *shape)
Add a shape to the list. Returns index of the shape in list.
TGeoVolume * MakeTorus(const char *name, TGeoMedium *medium, Double_t r, Double_t rmin, Double_t rmax, Double_t phi1=0, Double_t dphi=360)
Make in one step a volume pointing to a torus shape with given medium.
static TGeoBuilder * Instance(TGeoManager *geom)
Return pointer to singleton.
TGeoVolume * MakeEltu(const char *name, TGeoMedium *medium, Double_t a, Double_t b, Double_t dz)
Make in one step a volume pointing to a tube shape with given medium.
TGeoVolume * MakeHype(const char *name, TGeoMedium *medium, Double_t rin, Double_t stin, Double_t rout, Double_t stout, Double_t dz)
Make in one step a volume pointing to a tube shape with given medium.
TGeoVolume * MakeArb8(const char *name, TGeoMedium *medium, Double_t dz, Double_t *vertices=nullptr)
Make an TGeoArb8 volume.
TGeoMaterial * Material(const char *name, Double_t a, Double_t z, Double_t dens, Int_t uid, Double_t radlen=0, Double_t intlen=0)
Create material with given A, Z and density, having an unique id.
~TGeoBuilder() override
Destructor.
TGeoVolume * MakeTube(const char *name, TGeoMedium *medium, Double_t rmin, Double_t rmax, Double_t dz)
Make in one step a volume pointing to a tube shape with given medium.
TGeoVolume * MakePara(const char *name, TGeoMedium *medium, Double_t dx, Double_t dy, Double_t dz, Double_t alpha, Double_t theta, Double_t phi)
Make in one step a volume pointing to a parallelepiped shape with given medium.
Int_t AddTransformation(TGeoMatrix *matrix)
Add a matrix to the list. Returns index of the matrix in list.
TGeoVolume * MakeSphere(const char *name, TGeoMedium *medium, Double_t rmin, Double_t rmax, Double_t themin=0, Double_t themax=180, Double_t phimin=0, Double_t phimax=360)
Make in one step a volume pointing to a sphere shape with given medium.
TGeoMedium * Medium(const char *name, Int_t numed, Int_t nmat, Int_t isvol, Int_t ifield, Double_t fieldm, Double_t tmaxfd, Double_t stemax, Double_t deemax, Double_t epsil, Double_t stmin)
Create tracking medium.
TGeoVolume * MakeTubs(const char *name, TGeoMedium *medium, Double_t rmin, Double_t rmax, Double_t dz, Double_t phi1, Double_t phi2)
Make in one step a volume pointing to a tube segment shape with given medium.
TGeoVolume * MakeBox(const char *name, TGeoMedium *medium, Double_t dx, Double_t dy, Double_t dz)
Make in one step a volume pointing to a box shape with given medium.
void Matrix(Int_t index, Double_t theta1, Double_t phi1, Double_t theta2, Double_t phi2, Double_t theta3, Double_t phi3)
Create rotation matrix named 'mat<index>'.
TGeoVolume * Division(const char *name, const char *mother, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step, Int_t numed=0, Option_t *option="")
Create a new volume by dividing an existing one (GEANT3 like)
TGeoVolume * MakeParaboloid(const char *name, TGeoMedium *medium, Double_t rlo, Double_t rhi, Double_t dz)
Make in one step a volume pointing to a tube shape with given medium.
TGeoVolume * MakeTrd1(const char *name, TGeoMedium *medium, Double_t dx1, Double_t dx2, Double_t dy, Double_t dz)
Make in one step a volume pointing to a TGeoTrd1 shape with given medium.
TGeoVolumeAssembly * MakeVolumeAssembly(const char *name)
Make an assembly of volumes.
TGeoVolume * MakeCons(const char *name, TGeoMedium *medium, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2, Double_t phi1, Double_t phi2)
Make in one step a volume pointing to a cone segment shape with given medium.
Int_t AddMaterial(TGeoMaterial *material)
Add a material to the list. Returns index of the material in list.
TGeoManager * fGeometry
Definition TGeoBuilder.h:35
TGeoVolumeMulti * MakeVolumeMulti(const char *name, TGeoMedium *medium)
Make a TGeoVolumeMulti handling a list of volumes.
TGeoVolume * MakeTrd2(const char *name, TGeoMedium *medium, Double_t dx1, Double_t dx2, Double_t dy1, Double_t dy2, Double_t dz)
Make in one step a volume pointing to a TGeoTrd2 shape with given medium.
TGeoVolume * Volume(const char *name, const char *shape, Int_t nmed, Float_t *upar, Int_t npar=0)
Create a volume in GEANT3 style.
TGeoMaterial * Mixture(const char *name, Float_t *a, Float_t *z, Double_t dens, Int_t nelem, Float_t *wmat, Int_t uid)
Create mixture OR COMPOUND IMAT as composed by THE BASIC nelem materials defined by arrays A,...
TGeoVolume * MakeCone(const char *name, TGeoMedium *medium, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2)
Make in one step a volume pointing to a cone shape with given medium.
void RegisterMatrix(TGeoMatrix *matrix)
Register a matrix to the list of matrices.
static TGeoBuilder * fgInstance
Definition TGeoBuilder.h:28
TGeoVolume * MakeCtub(const char *name, TGeoMedium *medium, Double_t rmin, Double_t rmax, Double_t dz, Double_t phi1, Double_t phi2, Double_t lx, Double_t ly, Double_t lz, Double_t tx, Double_t ty, Double_t tz)
Make in one step a volume pointing to a tube segment shape with given medium.
Class describing rotation + translation.
Definition TGeoMatrix.h:317
A cone segment is a cone having a range in phi.
Definition TGeoCone.h:99
The cones are defined by 5 parameters:
Definition TGeoCone.h:17
The cut tubes constructor has the form:
Definition TGeoTube.h:173
An elliptical tube is defined by the two semi-axes A and B.
Definition TGeoEltu.h:17
A twisted trapezoid.
Definition TGeoArb8.h:151
A hyperboloid is represented as a solid limited by two planes perpendicular to the Z axis (top and bo...
Definition TGeoHype.h:17
The manager class for any TGeo geometry.
Definition TGeoManager.h:45
TObjArray * GetListOfGVolumes() const
TObjArray * GetListOfMatrices() const
TGeoVolumeMulti * MakeVolumeMulti(const char *name, TGeoMedium *medium)
Make a TGeoVolumeMulti handling a list of volumes.
TObjArray * GetListOfGShapes() const
TGeoVolume * GetVolume(const char *name) const
Search for a named volume. All trailing blanks stripped.
TGeoVolume * FindVolumeFast(const char *name, Bool_t multi=kFALSE)
Fast search for a named volume. All trailing blanks stripped.
TGeoMedium * GetMedium(const char *medium) const
Search for a named tracking medium. All trailing blanks stripped.
TList * GetListOfMaterials() const
TObjArray * GetListOfShapes() const
Base class describing materials.
void SetIndex(Int_t index)
Geometrical transformation package.
Definition TGeoMatrix.h:38
Media are used to store properties related to tracking and which are useful only when using geometry ...
Definition TGeoMedium.h:23
Mixtures of elements.
void DefineElement(Int_t iel, Double_t a, Double_t z, Double_t weight)
Parallelepiped class.
Definition TGeoPara.h:17
A paraboloid is defined by the revolution surface generated by a parabola and is bounded by two plane...
A polycone is represented by a sequence of tubes/cones, glued together at defined Z planes.
Definition TGeoPcon.h:17
Polygons are defined in the same way as polycones, the difference being just that the segments betwee...
Definition TGeoPgon.h:20
Class describing rotations.
Definition TGeoMatrix.h:168
Base abstract class for all shapes.
Definition TGeoShape.h:25
Bool_t IsRunTimeShape() const
Definition TGeoShape.h:150
static Double_t Tolerance()
Definition TGeoShape.h:97
TGeoSphere are not just balls having internal and external radii, but sectors of a sphere having defi...
Definition TGeoSphere.h:17
The torus is defined by its axial radius, its inner and outer radius.
Definition TGeoTorus.h:17
Class describing translations.
Definition TGeoMatrix.h:116
A general trapezoid.
Definition TGeoArb8.h:98
A trapezoid with only X varying with Z.
Definition TGeoTrd1.h:17
A trapezoid with only X varying with Z.
Definition TGeoTrd2.h:17
A tube segment is a tube having a range in phi.
Definition TGeoTube.h:94
Cylindrical tube class.
Definition TGeoTube.h:17
Volume assemblies.
Definition TGeoVolume.h:316
Volume families.
Definition TGeoVolume.h:266
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition TGeoVolume.h:43
void SetShape(const TGeoShape *shape)
set the shape associated with this volume
TGeoShape * GetShape() const
Definition TGeoVolume.h:190
A TGeoXtru shape is represented by the extrusion of an arbitrary polygon with fixed outline between s...
Definition TGeoXtru.h:22
A doubly linked list.
Definition TList.h:38
void Add(TObject *obj) override
Definition TList.h:81
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
Definition TNamed.cxx:173
const char * GetName() const override
Returns name of object.
Definition TNamed.h:49
An array of TObjects.
Definition TObjArray.h:31
TObject * FindObject(const char *name) const override
Find an object in this collection using its name.
Mother of all ROOT objects.
Definition TObject.h:41
virtual const char * GetName() const
Returns name of object.
Definition TObject.cxx:457
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition TObject.h:202
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition TObject.cxx:1057
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition TObject.cxx:1071
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
Definition TObject.cxx:1099
virtual void SetUniqueID(UInt_t uid)
Set the unique object id.
Definition TObject.cxx:875
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Definition TObject.cxx:1045
Basic string class.
Definition TString.h:138
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Definition fillpatterns.C:1
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
TH1F * h1
Definition legend1.C:5