GEAR  1.9.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Friends Pages
MeasurementSurface.cc
1 
2 #include "gearsurf/MeasurementSurface.h"
3 #include "gearsurf/ICoordinateSystem.h"
4 
5 
6 namespace gear {
7 
8  MeasurementSurface::~MeasurementSurface(){
9 
10  delete _coordinateSystem;
11  delete _boundary;
12 
13  }
14 
15  // only checks the boundary if a boundary is present
16  bool MeasurementSurface::isLocalInBoundary( CLHEP::Hep3Vector local ) const{
17 
18  bool inbounds = true ;
19 
20  if (_boundary) {
21  inbounds = _boundary->isInBoundary( local ) ;
22  }
23 
24  return inbounds;
25 
26  }
27 
28 
29  // only checks the boundary if a boundary is present
30  bool MeasurementSurface::isGlobalInBoundary( CLHEP::Hep3Vector global ) const{
31 
32  bool inbounds = true ;
33 
34  if (_boundary) {
35 
36  CLHEP::Hep3Vector local = _coordinateSystem->getLocalPoint( global );
37 
38  inbounds = this->isLocalInBoundary( local ) ;
39 
40  }
41 
42  return inbounds;
43 
44 
45  }
46 
47 
48 
49 } //end of gear namespace
50 
51 
52 
bool isLocalInBoundary(CLHEP::Hep3Vector local) const
Checks if a point in local coordinates is within the boundaries.
virtual bool isInBoundary(CLHEP::Hep3Vector local) const =0
bool isGlobalInBoundary(CLHEP::Hep3Vector global) const
Checks if a point in global coordinates is within the boundaries.
virtual CLHEP::Hep3Vector getLocalPoint(CLHEP::Hep3Vector globalPoint) const =0