Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
DataFormats
GeometrySurface
src
RectangularPlaneBounds.cc
Go to the documentation of this file.
1
#include "
DataFormats/GeometrySurface/interface/RectangularPlaneBounds.h
"
2
#include "
DataFormats/GeometrySurface/interface/LocalError.h
"
3
#include <cmath>
4
5
RectangularPlaneBounds::RectangularPlaneBounds
(
float
w,
float
h
,
float
t
) :
6
halfWidth(w), halfLength(h), halfThickness(t) {}
7
8
9
bool
RectangularPlaneBounds::inside
(
const
Local2DPoint
&
p
)
const
{
10
return
fabs(p.
x
()) <=
halfWidth
&& fabs(p.
y
()) <=
halfLength
;
11
}
12
13
bool
RectangularPlaneBounds::inside
(
const
Local3DPoint
&
p
)
const
{
14
return
15
fabs(p.
x
()) <
halfWidth
&&
16
fabs(p.
y
()) <
halfLength
&&
17
fabs(p.
z
()) <
halfThickness
;
18
}
19
20
bool
RectangularPlaneBounds::inside
(
const
Local3DPoint
&
p
,
const
LocalError
& err,
21
float
scale)
const
{
22
if
(scale >=0){
23
return
24
fabs(p.
z
()) <
halfThickness
&&
25
(fabs(p.
x
()) <
halfWidth
|| fabs(p.
x
()) <
halfWidth
+
std::sqrt
(err.
xx
())*scale) &&
26
(fabs(p.
y
()) <
halfLength
|| fabs(p.
y
()) <
halfLength
+
std::sqrt
(err.
yy
())*scale);
27
}
else
{
28
return
29
fabs(p.
z
()) <
halfThickness
&&
30
(fabs(p.
x
()) <
halfWidth
+
std::sqrt
(err.
xx
())*scale) &&
31
(fabs(p.
y
()) <
halfLength
+
std::sqrt
(err.
yy
())*scale);
32
}
33
}
34
35
bool
RectangularPlaneBounds::inside
(
const
Local2DPoint
&
p
,
const
LocalError
& err,
36
float
scale)
const
{
37
if
(scale >=0){
38
return
39
(fabs(p.
x
()) <
halfWidth
|| fabs(p.
x
()) <
halfWidth
+
std::sqrt
(err.
xx
())*scale) &&
40
(fabs(p.
y
()) <
halfLength
|| fabs(p.
y
()) <
halfLength
+
std::sqrt
(err.
yy
())*scale);
41
}
else
{
42
return
43
(fabs(p.
x
()) <
halfWidth
+
std::sqrt
(err.
xx
())*scale) &&
44
(fabs(p.
y
()) <
halfLength
+
std::sqrt
(err.
yy
())*scale);
45
}
46
}
47
48
Bounds
*
RectangularPlaneBounds::clone
()
const
{
49
return
new
RectangularPlaneBounds
(*
this
);
50
}
51
52
LocalError.h
LocalError::xx
float xx() const
Definition:
LocalError.h:19
PV2DBase::y
T y() const
Definition:
PV2DBase.h:40
PV3DBase::y
T y() const
Definition:
PV3DBase.h:57
RectangularPlaneBounds::clone
virtual Bounds * clone() const
Definition:
RectangularPlaneBounds.cc:48
Point2DBase< float, LocalTag >
RectangularPlaneBounds::RectangularPlaneBounds
RectangularPlaneBounds(float w, float h, float t)
Definition:
RectangularPlaneBounds.cc:5
LocalError::yy
float yy() const
Definition:
LocalError.h:21
mathSSE::sqrt
T sqrt(T t)
Definition:
SSEVec.h:28
matplotRender.t
tuple t
Definition:
matplotRender.py:569
PV3DBase::z
T z() const
Definition:
PV3DBase.h:58
RectangularPlaneBounds.h
LocalError
Definition:
LocalError.h:11
RectangularPlaneBounds::inside
virtual bool inside(const Local2DPoint &p) const
Definition:
RectangularPlaneBounds.cc:9
L1TEmulatorMonitor_cff.p
tuple p
Definition:
L1TEmulatorMonitor_cff.py:48
RectangularPlaneBounds::halfLength
float halfLength
Definition:
RectangularPlaneBounds.h:42
Point3DBase< float, LocalTag >
RectangularPlaneBounds::halfWidth
float halfWidth
Definition:
RectangularPlaneBounds.h:41
Bounds
Definition:
Bounds.h:18
h
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition:
Activities.doc:4
PV2DBase::x
T x() const
Definition:
PV2DBase.h:39
PV3DBase::x
T x() const
Definition:
PV3DBase.h:56
RectangularPlaneBounds::halfThickness
float halfThickness
Definition:
RectangularPlaneBounds.h:43
Generated for CMSSW Reference Manual by
1.8.5