51 if (!
file) {
file=
new std::fstream(); }
52 else { (
file->clear()); }
56 if (strcmp(status,
"in")==0) {
60 if (strcmp(status,
"out")==0) {
69 Error(
"open",
"Output file %s exists already and will not be recreated.",
73 }
else { Error(
"open",
"Invalid file option!"); }
75 if (
file->rdbuf()->is_open()==0) {
76 Error(
"open",
"Failed to open file %s",
filename.Data());
85 if (
file &&
file->rdbuf()->is_open()==1) {
return kTRUE; }
110 else { cout<<
"Open input file: "<<
filename<<endl; }
111 }
else { cout<<
"No file open."<<endl; }
118 std::fstream& fin=*
file;
120 fin.seekg(0,ios::beg);
124 TList* volumes=
set->getListOfVolumes();
128 TString volumeName =
"";
130 if (fin.eof()) {
break; }
132 volu->SetName(volumeName);
136 if (sensitivity>0) { fin >> na; }
138 TString motherName =
"";
141 if (motherName==
"world") { mother=
set->getMasterNode(
"cave"); }
142 else { mother=
set->getVolume(motherName.Data()); }
146 fin>>t[0]>>t[1]>>t[2];
147 for(Int_t kk=0; kk<3; kk++) { t[kk]*=10.; }
148 for(Int_t i=0; i<9; i++) { fin>>r[i]; }
153 TString materialName =
"";
167 cerr <<
"Shape "<<type<<
" not supported."<<endl;
171 for (Int_t ik=0; ik<npar; ik++) {
176 cerr <<
"Conversion for shape "<<type<<
" not implemented."<<endl;
180 TString control =
"";
182 if ( control !=
"#fi" && !fin.eof()) {
183 cerr <<
"End of File section is '" << control <<
"' instead of '#fi'." << endl;
195 TString shName=sh->GetName();
199 if (shName ==
"BOX ") {
200 Double_t
x=par[0]*10.;
201 Double_t
y=par[1]*10.;
202 Double_t
z=par[2]*10.;
211 }
else if (shName ==
"TUBE") {
212 Double_t
z=par[2]*10.;
214 volu->
setPoint(1,par[0]*10.,par[1]*10.,0.);
216 }
else if (shName ==
"TUBS") {
217 Double_t
z=par[2]*10.;
218 Double_t a=par[3]/6.28318548*360;
220 volu->
setPoint(1,par[0]*10.,par[1]*10.,0.);
222 volu->
setPoint(3,a,par[4]/6.28318548*360+a,0.);
223 }
else if (shName ==
"CONE") {
224 Double_t
z=par[4]*10.;
226 volu->
setPoint(1,par[0]*10.,par[1]*10.,0.);
228 volu->
setPoint(3,par[2]*10.,par[3]*10.,0.);
229 }
else if (shName ==
"CONS") {
230 Double_t
z=par[4]*10.;
231 Double_t a=par[5]/6.28318548*360;
233 volu->
setPoint(1,par[0]*10.,par[1]*10.,0.);
235 volu->
setPoint(3,par[2]*10.,par[3]*10.,0.);
236 volu->
setPoint(4,a,par[6]/6.28318548*360+a,0.);
237 }
else if (shName ==
"SPHE") {
238 Double_t a=par[4]/6.28318548*360;
239 volu->
setPoint(0,par[0]*10.,par[1]*10.,0.);
241 volu->
setPoint(2,a,par[5]/6.28318548*360+a,0.);
242 }
else if (shName ==
"ELTU") {
243 Double_t
z=par[2]*10.;
245 volu->
setPoint(1,par[0]*10.,par[1]*10.,0.);
247 }
else { rc=kFALSE; }