CMS 3D CMS Logo

TrapezoidalStripTopology.cc
Go to the documentation of this file.
2 
3 #include <iostream>
4 #include <cmath>
5 #include <algorithm>
6 
8  float l,
9  float r0) :
10  theNumberOfStrips(ns), thePitch(p),
11  theDistToBeam(r0), theDetHeight(l) {
13  theYAxOr = 1;
14 #ifdef VERBOSE
15  cout<<"Constructing TrapezoidalStripTopology with"
16  <<" nstrips = "<<ns
17  <<" pitch = "<<p
18  <<" length = "<<l
19  <<" r0 ="<<r0
20  <<endl;
21 #endif
22 }
23 
25  float l,
26  float r0, int yAx) :
28  theDistToBeam(r0), theDetHeight(l), theYAxOr(yAx){
30 #ifdef VERBOSE
31  cout<<"Constructing TrapezoidalStripTopology with"
32  <<" nstrips = "<<ns
33  <<" pitch = "<<p
34  <<" length = "<<l
35  <<" r0 ="<<r0
36  <<" yAxOrientation ="<<yAx
37  <<endl;
38 #endif
39 }
40 
43  return LocalPoint( strip*thePitch + theOffset, 0.0);
44 }
45 
48  float y = mp.y()*theDetHeight;
49  float x = (mp.x()*thePitch +
51  return LocalPoint(x,y);
52 }
53 
55 TrapezoidalStripTopology::localError(float strip, float stripErr2) const {
56  float lt,lc2,ls2,lslc;
57  float localL2,localP2;
58  float sl2,sp2;
59  // angle from strip to local frame (see CMS TN / 95-170)
60  lt = -(strip*thePitch + theOffset)*theYAxOr/theDistToBeam;
61  lc2 = 1.f/(1.+lt*lt);
62  lslc = lt*lc2;
63  ls2 = 1.f-lc2;
64  localL2 = theDetHeight*theDetHeight / lc2;
65  localP2 = thePitch*thePitch*lc2;
66  sl2 = localL2/12.;
67  sp2 = stripErr2*localP2;
68  return LocalError(lc2*sp2+ls2*sl2,
69  lslc*(sp2-sl2),
70  ls2*sp2+lc2*sl2);
71 }
72 
75  const MeasurementError& merr) const {
76  float lt,lc2,ls2,lslc;
77  float localL,localP;
78  float sl2,sp2,spl;
79  // angle from strip to local frame (see CMS TN / 95-170)
80  lt = -(mp.x()*thePitch + theOffset)*theYAxOr/theDistToBeam;
81  lc2 = 1./(1.+lt*lt);
82  lslc = lt*lc2;
83  ls2 = 1.f-lc2;
84  localL = theDetHeight / std::sqrt(lc2);
85  localP = localPitch(localPosition(mp));
86  sp2 = merr.uu() * localP*localP;
87  sl2 = merr.vv() * localL*localL;
88  spl = merr.uv() * localP*localL;
89  return LocalError(lc2*sp2+ls2*sl2-2*lslc*spl,
90  lslc*(sp2-sl2)+(lc2-ls2)*spl,
91  ls2*sp2+lc2*sl2+2*lslc*spl);
92 }
93 
94 float
96  float aStrip =
98  if (aStrip < 0 ) aStrip = 0;
99  else if (aStrip > theNumberOfStrips) aStrip = theNumberOfStrips;
100  return aStrip;
101 }
102 
105  return
107  lp.y()/theDetHeight);
108 }
109 
112  const LocalError& lerr) const {
113  float lt,lc2,ls2,lslc;
114  float localL,localP;
115  float sl2,sp2,spl;
116  lt = -lp.x()/(theYAxOr*lp.y()+theDistToBeam)*theYAxOr;
117  lc2 = 1./(1.+lt*lt);
118  lslc = lt*lc2;
119  ls2 = 1.-lc2;
120  localL = theDetHeight / std::sqrt(lc2);
121  localP = localPitch(lp);
122  sp2 = lc2*lerr.xx()+ls2*lerr.yy()+2*lslc*lerr.xy();
123  sl2 = ls2*lerr.xx()+lc2*lerr.yy()-2*lslc*lerr.xy();
124  spl = lslc*(lerr.yy()-lerr.xx())+(lc2-ls2)*lerr.xy();
125  return MeasurementError(sp2/(localP*localP),
126  spl/(localP*localL),
127  sl2/(localL*localL));
128 
129 }
130 
131 int
133  return std::min(int(strip(lp)),theNumberOfStrips-1);
134 }
135 
136 float
138  return thePitch;
139 }
140 
141 float
143  float x=lp.x();
144  float y=theYAxOr*lp.y()+theDistToBeam;
145  return thePitch*y/(theDistToBeam*std::sqrt(1.f+x*x/(y*y)));
146 }
147 
148 float
150  return std::atan( -(strip*thePitch + theOffset)*theYAxOr/theDistToBeam );
151 }
152 
153 int
155  return theNumberOfStrips;
156 }
157 
158 float TrapezoidalStripTopology::shiftOffset( float pitch_fraction) {
159  theOffset += thePitch * pitch_fraction;
160  return theOffset;
161 }
162 
164  const {
165  float ltan = -lp.x()/(theYAxOr*lp.y()+theDistToBeam)*theYAxOr;
166  float localL = theDetHeight * std::sqrt(1.f+ltan*ltan);
167  // float lcos2 = 1.f/(1.f+ltan*ltan);
168  // float localL = theDetHeight / std::sqrt(lcos2);
169 
170  return localL;
171 }
172 
float xx() const
Definition: LocalError.h:24
float vv() const
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:32
T y() const
Definition: PV2DBase.h:46
LocalPoint localPosition(float strip) const override
virtual float shiftOffset(float pitch_fraction)
float localPitch(const LocalPoint &) const override
LocalError localError(float strip, float stripErr2) const override
T y() const
Definition: PV3DBase.h:63
float strip(const LocalPoint &) const override
float xy() const
Definition: LocalError.h:25
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
float yy() const
Definition: LocalError.h:26
T sqrt(T t)
Definition: SSEVec.h:18
float uu() const
double f[11][100]
T min(T a, T b)
Definition: MathUtil.h:58
TrapezoidalStripTopology(int nstrip, float pitch, float detheight, float r0)
int channel(const LocalPoint &) const override
float stripAngle(float strip) const override
MeasurementPoint measurementPosition(const LocalPoint &) const override
MeasurementError measurementError(const LocalPoint &, const LocalError &) const override
T x() const
Definition: PV2DBase.h:45
T x() const
Definition: PV3DBase.h:62
float localStripLength(const LocalPoint &aLP) const override
float uv() const