CMS 3D CMS Logo

CSCRadialStripTopology.cc
Go to the documentation of this file.
3 
4 #include <cmath>
5 #include <algorithm>
6 
7 CSCRadialStripTopology::CSCRadialStripTopology(int ns, float aw, float dh, float r, float yAx, float yMid)
8  : theNumberOfStrips(ns),
9  theAngularWidth(aw),
10  theDetHeight(dh),
11  theCentreToIntersection(r),
12  theYAxisOrientation(yAx),
13  yCentre(yMid) {
14  // Angular offset of extreme edge of detector, so that angle is
15  // zero for a strip lying along local y axis = long symmetry axis of plane of strips
17 
18  LogTrace("CSCRadialStripTopology") << "CSCRadialStripTopology: constructed with"
19  << " strips = " << ns << " width = " << aw << " rad "
20  << " det_height = " << dh << " ctoi = " << r << " phi_edge = " << thePhiOfOneEdge
21  << " rad "
22  << " y_ax_ori = " << theYAxisOrientation << " y_det_centre = " << yCentre << "\n";
23 }
24 
26  return std::min(int(strip(lp)), theNumberOfStrips - 1);
27 }
28 
30  return std::min(nstrips(), static_cast<int>(std::max(float(0), strip(lp))) + 1);
31 }
32 
35 }
36 
39 }
40 
42  return detHeight() * std::sqrt(1.f + std::pow(lp.x() / yDistanceToIntersection(lp.y()), 2.f));
43 }
44 
45 float CSCRadialStripTopology::xOfStrip(int strip, float y) const {
46  return yAxisOrientation() * yDistanceToIntersection(y) * std::tan(stripAngle(static_cast<float>(strip) - 0.5));
47 }
48 
49 float CSCRadialStripTopology::strip(const LocalPoint& lp) const {
50  const float // phi is measured from y axis --> sign of angle is sign of x * yAxisOrientation --> use atan2(x,y), not atan2(y,x)
51  phi(std::atan2(lp.x(), yDistanceToIntersection(lp.y()))),
52  aStrip((phi - yAxisOrientation() * phiOfOneEdge()) / angularWidth());
53  return std::max(float(0), std::min((float)nstrips(), aStrip));
54 }
55 
58 }
59 
61  const float // y = (L/cos(phi))*mp.y()*cos(phi)
62  y(mp.y() * detHeight() + yCentreOfStripPlane()),
64  return LocalPoint(x, y);
65 }
66 
68  const float // phi is [pi/2 - conventional local phi], use atan2(x,y) rather than atan2(y,x)
69  phi(yAxisOrientation() * std::atan2(lp.x(), yDistanceToIntersection(lp.y())));
71  (lp.y() - yCentreOfStripPlane()) / detHeight());
72 }
73 
74 LocalError CSCRadialStripTopology::localError(float strip, float stripErr2) const {
75  const double phi(stripAngle(strip)), t1(std::tan(phi)), t2(t1 * t1),
76  // s1(std::sin(phi)), c1(std::cos(phi)),
77  // cs(s1*c1), s2(s1*s1), c2(1-s2), // rotation matrix
78 
79  tt(stripErr2 * std::pow(centreToIntersection() * angularWidth(), 2.f)), // tangential sigma^2 *c2
80  rr(std::pow(detHeight(), 2.f) * (1.f / 12.f)), // radial sigma^2( uniform prob density along strip) *c2
81 
82  xx(tt + t2 * rr), yy(t2 * tt + rr), xy(t1 * (rr - tt));
83 
84  return LocalError(xx, xy, yy);
85 }
86 
88  const double phi(stripAngle(mp.x())), s1(std::sin(phi)), c1(std::cos(phi)), cs(s1 * c1), s2(s1 * s1),
89  c2(1 - s2), // rotation matrix
90 
92  c1), // tangential measurement unit (local pitch)
93  R(detHeight() / c1), // radial measurement unit (strip length)
94  tt(me.uu() * T * T), // tangential sigma^2
95  rr(me.vv() * R * R), // radial sigma^2
96  tr(me.uv() * T * R),
97 
98  xx(c2 * tt + 2 * cs * tr + s2 * rr), yy(s2 * tt - 2 * cs * tr + c2 * rr), xy(cs * (rr - tt) + tr * (c2 - s2));
99 
100  return LocalError(xx, xy, yy);
101 }
102 
104  const double yHitToInter(yDistanceToIntersection(p.y())),
105  t(yAxisOrientation() * p.x() / yHitToInter), // tan(strip angle)
106  cs(t / (1 + t * t)), s2(t * cs), c2(1 - s2), // rotation matrix
107 
108  T2(1. / (std::pow(angularWidth(), 2.f) *
109  (std::pow(p.x(), 2.f) + std::pow(yHitToInter, 2)))), // 1./tangential measurement unit (local pitch) ^2
110  R2(c2 / std::pow(detHeight(), 2.f)), // 1./ radial measurement unit (strip length) ^2
111 
112  uu((c2 * e.xx() - 2 * cs * e.xy() + s2 * e.yy()) * T2), vv((s2 * e.xx() + 2 * cs * e.xy() + c2 * e.yy()) * R2),
113  uv((cs * (e.xx() - e.yy()) + e.xy() * (c2 - s2)) * std::sqrt(T2 * R2));
114 
115  return MeasurementError(uu, uv, vv);
116 }
117 
119  // The local pitch is the local x width of the strip at the local (x,y)
120  const int istrip = std::min(nstrips(), static_cast<int>(strip(lp)) + 1); // which strip number
121  const float fangle = stripAngle(static_cast<float>(istrip) - 0.5); // angle of strip centre
122  return yDistanceToIntersection(lp.y()) * std::sin(angularWidth()) /
123  std::pow(std::cos(fangle - 0.5f * angularWidth()), 2.f);
124 }
Point2DBase
Definition: Point2DBase.h:9
RandomServiceHelper.t2
t2
Definition: RandomServiceHelper.py:257
DDAxes::y
CSCRadialStripTopology::CSCRadialStripTopology
CSCRadialStripTopology(int ns, float aw, float dh, float r, float yAx=1.f, float yMid=0.)
Definition: CSCRadialStripTopology.cc:7
MessageLogger.h
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:45
min
T min(T a, T b)
Definition: MathUtil.h:58
findQualityFiles.rr
string rr
Definition: findQualityFiles.py:185
CSCRadialStripTopology::theAngularWidth
float theAngularWidth
Definition: CSCRadialStripTopology.h:234
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
CSCRadialStripTopology::theNumberOfStrips
int theNumberOfStrips
Definition: CSCRadialStripTopology.h:233
CSCRadialStripTopology::angularWidth
float angularWidth() const override
Definition: CSCRadialStripTopology.h:159
DDAxes::x
indexGen.s2
s2
Definition: indexGen.py:107
align::LocalPoint
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
CSCRadialStripTopology::centreToIntersection
float centreToIntersection() const override
Definition: CSCRadialStripTopology.h:181
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
CSCRadialStripTopology::yCentreOfStripPlane
float yCentreOfStripPlane() const override
Definition: CSCRadialStripTopology.h:223
CSCRadialStripTopology::localStripLength
float localStripLength(const LocalPoint &) const override
Definition: CSCRadialStripTopology.cc:41
RandomServiceHelper.t1
t1
Definition: RandomServiceHelper.py:256
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
MeasurementError
Definition: MeasurementError.h:8
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
CSCRadialStripTopology::xOfStrip
float xOfStrip(int strip, float y) const override
Definition: CSCRadialStripTopology.cc:45
Point3DBase< float, LocalTag >
CSCRadialStripTopology::localError
LocalError localError(float strip, float stripErr2) const override
Definition: CSCRadialStripTopology.cc:74
OrderedSet.t
t
Definition: OrderedSet.py:90
CSCRadialStripTopology::strip
float strip(const LocalPoint &) const override
Definition: CSCRadialStripTopology.cc:49
geometryCSVtoXML.xy
xy
Definition: geometryCSVtoXML.py:19
MeasurementPoint
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
Definition: MeasurementPoint.h:12
geometryCSVtoXML.yy
yy
Definition: geometryCSVtoXML.py:19
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
LocalError
Definition: LocalError.h:12
PV2DBase::y
T y() const
Definition: PV2DBase.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
CSCRadialStripTopology::localPosition
LocalPoint localPosition(float strip) const override
Definition: CSCRadialStripTopology.cc:56
CSCRadialStripTopology::yAxisOrientation
float yAxisOrientation() const override
Definition: CSCRadialStripTopology.h:218
CSCRadialStripTopology::localPitch
float localPitch(const LocalPoint &) const override
Definition: CSCRadialStripTopology.cc:118
CSCRadialStripTopology::measurementError
MeasurementError measurementError(const LocalPoint &, const LocalError &) const override
Definition: CSCRadialStripTopology.cc:103
CSCRadialStripTopology::nstrips
int nstrips() const override
Definition: CSCRadialStripTopology.h:122
alignCSCRings.r
r
Definition: alignCSCRings.py:93
DDAxes::phi
CSCRadialStripTopology.h
CSCRadialStripTopology::detHeight
float detHeight() const override
Definition: CSCRadialStripTopology.h:169
T
long double T
Definition: Basic3DVectorLD.h:48
CSCRadialStripTopology::nearestStrip
int nearestStrip(const LocalPoint &) const override
Definition: CSCRadialStripTopology.cc:29
detailsBasic3DVector::y
float float y
Definition: extBasic3DVector.h:14
CSCRadialStripTopology::thePhiOfOneEdge
float thePhiOfOneEdge
Definition: CSCRadialStripTopology.h:237
CSCRadialStripTopology::theYAxisOrientation
float theYAxisOrientation
Definition: CSCRadialStripTopology.h:238
CSCRadialStripTopology::phiOfOneEdge
float phiOfOneEdge() const override
Definition: CSCRadialStripTopology.h:202
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:30
CSCRadialStripTopology::channel
int channel(const LocalPoint &) const override
Definition: CSCRadialStripTopology.cc:25
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:671
CSCRadialStripTopology::originToIntersection
float originToIntersection() const override
Definition: CSCRadialStripTopology.h:188
hlt_dqm_clientPB-live_cfg.me
me
Definition: hlt_dqm_clientPB-live_cfg.py:61
CSCRadialStripTopology::yCentre
float yCentre
Definition: CSCRadialStripTopology.h:239
CSCRadialStripTopology::stripAngle
float stripAngle(float strip) const override
Definition: CSCRadialStripTopology.cc:33
dttmaxenums::R
Definition: DTTMax.h:29
CSCRadialStripTopology::measurementPosition
MeasurementPoint measurementPosition(const LocalPoint &) const override
Definition: CSCRadialStripTopology.cc:67
cuy.dh
dh
Definition: cuy.py:355
geometryCSVtoXML.xx
xx
Definition: geometryCSVtoXML.py:19
CSCRadialStripTopology::yDistanceToIntersection
float yDistanceToIntersection(float y) const override
Definition: CSCRadialStripTopology.cc:37
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37