#include "geantdef.h" #include "hgeosect.h" int HGeoSect::readDet(HGeoInfo & geoInfo, HGeoMedia & geoMedia) { #ifdef WITHORACLE HGeoParam ele; int ns=geoInfo.getNs(); for(int i=1;i<=ns;i++) { HString volName=detName + HString(i); ele.objIndex=geoInfo.geoDb->getGeomParam(volName,ele); if (ele.objIndex>0) { int rc; if (i==1) rc=readParam(geoInfo,volName,ele,geoMedia); else rc=readCopyParam(geoInfo,ele); if (rc==HSUCCESS) { append(volName,ele); geoInfo.setnsSet(ele.inout,i); #ifdef ILSESHOW showAll(volName,ele); #endif } else { cerr << " cannot read " << volName << " from oracle" << endl; return HFAILURE; } } } if (length()>0) return HSUCCESS; #endif return HFAILURE; } int HGeoSect::readDet(HGeoInfo & geoInfo) { HGeoParam ele; HString eleName(' ',120); while(!geoInfo.fin.eof()) { geoInfo.fin >> eleName; if (eleName.empty() || eleName(0)=='/') geoInfo.fin.getline(eleName,120); else { if (eleName(0,3)!=detName) { cerr << detName << " not found in file" << endl; return HFAILURE; } else { int no=int(eleName(3,1)); readInout(geoInfo,ele); geoInfo.setnsSet(ele.inout,no); geoInfo.fin >> ele.mother.assign(10); if (readCopy(geoInfo,ele)==HSUCCESS) append(eleName,ele); else { cerr << "cannot read Sectors" << endl; return HFAILURE; } } } } if (length()>0) return HSUCCESS; else return HFAILURE; } int HGeoSect::createDet(HGeoInfo & geoInfo, HGeoMedia & geoMedia){ reset(); return createModule(geoInfo,geoMedia); } int HGeoSect::writeToFile(HString & modName, HGeoInfo & geoInfo) { ofstream fout; connectOutputFile(modName,geoInfo,fout); reset(); HString volName, copyName; HGeoParam ele; int lName, nfirst=1; do { volName=name(); ele=element(); fout << volName << '\n'; if (ele.inout==0) fout << ele.inout << '\n'; fout << ele.mother << '\n'; if (nfirst) { nfirst=0; fout << ele.shape << '\n'; fout << ele.material << '\n'; if (pShapes->writePoints(fout,ele)==HFAILURE) { fout.close(); return HFAILURE; } } fout<