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

virtual Boundsclone () const
 
virtual bool inside (const Local2DPoint &p) const
 
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, float scale) const
 Determine if a 2D point is inside the bounds, taking error into account. More...
 
virtual float length () const
 
virtual const std::array< const float, 4 > parameters () const
 
virtual float thickness () const
 
 TrapezoidalPlaneBounds (float be, float te, float a, float t)
 
virtual float width () const
 
virtual float widthAtHalfLength () const
 
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 16 of file TrapezoidalPlaneBounds.h.

Constructor & Destructor Documentation

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.

References funct::abs(), offset, and tan_a.

Referenced by clone().

8  :
9  hbotedge(be), htopedge(te), hapothem(a), hthickness(t) {
10 
11  // pre-compute offset of triangle vertex and tg of (half) opening
12  // angle of the trapezoid for faster inside() implementation.
13 
14  offset = a * (te+be) / (te-be); // check sign if te < be !!!
15  tan_a = te / std::abs(offset + a);
16 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double a
Definition: hdecay.h:121

Member Function Documentation

Bounds * TrapezoidalPlaneBounds::clone ( void  ) const
virtual

Implements Bounds.

Reimplemented in CSCLayerGeometry.

Definition at line 47 of file TrapezoidalPlaneBounds.cc.

References TrapezoidalPlaneBounds().

Referenced by widthAtHalfLength().

47  {
48  return new TrapezoidalPlaneBounds(*this);
49 }
TrapezoidalPlaneBounds(float be, float te, float a, float t)
bool TrapezoidalPlaneBounds::inside ( const Local2DPoint p) const
virtual

Reimplemented from Bounds.

Reimplemented in CSCLayerGeometry.

Definition at line 23 of file TrapezoidalPlaneBounds.cc.

References funct::abs(), hapothem, offset, tan_a, PV2DBase< T, PVType, FrameType >::x(), and PV2DBase< T, PVType, FrameType >::y().

Referenced by inside(), and widthAtHalfLength().

23  {
24  return (std::abs(p.y()) < hapothem) &
25  (std::abs(p.x()) < tan_a*std::abs(p.y()+offset));
26 }
T y() const
Definition: PV2DBase.h:46
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
T x() const
Definition: PV2DBase.h:45
bool TrapezoidalPlaneBounds::inside ( const Local3DPoint ) const
virtual
bool TrapezoidalPlaneBounds::inside ( const Local3DPoint ,
const LocalError ,
float  scale 
) const
virtual

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

Implements Bounds.

Reimplemented in CSCLayerGeometry.

Definition at line 32 of file TrapezoidalPlaneBounds.cc.

References hapothem, hbotedge, hthickness, htopedge, inside(), mathSSE::sqrt(), tmp, LocalError::xx(), and LocalError::yy().

33  {
34  if (scale>=0 && inside(p)) return true;
35 
37  htopedge + std::sqrt(err.xx())*scale,
38  hapothem + std::sqrt(err.yy())*scale,
39  hthickness);
40  return tmp.inside(p);
41 }
virtual bool inside(const Local2DPoint &p) const
T sqrt(T t)
Definition: SSEVec.h:18
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
bool TrapezoidalPlaneBounds::inside ( const Local2DPoint p,
const LocalError err,
float  scale 
) const
virtual

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

Reimplemented from Bounds.

Definition at line 43 of file TrapezoidalPlaneBounds.cc.

References Bounds::inside().

43  {
44  return Bounds::inside(p,err,scale);
45 }
virtual bool inside(const Local3DPoint &) const =0
Determine if the point is inside the bounds.
virtual float TrapezoidalPlaneBounds::length ( ) const
inlinevirtual
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 53 of file TrapezoidalPlaneBounds.cc.

References hapothem, hbotedge, hthickness, and htopedge.

Referenced by HitEff::analyze(), CSCGeometryBuilder::buildChamber(), FWTGeoRecoGeometryESProducer::createShape(), CSCOfflineMonitor::doEfficiencies(), CSCValidation::doEfficiencies(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::inputTags(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::properties(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::recursePSetProperties(), and widthAtHalfLength().

53  {
54  // Same order as geant3 for constructor compatibility
55  std::array<const float, 4> vec { { hbotedge, htopedge, hthickness, hapothem } };
56  return vec;
57 }
virtual float TrapezoidalPlaneBounds::thickness ( ) const
inlinevirtual

thickness (full, not half)

Implements Bounds.

Definition at line 36 of file TrapezoidalPlaneBounds.h.

References hthickness.

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

36 { return 2 * hthickness;}
virtual float TrapezoidalPlaneBounds::width ( ) const
inlinevirtual
virtual float TrapezoidalPlaneBounds::widthAtHalfLength ( ) const
inlinevirtual

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

Reimplemented from Bounds.

Definition at line 40 of file TrapezoidalPlaneBounds.h.

References clone(), hbotedge, htopedge, Bounds::inside(), inside(), AlCaHLTBitMon_ParallelJobs::p, parameters(), Scenarios_cff::scale, and yAxisOrientation().

int TrapezoidalPlaneBounds::yAxisOrientation ( ) const
virtual

Definition at line 19 of file TrapezoidalPlaneBounds.cc.

References hbotedge, and htopedge.

Referenced by StripTopologyBuilder::build(), and widthAtHalfLength().

19  {
20  return (hbotedge>htopedge) ? -1 : 1;
21 }

Member Data Documentation

float TrapezoidalPlaneBounds::hapothem
private

Definition at line 66 of file TrapezoidalPlaneBounds.h.

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

float TrapezoidalPlaneBounds::hbotedge
private
float TrapezoidalPlaneBounds::hthickness
private

Definition at line 67 of file TrapezoidalPlaneBounds.h.

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

float TrapezoidalPlaneBounds::htopedge
private
float TrapezoidalPlaneBounds::offset
private

Definition at line 70 of file TrapezoidalPlaneBounds.h.

Referenced by inside(), and TrapezoidalPlaneBounds().

float TrapezoidalPlaneBounds::tan_a
private

Definition at line 71 of file TrapezoidalPlaneBounds.h.

Referenced by inside(), and TrapezoidalPlaneBounds().