CMS 3D CMS Logo

GEMStripTopology.cc
Go to the documentation of this file.
1 
7 #include <iostream>
8 #include <cmath>
9 #include <algorithm>
10 
11 GEMStripTopology::GEMStripTopology(int ns, float aw, float dh, float r0)
12  : numberOfStrips_(ns), angularWidth_(aw), detHeight_(dh), centreToIntersection_(r0) {
13  assert(angularWidth_ != 0);
14  assert(detHeight_ != 0);
17  yCentre_ = 0;
18  LogTrace("GEMStripTopology") << "Constructing GEMStripTopology with"
19  << " nstrips = " << ns << " angular width = " << aw << " det. height = " << dh
20  << " r0 = " << r0 << "\n";
21 }
22 
23 GEMStripTopology::GEMStripTopology(int ns, float aw, float dh, float r0, float yAx)
24  : numberOfStrips_(ns), angularWidth_(aw), detHeight_(dh), centreToIntersection_(r0), yAxisOrientation_(yAx) {
25  assert(angularWidth_ != 0);
26  assert(detHeight_ != 0);
28  yCentre_ = 0;
29  LogTrace("GEMStripTopology") << "Constructing GEMStripTopology with"
30  << " nstrips = " << ns << " angular width = " << aw << " det. height = " << dh
31  << " r0 = " << r0 << " yAxOrientation = " << yAx << "\n";
32 }
33 
36 }
37 
39  const float // y = (L/cos(phi))*mp.y()*cos(phi)
40  y(mp.y() * detHeight() + yCentreOfStripPlane()),
42  return LocalPoint(x, y);
43 }
44 
45 LocalError GEMStripTopology::localError(float strip, float stripErr2) const {
46  const double phi(stripAngle(strip)), t1(std::tan(phi)), t2(t1 * t1),
47  tt(stripErr2 * std::pow(centreToIntersection() * angularWidth(), 2)), // tangential sigma^2 *c2
48  rr(std::pow(detHeight(), 2) * (1.f / 12.f)), // radial sigma^2( uniform prob density along strip) *c2
49 
50  xx(tt + t2 * rr), yy(t2 * tt + rr), xy(t1 * (rr - tt));
51 
52  return LocalError(xx, xy, yy);
53 }
54 
56  const double phi(stripAngle(mp.x())), s1(std::sin(phi)), c1(std::cos(phi));
57  assert(c1 != 0);
58  const double cs(s1 * c1), s2(s1 * s1),
59  c2(1 - s2), // rotation matrix
60 
62  c1), // tangential measurement unit (local pitch)
63  R(detHeight() / c1), // radial measurement unit (strip length)
64  tt(me.uu() * T * T), // tangential sigma^2
65  rr(me.vv() * R * R), // radial sigma^2
66  tr(me.uv() * T * R),
67 
68  xx(c2 * tt + 2 * cs * tr + s2 * rr), yy(s2 * tt - 2 * cs * tr + c2 * rr), xy(cs * (rr - tt) + tr * (c2 - s2));
69 
70  return LocalError(xx, xy, yy);
71 }
72 
73 float GEMStripTopology::strip(const LocalPoint& lp) const {
74  const float // phi is measured from y axis --> sign of angle is sign of x * yAxisOrientation --> use atan2(x,y), not atan2(y,x)
75  phi(std::atan2(lp.x(), yDistanceToIntersection(lp.y()))),
76  aStrip((phi - yAxisOrientation() * phiOfOneEdge()) / angularWidth());
77  return std::max(float(0), std::min((float)nstrips(), aStrip));
78 }
79 
81  return std::min(nstrips(), static_cast<int>(std::max(float(0), strip(lp))) + 1);
82 }
83 
85  const float // phi is [pi/2 - conventional local phi], use atan2(x,y) rather than atan2(y,x)
86  phi(yAxisOrientation() * std::atan2(lp.x(), yDistanceToIntersection(lp.y())));
88  (lp.y() - yCentreOfStripPlane()) / detHeight());
89 }
90 
92  const double yHitToInter(yDistanceToIntersection(p.y()));
93  assert(yHitToInter != 0);
94  const double t(yAxisOrientation() * p.x() / yHitToInter), // tan(strip angle)
95  cs(t / (1 + t * t)), s2(t * cs), c2(1 - s2), // rotation matrix
96 
97  T2(1. / (std::pow(angularWidth(), 2) *
98  (std::pow(p.x(), 2) + std::pow(yHitToInter, 2)))), // 1./tangential measurement unit (local pitch) ^2
99  R2(c2 / std::pow(detHeight(), 2)), // 1./ radial measurement unit (strip length) ^2
100 
101  uu((c2 * e.xx() - 2 * cs * e.xy() + s2 * e.yy()) * T2), vv((s2 * e.xx() + 2 * cs * e.xy() + c2 * e.yy()) * R2),
102  uv((cs * (e.xx() - e.yy()) + e.xy() * (c2 - s2)) * std::sqrt(T2 * R2));
103 
104  return MeasurementError(uu, uv, vv);
105 }
106 
107 int GEMStripTopology::channel(const LocalPoint& lp) const { return std::min(int(strip(lp)), numberOfStrips_ - 1); }
108 
109 float GEMStripTopology::pitch() const { return localPitch(LocalPoint(0, 0)); }
110 
111 float GEMStripTopology::localPitch(const LocalPoint& lp) const {
112  const int istrip = std::min(nstrips(), static_cast<int>(strip(lp)) + 1); // which strip number
113  const float fangle = stripAngle(static_cast<float>(istrip) - 0.5); // angle of strip centre
114  assert(std::cos(fangle - 0.5f * angularWidth()) != 0);
115  return yDistanceToIntersection(lp.y()) * std::sin(angularWidth()) /
116  std::pow(std::cos(fangle - 0.5f * angularWidth()), 2);
117 }
118 
120  return phiOfOneEdge() + yAxisOrientation() * strip * angularWidth();
121 }
122 
124  assert(yDistanceToIntersection(lp.y()) != 0);
125  return detHeight() * std::sqrt(1.f + std::pow(lp.x() / yDistanceToIntersection(lp.y()), 2));
126 }
127 
129  return yAxisOrientation() * y + originToIntersection();
130 }
131 
132 float GEMStripTopology::xOfStrip(int strip, float y) const {
133  return yAxisOrientation() * yDistanceToIntersection(y) * std::tan(stripAngle(static_cast<float>(strip) - 0.5));
134 }
Point2DBase
Definition: Point2DBase.h:9
RandomServiceHelper.t2
t2
Definition: RandomServiceHelper.py:257
DDAxes::y
MessageLogger.h
GEMStripTopology::yCentre_
float yCentre_
Definition: GEMStripTopology.h:70
groupFilesInBlocks.tt
int tt
Definition: groupFilesInBlocks.py:144
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
fwrapper::cs
unique_ptr< ClusterSequence > cs
Definition: fastjetfortran_madfks.cc:47
min
T min(T a, T b)
Definition: MathUtil.h:58
GEMStripTopology::localPosition
LocalPoint localPosition(float strip) const override
Definition: GEMStripTopology.cc:34
findQualityFiles.rr
string rr
Definition: findQualityFiles.py:185
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
GEMStripTopology.h
GEMStripTopology::centreToIntersection
float centreToIntersection() const
Definition: GEMStripTopology.h:53
cms::cuda::assert
assert(be >=bs)
GEMStripTopology::originToIntersection
float originToIntersection() const
Definition: GEMStripTopology.h:55
DDAxes::x
indexGen.s2
s2
Definition: indexGen.py:107
GEMStripTopology::phiOfOneEdge_
float phiOfOneEdge_
Definition: GEMStripTopology.h:68
align::LocalPoint
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
GEMStripTopology::angularWidth
float angularWidth() const
Definition: GEMStripTopology.h:50
GEMStripTopology::channel
int channel(const LocalPoint &) const override
Definition: GEMStripTopology.cc:107
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
GEMStripTopology::nearestStrip
int nearestStrip(const LocalPoint &) const
Definition: GEMStripTopology.cc:80
GEMStripTopology::xOfStrip
float xOfStrip(int strip, float y) const
Definition: GEMStripTopology.cc:132
GEMStripTopology::localPitch
float localPitch(const LocalPoint &) const override
Definition: GEMStripTopology.cc:111
RandomServiceHelper.t1
t1
Definition: RandomServiceHelper.py:256
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
GEMStripTopology::yCentreOfStripPlane
float yCentreOfStripPlane() const
Definition: GEMStripTopology.h:61
MeasurementError
Definition: MeasurementError.h:8
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
GEMStripTopology::numberOfStrips_
int numberOfStrips_
Definition: GEMStripTopology.h:64
GEMStripTopology::localError
LocalError localError(float strip, float stripErr2) const override
Definition: GEMStripTopology.cc:45
Point3DBase< float, LocalTag >
GEMStripTopology::yAxisOrientation
float yAxisOrientation() const
Definition: GEMStripTopology.h:59
geometryCSVtoXML.xy
xy
Definition: geometryCSVtoXML.py:19
MeasurementPoint
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
Definition: MeasurementPoint.h:12
GEMStripTopology::strip
float strip(const LocalPoint &) const override
Definition: GEMStripTopology.cc:73
GEMStripTopology::yDistanceToIntersection
float yDistanceToIntersection(float y) const
Definition: GEMStripTopology.cc:128
geometryCSVtoXML.yy
yy
Definition: geometryCSVtoXML.py:19
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
GEMStripTopology::angularWidth_
float angularWidth_
Definition: GEMStripTopology.h:65
LocalError
Definition: LocalError.h:12
GEMStripTopology::measurementError
MeasurementError measurementError(const LocalPoint &, const LocalError &) const override
Definition: GEMStripTopology.cc:91
PV2DBase::y
T y() const
Definition: PV2DBase.h:44
GEMStripTopology::nstrips
int nstrips() const override
Definition: GEMStripTopology.h:44
PV2DBase::x
T x() const
Definition: PV2DBase.h:43
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
funct::tan
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
alignmentValidation.c1
c1
do drawing
Definition: alignmentValidation.py:1025
GEMStripTopology::yAxisOrientation_
float yAxisOrientation_
Definition: GEMStripTopology.h:69
DDAxes::phi
GEMStripTopology::measurementPosition
MeasurementPoint measurementPosition(const LocalPoint &) const override
Definition: GEMStripTopology.cc:84
T
long double T
Definition: Basic3DVectorLD.h:48
GEMStripTopology::stripAngle
float stripAngle(float strip) const override
Definition: GEMStripTopology.cc:119
detailsBasic3DVector::y
float float y
Definition: extBasic3DVector.h:14
GEMStripTopology::phiOfOneEdge
float phiOfOneEdge() const
Definition: GEMStripTopology.h:60
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
GEMStripTopology::detHeight
float detHeight() const
Definition: GEMStripTopology.h:51
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:224
GEMStripTopology::GEMStripTopology
GEMStripTopology(int ns, float aw, float dh, float r0)
Definition: GEMStripTopology.cc:11
GEMStripTopology::detHeight_
float detHeight_
Definition: GEMStripTopology.h:66
hlt_dqm_clientPB-live_cfg.me
me
Definition: hlt_dqm_clientPB-live_cfg.py:61
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
GEMStripTopology::localStripLength
float localStripLength(const LocalPoint &) const override
Definition: GEMStripTopology.cc:123
dttmaxenums::R
Definition: DTTMax.h:29
cuy.dh
dh
Definition: cuy.py:355
geometryCSVtoXML.xx
xx
Definition: geometryCSVtoXML.py:19
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
GEMStripTopology::pitch
float pitch() const override
Definition: GEMStripTopology.cc:109