17 #include "TGeoManager.h"
18 #include "TGeoMedium.h"
19 #include "TGeoMaterial.h"
20 #include "TGeoVolume.h"
21 #include "TGeoMatrix.h"
48 TString nodeName= volu->GetName();
49 if ( hadFormat == 1 ) {
51 nodeName=nodeName(0,4);
53 nodeName = (volu->GetName());
54 Ssiz_t l=nodeName.Last(
'#');
55 if (l>0) { nodeName=nodeName(0,l); }
60 Error(
"createNode",
"Mother volume of %s not found\n",volu->GetName());
76 if (lnMed<=0) {
return kFALSE; }
81 if (volu->
getShape().Contains(
"TORUS")) {
83 TGeoMedium* medium =
geoManager->GetMedium(lnMed);
84 rv =
geoManager->MakeTorus(nodeName.Data(),medium,par->At(0),par->At(1),par->At(2),par->At(3),par->At(4));
86 }
else if (volu->
getShape().Contains(
"ASSEMBLY")) {
87 rv=
geoManager->MakeVolumeAssembly(nodeName.Data());
91 lnMed,par->GetArray(),par->GetSize());
100 if (!rv) {
return kFALSE; }
109 tr=
new TGeoTranslation(pos.
getX(),pos.
getY(),pos.
getZ());
113 sprintf(b,
"R%i",
nRot);
114 TGeoRotation* r=
new TGeoRotation(b);
116 for (Int_t i=0; i<9; i++) { a[i]=rot(i); }
118 tr=
new TGeoCombiTrans(pos.
getX(),pos.
getY(),pos.
getZ(),r);
121 if (!mo) {
return kFALSE; }
137 material=
new TGeoMaterial(med->GetName(),p[0],p[1],med->
getDensity(),
141 material=
new TGeoMixture(med->GetName(),nComp,med->
getDensity());
142 Double_t sumWeights=0.;
144 for(Int_t i=0; i<nComp; i++) {
146 sumWeights+=p[0]*p[2];
149 for(Int_t i=0; i<nComp; i++) {
152 ((TGeoMixture*)material)->DefineElement(i,p[0],p[1],p[2]);
154 ((TGeoMixture*)material)->DefineElement(i,p[0],p[1],p[0]*p[2]/sumWeights);
162 TGeoMedium* medium=
new TGeoMedium(med->GetName(),
nMed,
material,mp);
163 if (medium) {
return nMed; }