11 #include "TGeoMedium.h"
12 #include "TGeoMaterial.h"
58 TListIter iter(
media);
67 if (i!=
media->GetSize()) {
69 cout<<
"//----------------------------------------------\n";
71 cout<<
"//----------------------------------------------\n";
83 cout<<
"-I- EicGeoMedia Read media"<<endl;
84 const Int_t maxBuf=256;
89 if (buf[0]==
'\0' || buf[0]==
'/') { fin.getline(buf,maxBuf); }
90 else if (fin.eof()) {
break; }
93 if (eleName.CompareTo(
"AUTONULL")!=0) {
95 medium->
read(fin,autoflag);
97 }
else { autoflag=0; }
115 material=
new TGeoMaterial(med->GetName(),p[0],p[1],med->
getDensity());
119 material=
new TGeoMixture(med->GetName(),nComp,med->
getDensity());
120 Double_t sumWeights=0.;
122 for(Int_t i=0; i<nComp; i++) {
124 sumWeights+=p[0]*p[2];
127 for(Int_t i=0; i<nComp; i++) {
130 ((TGeoMixture*)material)->DefineElement(i,p[0],p[1],p[2]);
132 ((TGeoMixture*)material)->DefineElement(i,p[0],p[1],p[0]*p[2]/sumWeights);
140 TGeoMedium* medium=
new TGeoMedium(med->GetName(),
nMed,
material,mp);
141 if (medium) {
return nMed; }