Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
DataFormats
GeometrySurface
src
TrapezoidalPlaneBounds.cc
Go to the documentation of this file.
1
2
3
#include "
DataFormats/GeometrySurface/interface/TrapezoidalPlaneBounds.h
"
4
#include "
DataFormats/GeometrySurface/interface/LocalError.h
"
5
#include <cmath>
6
7
TrapezoidalPlaneBounds::TrapezoidalPlaneBounds
(
float
be,
float
te,
8
float
a
,
float
t
) :
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 / fabs(
offset
+ a);
16
}
17
18
19
int
TrapezoidalPlaneBounds::yAxisOrientation
()
const
{
20
int
yAx = 1;
21
if
(
hbotedge
>
htopedge
) yAx = -1;
22
return
yAx;
23
}
24
25
bool
TrapezoidalPlaneBounds::inside
(
const
Local2DPoint
&
p
)
const
{
26
return
fabs(p.
y
()) <
hapothem
&&
27
fabs(p.
x
())/fabs(p.
y
()+
offset
) <
tan_a
;
28
}
29
30
bool
TrapezoidalPlaneBounds::inside
(
const
Local3DPoint
&
p
)
const
{
31
return
fabs(p.
y
()) <
hapothem
&&
32
fabs(p.
x
())/fabs(p.
y
()+
offset
) <
tan_a
&&
33
fabs(p.
z
()) <
hthickness
;
34
}
35
36
bool
TrapezoidalPlaneBounds::inside
(
const
Local3DPoint
&
p
,
37
const
LocalError
& err,
float
scale)
const
{
38
TrapezoidalPlaneBounds
tmp
(
hbotedge
+
sqrt
(err.
xx
())*scale,
39
htopedge
+
sqrt
(err.
xx
())*scale,
40
hapothem
+
sqrt
(err.
yy
())*scale,
41
hthickness
);
42
return
tmp.
inside
(p);
43
}
44
45
bool
TrapezoidalPlaneBounds::inside
(
const
Local2DPoint
&
p
,
const
LocalError
& err,
float
scale)
const
{
46
return
Bounds::inside
(p,err,scale);
47
}
48
49
Bounds
*
TrapezoidalPlaneBounds::clone
()
const
{
50
return
new
TrapezoidalPlaneBounds
(*
this
);
51
}
52
53
54
55
const
std::vector<float>
TrapezoidalPlaneBounds::parameters
()
const
{
56
std::vector<float> vec(4);
57
// Same order as geant3 for constructor compatibility
58
vec[0] =
hbotedge
;
59
vec[1] =
htopedge
;
60
vec[3] =
hapothem
;
61
vec[2] =
hthickness
;
62
return
vec;
63
}
LocalError.h
LocalError::xx
float xx() const
Definition:
LocalError.h:19
PV2DBase::y
T y() const
Definition:
PV2DBase.h:40
TrapezoidalPlaneBounds
Definition:
TrapezoidalPlaneBounds.h:16
TrapezoidalPlaneBounds::clone
virtual Bounds * clone() const
Definition:
TrapezoidalPlaneBounds.cc:49
Bounds::inside
virtual bool inside(const Local3DPoint &) const =0
Determine if the point is inside the bounds.
TrapezoidalPlaneBounds::TrapezoidalPlaneBounds
TrapezoidalPlaneBounds(float be, float te, float a, float t)
Definition:
TrapezoidalPlaneBounds.cc:7
PV3DBase::y
T y() const
Definition:
PV3DBase.h:57
TrapezoidalPlaneBounds::hthickness
float hthickness
Definition:
TrapezoidalPlaneBounds.h:65
TrapezoidalPlaneBounds::offset
float offset
Definition:
TrapezoidalPlaneBounds.h:68
Point2DBase< float, LocalTag >
TrapezoidalPlaneBounds::parameters
virtual const std::vector< float > parameters() const
Definition:
TrapezoidalPlaneBounds.cc:55
TrapezoidalPlaneBounds::inside
virtual bool inside(const Local2DPoint &p) const
Definition:
TrapezoidalPlaneBounds.cc:25
TrapezoidalPlaneBounds::hbotedge
float hbotedge
Definition:
TrapezoidalPlaneBounds.h:62
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
TrapezoidalPlaneBounds::htopedge
float htopedge
Definition:
TrapezoidalPlaneBounds.h:63
TrapezoidalPlaneBounds::hapothem
float hapothem
Definition:
TrapezoidalPlaneBounds.h:64
TrapezoidalPlaneBounds::tan_a
float tan_a
Definition:
TrapezoidalPlaneBounds.h:69
LocalError
Definition:
LocalError.h:11
L1TEmulatorMonitor_cff.p
tuple p
Definition:
L1TEmulatorMonitor_cff.py:48
tmp
std::vector< std::vector< double > > tmp
Definition:
MVATrainer.cc:100
Point3DBase< float, LocalTag >
a
double a
Definition:
hdecay.h:121
TrapezoidalPlaneBounds.h
Bounds
Definition:
Bounds.h:18
TrapezoidalPlaneBounds::yAxisOrientation
virtual int yAxisOrientation() const
Definition:
TrapezoidalPlaneBounds.cc:19
PV2DBase::x
T x() const
Definition:
PV2DBase.h:39
PV3DBase::x
T x() const
Definition:
PV3DBase.h:56
Generated for CMSSW Reference Manual by
1.8.5