#include "geantdef.h" #include "hgeobasicshapes.h" #include "geafuncdec.h" int HGeoBasicShapes::readPointsDb(HGeoInfo & geoInfo, HGeoParam & ele) { #ifdef WITHORACLE int np=geoInfo.geoDb->getPoints(ele.objIndex,ele.vol); #ifdef ILSESHOW cout << "number of points: " << np << endl; #endif if (np==nCorners) return HSUCCESS; cerr<<" number of points read from database doesn't fit shape "<> ele.vol; return HSUCCESS; } int HGeoBasicShapes::posInMother(HGeoParam & ele, HGeoParam & mo, HGeoShapePar & p) { float fac=10.F; FVec r(0.0F,9), rmt(0.0F,9), rmst(0.0F,9), v(0.0F,3); transposeMatrix(mo.geaRot,rmst); multiplyMatrices(rmst,ele.rot,r); multiplyMatrices(r,ele.geaRot,rmt); if (fabs(rmt.max())>1.0F) { cerr << "something wrong with the rotation matrices" << endl; cerr << "calculated matrix for Geant using GFANG: "<< endl; cerr << rmt << endl; return HFAILURE; } if (checkUnity(rmt)) p.nRot=0; else { #ifdef WITHGEANT float rowmat[3], theta[3], phi[3], sinth, costh, sinph, cosph; int rotate; const double deg2rad=0.01745329252; for (int i=0;i<3;i++) { for (int j=0;j<3;j++) { rowmat[j]=rmt[i+j*3]; } GFANG(rowmat,costh,sinth,cosph,sinph,rotate); theta[i]=(float)(atan2((sinth*deg2rad),(costh*deg2rad))/deg2rad); if (theta[i]<0.0F) theta[i]+=180.0F; theta[i]=((int)(theta[i]*1000.F+0.5F))/1000.F; phi[i]=(float)(atan2((sinph*deg2rad),(cosph*deg2rad))/deg2rad); if (phi[i]<0.0F) phi[i]+=360.0F; phi[i]=((int)(phi[i]*1000.F+0.5F))/1000.F; #ifdef ILSESHOW cout << "rmt: " << rmt << endl; cout<<"theta["<