CMS 3D CMS Logo

FourPointPlaneBounds.h
Go to the documentation of this file.
1 #ifndef FourPointPlaneBounds_H
2 #define FourPointPlaneBounds_H
3 
7 
9 
10 class FourPointPlaneBounds : public Bounds {
11 public:
13 
16  FourPointPlaneBounds(const LocalPoint& a, const LocalPoint& b, const LocalPoint& c, const LocalPoint& d);
17  ~FourPointPlaneBounds() override {}
18 
19  float length() const override;
20  float width() const override;
21  float thickness() const override;
22 
23  // basic bounds function
24  bool inside(const Local3DPoint& lp) const override;
25 
26  bool inside(const Local3DPoint& lp, const LocalError& e, float scale) const override { return inside(lp); }
27 
28  Bounds* clone() const override { return new FourPointPlaneBounds(*this); }
29 
30 private:
32 
33  const Local2DPoint& corner(int i) const { return corners_[i % 4]; }
34  double checkSide(int i, const Local2DPoint& lp) const;
35 
36  double checkSide(int i, Scalar x, Scalar y) const {
37  const Local2DPoint& cor(corner(i));
38  Local2DVector v(corner(i + 1) - cor);
39  // Local2DVector normal( -v.y(), v.x()); // 90 deg rotated
40  return -v.y() * (x - cor.x()) + v.x() * (y - cor.y()); // == normal.dot(LP(x,y)-cor))
41  }
42 };
43 
44 #endif
FourPointPlaneBounds::inside
bool inside(const Local3DPoint &lp, const LocalError &e, float scale) const override
Determine if a point is inside the bounds, taking error into account.
Definition: FourPointPlaneBounds.h:26
Point2DBase< float, LocalTag >
DDAxes::y
mps_fire.i
i
Definition: mps_fire.py:428
FourPointPlaneBounds::clone
Bounds * clone() const override
Definition: FourPointPlaneBounds.h:28
L1EGammaCrystalsEmulatorProducer_cfi.scale
scale
Definition: L1EGammaCrystalsEmulatorProducer_cfi.py:10
PV3DBase< float, PointTag, LocalTag >::ScalarType
float ScalarType
Definition: PV3DBase.h:17
Bounds
Definition: Bounds.h:18
FourPointPlaneBounds::width
float width() const override
Definition: FourPointPlaneBounds.cc:42
DDAxes::x
findQualityFiles.v
v
Definition: findQualityFiles.py:179
FourPointPlaneBounds
Definition: FourPointPlaneBounds.h:10
FourPointPlaneBounds::inside
bool inside(const Local3DPoint &lp) const override
Determine if the point is inside the bounds.
Definition: FourPointPlaneBounds.cc:33
FourPointPlaneBounds::thickness
float thickness() const override
Definition: FourPointPlaneBounds.cc:43
Vector2DBase
Definition: Vector2DBase.h:8
Bounds.h
Vector2DBase.h
Point3DBase< float, LocalTag >
b
double b
Definition: hdecay.h:118
a
double a
Definition: hdecay.h:119
FourPointPlaneBounds::FourPointPlaneBounds
FourPointPlaneBounds(const LocalPoint &a, const LocalPoint &b, const LocalPoint &c, const LocalPoint &d)
Definition: FourPointPlaneBounds.cc:8
LocalError
Definition: LocalError.h:12
PV2DBase::y
T y() const
Definition: PV2DBase.h:44
PV2DBase::x
T x() const
Definition: PV2DBase.h:43
FourPointPlaneBounds::~FourPointPlaneBounds
~FourPointPlaneBounds() override
Definition: FourPointPlaneBounds.h:17
Local2DVector
Vector2DBase< float, LocalTag > Local2DVector
Definition: FourPointPlaneBounds.h:8
FourPointPlaneBounds::corner
const Local2DPoint & corner(int i) const
Definition: FourPointPlaneBounds.h:33
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
FourPointPlaneBounds::corners_
Local2DPoint corners_[4]
Definition: FourPointPlaneBounds.h:31
FourPointPlaneBounds::checkSide
double checkSide(int i, Scalar x, Scalar y) const
Definition: FourPointPlaneBounds.h:36
FourPointPlaneBounds::length
float length() const override
Definition: FourPointPlaneBounds.cc:41
ztail.d
d
Definition: ztail.py:151
FourPointPlaneBounds::checkSide
double checkSide(int i, const Local2DPoint &lp) const
Definition: FourPointPlaneBounds.cc:31
LocalVector.h
FourPointPlaneBounds::Scalar
LocalPoint::ScalarType Scalar
Definition: FourPointPlaneBounds.h:12
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37