CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SimpleCylinderBounds.cc
Go to the documentation of this file.
3 
4 
5 SimpleCylinderBounds::SimpleCylinderBounds( float rmin, float rmax, float zmin, float zmax) :
6  theRmin(rmin), theRmax(rmax), theZmin(zmin), theZmax(zmax) {
7  if ( theRmin > theRmax) std::swap( theRmin, theRmax);
8  if ( theZmin > theZmax) std::swap( theZmin, theZmax);
9 }
10 
11 bool SimpleCylinderBounds::inside( const Local3DPoint& p) const {
12  return p.z() > theZmin && p.z() < theZmax &&
13  p.perp() > theRmin && p.perp() < theRmax;
14 }
15 
16 bool SimpleCylinderBounds::inside( const Local3DPoint& p, const LocalError& err,float scale) const {
17 
18  SimpleCylinderBounds tmp( theRmin, theRmax,
19  theZmin - sqrt(err.yy())*scale,
20  theZmax + sqrt(err.yy())*scale);
21 
22  return tmp.inside(p);
23  }
24 
25 bool SimpleCylinderBounds::inside( const Local2DPoint& p, const LocalError& err) const {
26  return Bounds::inside(p,err);
27 }
28 
30  return new SimpleCylinderBounds(*this);
31 }
T perp() const
Definition: PV3DBase.h:72
virtual bool inside(const Local3DPoint &) const =0
Determine if the point is inside the bounds.
float yy() const
Definition: LocalError.h:26
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
T sqrt(T t)
Definition: SSEVec.h:48
T z() const
Definition: PV3DBase.h:64
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
tuple clone
Definition: statics.py:58
Definition: Bounds.h:22