CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
RectangularPlaneBounds Class Referencefinal

#include <RectangularPlaneBounds.h>

Inheritance diagram for RectangularPlaneBounds:
Bounds

Public Member Functions

Boundsclone () const override
 
std::pair< bool, bool > inout (const Local3DPoint &p, const LocalError &err, float scale=1.f) 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 Local3DPoint &, const LocalError &, float scale=1.f) const=0
 Determine if a point is inside the bounds, taking error 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 bool inside (const Local3DPoint &) const=0
 Determine if the point is inside the bounds. More...
 
virtual bool inside (const Local2DPoint &p) const
 
bool inside (const Local2DPoint &p) const override
 
bool inside (const Local3DPoint &p) const override
 Determine if the point is inside the bounds. More...
 
bool inside (const Local2DPoint &p, float tollerance) const override
 Determine if a point is inside the bounds, taking a tollerance into account. More...
 
bool inside (const Local3DPoint &p, const LocalError &err, float scale=1.f) const override
 Determine if a point is inside the bounds, taking error into account. More...
 
bool inside (const Local2DPoint &p, const LocalError &err, float scale=1.f) const override
 Determine if a 2D point is inside the bounds, taking error into account. More...
 
float length () const override
 Lenght along local Y. More...
 
 RectangularPlaneBounds (float w, float h, float t)
 
float significanceInside (const Local3DPoint &, const LocalError &) const override
 
float thickness () const override
 Thickness of the volume in local Z. More...
 
float width () const override
 Width along local X. More...
 
 ~RectangularPlaneBounds () override
 
- Public Member Functions inherited from Bounds
void computeSpan (Surface const &plane)
 
std::pair< float, float > const & phiSpan () const
 
std::pair< float, float > const & rSpan () const
 
virtual float widthAtHalfLength () const
 Width at half length. Useful for e.g. pitch definition. More...
 
std::pair< float, float > const & zSpan () const
 
virtual ~Bounds ()
 

Private Attributes

float halfLength
 
float halfThickness
 
float halfWidth
 

Detailed Description

Rectangular plane bounds. Local Coordinate system coincides with center of the box with X axis along the width and Y axis along the lenght.

Definition at line 12 of file RectangularPlaneBounds.h.

Constructor & Destructor Documentation

◆ RectangularPlaneBounds()

RectangularPlaneBounds::RectangularPlaneBounds ( float  w,
float  h,
float  t 
)

Construct from half width (extension in local X), half length (Y) and half thickness (Z)

Definition at line 5 of file RectangularPlaneBounds.cc.

Referenced by clone().

T w() const
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

◆ ~RectangularPlaneBounds()

RectangularPlaneBounds::~RectangularPlaneBounds ( )
override

Definition at line 8 of file RectangularPlaneBounds.cc.

8 {}

Member Function Documentation

◆ clone()

Bounds * RectangularPlaneBounds::clone ( void  ) const
overridevirtual

Implements Bounds.

Definition at line 43 of file RectangularPlaneBounds.cc.

References RectangularPlaneBounds().

43 { return new RectangularPlaneBounds(*this); }
RectangularPlaneBounds(float w, float h, float t)

◆ inout()

std::pair< bool, bool > RectangularPlaneBounds::inout ( const Local3DPoint p,
const LocalError err,
float  scale = 1.f 
) const

Definition at line 29 of file RectangularPlaneBounds.cc.

References funct::abs(), submitPVResolutionJobs::err, halfLength, halfWidth, AlCaHLTBitMon_ParallelJobs::p, l1tEGammaCrystalsEmulatorProducer_cfi::scale, and mathSSE::sqrt().

29  {
30  float xl = std::abs(p.x()) - std::sqrt(err.xx()) * scale;
31  float xh = std::abs(p.x()) + std::sqrt(err.xx()) * scale;
32  bool inx = xl < halfWidth;
33  bool outx = xh > halfWidth;
34 
35  float yl = std::abs(p.y()) - std::sqrt(err.yy()) * scale;
36  float yh = std::abs(p.y()) + std::sqrt(err.yy()) * scale;
37  bool iny = yl < halfLength;
38  bool outy = yh > halfLength;
39 
40  return std::pair<bool, bool>(inx && iny, outx || outy);
41 }
T sqrt(T t)
Definition: SSEVec.h:19
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ inside() [1/10]

virtual bool Bounds::inside

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

◆ inside() [2/10]

virtual bool Bounds::inside
inline

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

Definition at line 57 of file Bounds.h.

57  {
58  return inside(Local3DPoint(p.x(), p.y(), 0), err, scale);
59  }
bool inside(const Local2DPoint &p) const override
Point3DBase< float, LocalTag > Local3DPoint
Definition: LocalPoint.h:9

◆ inside() [3/10]

virtual bool Bounds::inside

Determine if the point is inside the bounds.

◆ inside() [4/10]

virtual bool Bounds::inside
inline

Definition at line 39 of file Bounds.h.

39 { return inside(Local3DPoint(p.x(), p.y(), 0)); }
bool inside(const Local2DPoint &p) const override
Point3DBase< float, LocalTag > Local3DPoint
Definition: LocalPoint.h:9

◆ inside() [5/10]

virtual bool Bounds::inside
inline

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

Definition at line 42 of file Bounds.h.

42  {
43  return inside(p, LocalError(tollerance * tollerance, 0.f, tollerance * tollerance));
44  }
double f[11][100]
bool inside(const Local2DPoint &p) const override

◆ inside() [6/10]

bool RectangularPlaneBounds::inside ( const Local2DPoint p) const
inlineoverridevirtual

Reimplemented from Bounds.

Definition at line 29 of file RectangularPlaneBounds.h.

References funct::abs(), halfLength, halfWidth, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by TrackerValidationVariables::fillHitQuantities(), and inside().

29  {
30  return (std::abs(p.x()) < halfWidth) && (std::abs(p.y()) < halfLength);
31  }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ inside() [7/10]

bool RectangularPlaneBounds::inside ( const Local3DPoint ) const
inlineoverridevirtual

Determine if the point is inside the bounds.

Implements Bounds.

Definition at line 33 of file RectangularPlaneBounds.h.

References funct::abs(), halfLength, halfThickness, halfWidth, and AlCaHLTBitMon_ParallelJobs::p.

33  {
34  return (std::abs(p.x()) < halfWidth) && (std::abs(p.y()) < halfLength) && (std::abs(p.z()) < halfThickness);
35  }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ inside() [8/10]

bool RectangularPlaneBounds::inside ( const Local2DPoint p,
float  tollerance 
) const
inlineoverridevirtual

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

Reimplemented from Bounds.

Definition at line 37 of file RectangularPlaneBounds.h.

References funct::abs(), halfLength, halfWidth, and AlCaHLTBitMon_ParallelJobs::p.

37  {
38  return (std::abs(p.x()) < (halfWidth + tollerance)) && (std::abs(p.y()) < (halfLength + tollerance));
39  }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ inside() [9/10]

bool RectangularPlaneBounds::inside ( const Local3DPoint ,
const LocalError ,
float  scale = 1.f 
) const
overridevirtual

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

Implements Bounds.

Definition at line 10 of file RectangularPlaneBounds.cc.

References funct::abs(), submitPVResolutionJobs::err, halfLength, halfThickness, halfWidth, inside(), AlCaHLTBitMon_ParallelJobs::p, l1tEGammaCrystalsEmulatorProducer_cfi::scale, and mathSSE::sqrt().

10  {
11  if ((scale >= 0) && inside(p))
12  return true;
13  return std::abs(p.z()) < halfThickness && (std::abs(p.x()) < halfWidth + std::sqrt(err.xx()) * scale) &&
14  (std::abs(p.y()) < halfLength + std::sqrt(err.yy()) * scale);
15 }
T sqrt(T t)
Definition: SSEVec.h:19
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool inside(const Local2DPoint &p) const override

◆ inside() [10/10]

bool RectangularPlaneBounds::inside ( const Local2DPoint p,
const LocalError err,
float  scale = 1.f 
) const
overridevirtual

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

Reimplemented from Bounds.

Definition at line 17 of file RectangularPlaneBounds.cc.

References funct::abs(), submitPVResolutionJobs::err, halfLength, halfWidth, inside(), AlCaHLTBitMon_ParallelJobs::p, l1tEGammaCrystalsEmulatorProducer_cfi::scale, and mathSSE::sqrt().

17  {
18  if ((scale >= 0) && inside(p))
19  return true;
20  return (std::abs(p.x()) < halfWidth + std::sqrt(err.xx()) * scale) &&
21  (std::abs(p.y()) < halfLength + std::sqrt(err.yy()) * scale);
22 }
T sqrt(T t)
Definition: SSEVec.h:19
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool inside(const Local2DPoint &p) const override

◆ length()

float RectangularPlaneBounds::length ( ) const
inlineoverridevirtual

Lenght along local Y.

Implements Bounds.

Definition at line 20 of file RectangularPlaneBounds.h.

References halfLength.

Referenced by TrackerValidationVariables::fillHitQuantities().

20 { return 2 * halfLength; }

◆ significanceInside()

float RectangularPlaneBounds::significanceInside ( const Local3DPoint p,
const LocalError err 
) const
overridevirtual

◆ thickness()

float RectangularPlaneBounds::thickness ( ) const
inlineoverridevirtual

Thickness of the volume in local Z.

Implements Bounds.

Definition at line 24 of file RectangularPlaneBounds.h.

References halfThickness.

24 { return 2 * halfThickness; }

◆ width()

float RectangularPlaneBounds::width ( ) const
inlineoverridevirtual

Width along local X.

Implements Bounds.

Definition at line 22 of file RectangularPlaneBounds.h.

References halfWidth.

Referenced by TrackerValidationVariables::fillHitQuantities().

22 { return 2 * halfWidth; }

Member Data Documentation

◆ halfLength

float RectangularPlaneBounds::halfLength
private

Definition at line 54 of file RectangularPlaneBounds.h.

Referenced by inout(), inside(), length(), and significanceInside().

◆ halfThickness

float RectangularPlaneBounds::halfThickness
private

Definition at line 55 of file RectangularPlaneBounds.h.

Referenced by inside(), and thickness().

◆ halfWidth

float RectangularPlaneBounds::halfWidth
private

Definition at line 53 of file RectangularPlaneBounds.h.

Referenced by inout(), inside(), significanceInside(), and width().