Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
DataFormats
GeometrySurface
src
Cylinder.cc
Go to the documentation of this file.
1
2
3
#include "
DataFormats/GeometrySurface/interface/Cylinder.h
"
4
#include "
DataFormats/GeometrySurface/interface/TangentPlane.h
"
5
#include "
DataFormats/GeometrySurface/interface/GeomExceptions.h
"
6
7
#include <cfloat>
8
9
Surface::Side
Cylinder::side(
const
LocalPoint
&
p
,
Scalar
toler)
const
10
{
11
Scalar
lz = p.
perp
() -
radius
();
12
return
(fabs(lz)<toler ?
SurfaceOrientation::onSurface
:
13
(lz>0 ?
SurfaceOrientation::positiveSide
:
SurfaceOrientation::negativeSide
));
14
}
15
16
ReferenceCountingPointer<TangentPlane>
17
Cylinder::tangentPlane (
const
LocalPoint
& aPoint)
const
18
{
19
return
tangentPlane(toGlobal(aPoint));
20
}
21
22
ReferenceCountingPointer<TangentPlane>
23
Cylinder::tangentPlane (
const
GlobalPoint
& aPoint)
const
24
{
25
//
26
// Tangent plane at specified point. In order to avoid
27
// possible numerical problems currently no attempt is made
28
// to verify, if the point is actually on the cylinder.
29
//
30
// local y parallel to axis
31
GlobalVector
yPlane(
rotation
().
z
());
32
// local x normal to y and a vector linking the specified
33
// point with the axis
34
GlobalVector
xPlane(yPlane.cross(aPoint-
position
()));
35
Scalar
size
=
std::max
(
std::max
(
std::abs
(xPlane.x()),
std::abs
(xPlane.y())),
std::abs
(xPlane.z()));
36
if
( size<FLT_MIN )
37
throw
GeometryError
(
"Attempt to construct TangentPlane on cylinder axis"
);
38
// // local z defined by x and y (should point outwards from axis)
39
// GlobalVector zPlane(xPlane.cross(yPlane));
40
// rotation constructor will normalize...
41
return
ReferenceCountingPointer<TangentPlane>
(
new
TangentPlane
(aPoint,
42
RotationType
(xPlane,
43
yPlane)
44
));
45
}
align::RotationType
TkRotation< Scalar > RotationType
Definition:
Definitions.h:29
SurfaceOrientation::positiveSide
Definition:
Surface.h:25
PV3DBase::perp
T perp() const
Definition:
PV3DBase.h:72
align::Scalar
double Scalar
Definition:
Definitions.h:27
Vector3DBase
Definition:
Vector3DBase.h:9
idealTransformation.rotation
dictionary rotation
Definition:
idealTransformation.py:1
detailsBasic3DVector::z
float float float z
Definition:
extBasic3DVector.h:15
position
static int position[TOTALCHAMBERS][3]
Definition:
ReadPGInfo.cc:509
ReferenceCountingPointer
Definition:
ReferenceCounted.h:73
GeomExceptions.h
GeometryError
Definition:
GeomExceptions.h:17
SurfaceOrientation::negativeSide
Definition:
Surface.h:25
max
const T & max(const T &a, const T &b)
Definition:
MaterialBudgetTrackerHistos.cc:4
funct::abs
Abs< T >::type abs(const T &t)
Definition:
Abs.h:22
SurfaceOrientation::Side
Side
Definition:
Surface.h:25
TangentPlane.h
TangentPlane
Plane TangentPlane
Definition:
Surface.h:34
AlCaHLTBitMon_ParallelJobs.p
tuple p
Definition:
AlCaHLTBitMon_ParallelJobs.py:152
Point3DBase< float, LocalTag >
SurfaceOrientation::onSurface
Definition:
Surface.h:25
Cylinder.h
CosmicsPD_Skims.radius
tuple radius
Definition:
CosmicsPD_Skims.py:135
findQualityFiles.size
tuple size
Write out results.
Definition:
findQualityFiles.py:442
Generated for CMSSW Reference Manual by
1.8.5