50 Bool_t g3CompatibleVolumeNames)
52 fG3CompatibleVolumeNames(g3CompatibleVolumeNames)
63 fG3CompatibleVolumeNames(
kFALSE)
102 for (
Int_t i=0; i<size; i++) doubleArray[i] = array[i];
121 for (i=0;i<
l;i++) vname[i] = toupper(
name[i]);
122 for (i=
l;i<4;i++) vname[i] =
' ';
211 a[i] = da[i]; z[i] = dz[i]; wmat[i] = dwmat[i];
240 for (i=0;i<nlmat;i++) {
241 amol +=
a[i]*wmat[i];
243 for (i=0;i<nlmat;i++) {
244 wmat[i] *=
a[i]/amol;
280 Medium(kmed,
name, nmat, isvol, ifield, fieldm, tmaxfd, stemax, deemax, epsil,
313 GetTGeoManager()->
Medium(
name,kmed,nmat, isvol, ifield, fieldm, tmaxfd, stemax,deemax, epsil, stmin);
374 Fatal(
"Gsvolu",
"Could not create volume %s",
name);
397 Vname(mother,vmother);
416 Vname(mother,vmother);
438 Vname(mother,vmother);
461 Vname(mother,vmother);
512 Vname(mother,vmother);
528 Gsposp(
name, nr, mother,
x,
y, z, irot, konly, dupar, np);
548 Vname(mother,vmother);
561 printf(
"VolId: Volume %s not found\n",
name);
574 if (medium)
return medium->
GetId();
576 printf(
"MediumId: Medium %s not found\n",
name);
588 Error(
"VolName",
"volume with id=%d does not exist",
id);
612 Error(
"NofVolDaughters",
"Volume %s not found.", volName);
628 Error(
"VolDaughterName",
"Volume %s not found.", volName);
634 Error(
"VolDaughterName",
"Volume %s Index out of limits", volName);
651 Error(
"VolDaughterName",
"Volume %s not found.", volName);
657 Error(
"VolDaughterName",
"Volume %s Index out of limits", volName);
673 Error(
"VolId2Mate",
"volume with id=%d does not exist",
id);
740 TClass *class_type = shape->IsA();
741 if (class_type==TGeoBBox::Class()) {
751 if (class_type==TGeoTrd1::Class()) {
762 if (class_type==TGeoTrd2::Class()) {
774 if (class_type==TGeoTrap::Class()) {
793 if (class_type==TGeoTube::Class()) {
803 if (class_type==TGeoTubeSeg::Class()) {
815 if (class_type==TGeoCone::Class()) {
827 if (class_type==TGeoConeSeg::Class()) {
841 if (class_type==TGeoSphere::Class()) {
854 if (class_type==TGeoPara::Class()) {
867 if (class_type==TGeoPgon::Class()) {
880 for (
Int_t i=0; i<nz; i++) {
881 par.
AddAt(z[i], 4+3*i);
882 par.
AddAt(rmin[i], 4+3*i+1);
883 par.
AddAt(rmax[i], 4+3*i+2);
887 if (class_type==TGeoPcon::Class()) {
899 for (
Int_t i=0; i<nz; i++) {
900 par.
AddAt(z[i], 3+3*i);
901 par.
AddAt(rmin[i], 3+3*i+1);
902 par.
AddAt(rmax[i], 3+3*i+2);
906 if (class_type==TGeoEltu::Class()) {
916 if (class_type==TGeoHype::Class()) {
928 if (class_type==TGeoGtra::Class()) {
948 if (class_type==TGeoCtub::Class()) {
969 Error(
"GetShape",
"Getting shape parameters for shape %s not implemented", shape->
ClassName());
1052 imed = med->
GetId();
R__EXTERN TGeoManager * gGeoManager
Array of doubles (64 bits per element).
void Set(Int_t n)
Set size of this array to n doubles.
void AddAt(Double_t c, Int_t i)
Set the double c value at position i in the array.
TClass instances represent classes, structs and namespaces in the ROOT type system.
virtual Double_t GetDZ() const
A phi segment of a conical tube.
virtual Double_t GetRmax2() const
virtual Double_t GetDz() const
virtual Double_t GetRmin2() const
virtual Double_t GetRmin1() const
virtual Double_t GetRmax1() const
A tube segment cut with 2 planes.
const Double_t * GetNlow() const
const Double_t * GetNhigh() const
virtual Double_t GetA() const
virtual Double_t GetB() const
Gtra is a twisted trapezoid.
Double_t GetTwistAngle() const
Matrix class used for computing global transformations Should NOT be used for node definition.
Hyperboloid class defined by 5 parameters.
Double_t RadiusHypeSq(Double_t z, Bool_t inner) const
Compute r^2 = x^2 + y^2 at a given z coordinate, for either inner or outer hyperbolas.
Double_t GetStOut() const
Implementation of the TVirtualMCGeometry interface for building TGeo geometry.
virtual Int_t VolId(const char *volName) const
Return the unique numeric identifier for volume name.
virtual Int_t VolId2Mate(Int_t id) const
Return material number for a given volume id.
virtual void Gsdvt(const char *name, const char *mother, Double_t step, Int_t iaxis, Int_t numed, Int_t ndvmx)
Create a new volume by dividing an existing one.
virtual Bool_t GetShape(const TString &volumePath, TString &shapeType, TArrayD &par)
Returns the shape and its parameters for the volume specified by volumeName.
virtual void Gsposp(const char *name, Int_t nr, const char *mother, Double_t x, Double_t y, Double_t z, Int_t irot, const char *konly, Float_t *upar, Int_t np)
Place a copy of generic volume name with user number nr inside mother, with its parameters upar(1....
virtual Int_t NofVolumes() const
Return total number of volumes in the geometry.
virtual void Mixture(Int_t &kmat, const char *name, Float_t *a, Float_t *z, Double_t dens, Int_t nlmat, Float_t *wmat)
Define a mixture or a compound with a number kmat composed by the basic nlmat materials defined by ar...
virtual void Medium(Int_t &kmed, const char *name, 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, Float_t *ubuf, Int_t nbuf)
Define a medium.
virtual void Gsord(const char *name, Int_t iax)
Flag volume name whose contents will have to be ordered along axis iax, by setting the search flag to...
virtual void Matrix(Int_t &krot, Double_t thetaX, Double_t phiX, Double_t thetaY, Double_t phiY, Double_t thetaZ, Double_t phiZ)
Define a rotation matrix.
virtual void Gsdvn(const char *name, const char *mother, Int_t ndiv, Int_t iaxis)
Create a new volume by dividing an existing one.
virtual void Gsdvt2(const char *name, const char *mother, Double_t step, Int_t iaxis, Double_t c0, Int_t numed, Int_t ndvmx)
Create a new volume by dividing an existing one.
virtual void Gspos(const char *name, Int_t nr, const char *mother, Double_t x, Double_t y, Double_t z, Int_t irot, const char *konly)
Position a volume into an existing one.
static TGeoMCGeometry * fgInstance
Singleton instance.
virtual Int_t VolDaughterCopyNo(const char *volName, Int_t i) const
Return the copyNo of i-th daughters of the volume specified by volName According to A.
virtual Int_t NofVolDaughters(const char *volName) const
Return number of daughters of the volume specified by volName According to A.
void Vname(const char *name, char *vname) const
Convert name to upper case.
virtual const char * VolDaughterName(const char *volName, Int_t i) const
Return the name of i-th daughters of the volume specified by volName According to A.
virtual Bool_t GetTransformation(const TString &volumePath, TGeoHMatrix &matrix)
Return the transformation matrix between the volume specified by the path volumePath and the Top or m...
virtual Bool_t GetMaterial(const TString &volumeName, TString &name, Int_t &imat, Double_t &a, Double_t &z, Double_t &density, Double_t &radl, Double_t &inter, TArrayD &par)
Returns the Material and its parameters for the volume specified by volumeName.
Bool_t fG3CompatibleVolumeNames
Option to convert volumes names to be compatible with G3.
TGeoManager * GetTGeoManager() const
Return TGeoManager global pointer.
virtual Int_t Gsvolu(const char *name, const char *shape, Int_t nmed, Float_t *upar, Int_t np)
Create a new volume.
virtual Bool_t GetMedium(const TString &volumeName, TString &name, Int_t &imed, 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, TArrayD &par)
Returns the Medium and its parameters for the volume specified by volumeName.
virtual const char * VolName(Int_t id) const
Return the volume name given the volume identifier.
virtual Int_t MediumId(const char *mediumName) const
Return the unique numeric identifier for medium name.
virtual void Material(Int_t &kmat, const char *name, Double_t a, Double_t z, Double_t dens, Double_t radl, Double_t absl, Float_t *buf, Int_t nwbuf)
Define a material.
virtual void Gsdvn2(const char *name, const char *mother, Int_t ndiv, Int_t iaxis, Double_t c0i, Int_t numed)
Create a new volume by dividing an existing one.
virtual ~TGeoMCGeometry()
Destructor.
TGeoMCGeometry()
Default constructor.
Double_t * CreateDoubleArray(Float_t *array, Int_t size) const
Convert Float_t* array to Double_t*, !! The new array has to be deleted by user.
The manager class for any TGeo geometry.
TObjArray * GetListOfUVolumes() const
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 * Volume(const char *name, const char *shape, Int_t nmed, Float_t *upar, Int_t npar=0)
Create a volume in GEANT3 style.
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>'.
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 ...
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.
TObjArray * GetListOfMatrices() const
Int_t GetUID(const char *volname) const
Retrieve unique id for a volume name. Return -1 if name not found.
TGeoVolume * GetVolume(const char *name) const
Search for a named volume. All trailing blanks stripped.
TGeoHMatrix * GetCurrentMatrix() const
TGeoMedium * GetMedium(const char *medium) const
Search for a named tracking medium. All trailing blanks stripped.
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 * GetCurrentVolume() 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,...
Int_t PushPath(Int_t startlevel=0)
Base class describing materials.
virtual Double_t GetIntLen() const
virtual Double_t GetRadLen() const
virtual Double_t GetA() const
virtual Double_t GetDensity() const
virtual Double_t GetZ() const
Media are used to store properties related to tracking and which are useful only when using geometry ...
TGeoMaterial * GetMaterial() const
Double_t GetParam(Int_t i) const
TGeoVolume * GetVolume() const
Double_t * GetRmax() const
Double_t * GetRmin() const
Base abstract class for all shapes.
virtual Double_t GetRmin() const
Double_t GetTheta2() const
virtual Double_t GetRmax() const
Double_t GetTheta1() const
TRAP is a general trapezoid, i.e.
Double_t GetAlpha2() const
Double_t GetTheta() const
Double_t GetAlpha1() const
A trapezoid with only x length varying with z.
A trapezoid with both x and y lengths varying with z.
virtual Double_t GetRmin() const
virtual Double_t GetDz() const
virtual Double_t GetRmax() const
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
TGeoMedium * GetMedium() const
Int_t GetNdaughters() const
TGeoNode * GetNode(const char *name) const
get the pointer to a daughter node
TGeoShape * GetShape() const
virtual const char * GetName() const
Returns name of object.
Int_t GetEntriesFast() const
virtual UInt_t GetUniqueID() const
Return the unique object id.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
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.
void ToLower()
Change string to lower-case.
const char * Data() const
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Interface to Monte Carlo geometry construction.
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
constexpr Double_t DegToRad()
Conversion from degree to radian:
Double_t Sqrt(Double_t x)