| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

RpcPlane.cc

Go to the documentation of this file.
00001 
00010 #include "RpcPlane.h"
00011 
00012 using namespace HepGeom;
00013 
00014 RpcPlane::RpcPlane(double xUp, double xLow,
00015                    double yUp, double yLow,
00016                    double z )
00017 { 
00018   m_xUp  = xUp;
00019   m_xLow = xLow;
00020   m_yUp  = yUp;
00021   m_yLow = yLow;
00022   m_z    = z;
00023 }
00024 
00025 
00026 RpcPlane::~RpcPlane()
00027 {}
00028 
00029 bool RpcPlane::intersect(const Point3D<double> & linePoint, const Normal3D<double> & lineSlope,
00030                                Point3D<double> & intersect )
00031 {
00032   Point3D<double>  aPoint=linePoint;
00033   Normal3D<double> aSlope=lineSlope;
00034 
00035   bool found;
00036 
00037   found=false;
00038 
00039   double x,y;
00040 
00042   if( aSlope.z()!=0 ) {
00043     x=aSlope.x()/aSlope.z()*(m_z-aPoint.z()) + aPoint.x();
00044     y=aSlope.y()/aSlope.z()*(m_z-aPoint.z()) + aPoint.y();
00045   
00046     if(x>=m_xLow && x<=m_xUp &&
00047        y>=m_yLow && y<=m_yUp )  {
00048 
00049       found = true; 
00050       intersect.setX(x);
00051       intersect.setY(y);
00052       intersect.setZ(m_z);
00053 
00054     }
00055   }
00056 
00057   return found;
00058 }
00059 
00060 
00061 std::ostream & operator<<(std::ostream & os, const RpcPlane & p)
00062 {
00063   os<<"xUp="<<p.xUp()<<" "<<"xLow="<<p.xLow()<<" "
00064     <<"yUp="<<p.yUp()<<" "<<"yLow="<<p.yLow()<<" "
00065     <<"z="<<p.z();
00066 
00067   return os;
00068 }
00069 
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 21:01:51 2011 for MuonProphet by doxygen 1.4.7