Main Page
Namespaces
Classes
Package Documentation
Geometry
CSCGeometry
src
CSCSlantedWireGeometry.cc
Go to the documentation of this file.
1
#include <
Geometry/CSCGeometry/src/CSCSlantedWireGeometry.h
>
2
#include <
Geometry/CSCGeometry/interface/nint.h
>
3
4
#include <
FWCore/MessageLogger/interface/MessageLogger.h
>
5
6
#include <cmath>
7
8
CSCSlantedWireGeometry::CSCSlantedWireGeometry
(
double
wireSpacing,
9
double
yOfFirstWire,
double
narrow,
double
wide,
double
length,
float
wireAngle ) :
10
CSCWireGeometry
( wireSpacing, yOfFirstWire, narrow, wide, length ), theWireAngle( wireAngle ){
11
cosWireAngle
=
cos
( wireAngle );
12
sinWireAngle
=
sin
( wireAngle );
13
theWireOffset
= yOfFirstWire *
cosWireAngle
;
14
LogTrace
(
"CSCWireGeometry|CSC"
) <<
15
"CSCSlantedWireGeometry: constructed:\n"
<<
16
" wireSpacing = "
<< wireSpacing <<
17
", y1 = "
<< yOfFirstWire <<
18
", narrow_width = "
<< narrow <<
19
", wide_width = "
<< wide <<
20
", length = "
<< length <<
21
", wireAngle = "
<< wireAngle <<
22
", theWireOffset = "
<<
theWireOffset
;
23
}
24
25
int
CSCSlantedWireGeometry::nearestWire
(
const
LocalPoint
& lp)
const
{
26
// Return nearest wire number to input LocalPoint.
27
// Beware this may not exist or be read out!
28
29
// rotate point to an axis perp. to wires
30
float
yprime = lp.
y
() *
cosWireAngle
- lp.
x
() *
sinWireAngle
;
31
32
// climb the ladder
33
return
1 +
nint
( (yprime -
theWireOffset
) /
wireSpacing
() );
34
}
35
36
37
float
CSCSlantedWireGeometry::yOfWire
(
float
wire,
float
x
)
const
{
38
// Return local y of given wire, at given x
39
40
// y in rotated frame with y axis perpendicular to wires...
41
float
yprime =
theWireOffset
+ (wire-1.) *
wireSpacing
();
42
// then y in usual (unrotated!) local xy frame...
43
return
( yprime + x*
sinWireAngle
)/
cosWireAngle
;
44
}
MessageLogger.h
funct::sin
Sin< T >::type sin(const T &t)
Definition:
Sin.h:22
CSCSlantedWireGeometry.h
PV3DBase::y
T y() const
Definition:
PV3DBase.h:63
CSCWireGeometry
Definition:
CSCWireGeometry.h:17
CSCSlantedWireGeometry::sinWireAngle
float sinWireAngle
Definition:
CSCSlantedWireGeometry.h:53
funct::cos
Cos< T >::type cos(const T &t)
Definition:
Cos.h:22
CSCWireGeometry::wireSpacing
double wireSpacing() const
Definition:
CSCWireGeometry.h:33
CSCSlantedWireGeometry::cosWireAngle
float cosWireAngle
Definition:
CSCSlantedWireGeometry.h:52
LogTrace
#define LogTrace(id)
Definition:
PFTrackAlgoTools.cc:504
CSCSlantedWireGeometry::theWireOffset
float theWireOffset
Definition:
CSCSlantedWireGeometry.h:54
CSCSlantedWireGeometry::yOfWire
float yOfWire(float wire, float x=0.) const
Definition:
CSCSlantedWireGeometry.cc:37
CSCSlantedWireGeometry::nearestWire
int nearestWire(const LocalPoint &lp) const
Definition:
CSCSlantedWireGeometry.cc:25
Point3DBase< float, LocalTag >
nint.h
DDAxes::x
PV3DBase::x
T x() const
Definition:
PV3DBase.h:62
MuonTrackValidator_cfi.nint
nint
Definition:
MuonTrackValidator_cfi.py:62
CSCSlantedWireGeometry::CSCSlantedWireGeometry
CSCSlantedWireGeometry(double wireSpacing, double yOfFirstWire, double narrow, double wide, double length, float wireAngle)
Definition:
CSCSlantedWireGeometry.cc:8
Generated for CMSSW Reference Manual by
1.8.11