//----------------------------------------------------------- // File and Version Information: // $Id$ // // Description: // Implementation of class TpcAbsPadShape // see TpcAbsPadShape.h for details // // Environment: // Software developed for the PANDA Detector at FAIR. // // Author List: // Cristoforo Simonetto TUM (original author) // // //----------------------------------------------------------- // This Class' Header ------------------ #include "TpcAbsPadShape.h" // C/C++ Headers ---------------------- #include "TPolyLine.h" #include "TMath.h" // Collaborating Class Headers -------- #include "TpcPRLookupTable.h" // Class Member definitions ----------- TpcAbsPadShape::TpcAbsPadShape(const unsigned int fID) :lookupTable(0), ID(fID) {;} TpcAbsPadShape::~TpcAbsPadShape() { if (lookupTable != 0) delete lookupTable; } double TpcAbsPadShape::GetValue(const double x, const double y) const { return(lookupTable->GetValue(x,y)); } double TpcAbsPadShape::GetLTValue(const int x, const int y) const {return(lookupTable->GetLTValue(x,y));} bool operator== (const TpcAbsPadShape& lhs, const TpcAbsPadShape& rhs) { return(lhs.ID==rhs.ID); } std::ostream& operator<< (std::ostream& s, const TpcAbsPadShape& me) { return s << "TpcAbsPadShape\n" << "ID="<SetPoint(i,u,v); } line->SetLineColor(color); line->Draw(); } double TpcAbsPadShape::GetWeight(const double amp, const double dirX, const double dirY) { return(lookupTable->GetWeight(amp,dirX,dirY)); } double TpcAbsPadShape::GetAreaTriangle(double x1,double y1, double x2,double y2, double x3,double y3) const { double a=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)); double b=sqrt((x1-x3)*(x1-x3)+(y1-y3)*(y1-y3)); double c=sqrt((x3-x2)*(x3-x2)+(y3-y2)*(y3-y2)); double s=(a+b+c)/2.; return sqrt(s*(s-a)*(s-b)*(s-c)); }