18 worldRadius =
pow(reqNodes,.5)*sizeBase;
20 worldRadius =
pow(reqNodes,.3)*sizeBase;
24 (
"WORLD", medEmptySpace, worldRadius, worldRadius, worldRadius);
37 for (
UInt_t i = 0; i < volumeCount; i++) {
39 sprintf(name,
"Volume_%d", i);
43 if (reqSpheres && reqTubes) {
62 if (color ==
kBlack) color += 1;
67 volumes[i] = geom->
MakeSphere(name, medSolid, 0., rMax);
68 printf(
"Volume %d : Color %d, Sphere, Radius %f\n", i, color, rMax);
72 volumes[i] = geom->
MakeTube(name, medSolid, rMin, rMax, dz);
73 printf(
"Volume %d : Color %d, Tube, Inner Radius %f, "
74 "Outer Radius %f, Length %f\n",
75 i, color, rMin, rMax, dz);
79 volumes[i] = geom->
MakeTubs(name, medSolid, rMin, rMax, dz,
81 printf(
"Volume %d : Color %d, Tube Seg, Inner Radius %f, "
82 "Outer Radius %f, Length %f, Phi1 %f, Phi2 %f\n",
83 i, color, rMin, rMax, dz, phi1, phi2);
93 volumes[i] = geom->
MakeCtub(name, medSolid, rMin, rMax, dz,
94 phi1, phi2, n1[0], n1[1], n1[2],
96 printf(
"Volume %d : Color %d, Cut Tube, Inner Radius %f, "
97 "Outer Radius %f, Length %f, Phi1 %f, Phi2 %f, "
98 "n1 (%f,%f,%f), n2 (%f,%f,%f)\n",
99 i, color, rMin, rMax, dz, phi1, phi2,
100 n1[0], n1[1], n1[2], n2[0], n2[1], n2[2]);
111 printf(
"\nCreated %d volumes\n\n", volumeCount);
115 for (i = 0; i < reqNodes; i++) {
125 trans =
new TGeoTranslation(x*worldRadius, y*worldRadius, z*worldRadius);
130 rot =
new TGeoRotation(
"rot", x*360.0, y*360.0, z*360.0);
132 UInt_t perSide =
pow(reqNodes,1.0/3.0)+0.5;
135 zi = i / (perSide*perSide);
136 yi = (i / perSide) % perSide;
virtual void Rannor(Float_t &a, Float_t &b)
Return 2 numbers distributed following a gaussian with mean=0 and sigma=1.
virtual Double_t Rndm(Int_t i=0)
Machine independent random number generator.
Double_t distance(const TPoint2 &p1, const TPoint2 &p2)
virtual void Draw(Option_t *option="")
draw top volume according to option
void SetTopVolume(TGeoVolume *vol)
Set the top volume and corresponding node as starting point of the geometry.
virtual void SetSeed(UInt_t seed=0)
Set the random generator seed.
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 * 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.
double pow(double, double)
virtual UInt_t Integer(UInt_t imax)
Returns a random integer on [ 0, imax-1 ].
virtual void AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=0, Option_t *option="")
Add a TGeoNode to the list of nodes.
void glViewerLOD(Int_t reqNodes=1000, Bool_t randomDist=kTRUE, Bool_t reqSpheres=kTRUE, Bool_t reqTubes=kTRUE)
void CloseGeometry(Option_t *option="d")
Closing geometry implies checking the geometry validity, fixing shapes with negative parameters (run-...
R__EXTERN TRandom * gRandom
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.
ClassImp(TMCParticle) void TMCParticle printf(": p=(%7.3f,%7.3f,%9.3f) ;", fPx, fPy, fPz)
static RooMathCoreReg dummy
virtual void SetLineColor(Color_t lcolor)
Set the line color.
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.
void SetNsegments(Int_t nseg)
Set number of segments for approximating circles in drawing.
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.