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
Local2DPoint
&
p
,
float
tollerance)
const
{
21
return
std::abs
(p.
x
()) <
halfWidth
+ tollerance &&
22
std::abs
(p.
y
()) <
halfLength
+ tollerance;
23
24
}
25
26
bool
RectangularPlaneBounds::inside
(
const
Local3DPoint
&
p
,
const
LocalError
& err,
27
float
scale
)
const
{
28
if
(scale >=0){
29
return
30
fabs(p.
z
()) <
halfThickness
&&
31
(fabs(p.
x
()) <
halfWidth
|| fabs(p.
x
()) <
halfWidth
+
std::sqrt
(err.
xx
())*scale) &&
32
(fabs(p.
y
()) <
halfLength
|| fabs(p.
y
()) <
halfLength
+
std::sqrt
(err.
yy
())*scale);
33
}
else
{
34
return
35
fabs(p.
z
()) <
halfThickness
&&
36
(fabs(p.
x
()) <
halfWidth
+
std::sqrt
(err.
xx
())*scale) &&
37
(fabs(p.
y
()) <
halfLength
+
std::sqrt
(err.
yy
())*scale);
38
}
39
}
40
41
bool
RectangularPlaneBounds::inside
(
const
Local2DPoint
&
p
,
const
LocalError
& err,
42
float
scale
)
const
{
43
if
(scale >=0){
44
return
45
(fabs(p.
x
()) <
halfWidth
|| fabs(p.
x
()) <
halfWidth
+
std::sqrt
(err.
xx
())*scale) &&
46
(fabs(p.
y
()) <
halfLength
|| fabs(p.
y
()) <
halfLength
+
std::sqrt
(err.
yy
())*scale);
47
}
else
{
48
return
49
(fabs(p.
x
()) <
halfWidth
+
std::sqrt
(err.
xx
())*scale) &&
50
(fabs(p.
y
()) <
halfLength
+
std::sqrt
(err.
yy
())*scale);
51
}
52
}
53
54
Bounds
*
RectangularPlaneBounds::clone
()
const
{
55
return
new
RectangularPlaneBounds
(*
this
);
56
}
57
58
LocalError.h
LocalError::xx
float xx() const
Definition:
LocalError.h:24
PV2DBase::y
T y() const
Definition:
PV2DBase.h:45
lumiQTWidget.t
tuple t
Definition:
lumiQTWidget.py:50
PV3DBase::y
T y() const
Definition:
PV3DBase.h:62
abs
#define abs(x)
Definition:
mlp_lapack.h:159
RectangularPlaneBounds::clone
virtual Bounds * clone() const
Definition:
RectangularPlaneBounds.cc:54
Point2DBase< float, LocalTag >
RectangularPlaneBounds::RectangularPlaneBounds
RectangularPlaneBounds(float w, float h, float t)
Definition:
RectangularPlaneBounds.cc:5
LocalError::yy
float yy() const
Definition:
LocalError.h:26
pileupReCalc_HLTpaths.scale
int scale
Definition:
pileupReCalc_HLTpaths.py:111
mathSSE::sqrt
T sqrt(T t)
Definition:
SSEVec.h:46
PV3DBase::z
T z() const
Definition:
PV3DBase.h:63
RectangularPlaneBounds.h
h
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition:
Activities.doc:4
LocalError
Definition:
LocalError.h:12
RectangularPlaneBounds::inside
virtual bool inside(const Local2DPoint &p) const
Definition:
RectangularPlaneBounds.cc:9
RectangularPlaneBounds::halfLength
float halfLength
Definition:
RectangularPlaneBounds.h:45
AlCaHLTBitMon_ParallelJobs.p
tuple p
Definition:
AlCaHLTBitMon_ParallelJobs.py:152
Point3DBase< float, LocalTag >
RectangularPlaneBounds::halfWidth
float halfWidth
Definition:
RectangularPlaneBounds.h:44
Bounds
Definition:
Bounds.h:18
PV2DBase::x
T x() const
Definition:
PV2DBase.h:44
PV3DBase::x
T x() const
Definition:
PV3DBase.h:61
RectangularPlaneBounds::halfThickness
float halfThickness
Definition:
RectangularPlaneBounds.h:46
w
T w() const
Definition:
newBasic3DVector.h:234
Generated for CMSSW Reference Manual by
1.8.5