Main Page
Namespaces
Classes
Package Documentation
MagneticField
VolumeGeometry
src
MagCylinder.cc
Go to the documentation of this file.
1
#include "
MagneticField/VolumeGeometry/interface/MagCylinder.h
"
2
#include "
MagneticField/VolumeGeometry/interface/MagExceptions.h
"
3
#include "
DataFormats/GeometrySurface/interface/Cylinder.h
"
4
5
MagCylinder::MagCylinder
(
const
PositionType
&
pos
,
6
const
RotationType
&
rot
,
7
const
std::vector<VolumeSide>& faces,
8
const
MagneticFieldProvider<float>
* mfp)
9
:
MagVolume
(pos,rot,mfp), theFaces(faces), theZmin(0.), theZmax(0.), theInnerR(0.), theOuterR(0.)
10
{
11
using
SurfaceOrientation::GlobalFace
;
12
13
unsigned
int
def
= 0;
14
for
(std::vector<VolumeSide>::const_iterator
i
=faces.begin();
i
!= faces.end(); ++
i
) {
15
if
(
i
->globalFace() ==
SurfaceOrientation::zminus
) {
16
theZmin
=
MagVolume::toLocal
(
i
->surface().position()).
z
();
17
++
def
;
18
}
19
else
if
(
i
->globalFace() ==
SurfaceOrientation::zplus
) {
20
theZmax
=
MagVolume::toLocal
(
i
->surface().position()).
z
();
21
++
def
;
22
}
23
else
if
(
i
->globalFace() ==
SurfaceOrientation::outer
||
i
->globalFace() ==
SurfaceOrientation::inner
) {
24
const
Cylinder
* cyl =
dynamic_cast<
const
Cylinder
*
>
(&(
i
->surface()));
25
if
(cyl ==
nullptr
) {
26
throw
MagGeometryError
(
"MagCylinder inner/outer surface is not a cylinder"
);
27
}
28
if
(
i
->globalFace() ==
SurfaceOrientation::outer
)
theOuterR
= cyl->
radius
();
29
else
theInnerR
= cyl->
radius
();
30
++
def
;
31
}
32
}
33
if
(def != faces.size()) {
34
throw
MagGeometryError
(
"MagCylinder constructed with wrong number/type of faces"
);
35
}
36
37
}
38
39
bool
MagCylinder::inside
(
const
GlobalPoint
&
gp
,
double
tolerance
)
const
40
{
41
return
inside
(
toLocal
(gp), tolerance);
42
}
43
44
bool
MagCylinder::inside
(
const
LocalPoint
& lp,
double
tolerance
)
const
45
{
46
Scalar
r
( lp.perp());
47
return
48
lp.z() >
theZmin
- tolerance &&
49
lp.z() <
theZmax
+ tolerance &&
50
r
>
theInnerR
- tolerance &&
51
r
<
theOuterR
+
tolerance
;
52
}
SurfaceOrientation::outer
Definition:
Surface.h:24
mps_fire.i
i
Definition:
mps_fire.py:329
MagCylinder::theZmax
Scalar theZmax
Definition:
MagCylinder.h:37
MagVolume::GlobalPoint
GloballyPositioned< float >::GlobalPoint GlobalPoint
Definition:
MagVolume.h:19
tolerance
const double tolerance
Definition:
HGCalGeomParameters.cc:27
Cylinder
Definition:
Cylinder.h:19
MagCylinder::theInnerR
Scalar theInnerR
Definition:
MagCylinder.h:38
runTauDisplay.gp
gp
Definition:
runTauDisplay.py:429
MagVolume::LocalPoint
GloballyPositioned< float >::LocalPoint LocalPoint
Definition:
MagVolume.h:17
SurfaceOrientation::GlobalFace
GlobalFace
Definition:
Surface.h:24
MagCylinder::MagCylinder
MagCylinder(const PositionType &pos, const RotationType &rot, const std::vector< VolumeSide > &faces, const MagneticFieldProvider< float > *mfp)
Definition:
MagCylinder.cc:5
Cylinder::radius
Scalar radius() const
Radius of the cylinder.
Definition:
Cylinder.h:67
MagVolume
Definition:
MagVolume.h:13
TkRotation< float >
SurfaceOrientation::inner
Definition:
Surface.h:24
GloballyPositioned< float >::toLocal
LocalPoint toLocal(const GlobalPoint &gp) const
Definition:
GloballyPositioned.h:125
SurfaceOrientation::zplus
Definition:
Surface.h:24
MagExceptions.h
MagGeometryError
Definition:
MagExceptions.h:17
MagCylinder::inside
bool inside(const GlobalPoint &gp, double tolerance=0.) const override
Definition:
MagCylinder.cc:39
pos
Definition:
PixelAliasList.h:18
alignCSCRings.r
r
Definition:
alignCSCRings.py:93
MagCylinder::theOuterR
Scalar theOuterR
Definition:
MagCylinder.h:39
GloballyPositioned< float >::Scalar
float Scalar
Definition:
GloballyPositioned.h:21
Point3DBase< float, GlobalTag >
MagCylinder::theZmin
Scalar theZmin
Definition:
MagCylinder.h:36
DDAxes::z
SurfaceOrientation::zminus
Definition:
Surface.h:24
Cylinder.h
def
JetCorrectorParameters::Definitions def
Definition:
classes.h:6
MagneticFieldProvider< float >
makeMuonMisalignmentScenario.rot
rot
Definition:
makeMuonMisalignmentScenario.py:321
MagCylinder.h
Generated for CMSSW Reference Manual by
1.8.11