CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
TrapezoidalPlaneBounds Class Reference

#include <TrapezoidalPlaneBounds.h>

Inheritance diagram for TrapezoidalPlaneBounds:
Bounds CSCLayerGeometry

Public Member Functions

Boundsclone () const override
 
virtual bool inside (const Local2DPoint &p) const
 
bool inside (const Local2DPoint &p) const override
 
bool inside (const Local2DPoint &p, const LocalError &err, float scale) const override
 Determine if a 2D 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 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=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) const override
 Determine if a point is inside the bounds, taking error into account. More...
 
float length () const override
 
virtual const std::array< const float, 4 > parameters () const
 
float significanceInside (const Local3DPoint &, const LocalError &) const override
 
float thickness () const override
 
 TrapezoidalPlaneBounds (float be, float te, float a, float t)
 
float width () const override
 
float widthAtHalfLength () const override
 
virtual int yAxisOrientation () const
 
- Public Member Functions inherited from Bounds
void computeSpan (Surface const &plane)
 
virtual bool inside (const Local2DPoint &p, float tollerance) const
 Determine if a point is inside the bounds, taking a tollerance into account. More...
 
std::pair< float, float > const & phiSpan () const
 
std::pair< float, float > const & rSpan () const
 
std::pair< float, float > const & zSpan () const
 
virtual ~Bounds ()
 

Private Attributes

float hapothem
 
float hbotedge
 
float hthickness
 
float htopedge
 
float offset
 
float tan_a
 

Detailed Description

Trapezoidal plane bounds. Local Coordinate system coincides with center of the box with Y axis being the symmetry axis along the height and pointing in the direction of top_edge.

Definition at line 15 of file TrapezoidalPlaneBounds.h.

Constructor & Destructor Documentation

◆ TrapezoidalPlaneBounds()

TrapezoidalPlaneBounds::TrapezoidalPlaneBounds ( float  be,
float  te,
float  a,
float  t 
)

constructed from: half bottom edge (smaller side width) half top edge (larger side width) half apothem (distance from top to bottom sides, measured perpendicularly to them) half thickness

Definition at line 7 of file TrapezoidalPlaneBounds.cc.

9  // pre-compute offset of triangle vertex and tg of (half) opening
10  // angle of the trapezoid for faster inside() implementation.
11 
12  offset = a * (te + be) / (te - be); // check sign if te < be !!!
13  tan_a = te / std::abs(offset + a);
14 }

References a, funct::abs(), cms::cuda::be, offset, and tan_a.

Referenced by clone().

Member Function Documentation

◆ clone()

Bounds * TrapezoidalPlaneBounds::clone ( void  ) const
overridevirtual

Implements Bounds.

Reimplemented in CSCLayerGeometry.

Definition at line 47 of file TrapezoidalPlaneBounds.cc.

47 { return new TrapezoidalPlaneBounds(*this); }

References TrapezoidalPlaneBounds().

◆ inside() [1/9]

virtual bool Bounds::inside
inline

Definition at line 39 of file Bounds.h.

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

◆ inside() [2/9]

bool TrapezoidalPlaneBounds::inside ( const Local2DPoint p) const
overridevirtual

Reimplemented from Bounds.

Reimplemented in CSCLayerGeometry.

Definition at line 18 of file TrapezoidalPlaneBounds.cc.

18  {
19  return (std::abs(p.y()) < hapothem) & (std::abs(p.x()) < tan_a * std::abs(p.y() + offset));
20 }

References funct::abs(), hapothem, offset, AlCaHLTBitMon_ParallelJobs::p, and tan_a.

Referenced by inside().

◆ inside() [3/9]

bool TrapezoidalPlaneBounds::inside ( const Local2DPoint p,
const LocalError err,
float  scale 
) const
overridevirtual

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

Reimplemented from Bounds.

Definition at line 38 of file TrapezoidalPlaneBounds.cc.

38  {
39  return Bounds::inside(p, err, scale);
40 }

References submitPVResolutionJobs::err, Bounds::inside(), AlCaHLTBitMon_ParallelJobs::p, and L1EGammaCrystalsEmulatorProducer_cfi::scale.

◆ inside() [4/9]

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() [5/9]

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/9]

virtual bool Bounds::inside

Determine if the point is inside the bounds.

◆ inside() [7/9]

virtual bool Bounds::inside

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

◆ inside() [8/9]

bool TrapezoidalPlaneBounds::inside ( const Local3DPoint ) const
overridevirtual

Determine if the point is inside the bounds.

Implements Bounds.

Reimplemented in CSCLayerGeometry.

Definition at line 22 of file TrapezoidalPlaneBounds.cc.

22  {
23  return ((std::abs(p.y()) < hapothem) & (std::abs(p.z()) < hthickness)) &&
24  std::abs(p.x()) < tan_a * std::abs(p.y() + offset);
25 }

References funct::abs(), hapothem, hthickness, offset, AlCaHLTBitMon_ParallelJobs::p, and tan_a.

◆ inside() [9/9]

bool TrapezoidalPlaneBounds::inside ( const Local3DPoint ,
const LocalError ,
float  scale 
) const
overridevirtual

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

Implements Bounds.

Reimplemented in CSCLayerGeometry.

Definition at line 27 of file TrapezoidalPlaneBounds.cc.

27  {
28  if (scale >= 0 && inside(p))
29  return true;
30 
32  htopedge + std::sqrt(err.xx()) * scale,
33  hapothem + std::sqrt(err.yy()) * scale,
34  hthickness);
35  return tmp.inside(p);
36 }

References submitPVResolutionJobs::err, hapothem, hbotedge, hthickness, htopedge, inside(), AlCaHLTBitMon_ParallelJobs::p, L1EGammaCrystalsEmulatorProducer_cfi::scale, mathSSE::sqrt(), and createJobs::tmp.

◆ length()

float TrapezoidalPlaneBounds::length ( ) const
inlineoverridevirtual

apothem (full, not half)

Implements Bounds.

Definition at line 27 of file TrapezoidalPlaneBounds.h.

27 { return 2 * hapothem; }

References hapothem.

Referenced by CSCStripElectronicsSim::addCrosstalk(), operator<<(), CSCLayerGeometry::possibleRecHitPosition(), and CSCChamberSpecs::stripNoise().

◆ parameters()

const std::array< const float, 4 > TrapezoidalPlaneBounds::parameters ( void  ) const
virtual

returns the 4 parameters needed for construction, in the order ( half bottom edge, half top edge, half thickness, half apothem). Beware! This order is different from the one in the constructor!

Definition at line 49 of file TrapezoidalPlaneBounds.cc.

49  {
50  // Same order as geant3 for constructor compatibility
51  std::array<const float, 4> vec{{hbotedge, htopedge, hthickness, hapothem}};
52  return vec;
53 }

References hapothem, hbotedge, hthickness, and htopedge.

Referenced by HitEff::analyze(), CSCOfflineMonitor::doEfficiencies(), and CSCValidation::doEfficiencies().

◆ significanceInside()

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

Reimplemented from Bounds.

Definition at line 42 of file TrapezoidalPlaneBounds.cc.

42  {
43  return std::max((std::abs(p.y()) - hapothem) / std::sqrt(err.yy()),
44  (std::abs(p.x()) - tan_a * std::abs(p.y() + offset)) / std::sqrt(err.xx()));
45 }

References funct::abs(), submitPVResolutionJobs::err, hapothem, SiStripPI::max, offset, AlCaHLTBitMon_ParallelJobs::p, mathSSE::sqrt(), and tan_a.

◆ thickness()

float TrapezoidalPlaneBounds::thickness ( ) const
inlineoverridevirtual

thickness (full, not half)

Implements Bounds.

Definition at line 33 of file TrapezoidalPlaneBounds.h.

33 { return 2 * hthickness; }

References hthickness.

Referenced by CSCLayerGeometry::inside(), and operator<<().

◆ width()

float TrapezoidalPlaneBounds::width ( ) const
inlineoverridevirtual

largest width (full, not half)

Implements Bounds.

Definition at line 30 of file TrapezoidalPlaneBounds.h.

30 { return 2 * std::max(hbotedge, htopedge); }

References hbotedge, htopedge, and SiStripPI::max.

◆ widthAtHalfLength()

float TrapezoidalPlaneBounds::widthAtHalfLength ( ) const
inlineoverridevirtual

Width at half length. Useful for e.g. pitch definition.

Reimplemented from Bounds.

Definition at line 37 of file TrapezoidalPlaneBounds.h.

37 { return hbotedge + htopedge; }

References hbotedge, and htopedge.

◆ yAxisOrientation()

int TrapezoidalPlaneBounds::yAxisOrientation ( ) const
virtual

Definition at line 16 of file TrapezoidalPlaneBounds.cc.

16 { return (hbotedge > htopedge) ? -1 : 1; }

References hbotedge, and htopedge.

Referenced by StripTopologyBuilder::build().

Member Data Documentation

◆ hapothem

float TrapezoidalPlaneBounds::hapothem
private

Definition at line 65 of file TrapezoidalPlaneBounds.h.

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

◆ hbotedge

float TrapezoidalPlaneBounds::hbotedge
private

◆ hthickness

float TrapezoidalPlaneBounds::hthickness
private

Definition at line 66 of file TrapezoidalPlaneBounds.h.

Referenced by inside(), parameters(), and thickness().

◆ htopedge

float TrapezoidalPlaneBounds::htopedge
private

◆ offset

float TrapezoidalPlaneBounds::offset
private

Definition at line 69 of file TrapezoidalPlaneBounds.h.

Referenced by inside(), significanceInside(), and TrapezoidalPlaneBounds().

◆ tan_a

float TrapezoidalPlaneBounds::tan_a
private

Definition at line 70 of file TrapezoidalPlaneBounds.h.

Referenced by inside(), significanceInside(), and TrapezoidalPlaneBounds().

TrapezoidalPlaneBounds::tan_a
float tan_a
Definition: TrapezoidalPlaneBounds.h:70
L1EGammaCrystalsEmulatorProducer_cfi.scale
scale
Definition: L1EGammaCrystalsEmulatorProducer_cfi.py:10
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
TrapezoidalPlaneBounds::TrapezoidalPlaneBounds
TrapezoidalPlaneBounds(float be, float te, float a, float t)
Definition: TrapezoidalPlaneBounds.cc:7
TrapezoidalPlaneBounds::hbotedge
float hbotedge
Definition: TrapezoidalPlaneBounds.h:63
TrapezoidalPlaneBounds::offset
float offset
Definition: TrapezoidalPlaneBounds.h:69
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
Bounds::inside
virtual bool inside(const Local3DPoint &) const =0
Determine if the point is inside the bounds.
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
a
double a
Definition: hdecay.h:119
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
LocalError
Definition: LocalError.h:12
TrapezoidalPlaneBounds::htopedge
float htopedge
Definition: TrapezoidalPlaneBounds.h:64
submitPVResolutionJobs.err
err
Definition: submitPVResolutionJobs.py:85
TrapezoidalPlaneBounds::hthickness
float hthickness
Definition: TrapezoidalPlaneBounds.h:66
TrapezoidalPlaneBounds
Definition: TrapezoidalPlaneBounds.h:15
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
cms::cuda::be
int be
Definition: HistoContainer.h:126
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
TrapezoidalPlaneBounds::hapothem
float hapothem
Definition: TrapezoidalPlaneBounds.h:65
TrapezoidalPlaneBounds::inside
bool inside(const Local2DPoint &p) const override
Definition: TrapezoidalPlaneBounds.cc:18
Local3DPoint
Point3DBase< float, LocalTag > Local3DPoint
Definition: LocalPoint.h:9