#include "geantdef.h" #include "hgeantinput.h" #include "hgeoshower.h" #include "geafuncdec.h" typedef HFloatVec FVec; // Common Blocks for GEANT position of sensitive volume in the reference // coordinate system of the Shower and for shape of volume #ifdef WITHGEANT struct SHOWERDISTCONST_DEF { float showerdx[3]; float showerdy[3]; char showershape[5]; }; #define SHOWERDCONST COMMON_BLOCK(SHOWERDCONST,showerdconst) COMMON_BLOCK_DEF(SHOWERDISTCONST_DEF,SHOWERDCONST); #endif int HGeoShower::readDet(HGeoInfo & geoInfo, HGeoMedia & geoMedia) { #ifdef WITHORACLE int n=readKeepIn(geoInfo,geoMedia); if (n==0) return HFAILURE; HString sno; for(int i=1;i<=numModules;i++) { sno=i; detName.replace(2,sno); eleName.replace(1,sno); noOfKeepIn[i]=readModule(geoInfo,geoMedia); } if (length()>0) return HSUCCESS; #endif return HFAILURE; } int HGeoShower::readDet(HGeoInfo & geoInfo) { int n=readKeepIn(geoInfo); if (n==0) return HFAILURE; HString sno; for(int i=1;i<=numModules;i++) { sno=i; detName.replace(2,sno); eleName.replace(1,sno); geoInfo.fin.seekg(0, ios::beg); geoInfo.fin.clear(); noOfKeepIn[i]=readModule(geoInfo); } if (length()>0) return HSUCCESS; return HFAILURE; } int HGeoShower::createDet(HGeoInfo & geoInfo, HGeoMedia & geoMedia){ reset(); SHOWERDCONST.showershape[0]='\0'; if (createKeepIn(geoInfo,geoMedia)==HFAILURE) return HFAILURE; HString sno; for(int i=1;i<=numModules;i++) { reset(); sno=i; detName.replace(2,sno); eleName.replace(1,sno); if (noOfKeepIn[i]>0) { if (createModule(geoInfo,geoMedia)==HFAILURE) return HFAILURE; } } return HSUCCESS; } int HGeoShower::createHits(HString & volName) { extern HGeantInput geantInput; int l1, idtype, iset, idet; HString copyName=volName(0,4); l1=(int)copyName(1,1); idtype=50+l1; if (hitsRead<1) { int i=0; int n=geantInput.getHitNoFiles(); while (i<=n) { hitsFileName=geantInput.getHitFileName(i); if (hitsFileName.find("shower")>=0 || hitsFileName.find("meta")>=0) break; i++; } if (i>n) { cerr << "No file for hit definition of tof found" << endl; return HFAILURE; } if (readHits(hitsFileName)==HFAILURE) return HFAILURE; } if (restoreTree(volName)==HFAILURE) return HFAILURE; #ifdef WITHGEANT char* cS=chset; char* cN=copyName; GSDET(cS,cN,nv,chnmsv,nbitsv,idtype,1000,1000,iset,idet); GSDETH(cS,cN,nh,chnamh,nbitsh,orig,fact); #endif #ifdef ILSESHOW showHits(volName,idtype); #endif // fill Commonblock #ifdef WITHGEANT FVec refPos(0.F,3); HString shape, s1; calcRefPos(volName,refPos,s1); //cout<