CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
SimpleDiskBounds Class Reference

#include <SimpleDiskBounds.h>

Inheritance diagram for SimpleDiskBounds:
Bounds

Public Member Functions

virtual Boundsclone () const
 
float innerRadius () const
 Extension of the Bounds interface. More...
 
virtual bool inside (const Local3DPoint &p) const
 Determine if the point is inside the bounds. More...
 
virtual bool inside (const Local3DPoint &p, const LocalError &err, float scale) const
 Determine if a point is inside the bounds, taking error into account. More...
 
virtual bool inside (const Local2DPoint &p, const LocalError &err) const
 
virtual float length () const
 
float outerRadius () const
 
 SimpleDiskBounds (float rmin, float rmax, float zmin, float zmax)
 Construct the bounds from min and max R and Z in LOCAL coordinates. More...
 
virtual float thickness () const
 
virtual float width () const
 
- Public Member Functions inherited from Bounds
virtual bool inside (const Local2DPoint &p) const
 
virtual bool inside (const Local2DPoint &p, float tollerance) const
 Determine if a point is inside the bounds, taking a tollerance into account. More...
 
virtual bool inside (const Local2DPoint &p, const LocalError &err, float scale=1.f) const
 Determine if a 2D point is inside the bounds, taking error into account. More...
 
virtual float widthAtHalfLength () const
 Width at half length. Useful for e.g. pitch definition. More...
 
virtual ~Bounds ()
 

Private Attributes

float theRmax
 
float theRmin
 
float theZmax
 
float theZmin
 

Detailed Description

Plane bounds that define a disk with a concentric hole in the middle.

Definition at line 13 of file SimpleDiskBounds.h.

Constructor & Destructor Documentation

SimpleDiskBounds::SimpleDiskBounds ( float  rmin,
float  rmax,
float  zmin,
float  zmax 
)

Construct the bounds from min and max R and Z in LOCAL coordinates.

Definition at line 8 of file SimpleDiskBounds.cc.

References std::swap(), theRmax, theRmin, theZmax, and theZmin.

Referenced by clone().

8  :
9  theRmin(rmin), theRmax(rmax), theZmin(zmin), theZmax(zmax) {
12 }
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)

Member Function Documentation

Bounds * SimpleDiskBounds::clone ( void  ) const
virtual

Implements Bounds.

Definition at line 23 of file SimpleDiskBounds.cc.

References SimpleDiskBounds().

23  {
24  return new SimpleDiskBounds(*this);
25 }
SimpleDiskBounds(float rmin, float rmax, float zmin, float zmax)
Construct the bounds from min and max R and Z in LOCAL coordinates.
float SimpleDiskBounds::innerRadius ( ) const
inline

Extension of the Bounds interface.

Definition at line 32 of file SimpleDiskBounds.h.

References theRmin.

Referenced by ThirdHitRZPredictionBase::initLayer(), and MuonRoadTrajectoryBuilder::makeTrajectories_0().

32 {return theRmin;}
bool SimpleDiskBounds::inside ( const Local3DPoint ) const
virtual

Determine if the point is inside the bounds.

Implements Bounds.

Definition at line 14 of file SimpleDiskBounds.cc.

References PV3DBase< T, PVType, FrameType >::perp(), theRmax, theRmin, theZmax, theZmin, and PV3DBase< T, PVType, FrameType >::z().

Referenced by ForwardDetLayer::compatible(), and MuRingForwardDoubleLayer::compatible().

14  {
15  return p.z() > theZmin && p.z() < theZmax &&
16  p.perp() > theRmin && p.perp() < theRmax;
17 }
bool SimpleDiskBounds::inside ( const Local3DPoint ,
const LocalError ,
float  scale 
) const
virtual

Determine if a point is inside the bounds, taking error into account.

Implements Bounds.

Definition at line 29 of file SimpleDiskBounds.cc.

References deltaR(), f, max(), perp(), PV3DBase< T, PVType, FrameType >::perp2(), perp2(), mathSSE::sqrt(), theRmax, theRmin, theZmax, theZmin, PV3DBase< T, PVType, FrameType >::x(), LocalError::xx(), LocalError::xy(), PV3DBase< T, PVType, FrameType >::y(), LocalError::yy(), and PV3DBase< T, PVType, FrameType >::z().

30 {
31  if (p.z() < theZmin || p.z() > theZmax) return false; // check the easy part first
32 
33  double perp2 = p.perp2();
34  double perp = sqrt(perp2);
35  if (perp2 == 0) return scale*scale*(err.xx() + err.xy()) > theRmin*theRmin;
36 
37  // rotated error along p.x(),p.y()
38  // equivalent to (but faster than) err.rotate(p.x(),p.y()).xx()
39  // since we don't need all matrix elements
40  float deltaR = scale * sqrt( p.x()*p.x()/perp2 * err.xx() -
41  2*p.x()*p.y()/perp2 * err.xy() +
42  p.y()*p.y()/perp2 * err.yy());
43  return perp > std::max(theRmin-deltaR, 0.f) && perp < theRmax+deltaR;
44 }
const T & max(const T &a, const T &b)
T sqrt(T t)
Definition: SSEVec.h:46
double f[11][100]
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
T perp2() const
Squared magnitude of transverse component.
T perp() const
Magnitude of transverse component.
bool SimpleDiskBounds::inside ( const Local2DPoint p,
const LocalError err 
) const
virtual

Definition at line 19 of file SimpleDiskBounds.cc.

References Bounds::inside().

19  {
20  return Bounds::inside(p,err);
21 }
virtual bool inside(const Local3DPoint &) const =0
Determine if the point is inside the bounds.
virtual float SimpleDiskBounds::length ( ) const
inlinevirtual

"Lenght" of the bounded volume; refer to the concrete class documentation for the specific definition.

Implements Bounds.

Definition at line 19 of file SimpleDiskBounds.h.

References theZmax, and theZmin.

Referenced by Vispa.Views.LineDecayView.DecayLine::arrowBoundingRect(), Vispa.Views.LineDecayView.DecayLine::labelBoundingRect(), and Vispa.Views.LineDecayView.DecayLine::paint().

19 { return theZmax - theZmin;}
float SimpleDiskBounds::outerRadius ( ) const
inline
virtual float SimpleDiskBounds::thickness ( ) const
inlinevirtual

"Thickness" of the bound around the surface; refer to the concrete class documentation for the specific definition.

Implements Bounds.

Definition at line 21 of file SimpleDiskBounds.h.

References theZmax, and theZmin.

virtual float SimpleDiskBounds::width ( ) const
inlinevirtual

Member Data Documentation

float SimpleDiskBounds::theRmax
private

Definition at line 37 of file SimpleDiskBounds.h.

Referenced by inside(), outerRadius(), SimpleDiskBounds(), and width().

float SimpleDiskBounds::theRmin
private

Definition at line 36 of file SimpleDiskBounds.h.

Referenced by innerRadius(), inside(), and SimpleDiskBounds().

float SimpleDiskBounds::theZmax
private

Definition at line 39 of file SimpleDiskBounds.h.

Referenced by inside(), length(), SimpleDiskBounds(), and thickness().

float SimpleDiskBounds::theZmin
private

Definition at line 38 of file SimpleDiskBounds.h.

Referenced by inside(), length(), SimpleDiskBounds(), and thickness().