//----------------------------------------------------------- // File and Version Information: // $Id$ // // Description: // Implementation of class PndTpcPRLookupTable // see PndTpcPRLookupTable.h for details // // Environment: // Software developed for the PANDA Detector at FAIR. // // Author List: // Sebastian Neubert TUM (original author) // Cristoforo Simonetto TUM // // //----------------------------------------------------------- // This Class' Header ------------------ #include "PndTpcPRLookupTable.h" // C/C++ Headers ---------------------- // Collaborating Class Headers -------- #include "PndTpcAbsPadShape.h" #include "PndTpcGem.h" #include "TError.h" #include "TMath.h" // Class Member definitions ----------- PndTpcPRLookupTable::PndTpcPRLookupTable() : isbuilt(false),range(0),step(0),nx(0),ny(0),table(0) {;} PndTpcPRLookupTable::~PndTpcPRLookupTable() { if(table!=0) { for(int i=0;i<2*nx;++i) delete [] table[i]; delete [] table; } } double PndTpcPRLookupTable::GetValue(const double dx, const double dy) const{ if(!isbuilt)return 0; int ilx=(int)TMath::Floor(dx/step); int ily=(int)TMath::Floor(dy/step); int iux=ilx+1; int iuy=ily+1; double lx=ilx*step; double ly=ily*step; double ux=iux*step; double uy=iuy*step; if(ilx<-nx || ilx>=nx){ //ErrMsg(warning)<<"ilx out of range"<=ny){ //ErrMsg(warning)<<"ily out of range"<=nx){ //ErrMsg(warning)<<"iux out of range"<=ny){ //ErrMsg(warning)<<"iuy out of range"<Eval(r)*1/gem.spread()*1/sqrt(2*3.1416); // TODO: cache these values!!! } //normalize to area double s2=intStep*intStep; sum*=s2; return sum; }