1 #ifndef Geom_SimpleConeBounds_H
2 #define Geom_SimpleConeBounds_H
29 float zmax,
float rmin_zmax,
float rmax_zmax) :
30 theZmin(zmin), theRminZmin(rmin_zmin), theRmaxZmin(rmax_zmin),
31 theZmax(zmax), theRminZmax(rmin_zmax), theRmaxZmax(rmax_zmax) {
32 if (theZmin > theZmax) {
36 if (theRminZmin > theRmaxZmin)
std::swap(theRminZmin, theRmaxZmin);
37 if (theRminZmax > theRmaxZmax)
std::swap(theRminZmax, theRmaxZmax);
41 virtual float length()
const {
return theZmax - theZmin;}
43 virtual float width()
const {
return 2*
std::max(theRmaxZmin,theRmaxZmax);}
46 virtual float thickness()
const {
return ((theRmaxZmin-theRminZmin)+
47 (theRmaxZmax-theRminZmax))/2.;}
52 float lrmin = (p.
z()-theZmin)*(theRminZmax-theRminZmin)/(theZmax-theZmin);
53 float lrmax = (p.
z()-theZmin)*(theRmaxZmax-theRmaxZmin)/(theZmax-theZmin);
54 return p.
z() > theZmin && p.
z() < theZmax &&
55 p.
perp() > lrmin && p.
perp() < lrmax;
62 theRminZmin, theRmaxZmin,
63 theZmax+
sqrt(err.
yy())*scale,
64 theRminZmax, theRmaxZmax);
78 float theta = atan(((theRmaxZmax+theRminZmax)/2.-
79 (theRmaxZmin+theRminZmin)/2.)/length());
84 float rAtZmax = (theRmaxZmax+theRminZmax)/2.;
85 float rAtZmin = (theRmaxZmin+theRminZmin)/2.;
86 float dr = (rAtZmax-rAtZmin);
91 return GlobalPoint(0,0,(theZmin*rAtZmax - theZmax*rAtZmin)/dr);
104 #endif // Geom_SimpleConeBounds_H
SimpleConeBounds(float zmin, float rmin_zmin, float rmax_zmin, float zmax, float rmin_zmax, float rmax_zmax)
Construct from inner/outer radius on the two Z faces.
virtual float thickness() const
Geom::Theta< float > openingAngle() const
virtual bool inside(const Local3DPoint &) const =0
Determine if the point is inside the bounds.
GloballyPositioned< float >::GlobalPoint GlobalPoint
Global3DPoint GlobalPoint
Geom::Theta< T > theta() const
virtual float length() const
Length along Z.
const T & max(const T &a, const T &b)
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
Abs< T >::type abs(const T &t)
GlobalPoint vertex() const
std::vector< std::vector< double > > tmp
virtual bool inside(const Local2DPoint &p, const LocalError &err) const
virtual bool inside(const Local3DPoint &p, const LocalError &err, float scale) const
Determine if a point is inside the bounds, taking error into account.
virtual float width() const
Maximum diameter.
virtual bool inside(const Local3DPoint &p) const
Determine if the point is inside the bounds.
virtual Bounds * clone() const
Unlimited (trivial) bounds.