DataFormats
GeometrySurface
src
SimpleDiskBounds.cc
Go to the documentation of this file.
1
2
3
#include "
DataFormats/GeometrySurface/interface/SimpleDiskBounds.h
"
4
#include "
DataFormats/GeometrySurface/interface/LocalError.h
"
5
#include <algorithm>
6
#include <cmath>
7
8
SimpleDiskBounds::SimpleDiskBounds
(
float
rmin,
float
rmax,
float
zmin
,
float
zmax
)
9
: theRmin(rmin), theRmax(rmax), theZmin(
zmin
), theZmax(
zmax
) {
10
if
(
theRmin
>
theRmax
)
11
std::swap
(
theRmin
,
theRmax
);
12
if
(
theZmin
>
theZmax
)
13
std::swap
(
theZmin
,
theZmax
);
14
}
15
16
bool
SimpleDiskBounds::inside
(
const
Local2DPoint
&
p
,
const
LocalError
&
err
)
const
{
return
Bounds::inside
(
p
,
err
); }
17
18
Bounds
*
SimpleDiskBounds::clone
()
const
{
return
new
SimpleDiskBounds
(*
this
); }
19
20
bool
SimpleDiskBounds::inside
(
const
Local3DPoint
&
p
,
const
LocalError
&
err
,
float
scale
)
const
{
21
if
(
p
.z() <
theZmin
||
p
.z() >
theZmax
)
22
return
false
;
// check the easy part first
23
24
double
perp2
=
p
.perp2();
25
double
perp
=
sqrt
(
perp2
);
26
if
(
perp2
== 0)
27
return
scale
*
scale
* (
err
.xx() +
err
.xy()) >
theRmin
*
theRmin
;
28
29
// rotated error along p.x(),p.y()
30
// equivalent to (but faster than) err.rotate(p.x(),p.y()).xx()
31
// since we don't need all matrix elements
32
float
deltaR
=
scale
*
sqrt
(
p
.x() *
p
.x() /
perp2
*
err
.xx() - 2 *
p
.x() *
p
.y() /
perp2
*
err
.xy() +
33
p
.y() *
p
.y() /
perp2
*
err
.yy());
34
return
perp
>
std::max
(
theRmin
-
deltaR
, 0.
f
) &&
perp
<
theRmax
+
deltaR
;
35
}
Point2DBase< float, LocalTag >
L1EGammaCrystalsEmulatorProducer_cfi.scale
scale
Definition:
L1EGammaCrystalsEmulatorProducer_cfi.py:10
f
double f[11][100]
Definition:
MuScleFitUtils.cc:78
AlCaHLTBitMon_ParallelJobs.p
p
Definition:
AlCaHLTBitMon_ParallelJobs.py:153
Bounds
Definition:
Bounds.h:18
perp
T perp() const
Magnitude of transverse component.
Definition:
Basic3DVectorLD.h:133
SiStripMonitorCluster_cfi.zmin
zmin
Definition:
SiStripMonitorCluster_cfi.py:200
SimpleDiskBounds::clone
Bounds * clone() const override
Definition:
SimpleDiskBounds.cc:18
std::swap
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
Definition:
DataFrameContainer.h:209
SiStripMonitorCluster_cfi.zmax
zmax
Definition:
SiStripMonitorCluster_cfi.py:201
Bounds::inside
virtual bool inside(const Local3DPoint &) const =0
Determine if the point is inside the bounds.
LocalError.h
mathSSE::sqrt
T sqrt(T t)
Definition:
SSEVec.h:19
SimpleDiskBounds::theZmax
float theZmax
Definition:
SimpleDiskBounds.h:44
Point3DBase< float, LocalTag >
PbPb_ZMuSkimMuonDPG_cff.deltaR
deltaR
Definition:
PbPb_ZMuSkimMuonDPG_cff.py:63
SiStripPI::max
Definition:
SiStripPayloadInspectorHelper.h:169
SimpleDiskBounds::SimpleDiskBounds
SimpleDiskBounds(float rmin, float rmax, float zmin, float zmax)
Construct the bounds from min and max R and Z in LOCAL coordinates.
Definition:
SimpleDiskBounds.cc:8
LocalError
Definition:
LocalError.h:12
SimpleDiskBounds::theZmin
float theZmin
Definition:
SimpleDiskBounds.h:43
SimpleDiskBounds::theRmin
float theRmin
Definition:
SimpleDiskBounds.h:41
SimpleDiskBounds::theRmax
float theRmax
Definition:
SimpleDiskBounds.h:42
perp2
T perp2() const
Squared magnitude of transverse component.
Definition:
Basic3DVectorLD.h:130
submitPVResolutionJobs.err
err
Definition:
submitPVResolutionJobs.py:85
SimpleDiskBounds::inside
bool inside(const Local3DPoint &p) const override
Determine if the point is inside the bounds.
Definition:
SimpleDiskBounds.h:20
SimpleDiskBounds.h
Generated for CMSSW Reference Manual by
1.8.16