#include <DataFormats/GeometrySurface/interface/TrapezoidalPlaneBounds.h>
Public Member Functions | |
virtual Bounds * | clone () const |
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. | |
virtual bool | inside (const Local3DPoint &p, const LocalError &err, float scale) const |
Determine if a point is inside the bounds, taking error into account. | |
virtual bool | inside (const Local3DPoint &p) const |
Determine if the point is inside the bounds. | |
virtual bool | inside (const Local2DPoint &p) const |
virtual float | length () const |
apothem (full, not half) | |
virtual const std::vector< float > | parameters () const |
returns the 4 parameters needed for construction, in the order ( half bottom edge, half top edge, half thickness, half apothem). | |
virtual float | thickness () const |
thickness (full, not half) | |
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 | |
virtual float | width () const |
largest width (full, not half) | |
virtual float | widthAtHalfLength () const |
Width at half length. | |
virtual int | yAxisOrientation () const |
Private Attributes | |
float | hapothem |
float | hbotedge |
float | hthickness |
float | htopedge |
float | offset |
float | tan_a |
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.
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.
Referenced by clone().
00008 : 00009 hbotedge(be), htopedge(te), hapothem(a), hthickness(t) { 00010 00011 // pre-compute offset of triangle vertex and tg of (half) opening 00012 // angle of the trapezoid for faster inside() implementation. 00013 00014 offset = a * (te+be) / (te-be); // check sign if te < be !!! 00015 tan_a = te / fabs(offset + a); 00016 }
Implements Bounds.
Reimplemented in CSCLayerGeometry.
Definition at line 49 of file TrapezoidalPlaneBounds.cc.
References TrapezoidalPlaneBounds().
00049 { 00050 return new TrapezoidalPlaneBounds(*this); 00051 }
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 45 of file TrapezoidalPlaneBounds.cc.
References Bounds::inside().
00045 { 00046 return Bounds::inside(p,err,scale); 00047 }
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.
Definition at line 36 of file TrapezoidalPlaneBounds.cc.
References hapothem, hbotedge, hthickness, htopedge, inside(), funct::sqrt(), tmp, LocalError::xx(), and LocalError::yy().
00037 { 00038 TrapezoidalPlaneBounds tmp( hbotedge + sqrt(err.xx())*scale, 00039 htopedge + sqrt(err.xx())*scale, 00040 hapothem + sqrt(err.yy())*scale, 00041 hthickness); 00042 return tmp.inside(p); 00043 }
bool TrapezoidalPlaneBounds::inside | ( | const Local3DPoint & | ) | const [virtual] |
Determine if the point is inside the bounds.
Implements Bounds.
Definition at line 30 of file TrapezoidalPlaneBounds.cc.
References hapothem, hthickness, offset, tan_a, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().
00030 { 00031 return fabs(p.y()) < hapothem && 00032 fabs(p.x())/fabs(p.y()+offset) < tan_a && 00033 fabs(p.z()) < hthickness; 00034 }
bool TrapezoidalPlaneBounds::inside | ( | const Local2DPoint & | p | ) | const [virtual] |
Reimplemented from Bounds.
Definition at line 25 of file TrapezoidalPlaneBounds.cc.
References hapothem, offset, tan_a, PV2DBase< T, PVType, FrameType >::x(), and PV2DBase< T, PVType, FrameType >::y().
Referenced by CSCWireHitSim::getIonizationClusters(), and inside().
00025 { 00026 return fabs(p.y()) < hapothem && 00027 fabs(p.x())/fabs(p.y()+offset) < tan_a; 00028 }
virtual float TrapezoidalPlaneBounds::length | ( | ) | const [inline, virtual] |
apothem (full, not half)
Implements Bounds.
Definition at line 30 of file TrapezoidalPlaneBounds.h.
References hapothem.
Referenced by CSCStripElectronicsSim::addCrosstalk(), CSCLayerGeometry::CSCLayerGeometry(), CSCMake2DRecHit::isHitInFiducial(), CSCLayerGeometry::possibleRecHitPosition(), CSCChamberSpecs::stripNoise(), VisCSCStripDigiTwig::update(), VisCSCCorrelatedLCTDigiTwig::update(), VisCSCComparatorDigiTwig::update(), and VisCSCCLCTDigiTwig::update().
00030 { return 2 * hapothem;}
const std::vector< float > 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 55 of file TrapezoidalPlaneBounds.cc.
References hapothem, hbotedge, hthickness, and htopedge.
Referenced by VisEventSetup::addCorners(), VisEventSetupService::addWafer(), VisTrackingGeometry::addWafer(), CSCEfficiency::analyze(), CSCGeometryBuilderFromDDD::buildChamber(), VisEventSetup::buildTracker(), CSCEfficiency::CalculateEfficiencies(), CSCValidation::doEfficiencies(), VisCSCChamberDrawer::getOutline(), VisCSCStripDigiTwig::update(), VisRPCDigiTwig::update(), and VisCSCWireDigiTwig::update().
00055 { 00056 std::vector<float> vec(4); 00057 // Same order as geant3 for constructor compatibility 00058 vec[0] = hbotedge; 00059 vec[1] = htopedge; 00060 vec[3] = hapothem; 00061 vec[2] = hthickness; 00062 return vec; 00063 }
virtual float TrapezoidalPlaneBounds::thickness | ( | ) | const [inline, virtual] |
thickness (full, not half)
Implements Bounds.
Definition at line 36 of file TrapezoidalPlaneBounds.h.
References hthickness.
00036 { return 2 * hthickness;}
virtual float TrapezoidalPlaneBounds::width | ( | ) | const [inline, virtual] |
largest width (full, not half)
Implements Bounds.
Definition at line 33 of file TrapezoidalPlaneBounds.h.
References hbotedge, htopedge, and max.
Referenced by CSCLayerGeometry::CSCLayerGeometry(), and VisCSCComparatorDigiTwig::update().
virtual float TrapezoidalPlaneBounds::widthAtHalfLength | ( | ) | const [inline, virtual] |
Width at half length.
Useful for e.g. pitch definition.
Reimplemented from Bounds.
Definition at line 40 of file TrapezoidalPlaneBounds.h.
References hbotedge, and htopedge.
Referenced by CSCLayerGeometry::CSCLayerGeometry().
int TrapezoidalPlaneBounds::yAxisOrientation | ( | ) | const [virtual] |
float TrapezoidalPlaneBounds::hapothem [private] |
Definition at line 64 of file TrapezoidalPlaneBounds.h.
Referenced by inside(), length(), and parameters().
float TrapezoidalPlaneBounds::hbotedge [private] |
Definition at line 62 of file TrapezoidalPlaneBounds.h.
Referenced by inside(), parameters(), width(), widthAtHalfLength(), and yAxisOrientation().
float TrapezoidalPlaneBounds::hthickness [private] |
Definition at line 65 of file TrapezoidalPlaneBounds.h.
Referenced by inside(), parameters(), and thickness().
float TrapezoidalPlaneBounds::htopedge [private] |
Definition at line 63 of file TrapezoidalPlaneBounds.h.
Referenced by inside(), parameters(), width(), widthAtHalfLength(), and yAxisOrientation().
float TrapezoidalPlaneBounds::offset [private] |
Definition at line 68 of file TrapezoidalPlaneBounds.h.
Referenced by inside(), and TrapezoidalPlaneBounds().
float TrapezoidalPlaneBounds::tan_a [private] |
Definition at line 69 of file TrapezoidalPlaneBounds.h.
Referenced by inside(), and TrapezoidalPlaneBounds().