Logo ROOT   6.08/07
Reference Guide
TGeoBuilder.h
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 #ifndef ROOT_TGeoBuilder
13 #define ROOT_TGeoBuilder
14 
15 #ifndef ROOT_TObject
16 #include "TObject.h"
17 #endif
18 
19 class TGeoMaterial;
20 class TGeoMatrix;
21 class TGeoMedium;
22 class TGeoShape;
23 class TGeoVolume;
24 class TGeoVolumeAssembly;
25 class TGeoVolumeMulti;
26 class TGeoManager;
27 
28 class TGeoBuilder : public TObject
29 {
30 protected:
31  static TGeoBuilder *fgInstance; //! static pointer to singleton
32 
33  TGeoBuilder();
34  TGeoBuilder(const TGeoBuilder&);
36 
37 private :
38  TGeoManager *fGeometry; //! current geometry
39 
40  void SetGeometry(TGeoManager *geom) {fGeometry = geom;}
41 
42 public :
43  virtual ~TGeoBuilder();
44 
45  static TGeoBuilder *Instance(TGeoManager *geom);
46 
47  Int_t AddMaterial(TGeoMaterial *material);
49  Int_t AddShape(TGeoShape *shape);
50  void RegisterMatrix(TGeoMatrix *matrix);
51 
52  TGeoVolume *MakeArb8(const char *name, TGeoMedium *medium,
53  Double_t dz, Double_t *vertices=0);
54  TGeoVolume *MakeBox(const char *name, TGeoMedium *medium,
55  Double_t dx, Double_t dy, Double_t dz);
56  TGeoVolume *MakeCone(const char *name, TGeoMedium *medium,
57  Double_t dz, Double_t rmin1, Double_t rmax1,
58  Double_t rmin2, Double_t rmax2);
59  TGeoVolume *MakeCons(const char *name, TGeoMedium *medium,
60  Double_t dz, Double_t rmin1, Double_t rmax1,
61  Double_t rmin2, Double_t rmax2,
62  Double_t phi1, Double_t phi2);
63  TGeoVolume *MakeCtub(const char *name, TGeoMedium *medium,
64  Double_t rmin, Double_t rmax, Double_t dz, Double_t phi1, Double_t phi2,
65  Double_t lx, Double_t ly, Double_t lz, Double_t tx, Double_t ty, Double_t tz);
66  TGeoVolume *MakeEltu(const char *name, TGeoMedium *medium,
68  TGeoVolume *MakeGtra(const char *name, TGeoMedium *medium,
69  Double_t dz, Double_t theta, Double_t phi, Double_t twist, Double_t h1,
70  Double_t bl1, Double_t tl1, Double_t alpha1, Double_t h2, Double_t bl2,
71  Double_t tl2, Double_t alpha2);
72  TGeoVolume *MakePara(const char *name, TGeoMedium *medium,
73  Double_t dx, Double_t dy, Double_t dz,
74  Double_t alpha, Double_t theta, Double_t phi);
75  TGeoVolume *MakePcon(const char *name, TGeoMedium *medium,
76  Double_t phi, Double_t dphi, Int_t nz);
77  TGeoVolume *MakeParaboloid(const char *name, TGeoMedium *medium,
78  Double_t rlo, Double_t rhi, Double_t dz);
79  TGeoVolume *MakeHype(const char *name, TGeoMedium *medium,
80  Double_t rin, Double_t stin, Double_t rout, Double_t stout, Double_t dz);
81  TGeoVolume *MakePgon(const char *name, TGeoMedium *medium,
82  Double_t phi, Double_t dphi, Int_t nedges, Int_t nz);
83  TGeoVolume *MakeSphere(const char *name, TGeoMedium *medium,
84  Double_t rmin, Double_t rmax,
85  Double_t themin=0, Double_t themax=180,
86  Double_t phimin=0, Double_t phimax=360);
87  TGeoVolume *MakeTorus(const char *name, TGeoMedium *medium, Double_t r,
88  Double_t rmin, Double_t rmax, Double_t phi1=0, Double_t dphi=360);
89  TGeoVolume *MakeTrap(const char *name, TGeoMedium *medium,
90  Double_t dz, Double_t theta, Double_t phi, Double_t h1,
91  Double_t bl1, Double_t tl1, Double_t alpha1, Double_t h2, Double_t bl2,
92  Double_t tl2, Double_t alpha2);
93  TGeoVolume *MakeTrd1(const char *name, TGeoMedium *medium,
94  Double_t dx1, Double_t dx2, Double_t dy, Double_t dz);
95  TGeoVolume *MakeTrd2(const char *name, TGeoMedium *medium,
96  Double_t dx1, Double_t dx2, Double_t dy1, Double_t dy2,
97  Double_t dz);
98  TGeoVolume *MakeTube(const char *name, TGeoMedium *medium,
99  Double_t rmin, Double_t rmax, Double_t dz);
100  TGeoVolume *MakeTubs(const char *name, TGeoMedium *medium,
101  Double_t rmin, Double_t rmax, Double_t dz,
102  Double_t phi1, Double_t phi2);
103  TGeoVolume *MakeXtru(const char *name, TGeoMedium *medium,
104  Int_t nz);
105  TGeoVolumeAssembly *MakeVolumeAssembly(const char *name);
106  TGeoVolumeMulti *MakeVolumeMulti(const char *name, TGeoMedium *medium);
107 
108  //--- GEANT3-like geometry creation
109  TGeoVolume *Division(const char *name, const char *mother, Int_t iaxis, Int_t ndiv,
110  Double_t start, Double_t step, Int_t numed=0, Option_t *option="");
111  void Matrix(Int_t index, Double_t theta1, Double_t phi1,
112  Double_t theta2, Double_t phi2,
113  Double_t theta3, Double_t phi3);
114  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);
115  TGeoMaterial *Mixture(const char *name, Float_t *a, Float_t *z, Double_t dens,
116  Int_t nelem, Float_t *wmat, Int_t uid);
117  TGeoMaterial *Mixture(const char *name, Double_t *a, Double_t *z, Double_t dens,
118  Int_t nelem, Double_t *wmat, Int_t uid);
119  TGeoMedium *Medium(const char *name, Int_t numed, Int_t nmat, Int_t isvol,
120  Int_t ifield, Double_t fieldm, Double_t tmaxfd,
121  Double_t stemax, Double_t deemax, Double_t epsil,
122  Double_t stmin);
123  void Node(const char *name, Int_t nr, const char *mother,
124  Double_t x, Double_t y, Double_t z, Int_t irot,
125  Bool_t isOnly, Float_t *upar, Int_t npar=0);
126  void Node(const char *name, Int_t nr, const char *mother,
127  Double_t x, Double_t y, Double_t z, Int_t irot,
128  Bool_t isOnly, Double_t *upar, Int_t npar=0);
129  TGeoVolume *Volume(const char *name, const char *shape, Int_t nmed,
130  Float_t *upar, Int_t npar=0);
131  TGeoVolume *Volume(const char *name, const char *shape, Int_t nmed,
132  Double_t *upar, Int_t npar=0);
133 
134  ClassDef(TGeoBuilder, 0) // geometry builder singleton
135 };
136 
137 #endif
138 
Int_t AddShape(TGeoShape *shape)
Add a shape to the list. Returns index of the shape in list.
Volume families.
Definition: TGeoVolume.h:269
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.
The manager class for any TGeo geometry.
Definition: TGeoManager.h:38
TGeoVolumeAssembly * MakeVolumeAssembly(const char *name)
Make an assembly of volumes.
Volume assemblies.
Definition: TGeoVolume.h:320
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.
float Float_t
Definition: RtypesCore.h:53
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.
const char Option_t
Definition: RtypesCore.h:62
Geometrical transformation package.
Definition: TGeoMatrix.h:40
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, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition: TGeoVolume.h:61
void SetGeometry(TGeoManager *geom)
current geometry
Definition: TGeoBuilder.h:40
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.
Base class describing materials.
Definition: TGeoMaterial.h:35
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
TArc * a
Definition: textangle.C:12
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.
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)
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.
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:254
TGeoVolume * MakeArb8(const char *name, TGeoMedium *medium, Double_t dz, Double_t *vertices=0)
Make an TGeoArb8 volume.
static TGeoBuilder * fgInstance
Definition: TGeoBuilder.h:31
TH1F * h1
Definition: legend1.C:5
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.
Base abstract class for all shapes.
Definition: TGeoShape.h:27
Int_t AddMaterial(TGeoMaterial *material)
Add a material to the list. Returns index of the material in list.
TRandom2 r(17)
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.
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 ...
TGeoVolumeMulti * MakeVolumeMulti(const char *name, TGeoMedium *medium)
Make a TGeoVolumeMulti handling a list of volumes.
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.
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.
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 * 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.
TGeoManager * fGeometry
Definition: TGeoBuilder.h:38
double Double_t
Definition: RtypesCore.h:55
void RegisterMatrix(TGeoMatrix *matrix)
Register a matrix to the list of matrices.
Int_t AddTransformation(TGeoMatrix *matrix)
Add a matrix to the list. Returns index of the matrix in list.
Double_t y[n]
Definition: legend1.C:17
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.
TGeoBuilder()
static pointer to singleton
Definition: TGeoBuilder.cxx:57
TGeoBuilder & operator=(const TGeoBuilder &)
Assignment.
Definition: TGeoBuilder.cxx:83
Media are used to store properties related to tracking and which are useful only when using geometry ...
Definition: TGeoMedium.h:25
virtual ~TGeoBuilder()
Destructor.
Definition: TGeoBuilder.cxx:75
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.
Utility class for creating geometry objects.These will be associated with the current selected geomet...
Definition: TGeoBuilder.h:28
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.
Mother of all ROOT objects.
Definition: TObject.h:37
you should not use this method at all Int_t Int_t z
Definition: TRolke.cxx:630
static TGeoBuilder * Instance(TGeoManager *geom)
Return pointer to singleton.
Definition: TGeoBuilder.cxx:92
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
Definition: TRolke.cxx:630
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 &#39;mat<index>&#39;.
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 * 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.
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.
char name[80]
Definition: TGX11.cxx:109
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 * 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.