Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
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
setNominalValue
();
36
}
37
38
bool
MagCylinder::inside
(
const
GlobalPoint
&
gp
,
double
tolerance
)
const
{
return
inside
(
toLocal
(gp), tolerance); }
39
40
bool
MagCylinder::inside
(
const
LocalPoint
& lp,
double
tolerance
)
const
{
41
Scalar
r
(lp.perp());
42
return
lp.z() >
theZmin
- tolerance && lp.z() <
theZmax
+ tolerance &&
r
>
theInnerR
- tolerance &&
43
r
<
theOuterR
+
tolerance
;
44
}
SurfaceOrientation::outer
Definition:
Surface.h:19
spu::def
int def(FILE *, FILE *, int)
Definition:
SherpackUtilities.cc:14
mps_fire.i
i
Definition:
mps_fire.py:428
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:29
Cylinder
Definition:
Cylinder.h:19
MagCylinder::theInnerR
Scalar theInnerR
Definition:
MagCylinder.h:37
MagVolume::LocalPoint
GloballyPositioned< float >::LocalPoint LocalPoint
Definition:
MagVolume.h:16
SurfaceOrientation::GlobalFace
GlobalFace
Definition:
Surface.h:19
MagCylinder::MagCylinder
MagCylinder(const PositionType &pos, const RotationType &rot, const std::vector< VolumeSide > &faces, const MagneticFieldProvider< float > *mfp)
Definition:
MagCylinder.cc:5
MagCylinder::inside
bool inside(const GlobalPoint &gp, double tolerance=0.) const override
Definition:
MagCylinder.cc:38
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:19
GloballyPositioned< float >::toLocal
LocalPoint toLocal(const GlobalPoint &gp) const
Definition:
GloballyPositioned.h:98
SurfaceOrientation::zplus
Definition:
Surface.h:19
MagExceptions.h
MagGeometryError
Definition:
MagExceptions.h:18
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
runTauDisplay.gp
list gp
Definition:
runTauDisplay.py:431
alignCSCRings.r
list r
Definition:
alignCSCRings.py:93
DDAxes::z
MagneticField::setNominalValue
void setNominalValue()
Definition:
MagneticField.cc:14
SurfaceOrientation::zminus
Definition:
Surface.h:19
Cylinder.h
MagneticFieldProvider< float >
MagCylinder.h
makeMuonMisalignmentScenario.rot
list rot
Definition:
makeMuonMisalignmentScenario.py:322
Generated for CMSSW Reference Manual by
1.8.5