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
using
SurfaceOrientation::GlobalFace
;
11
12
unsigned
int
def
= 0;
13
for
(std::vector<VolumeSide>::const_iterator
i
= faces.begin();
i
!= faces.end(); ++
i
) {
14
if
(
i
->globalFace() ==
SurfaceOrientation::zminus
) {
15
theZmin
=
MagVolume::toLocal
(
i
->surface().position()).
z
();
16
++
def
;
17
}
else
if
(
i
->globalFace() ==
SurfaceOrientation::zplus
) {
18
theZmax
=
MagVolume::toLocal
(
i
->surface().position()).
z
();
19
++
def
;
20
}
else
if
(
i
->globalFace() ==
SurfaceOrientation::outer
||
i
->globalFace() ==
SurfaceOrientation::inner
) {
21
const
Cylinder
* cyl =
dynamic_cast<
const
Cylinder
*
>
(&(
i
->surface()));
22
if
(cyl ==
nullptr
) {
23
throw
MagGeometryError
(
"MagCylinder inner/outer surface is not a cylinder"
);
24
}
25
if
(
i
->globalFace() ==
SurfaceOrientation::outer
)
26
theOuterR
= cyl->
radius
();
27
else
28
theInnerR
= cyl->
radius
();
29
++
def
;
30
}
31
}
32
if
(def != faces.size()) {
33
throw
MagGeometryError
(
"MagCylinder constructed with wrong number/type of faces"
);
34
}
35
}
36
37
bool
MagCylinder::inside
(
const
GlobalPoint
&
gp
,
double
tolerance
)
const
{
return
inside
(
toLocal
(gp), tolerance); }
38
39
bool
MagCylinder::inside
(
const
LocalPoint
& lp,
double
tolerance
)
const
{
40
Scalar
r
(lp.perp());
41
return
lp.z() >
theZmin
- tolerance && lp.z() <
theZmax
+ tolerance &&
r
>
theInnerR
- tolerance &&
42
r
<
theOuterR
+
tolerance
;
43
}
SurfaceOrientation::outer
Definition:
Surface.h:21
mps_fire.i
i
Definition:
mps_fire.py:341
MagCylinder::theZmax
Scalar theZmax
Definition:
MagCylinder.h:36
MagVolume::GlobalPoint
GloballyPositioned< float >::GlobalPoint GlobalPoint
Definition:
MagVolume.h:18
tolerance
const double tolerance
Definition:
HGCalGeomParameters.cc:25
Cylinder
Definition:
Cylinder.h:19
MagCylinder::theInnerR
Scalar theInnerR
Definition:
MagCylinder.h:37
runTauDisplay.gp
gp
Definition:
runTauDisplay.py:431
MagVolume::LocalPoint
GloballyPositioned< float >::LocalPoint LocalPoint
Definition:
MagVolume.h:16
SurfaceOrientation::GlobalFace
GlobalFace
Definition:
Surface.h:21
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:64
MagVolume
Definition:
MagVolume.h:13
TkRotation< float >
SurfaceOrientation::inner
Definition:
Surface.h:21
GloballyPositioned< float >::toLocal
LocalPoint toLocal(const GlobalPoint &gp) const
Definition:
GloballyPositioned.h:98
SurfaceOrientation::zplus
Definition:
Surface.h:21
MagExceptions.h
MagGeometryError
Definition:
MagExceptions.h:18
MagCylinder::inside
bool inside(const GlobalPoint &gp, double tolerance=0.) const override
Definition:
MagCylinder.cc:37
pos
Definition:
PixelAliasList.h:18
alignCSCRings.r
r
Definition:
alignCSCRings.py:93
MagCylinder::theOuterR
Scalar theOuterR
Definition:
MagCylinder.h:38
GloballyPositioned< float >::Scalar
float Scalar
Definition:
GloballyPositioned.h:20
Point3DBase< float, GlobalTag >
MagCylinder::theZmin
Scalar theZmin
Definition:
MagCylinder.h:35
DDAxes::z
SurfaceOrientation::zminus
Definition:
Surface.h:21
Cylinder.h
def
JetCorrectorParameters::Definitions def
Definition:
classes.h:6
MagneticFieldProvider< float >
makeMuonMisalignmentScenario.rot
rot
Definition:
makeMuonMisalignmentScenario.py:322
MagCylinder.h
Generated for CMSSW Reference Manual by
1.8.11