76 printf(
"ERROR: Cannot create geometry builder with NULL geometry\n");
95 materials->
Add(material);
159 if (
box->IsRunTimeShape()) {
175 Warning(
"MakePara",
"parallelepiped %s having alpha=0, theta=0 -> making box instead",
name);
179 para =
new TGeoPara(
name, dx, dy, dz, alpha, theta, phi);
218 Error(
"MakeTube",
"tube %s, Rmin=%g greater than Rmax=%g",
name, rmin, rmax);
304 TGeoCtub *ctub =
new TGeoCtub(
name, rmin, rmax, dz, phi1, phi2, lx, ly, lz, tx, ty, tz);
405 TGeoTrap *trap =
new TGeoTrap(
name, dz, theta, phi,
h1, bl1, tl1, alpha1, h2, bl2, tl2, alpha2);
417 TGeoGtra *gtra =
new TGeoGtra(
name, dz, theta, phi, twist,
h1, bl1, tl1, alpha1, h2, bl2, tl2, alpha2);
468 sname = sname.
Strip();
469 const char *vname = sname.
Data();
471 smname = smname.
Strip();
472 const char *mname = smname.
Data();
478 return amother->
Divide(vname, iaxis, ndiv, start, step, numed,
option);
480 Error(
"Division",
"VOLUME: \"%s\" not defined", mname);
526 for (i = 0; i < nelem; i++) {
542 for (i = 0; i < nelem; i++) {
571 return new TGeoMedium(
name, numed, nmat, isvol, ifield, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
601 mname = mname.
Strip();
602 Error(
"Node",
"Mother VOLUME \"%s\" not defined", mname.
Data());
609 Info(
"Node",
"Calling gspos, mother=%s, name=%s, nr=%d, x=%g, y=%g, z=%g, irot=%d, konly=%i", mother,
name, nr,
617 vname = vname.
Strip();
618 Error(
"Node",
"VOLUME: \"%s\" not defined", vname.
Data());
622 Error(
"Node",
"cannot add multiple-volume object %s as node", volume->
GetName());
631 Warning(
"Node",
"volume: %s is defined as single -> ignoring shape parameters", volume->
GetName());
632 Node(
name, nr, mother,
x,
y, z, irot, isOnly, upar);
636 vname = vname.
Strip();
637 Error(
"Node",
"VOLUME: \"%s\" not defined ", vname.
Data());
644 volume =
MakeBox(
name, medium, upar[0], upar[1], upar[2]);
646 volume =
MakeTrd1(
name, medium, upar[0], upar[1], upar[2], upar[3]);
648 volume =
MakeTrd2(
name, medium, upar[0], upar[1], upar[2], upar[3], upar[4]);
650 volume =
MakeTrap(
name, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5], upar[6], upar[7],
651 upar[8], upar[9], upar[10]);
653 volume =
MakeGtra(
name, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5], upar[6], upar[7],
654 upar[8], upar[9], upar[10], upar[11]);
656 volume =
MakeTube(
name, medium, upar[0], upar[1], upar[2]);
658 volume =
MakeTubs(
name, medium, upar[0], upar[1], upar[2], upar[3], upar[4]);
660 volume =
MakeCone(
name, medium, upar[0], upar[1], upar[2], upar[3], upar[4]);
662 volume =
MakeCons(
name, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5], upar[6]);
666 for (i = 0; i < nz; i++) {
667 ((
TGeoPgon *)volume->
GetShape())->DefineSection(i, upar[3 * i + 4], upar[3 * i + 5], upar[3 * i + 6]);
672 for (i = 0; i < nz; i++) {
673 ((
TGeoPcon *)volume->
GetShape())->DefineSection(i, upar[3 * i + 3], upar[3 * i + 4], upar[3 * i + 5]);
676 volume =
MakeEltu(
name, medium, upar[0], upar[1], upar[2]);
678 volume =
MakeSphere(
name, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5]);
680 volume =
MakeCtub(
name, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5], upar[6], upar[7],
681 upar[8], upar[9], upar[10]);
683 volume =
MakePara(
name, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5]);
685 Error(
"Node",
"cannot create shape %s", sh.
Data());
703 Fatal(
"Node",
"Node %s/%s_%d rotation %i not found", mother,
name, nr, irot);
753 mname = mname.
Strip();
754 Error(
"Node",
"Mother VOLUME \"%s\" not defined", mname.
Data());
761 Info(
"Node",
"Calling gspos, mother=%s, name=%s, nr=%d, x=%g, y=%g, z=%g, irot=%d, konly=%i", mother,
name, nr,
769 vname = vname.
Strip();
770 Error(
"Node",
"VOLUME: \"%s\" not defined", vname.
Data());
774 Error(
"Node",
"cannot add multiple-volume object %s as node", volume->
GetName());
783 Warning(
"Node",
"volume: %s is defined as single -> ignoring shape parameters", volume->
GetName());
784 Node(
name, nr, mother,
x,
y, z, irot, isOnly, upar);
788 vname = vname.
Strip();
789 Error(
"Node",
"VOLUME: \"%s\" not defined ", vname.
Data());
796 volume =
MakeBox(
name, medium, upar[0], upar[1], upar[2]);
798 volume =
MakeTrd1(
name, medium, upar[0], upar[1], upar[2], upar[3]);
800 volume =
MakeTrd2(
name, medium, upar[0], upar[1], upar[2], upar[3], upar[4]);
802 volume =
MakeTrap(
name, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5], upar[6], upar[7],
803 upar[8], upar[9], upar[10]);
805 volume =
MakeGtra(
name, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5], upar[6], upar[7],
806 upar[8], upar[9], upar[10], upar[11]);
808 volume =
MakeTube(
name, medium, upar[0], upar[1], upar[2]);
810 volume =
MakeTubs(
name, medium, upar[0], upar[1], upar[2], upar[3], upar[4]);
812 volume =
MakeCone(
name, medium, upar[0], upar[1], upar[2], upar[3], upar[4]);
814 volume =
MakeCons(
name, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5], upar[6]);
818 for (i = 0; i < nz; i++) {
819 ((
TGeoPgon *)volume->
GetShape())->DefineSection(i, upar[3 * i + 4], upar[3 * i + 5], upar[3 * i + 6]);
824 for (i = 0; i < nz; i++) {
825 ((
TGeoPcon *)volume->
GetShape())->DefineSection(i, upar[3 * i + 3], upar[3 * i + 4], upar[3 * i + 5]);
828 volume =
MakeEltu(
name, medium, upar[0], upar[1], upar[2]);
830 volume =
MakeSphere(
name, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5]);
832 volume =
MakeCtub(
name, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5], upar[6], upar[7],
833 upar[8], upar[9], upar[10]);
835 volume =
MakePara(
name, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5]);
837 Error(
"Node",
"cannot create shape %s", sh.
Data());
855 Fatal(
"Node",
"Node %s/%s_%d rotation %i not found", mother,
name, nr, irot);
892 Error(
"Volume",
"cannot create volume: %s, medium: %d is unknown",
name, nmed);
897 sname = sname.
Strip();
898 const char *vname = sname.
Data();
905 Error(
"Volume",
"volume multi: %s not created", vname);
913 volume =
MakeBox(vname, medium, upar[0], upar[1], upar[2]);
915 volume =
MakeTrd1(vname, medium, upar[0], upar[1], upar[2], upar[3]);
917 volume =
MakeTrd2(vname, medium, upar[0], upar[1], upar[2], upar[3], upar[4]);
919 volume =
MakeTrap(vname, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5], upar[6], upar[7], upar[8],
922 volume =
MakeGtra(vname, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5], upar[6], upar[7], upar[8],
923 upar[9], upar[10], upar[11]);
925 volume =
MakeTube(vname, medium, upar[0], upar[1], upar[2]);
927 volume =
MakeTubs(vname, medium, upar[0], upar[1], upar[2], upar[3], upar[4]);
929 volume =
MakeCone(vname, medium, upar[0], upar[1], upar[2], upar[3], upar[4]);
931 volume =
MakeCons(vname, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5], upar[6]);
935 for (i = 0; i < nz; i++) {
936 ((
TGeoPgon *)volume->
GetShape())->DefineSection(i, upar[3 * i + 4], upar[3 * i + 5], upar[3 * i + 6]);
939 volume =
MakePcon(vname, medium, upar[0], upar[1], (
Int_t)upar[2]);
941 for (i = 0; i < nz; i++) {
942 ((
TGeoPcon *)volume->
GetShape())->DefineSection(i, upar[3 * i + 3], upar[3 * i + 4], upar[3 * i + 5]);
945 volume =
MakeEltu(vname, medium, upar[0], upar[1], upar[2]);
947 volume =
MakeSphere(vname, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5]);
949 volume =
MakeCtub(vname, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5], upar[6], upar[7], upar[8],
952 volume =
MakePara(vname, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5]);
954 volume =
MakeTorus(vname, medium, upar[0], upar[1], upar[2], upar[3], upar[4]);
958 Error(
"Volume",
"volume: %s not created", vname);
978 Error(
"Volume",
"cannot create volume: %s, medium: %d is unknown",
name, nmed);
983 sname = sname.
Strip();
984 const char *vname = sname.
Data();
991 Error(
"Volume",
"volume multi: %s not created", vname);
999 volume =
MakeBox(vname, medium, upar[0], upar[1], upar[2]);
1001 volume =
MakeTrd1(vname, medium, upar[0], upar[1], upar[2], upar[3]);
1003 volume =
MakeTrd2(vname, medium, upar[0], upar[1], upar[2], upar[3], upar[4]);
1005 volume =
MakeTrap(vname, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5], upar[6], upar[7], upar[8],
1008 volume =
MakeGtra(vname, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5], upar[6], upar[7], upar[8],
1009 upar[9], upar[10], upar[11]);
1011 volume =
MakeTube(vname, medium, upar[0], upar[1], upar[2]);
1013 volume =
MakeTubs(vname, medium, upar[0], upar[1], upar[2], upar[3], upar[4]);
1015 volume =
MakeCone(vname, medium, upar[0], upar[1], upar[2], upar[3], upar[4]);
1017 volume =
MakeCons(vname, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5], upar[6]);
1021 for (i = 0; i < nz; i++) {
1022 ((
TGeoPgon *)volume->
GetShape())->DefineSection(i, upar[3 * i + 4], upar[3 * i + 5], upar[3 * i + 6]);
1025 volume =
MakePcon(vname, medium, upar[0], upar[1], (
Int_t)upar[2]);
1027 for (i = 0; i < nz; i++) {
1028 ((
TGeoPcon *)volume->
GetShape())->DefineSection(i, upar[3 * i + 3], upar[3 * i + 4], upar[3 * i + 5]);
1031 volume =
MakeEltu(vname, medium, upar[0], upar[1], upar[2]);
1033 volume =
MakeSphere(vname, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5]);
1035 volume =
MakeCtub(vname, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5], upar[6], upar[7], upar[8],
1038 volume =
MakePara(vname, medium, upar[0], upar[1], upar[2], upar[3], upar[4], upar[5]);
1040 volume =
MakeTorus(vname, medium, upar[0], upar[1], upar[2], upar[3], upar[4]);
1044 Error(
"Volume",
"volume: %s not created", vname);
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
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
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.
void SetGeometry(TGeoManager *geom)
current geometry
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.
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.
virtual void RegisterYourself()
Register the matrix in the current manager, which will become the owner.
Bool_t IsRegistered() const
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)
Class describing rotations.
Base abstract class for all shapes.
Bool_t IsRunTimeShape() const
static Double_t Tolerance()
Class describing translations.
void AddVolume(TGeoVolume *vol)
Add a volume with valid shape to the list of volumes.
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
TGeoMedium * GetMedium() const
virtual TGeoNode * AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=nullptr, Option_t *option="")
Add a TGeoNode to the list of nodes.
virtual void AddNodeOverlap(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=nullptr, Option_t *option="")
Add a TGeoNode to the list of nodes.
void SetShape(const TGeoShape *shape)
set the shape associated with this volume
TGeoShape * GetShape() const
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.
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.
const char * GetTitle() const override
Returns title of object.
virtual void SetName(const char *name)
Set the name of the TNamed.
Int_t GetEntriesFast() const
virtual void AddAtAndExpand(TObject *obj, Int_t idx)
Add object at position idx.
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 UInt_t GetUniqueID() const
Return the unique object id.
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 ToLower()
Change string to lower-case.
TSubString Strip(EStripType s=kTrailing, char c=' ') const
Return a substring of self stripped at beginning and/or end.
const char * Data() const
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.