/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions | Private Attributes
RpcPlane Class Reference

a horizontal plane to represent RPC geometry More...

#include <RpcPlane.h>

List of all members.

Public Member Functions

 RpcPlane (double xUp, double xLow, double yUp, double yLow, double z)
virtual ~RpcPlane ()
bool intersect (const HepGeom::Point3D< double > &linePoint, const HepGeom::Normal3D< double > &lineSlope, HepGeom::Point3D< double > &intersect)
double xUp () const
double xLow () const
double yUp () const
double yLow () const
double z () const

Private Attributes

double m_xUp
 Mark the upper and lower bound of each variable, x, y and z.
double m_xLow
double m_yUp
double m_yLow
double m_z

Detailed Description

a horizontal plane to represent RPC geometry

a horizontal plane to represent RPC

Zhe Wang, 14 Oct. 2009 at BNL

A horizontal rectangular representation. Calculate intersections of a line with its surfaces.

Zhe Wang, 14 Oct. 2009 at BNL

Definition at line 21 of file RpcPlane.h.


Constructor & Destructor Documentation

RpcPlane::RpcPlane ( double  xUp,
double  xLow,
double  yUp,
double  yLow,
double  z 
)

Definition at line 14 of file RpcPlane.cc.

{ 
  m_xUp  = xUp;
  m_xLow = xLow;
  m_yUp  = yUp;
  m_yLow = yLow;
  m_z    = z;
}
RpcPlane::~RpcPlane ( ) [virtual]

Definition at line 26 of file RpcPlane.cc.

{}

Member Function Documentation

bool RpcPlane::intersect ( const HepGeom::Point3D< double > &  linePoint,
const HepGeom::Normal3D< double > &  lineSlope,
HepGeom::Point3D< double > &  intersect 
)

constant z .............................................

constant x .............................................

constant y .............................................

Definition at line 33 of file RectangularBox.cc.

{
  Point3D<double>  aPoint=linePoint;
  Normal3D<double> aSlope=lineSlope;

  bool foundA;
  bool foundB;

  foundA=foundB=false;

  double x,y,z;

  // top plane
  if(foundA && foundB) return true;

  if( aSlope.z()!=0 ) {
    x=aSlope.x()/aSlope.z()*(m_zUp-aPoint.z()) + aPoint.x();
    y=aSlope.y()/aSlope.z()*(m_zUp-aPoint.z()) + aPoint.y();
  
    if(x>=m_xLow && x<=m_xUp &&
       y>=m_yLow && y<=m_yUp )  {
      if(!foundA) { 
        foundA = true; 
        intersectA.setX(x);
        intersectA.setY(y);
        intersectA.setZ(m_zUp);
      } else {
        if (!foundB) {
          foundB = true;
          intersectB.setX(x);
          intersectB.setY(y);
          intersectB.setZ(m_zUp);
        }
      }
    }
  }
  
  // bottom plane
  if(foundA && foundB) return true;

  if( aSlope.z()!=0 ) {
    x=aSlope.x()/aSlope.z()*(m_zLow-aPoint.z()) + aPoint.x();
    y=aSlope.y()/aSlope.z()*(m_zLow-aPoint.z()) + aPoint.y();
    
    if(x>=m_xLow && x<=m_xUp &&
       y>=m_yLow && y<=m_yUp )  {
      if(!foundA) {
        foundA = true;
        intersectA.setX(x);
        intersectA.setY(y);
        intersectA.setZ(m_zLow);
      } else {
        if (!foundB) {
          foundB = true;
          intersectB.setX(x);
          intersectB.setY(y);
          intersectB.setZ(m_zLow);
        }
      }
    }
  }

  // x positive plane
  if(foundA && foundB) return true;

  if( aSlope.x()!=0 ) {
    z=aSlope.z()/aSlope.x()*(m_xUp-aPoint.x()) + aPoint.z();
    y=aSlope.y()/aSlope.x()*(m_xUp-aPoint.x()) + aPoint.y();

    if(z>=m_zLow && z<=m_zUp &&
       y>=m_yLow && y<=m_yUp )  {
      if(!foundA) {
        foundA = true;
        intersectA.setZ(z);
        intersectA.setY(y);
        intersectA.setX(m_xUp);
      } else {
        if (!foundB) {
          foundB = true;
          intersectB.setZ(z);
          intersectB.setY(y);
          intersectB.setX(m_xUp);
        }
      }
    }
  }

  // x negtive plane
  if(foundA && foundB) return true;

  if( aSlope.x()!=0 ) {
    z=aSlope.z()/aSlope.x()*(m_xLow-aPoint.x()) + aPoint.z();
    y=aSlope.y()/aSlope.x()*(m_xLow-aPoint.x()) + aPoint.y();

    if(z>=m_zLow && z<=m_zUp &&
       y>=m_yLow && y<=m_yUp )  {
      if(!foundA) {
        foundA = true;
        intersectA.setZ(z);
        intersectA.setY(y);
        intersectA.setX(m_xLow);
      } else {
        if (!foundB) {
          foundB = true;
          intersectB.setZ(z);
          intersectB.setY(y);
          intersectB.setX(m_xLow);
        }
      }
    }
  }

  
  // y positive plane
  if(foundA && foundB) return true;

  if( aSlope.y()!=0 ) {
    z=aSlope.z()/aSlope.y()*(m_yUp-aPoint.y()) + aPoint.z();
    x=aSlope.x()/aSlope.y()*(m_yUp-aPoint.y()) + aPoint.x();

    if(z>=m_zLow && z<=m_zUp &&
       x>=m_xLow && x<=m_xUp )  {
      if(!foundA) {
        foundA = true;
        intersectA.setZ(z);
        intersectA.setX(x);
        intersectA.setY(m_yUp);
      } else {
        if (!foundB) {
          foundB = true;
          intersectB.setZ(z);
          intersectB.setX(x);
          intersectB.setY(m_yUp);
        }
      }
    }
  }

  // y negtive plane
  if(foundA && foundB) return true;

  if( aSlope.y()!=0 ) {
    z=aSlope.z()/aSlope.y()*(m_yLow-aPoint.y()) + aPoint.z();
    x=aSlope.x()/aSlope.y()*(m_yLow-aPoint.y()) + aPoint.x();

    if(z>=m_zLow && z<=m_zUp &&
       x>=m_xLow && x<=m_xUp )  {
      if(!foundA) {
        foundA = true;
        intersectA.setZ(z);
        intersectA.setX(x);
        intersectA.setY(m_yLow);
      } else {
        if (!foundB) {
          foundB = true;
          intersectB.setZ(z);
          intersectB.setX(x);
          intersectB.setY(m_yLow);
        }
      }
    }
  }

  return foundA && foundB;
}
double RpcPlane::xUp ( ) const [inline]

Definition at line 34 of file RpcPlane.h.

{ return m_xUp;  }
double RpcPlane::xLow ( ) const [inline]

Definition at line 35 of file RpcPlane.h.

{ return m_xLow; }
double RpcPlane::yUp ( ) const [inline]

Definition at line 37 of file RpcPlane.h.

{ return m_yUp;  }
double RpcPlane::yLow ( ) const [inline]

Definition at line 38 of file RpcPlane.h.

{ return m_yLow; }
double RpcPlane::z ( ) const [inline]

Definition at line 40 of file RpcPlane.h.

{ return m_z;  }

Member Data Documentation

double RpcPlane::m_xUp [private]

Mark the upper and lower bound of each variable, x, y and z.

Definition at line 54 of file RpcPlane.h.

double RpcPlane::m_xLow [private]

Definition at line 54 of file RpcPlane.h.

double RpcPlane::m_yUp [private]

Definition at line 55 of file RpcPlane.h.

double RpcPlane::m_yLow [private]

Definition at line 55 of file RpcPlane.h.

double RpcPlane::m_z [private]

Definition at line 56 of file RpcPlane.h.


The documentation for this class was generated from the following files:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 10:21:29 for MuonProphet by doxygen 1.7.4