Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
DataFormats
GeometrySurface
src
GeneralTrapezoidalPlaneBounds.cc
Go to the documentation of this file.
1
2
#include "
DataFormats/GeometrySurface/interface/GeneralTrapezoidalPlaneBounds.h
"
3
#include "
DataFormats/GeometrySurface/interface/LocalError.h
"
4
#include <cmath>
5
6
GeneralTrapezoidalPlaneBounds::GeneralTrapezoidalPlaneBounds
(
float
be,
float
te,
float
ang,
7
float
a
,
float
t
) :
8
hbotedge(be), htopedge(te), tilt_angle(ang), hapothem(a), hthickness(t) {
9
10
// pre-compute offsets of triangles and tg of (half) opening
11
// angles of the trapezoid for faster inside() implementation
12
13
tg_tilt
=
tan
(ang*
M_PI
/180.);
14
xoff
= a *
tg_tilt
;
15
offsetp
= a * (te+be) / (te-be+2.*
xoff
);
// for x > 0
16
tan_ap
= (te+
xoff
) / (
offsetp
+ a);
17
offsetn
= a * (te+be) / (te-be-2.*
xoff
);
// for x < 0
18
tan_an
= (
xoff
-te) / (
offsetn
+ a);
19
}
20
21
bool
GeneralTrapezoidalPlaneBounds::inside
(
const
Local2DPoint
&
p
)
const
{
22
return
std::abs
(p.
y
()) <=
hapothem
&&
23
( (p.
x
() >=0. && p.
x
()/(p.
y
()+
offsetp
) <=
tan_ap
) ||
24
(p.
x
() < 0. && p.
x
()/(p.
y
()+
offsetn
) >=
tan_an
) );
25
}
26
27
bool
GeneralTrapezoidalPlaneBounds::inside
(
const
Local3DPoint
&
p
)
const
{
28
return
std::abs
(p.
y
()) <=
hapothem
&&
29
( (p.
x
() >=0. && p.
x
()/(p.
y
()+
offsetp
) <=
tan_ap
) ||
30
(p.
x
() < 0. && p.
x
()/(p.
y
()+
offsetn
) >=
tan_an
) ) &&
31
std::abs
(p.
z
()) <=
hthickness
;
32
}
33
34
bool
GeneralTrapezoidalPlaneBounds::inside
(
const
Local3DPoint
&
p
,
35
const
LocalError
& err,
float
scale)
const
{
36
37
GeneralTrapezoidalPlaneBounds
tmp
(
hbotedge
+
sqrt
(err.
xx
())*scale,
38
htopedge
+
sqrt
(err.
xx
())*scale,
39
tilt_angle
,
40
hapothem
+
sqrt
(err.
yy
())*scale,
41
hthickness
);
42
return
tmp.
inside
(p);
43
}
44
45
const
std::vector<float>
GeneralTrapezoidalPlaneBounds::parameters
()
const
{
46
std::vector<float> vec(7);
47
// Same order as geant3 for constructor compatibility
48
vec[0] =
hthickness
;
49
vec[1] = 0;
50
vec[2] = 0;
51
vec[3] =
hapothem
;
52
vec[4] =
hbotedge
;
53
vec[5] =
htopedge
;
54
vec[6] =
tilt_angle
;
55
return
vec;
56
}
GeneralTrapezoidalPlaneBounds::hbotedge
float hbotedge
Definition:
GeneralTrapezoidalPlaneBounds.h:46
LocalError.h
GeneralTrapezoidalPlaneBounds::hapothem
float hapothem
Definition:
GeneralTrapezoidalPlaneBounds.h:49
LocalError::xx
float xx() const
Definition:
LocalError.h:19
PV2DBase::y
T y() const
Definition:
PV2DBase.h:40
GeneralTrapezoidalPlaneBounds::parameters
virtual const std::vector< float > parameters() const
Definition:
GeneralTrapezoidalPlaneBounds.cc:45
GeneralTrapezoidalPlaneBounds::htopedge
float htopedge
Definition:
GeneralTrapezoidalPlaneBounds.h:47
PV3DBase::y
T y() const
Definition:
PV3DBase.h:57
abs
#define abs(x)
Definition:
mlp_lapack.h:159
Point2DBase< float, LocalTag >
GeneralTrapezoidalPlaneBounds::GeneralTrapezoidalPlaneBounds
GeneralTrapezoidalPlaneBounds(float be, float te, float ang, float a, float t)
Definition:
GeneralTrapezoidalPlaneBounds.cc:6
GeneralTrapezoidalPlaneBounds::tg_tilt
float tg_tilt
Definition:
GeneralTrapezoidalPlaneBounds.h:54
GeneralTrapezoidalPlaneBounds::inside
virtual bool inside(const Local2DPoint &p) const
Definition:
GeneralTrapezoidalPlaneBounds.cc:21
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
GeneralTrapezoidalPlaneBounds::tan_an
float tan_an
Definition:
GeneralTrapezoidalPlaneBounds.h:56
funct::tan
Tan< T >::type tan(const T &t)
Definition:
Tan.h:22
GeneralTrapezoidalPlaneBounds::tilt_angle
float tilt_angle
Definition:
GeneralTrapezoidalPlaneBounds.h:48
GeneralTrapezoidalPlaneBounds::offsetn
float offsetn
Definition:
GeneralTrapezoidalPlaneBounds.h:55
GeneralTrapezoidalPlaneBounds::offsetp
float offsetp
Definition:
GeneralTrapezoidalPlaneBounds.h:55
GeneralTrapezoidalPlaneBounds::xoff
float xoff
Definition:
GeneralTrapezoidalPlaneBounds.h:53
M_PI
#define M_PI
Definition:
BFit3D.cc:3
LocalError
Definition:
LocalError.h:11
L1TEmulatorMonitor_cff.p
tuple p
Definition:
L1TEmulatorMonitor_cff.py:48
GeneralTrapezoidalPlaneBounds::tan_ap
float tan_ap
Definition:
GeneralTrapezoidalPlaneBounds.h:56
tmp
std::vector< std::vector< double > > tmp
Definition:
MVATrainer.cc:100
Point3DBase< float, LocalTag >
a
double a
Definition:
hdecay.h:121
GeneralTrapezoidalPlaneBounds::hthickness
float hthickness
Definition:
GeneralTrapezoidalPlaneBounds.h:50
GeneralTrapezoidalPlaneBounds.h
PV2DBase::x
T x() const
Definition:
PV2DBase.h:39
PV3DBase::x
T x() const
Definition:
PV3DBase.h:56
GeneralTrapezoidalPlaneBounds
Definition:
GeneralTrapezoidalPlaneBounds.h:16
Generated for CMSSW Reference Manual by
1.8.5