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) const
 
bool inside (const Local2DPoint &p) const override
 
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...
 
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...
 
virtual bool inside (const Local2DPoint &p, float tollerance) const
 Determine if a point is inside the bounds, taking a tollerance into account. More...
 
bool inside (const Local2DPoint &p, float tollerance) const override
 Determine if a point is inside the bounds, taking a tollerance into account. More...
 
virtual bool inside (const Local3DPoint &) const=0
 Determine if the point is inside the bounds. 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...
 
bool inside (const Local3DPoint &p) const override
 Determine if the point is inside the bounds. 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...
 
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().

◆ ~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.

43 { return new RectangularPlaneBounds(*this); }

References RectangularPlaneBounds().

◆ 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.

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 }

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

◆ inside() [1/10]

virtual bool Bounds::inside
inline

Definition at line 39 of file Bounds.h.

39 { return inside(Local3DPoint(p.x(), p.y(), 0)); }

◆ inside() [2/10]

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

Reimplemented from Bounds.

Definition at line 29 of file RectangularPlaneBounds.h.

29  {
30  return (std::abs(p.x()) < halfWidth) & (std::abs(p.y()) < halfLength);
31  }

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

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

◆ inside() [3/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  }

◆ inside() [4/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.

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 }

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

◆ 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  }

◆ inside() [6/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.

37  {
38  return (std::abs(p.x()) < (halfWidth + tollerance)) & (std::abs(p.y()) < (halfLength + tollerance));
39  }

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

◆ inside() [7/10]

virtual bool Bounds::inside

Determine if the point is inside the bounds.

◆ inside() [8/10]

virtual bool Bounds::inside

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

◆ inside() [9/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.

33  {
34  return (std::abs(p.x()) < halfWidth) & (std::abs(p.y()) < halfLength) & (std::abs(p.z()) < halfThickness);
35  }

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

◆ inside() [10/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.

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 }

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

◆ length()

float RectangularPlaneBounds::length ( ) const
inlineoverridevirtual

Lenght along local Y.

Implements Bounds.

Definition at line 20 of file RectangularPlaneBounds.h.

20 { return 2 * halfLength; }

References halfLength.

Referenced by TrackerValidationVariables::fillHitQuantities().

◆ significanceInside()

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

Reimplemented from Bounds.

Definition at line 24 of file RectangularPlaneBounds.cc.

24  {
25  return std::max((std::abs(p.x()) - halfWidth) / std::sqrt(err.xx()),
26  (std::abs(p.y()) - halfLength) / std::sqrt(err.yy()));
27 }

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

◆ thickness()

float RectangularPlaneBounds::thickness ( ) const
inlineoverridevirtual

Thickness of the volume in local Z.

Implements Bounds.

Definition at line 24 of file RectangularPlaneBounds.h.

24 { return 2 * halfThickness; }

References halfThickness.

◆ width()

float RectangularPlaneBounds::width ( ) const
inlineoverridevirtual

Width along local X.

Implements Bounds.

Definition at line 22 of file RectangularPlaneBounds.h.

22 { return 2 * halfWidth; }

References halfWidth.

Referenced by TrackerValidationVariables::fillHitQuantities().

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().

RectangularPlaneBounds::RectangularPlaneBounds
RectangularPlaneBounds(float w, float h, float t)
Definition: RectangularPlaneBounds.cc:5
L1EGammaCrystalsEmulatorProducer_cfi.scale
scale
Definition: L1EGammaCrystalsEmulatorProducer_cfi.py:10
RectangularPlaneBounds::halfWidth
float halfWidth
Definition: RectangularPlaneBounds.h:53
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
RectangularPlaneBounds::halfLength
float halfLength
Definition: RectangularPlaneBounds.h:54
w
const double w
Definition: UKUtility.cc:23
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
RectangularPlaneBounds::inside
bool inside(const Local2DPoint &p) const override
Definition: RectangularPlaneBounds.h:29
h
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
LocalError
Definition: LocalError.h:12
RectangularPlaneBounds::halfThickness
float halfThickness
Definition: RectangularPlaneBounds.h:55
submitPVResolutionJobs.err
err
Definition: submitPVResolutionJobs.py:85
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
Local3DPoint
Point3DBase< float, LocalTag > Local3DPoint
Definition: LocalPoint.h:9