69 Error(
"copy constructor",
"copying not allowed for TGeoBuilder");
85 Error(
"Assignment",
"assignment not allowed for TGeoBuilder");
95 printf(
"ERROR: Cannot create geometry builder with NULL geometry\n");
108 if (!material)
return -1;
112 materials->
Add(material);
122 if (!matrix)
return -1;
135 if (!shape)
return -1;
191 Warning(
"MakePara",
"parallelepiped %s having alpha=0, theta=0 -> making box instead", name);
192 return MakeBox(name, medium, dx, dy, dz);
195 para =
new TGeoPara(name, dx, dy, dz, alpha, theta, phi);
236 Error(
"MakeTube",
"tube %s, Rmin=%g greater than Rmax=%g", name,rmin,rmax);
325 TGeoCtub *ctub =
new TGeoCtub(name, rmin, rmax, dz, phi1, phi2, lx, ly, lz, tx, ty, tz);
432 TGeoTrap *trap =
new TGeoTrap(name, dz, theta, phi, h1, bl1, tl1, alpha1, h2, bl2,
446 TGeoGtra *gtra =
new TGeoGtra(name, dz, theta, phi, twist, h1, bl1, tl1, alpha1, h2, bl2,
499 sname = sname.
Strip();
500 const char *vname = sname.
Data();
502 smname = smname.
Strip();
503 const char *mname = smname.
Data();
507 if (amother)
return amother->
Divide(vname,iaxis,ndiv,start,step,numed, option);
509 Error(
"Division",
"VOLUME: \"%s\" not defined",mname);
555 for (i=0;i<nelem;i++) {
571 for (i=0;i<nelem;i++) {
602 return new TGeoMedium(name,numed,nmat,isvol,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
632 mname = mname.
Strip();
633 Error(
"Node",
"Mother VOLUME \"%s\" not defined",mname.
Data());
639 if (
gDebug > 0)
Info(
"Node",
"Calling gspos, mother=%s, name=%s, nr=%d, x=%g, y=%g, z=%g, irot=%d, konly=%i",mother,name,nr,x,y,z,irot,(
Int_t)isOnly);
645 vname = vname.
Strip();
646 Error(
"Node",
"VOLUME: \"%s\" not defined",vname.
Data());
650 Error(
"Node",
"cannot add multiple-volume object %s as node", volume->
GetName());
659 Warning(
"Node",
"volume: %s is defined as single -> ignoring shape parameters", volume->
GetName());
660 Node(name,nr,mother,x,y,z,irot,isOnly, upar);
664 vname = vname.
Strip();
665 Error(
"Node",
"VOLUME: \"%s\" not defined ",vname.
Data());
672 volume =
MakeBox(name,medium,upar[0],upar[1],upar[2]);
674 volume =
MakeTrd1(name,medium,upar[0],upar[1],upar[2],upar[3]);
676 volume =
MakeTrd2(name,medium,upar[0],upar[1],upar[2],upar[3],upar[4]);
678 volume =
MakeTrap(name,medium,upar[0],upar[1],upar[2],upar[3],upar[4],upar[5],upar[6],upar[7],upar[8],upar[9],upar[10]);
680 volume =
MakeGtra(name,medium,upar[0],upar[1],upar[2],upar[3],upar[4],upar[5],upar[6],upar[7],upar[8],upar[9],upar[10],upar[11]);
682 volume =
MakeTube(name,medium,upar[0],upar[1],upar[2]);
684 volume =
MakeTubs(name,medium,upar[0],upar[1],upar[2],upar[3],upar[4]);
686 volume =
MakeCone(name,medium,upar[0],upar[1],upar[2],upar[3],upar[4]);
688 volume =
MakeCons(name,medium,upar[0],upar[1],upar[2],upar[3],upar[4],upar[5],upar[6]);
693 ((
TGeoPgon*)volume->
GetShape())->DefineSection(i,upar[3*i+4],upar[3*i+5],upar[3*i+6]);
696 volume =
MakePcon(name,medium,upar[0],upar[1],(
Int_t)upar[2]);
699 ((
TGeoPcon*)volume->
GetShape())->DefineSection(i,upar[3*i+3],upar[3*i+4],upar[3*i+5]);
702 volume =
MakeEltu(name,medium,upar[0],upar[1],upar[2]);
704 volume =
MakeSphere(name,medium,upar[0],upar[1],upar[2],upar[3],upar[4],upar[5]);
706 volume =
MakeCtub(name,medium,upar[0],upar[1],upar[2],upar[3],upar[4],upar[5],upar[6],upar[7],upar[8],upar[9],upar[10]);
708 volume =
MakePara(name,medium,upar[0],upar[1],upar[2],upar[3],upar[4],upar[5]);
710 Error(
"Node",
"cannot create shape %s",sh.
Data());
727 Fatal(
"Node",
"Node %s/%s_%d rotation %i not found",mother, name, nr ,irot);
736 if (isOnly) amother->
AddNode(volume,nr);
772 mname = mname.
Strip();
773 Error(
"Node",
"Mother VOLUME \"%s\" not defined",mname.
Data());
779 if (
gDebug > 0)
Info(
"Node",
"Calling gspos, mother=%s, name=%s, nr=%d, x=%g, y=%g, z=%g, irot=%d, konly=%i",mother,name,nr,x,y,z,irot,(
Int_t)isOnly);
785 vname = vname.
Strip();
786 Error(
"Node",
"VOLUME: \"%s\" not defined",vname.
Data());
790 Error(
"Node",
"cannot add multiple-volume object %s as node", volume->
GetName());
799 Warning(
"Node",
"volume: %s is defined as single -> ignoring shape parameters", volume->
GetName());
800 Node(name,nr,mother,x,y,z,irot,isOnly, upar);
804 vname = vname.
Strip();
805 Error(
"Node",
"VOLUME: \"%s\" not defined ",vname.
Data());
812 volume =
MakeBox(name,medium,upar[0],upar[1],upar[2]);
814 volume =
MakeTrd1(name,medium,upar[0],upar[1],upar[2],upar[3]);
816 volume =
MakeTrd2(name,medium,upar[0],upar[1],upar[2],upar[3],upar[4]);
818 volume =
MakeTrap(name,medium,upar[0],upar[1],upar[2],upar[3],upar[4],upar[5],upar[6],upar[7],upar[8],upar[9],upar[10]);
820 volume =
MakeGtra(name,medium,upar[0],upar[1],upar[2],upar[3],upar[4],upar[5],upar[6],upar[7],upar[8],upar[9],upar[10],upar[11]);
822 volume =
MakeTube(name,medium,upar[0],upar[1],upar[2]);
824 volume =
MakeTubs(name,medium,upar[0],upar[1],upar[2],upar[3],upar[4]);
826 volume =
MakeCone(name,medium,upar[0],upar[1],upar[2],upar[3],upar[4]);
828 volume =
MakeCons(name,medium,upar[0],upar[1],upar[2],upar[3],upar[4],upar[5],upar[6]);
833 ((
TGeoPgon*)volume->
GetShape())->DefineSection(i,upar[3*i+4],upar[3*i+5],upar[3*i+6]);
836 volume =
MakePcon(name,medium,upar[0],upar[1],(
Int_t)upar[2]);
839 ((
TGeoPcon*)volume->
GetShape())->DefineSection(i,upar[3*i+3],upar[3*i+4],upar[3*i+5]);
842 volume =
MakeEltu(name,medium,upar[0],upar[1],upar[2]);
844 volume =
MakeSphere(name,medium,upar[0],upar[1],upar[2],upar[3],upar[4],upar[5]);
846 volume =
MakeCtub(name,medium,upar[0],upar[1],upar[2],upar[3],upar[4],upar[5],upar[6],upar[7],upar[8],upar[9],upar[10]);
848 volume =
MakePara(name,medium,upar[0],upar[1],upar[2],upar[3],upar[4],upar[5]);
850 Error(
"Node",
"cannot create shape %s",sh.
Data());
867 Fatal(
"Node",
"Node %s/%s_%d rotation %i not found",mother, name, nr ,irot);
876 if (isOnly) amother->
AddNode(volume,nr);
900 Error(
"Volume",
"cannot create volume: %s, medium: %d is unknown",name,nmed);
905 sname = sname.
Strip();
906 const char *vname = sname.
Data();
913 Error(
"Volume",
"volume multi: %s not created",vname);
921 volume =
MakeBox(vname,medium,upar[0],upar[1],upar[2]);
923 volume =
MakeTrd1(vname,medium,upar[0],upar[1],upar[2],upar[3]);
925 volume =
MakeTrd2(vname,medium,upar[0],upar[1],upar[2],upar[3],upar[4]);
927 volume =
MakeTrap(vname,medium,upar[0],upar[1],upar[2],upar[3],upar[4],upar[5],upar[6],upar[7],upar[8],upar[9],upar[10]);
929 volume =
MakeGtra(vname,medium,upar[0],upar[1],upar[2],upar[3],upar[4],upar[5],upar[6],upar[7],upar[8],upar[9],upar[10],upar[11]);
931 volume =
MakeTube(vname,medium,upar[0],upar[1],upar[2]);
933 volume =
MakeTubs(vname,medium,upar[0],upar[1],upar[2],upar[3],upar[4]);
935 volume =
MakeCone(vname,medium,upar[0],upar[1],upar[2],upar[3],upar[4]);
937 volume =
MakeCons(vname,medium,upar[0],upar[1],upar[2],upar[3],upar[4],upar[5],upar[6]);
942 ((
TGeoPgon*)volume->
GetShape())->DefineSection(i,upar[3*i+4],upar[3*i+5],upar[3*i+6]);
945 volume =
MakePcon(vname,medium,upar[0],upar[1],(
Int_t)upar[2]);
948 ((
TGeoPcon*)volume->
GetShape())->DefineSection(i,upar[3*i+3],upar[3*i+4],upar[3*i+5]);
951 volume =
MakeEltu(vname,medium,upar[0],upar[1],upar[2]);
953 volume =
MakeSphere(vname,medium,upar[0],upar[1],upar[2],upar[3],upar[4],upar[5]);
955 volume =
MakeCtub(vname,medium,upar[0],upar[1],upar[2],upar[3],upar[4],upar[5],upar[6],upar[7],upar[8],upar[9],upar[10]);
957 volume =
MakePara(vname,medium,upar[0],upar[1],upar[2],upar[3],upar[4],upar[5]);
959 volume =
MakeTorus(vname,medium,upar[0],upar[1],upar[2],upar[3],upar[4]);
963 Error(
"Volume",
"volume: %s not created",vname);
985 Error(
"Volume",
"cannot create volume: %s, medium: %d is unknown",name,nmed);
990 sname = sname.
Strip();
991 const char *vname = sname.
Data();
998 Error(
"Volume",
"volume multi: %s not created",vname);
1006 volume =
MakeBox(vname,medium,upar[0],upar[1],upar[2]);
1008 volume =
MakeTrd1(vname,medium,upar[0],upar[1],upar[2],upar[3]);
1010 volume =
MakeTrd2(vname,medium,upar[0],upar[1],upar[2],upar[3],upar[4]);
1012 volume =
MakeTrap(vname,medium,upar[0],upar[1],upar[2],upar[3],upar[4],upar[5],upar[6],upar[7],upar[8],upar[9],upar[10]);
1014 volume =
MakeGtra(vname,medium,upar[0],upar[1],upar[2],upar[3],upar[4],upar[5],upar[6],upar[7],upar[8],upar[9],upar[10],upar[11]);
1016 volume =
MakeTube(vname,medium,upar[0],upar[1],upar[2]);
1018 volume =
MakeTubs(vname,medium,upar[0],upar[1],upar[2],upar[3],upar[4]);
1020 volume =
MakeCone(vname,medium,upar[0],upar[1],upar[2],upar[3],upar[4]);
1022 volume =
MakeCons(vname,medium,upar[0],upar[1],upar[2],upar[3],upar[4],upar[5],upar[6]);
1026 for (i=0;i<nz;i++) {
1027 ((
TGeoPgon*)volume->
GetShape())->DefineSection(i,upar[3*i+4],upar[3*i+5],upar[3*i+6]);
1030 volume =
MakePcon(vname,medium,upar[0],upar[1],(
Int_t)upar[2]);
1032 for (i=0;i<nz;i++) {
1033 ((
TGeoPcon*)volume->
GetShape())->DefineSection(i,upar[3*i+3],upar[3*i+4],upar[3*i+5]);
1036 volume =
MakeEltu(vname,medium,upar[0],upar[1],upar[2]);
1038 volume =
MakeSphere(vname,medium,upar[0],upar[1],upar[2],upar[3],upar[4],upar[5]);
1040 volume =
MakeCtub(vname,medium,upar[0],upar[1],upar[2],upar[3],upar[4],upar[5],upar[6],upar[7],upar[8],upar[9],upar[10]);
1042 volume =
MakePara(vname,medium,upar[0],upar[1],upar[2],upar[3],upar[4],upar[5]);
1044 volume =
MakeTorus(vname,medium,upar[0],upar[1],upar[2],upar[3],upar[4]);
1048 Error(
"Volume",
"volume: %s not created",vname);
TGeoVolumeMulti * MakeVolumeMulti(const char *name, TGeoMedium *medium)
Make a TGeoVolumeMulti handling a list of volumes.
virtual const char * GetName() const
Returns name of object.
virtual UInt_t GetUniqueID() const
Return the unique object id.
Int_t AddShape(TGeoShape *shape)
Add a shape to the list. Returns index of the shape in list.
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.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
The manager class for any TGeo geometry.
TGeoVolumeAssembly * MakeVolumeAssembly(const char *name)
Make an assembly of volumes.
void DefineElement(Int_t iel, Double_t a, Double_t z, Double_t weight)
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.
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.
Gtra is a twisted trapezoid.
Geometrical transformation package.
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.
virtual void SetName(const char *name)
Set the name of the TNamed.
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
virtual void AddNodeOverlap(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=0, Option_t *option="")
Add a TGeoNode to the list of nodes.
TGeoVolume * GetVolume(const char *name) const
Search for a named volume. All trailing blanks stripped.
void SetGeometry(TGeoManager *geom)
current geometry
Class describing translations.
TObjArray * GetListOfGVolumes() const
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.
void ToLower()
Change string to lower-case.
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)
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
A trapezoid with only x length varying with z.
TList * GetListOfMaterials() const
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.
static Double_t Tolerance()
A phi segment of a conical tube.
void AddVolume(TGeoVolume *vol)
Add a volume with valid shape to the list of volumes.
virtual TObject * FindObject(const char *name) const
Find an object in this collection using its name.
TGeoVolume * MakeArb8(const char *name, TGeoMedium *medium, Double_t dz, Double_t *vertices=0)
Make an TGeoArb8 volume.
TGeoMedium * GetMedium() const
TRAP is a general trapezoid, i.e.
void SetIndex(Int_t index)
static TGeoBuilder * fgInstance
virtual TGeoVolume * Divide(const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step, Int_t numed=0, Option_t *option="")
Division a la G3.
virtual void SetUniqueID(UInt_t uid)
Set the unique object id.
virtual void AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=0, Option_t *option="")
Add a TGeoNode to the list of nodes.
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 SetShape(const TGeoShape *shape)
set the shape associated with this volume
A trapezoid with both x and y lengths varying with z.
Base abstract class for all shapes.
virtual void AddAtAndExpand(TObject *obj, Int_t idx)
Add object at position idx.
Int_t AddMaterial(TGeoMaterial *material)
Add a material to the list. Returns index of the material in list.
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.
Class describing rotation + translation.
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 ...
TObjArray * GetListOfShapes() const
TGeoVolumeMulti * MakeVolumeMulti(const char *name, TGeoMedium *medium)
Make a TGeoVolumeMulti handling a list of volumes.
Bool_t IsRegistered() const
Hyperboloid class defined by 5 parameters.
Int_t GetEntriesFast() const
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void RegisterYourself()
Register the matrix in the current manager, which will become the owner.
TSubString Strip(EStripType s=kTrailing, char c=' ') const
Return a substring of self stripped at beginning and/or end.
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.
TObjArray * GetListOfMatrices() const
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.
Class describing rotations.
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.
TGeoMedium * GetMedium(const char *medium) const
Search for a named tracking medium. All trailing blanks stripped.
A tube segment cut with 2 planes.
An extrusion with fixed outline shape in x-y and a sequence of z extents (segments).
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.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
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.
An arbitrary trapezoid with less than 8 vertices standing on.
TGeoBuilder()
static pointer to singleton
TGeoBuilder & operator=(const TGeoBuilder &)
Assignment.
Media are used to store properties related to tracking and which are useful only when using geometry ...
virtual ~TGeoBuilder()
Destructor.
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...
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.
you should not use this method at all Int_t Int_t z
static TGeoBuilder * Instance(TGeoManager *geom)
Return pointer to singleton.
virtual void Add(TObject *obj)
TGeoVolume * FindVolumeFast(const char *name, Bool_t multi=kFALSE)
Fast search for a named volume. All trailing blanks stripped.
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
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>'.
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
TGeoShape * GetShape() const
TGeoVolume * Volume(const char *name, const char *shape, Int_t nmed, Float_t *upar, Int_t npar=0)
Create a volume in GEANT3 style.
virtual const char * GetName() const
Returns name of object.
virtual Int_t GetSize() const
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...
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
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.
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.
TObjArray * GetListOfGShapes() const
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
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.
virtual const char * GetTitle() const
Returns title of object.
Bool_t IsRunTimeShape() const
const char * Data() const