75 printf(
"ERROR: Cannot create geometry builder with NULL geometry\n");
94 materials->
Add(material);
123 index = shapes->GetEntriesFast();
124 shapes->AddAtAndExpand(shape,
index);
134 if (
matrix->IsRegistered())
158 if (
box->IsRunTimeShape()) {
174 Warning(
"MakePara",
"parallelepiped %s having alpha=0, theta=0 -> making box instead",
name);
180 if (
para->IsRunTimeShape()) {
221 if (
tube->IsRunTimeShape()) {
238 if (
tubs->IsRunTimeShape()) {
254 if (
eltu->IsRunTimeShape()) {
271 if (
hype->IsRunTimeShape()) {
287 if (
parab->IsRunTimeShape()) {
303 TGeoCtub *
ctub =
new TGeoCtub(
name,
rmin,
rmax,
dz,
phi1,
phi2,
lx,
ly,
lz,
tx,
ty,
tz);
316 if (
cone->IsRunTimeShape()) {
333 if (
cons->IsRunTimeShape()) {
371 if (
trd1->IsRunTimeShape()) {
388 if (
trd2->IsRunTimeShape()) {
404 TGeoTrap *
trap =
new TGeoTrap(
name,
dz, theta, phi,
h1,
bl1,
tl1,
alpha1, h2,
bl2,
tl2,
alpha2);
416 TGeoGtra *
gtra =
new TGeoGtra(
name,
dz, theta, phi,
twist,
h1,
bl1,
tl1,
alpha1, h2,
bl2,
tl2,
alpha2);
479 Error(
"Division",
"VOLUME: \"%s\" not defined",
mname);
501 rot->RegisterYourself();
525 for (i = 0; i <
nelem; i++) {
541 for (i = 0; i <
nelem; i++) {
570 return new TGeoMedium(
name,
numed,
nmat,
isvol,
ifield,
fieldm,
tmaxfd,
stemax,
deemax,
epsil,
stmin);
601 Error(
"Node",
"Mother VOLUME \"%s\" not defined",
mname.Data());
608 Info(
"Node",
"Calling gspos, mother=%s, name=%s, nr=%d, x=%g, y=%g, z=%g, irot=%d, konly=%i",
mother,
name,
nr,
617 Error(
"Node",
"VOLUME: \"%s\" not defined",
vname.Data());
621 Error(
"Node",
"cannot add multiple-volume object %s as node", volume->
GetName());
630 Warning(
"Node",
"volume: %s is defined as single -> ignoring shape parameters", volume->
GetName());
636 Error(
"Node",
"VOLUME: \"%s\" not defined ",
vname.Data());
642 if (
sh.Contains(
"box")) {
644 }
else if (
sh.Contains(
"trd1")) {
646 }
else if (
sh.Contains(
"trd2")) {
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],
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],
654 }
else if (
sh.Contains(
"tube")) {
656 }
else if (
sh.Contains(
"tubs")) {
658 }
else if (
sh.Contains(
"cone")) {
660 }
else if (
sh.Contains(
"cons")) {
662 }
else if (
sh.Contains(
"pgon")) {
665 for (i = 0; i <
nz; i++) {
668 }
else if (
sh.Contains(
"pcon")) {
671 for (i = 0; i <
nz; i++) {
674 }
else if (
sh.Contains(
"eltu")) {
676 }
else if (
sh.Contains(
"sphe")) {
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],
681 }
else if (
sh.Contains(
"para")) {
684 Error(
"Node",
"cannot create shape %s",
sh.Data());
689 vmulti->AddVolume(volume);
753 Error(
"Node",
"Mother VOLUME \"%s\" not defined",
mname.Data());
760 Info(
"Node",
"Calling gspos, mother=%s, name=%s, nr=%d, x=%g, y=%g, z=%g, irot=%d, konly=%i",
mother,
name,
nr,
769 Error(
"Node",
"VOLUME: \"%s\" not defined",
vname.Data());
773 Error(
"Node",
"cannot add multiple-volume object %s as node", volume->
GetName());
782 Warning(
"Node",
"volume: %s is defined as single -> ignoring shape parameters", volume->
GetName());
788 Error(
"Node",
"VOLUME: \"%s\" not defined ",
vname.Data());
794 if (
sh.Contains(
"box")) {
796 }
else if (
sh.Contains(
"trd1")) {
798 }
else if (
sh.Contains(
"trd2")) {
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],
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],
806 }
else if (
sh.Contains(
"tube")) {
808 }
else if (
sh.Contains(
"tubs")) {
810 }
else if (
sh.Contains(
"cone")) {
812 }
else if (
sh.Contains(
"cons")) {
814 }
else if (
sh.Contains(
"pgon")) {
817 for (i = 0; i <
nz; i++) {
820 }
else if (
sh.Contains(
"pcon")) {
823 for (i = 0; i <
nz; i++) {
826 }
else if (
sh.Contains(
"eltu")) {
828 }
else if (
sh.Contains(
"sphe")) {
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],
833 }
else if (
sh.Contains(
"para")) {
836 Error(
"Node",
"cannot create shape %s",
sh.Data());
841 vmulti->AddVolume(volume);
891 Error(
"Volume",
"cannot create volume: %s, medium: %d is unknown",
name,
nmed);
904 Error(
"Volume",
"volume multi: %s not created",
vname);
911 if (
sh.Contains(
"box")) {
913 }
else if (
sh.Contains(
"trd1")) {
915 }
else if (
sh.Contains(
"trd2")) {
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],
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],
923 }
else if (
sh.Contains(
"tube")) {
925 }
else if (
sh.Contains(
"tubs")) {
927 }
else if (
sh.Contains(
"cone")) {
929 }
else if (
sh.Contains(
"cons")) {
931 }
else if (
sh.Contains(
"pgon")) {
934 for (i = 0; i <
nz; i++) {
937 }
else if (
sh.Contains(
"pcon")) {
940 for (i = 0; i <
nz; i++) {
943 }
else if (
sh.Contains(
"eltu")) {
945 }
else if (
sh.Contains(
"sphe")) {
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],
950 }
else if (
sh.Contains(
"para")) {
952 }
else if (
sh.Contains(
"tor")) {
957 Error(
"Volume",
"volume: %s not created",
vname);
977 Error(
"Volume",
"cannot create volume: %s, medium: %d is unknown",
name,
nmed);
990 Error(
"Volume",
"volume multi: %s not created",
vname);
997 if (
sh.Contains(
"box")) {
999 }
else if (
sh.Contains(
"trd1")) {
1001 }
else if (
sh.Contains(
"trd2")) {
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],
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],
1009 }
else if (
sh.Contains(
"tube")) {
1011 }
else if (
sh.Contains(
"tubs")) {
1013 }
else if (
sh.Contains(
"cone")) {
1015 }
else if (
sh.Contains(
"cons")) {
1017 }
else if (
sh.Contains(
"pgon")) {
1020 for (i = 0; i <
nz; i++) {
1023 }
else if (
sh.Contains(
"pcon")) {
1026 for (i = 0; i <
nz; i++) {
1029 }
else if (
sh.Contains(
"eltu")) {
1031 }
else if (
sh.Contains(
"sphe")) {
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],
1036 }
else if (
sh.Contains(
"para")) {
1038 }
else if (
sh.Contains(
"tor")) {
1043 Error(
"Volume",
"volume: %s not created",
vname);
int Int_t
Signed integer 4 bytes (int)
float Float_t
Float 4 bytes (float)
const char Option_t
Option string (const char)
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
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
Int_t gDebug
Global variable setting the debug level. Set to 0 to disable, increase it in steps of 1 to increase t...
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...
Utility class for creating geometry objects.These will be associated with the current selected geomet...
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.
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
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.
A cone segment is a cone having a range in phi.
The cones are defined by 5 parameters:
The cut tubes constructor has the form:
An elliptical tube is defined by the two semi-axes A and B.
A hyperboloid is represented as a solid limited by two planes perpendicular to the Z axis (top and bo...
The manager class for any TGeo geometry.
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.
Media are used to store properties related to tracking and which are useful only when using geometry ...
void DefineElement(Int_t iel, Double_t a, Double_t z, Double_t weight)
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.
Polygons are defined in the same way as polycones, the difference being just that the segments betwee...
Class describing rotations.
Base abstract class for all shapes.
Bool_t IsRunTimeShape() const
static Double_t Tolerance()
TGeoSphere are not just balls having internal and external radii, but sectors of a sphere having defi...
The torus is defined by its axial radius, its inner and outer radius.
Class describing translations.
A trapezoid with only X varying with Z.
A trapezoid with only X varying with Z.
A tube segment is a tube having a range in phi.
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
void SetShape(const TGeoShape *shape)
set the shape associated with this volume
TGeoShape * GetShape() const
A TGeoXtru shape is represented by the extrusion of an arbitrary polygon with fixed outline between s...
void Add(TObject *obj) override
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
const char * GetName() const override
Returns name of object.
TObject * FindObject(const char *name) const override
Find an object in this collection using its name.
Mother of all ROOT objects.
virtual const char * GetName() const
Returns name of object.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
virtual void SetUniqueID(UInt_t uid)
Set the unique object id.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)