GEAR  1.9.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Friends Pages
BoundaryRectangle.cc
1 
2 #include "gearsurf/BoundaryRectangle.h"
3 
4 #include "CLHEP/Vector/Rotation.h"
5 
6 namespace gear{
7 
8  bool BoundaryRectangle::isInBoundary( CLHEP::Hep3Vector local ) const {
9 
10  if( fabs( local.z() ) > _deltaW ) return false;
11 
12 
13 
14  // First we need to take into account, that the rectangle might be rotated
15  // around w. So we transpose the local coordinates to the frame of the rectangle
16  // If the rectangle is rotated by alpha, we need to rotate the coordinates by -alpha
17  CLHEP::HepRotation R;
18  R.rotateZ( -_alpha);
19  local = R * local; //to rectangle system
20 
21 
22 
23  if( fabs( local.x() ) > _width/2. ) return false;
24  if( fabs( local.y() ) > _length/2. ) return false;
25 
26 
27  return true;
28 
29  }
30 
31 }
virtual bool isInBoundary(CLHEP::Hep3Vector local) const