CMS 3D CMS Logo

TrapezoidalStripTopology.cc
Go to the documentation of this file.
2 
3 #include <iostream>
4 #include <cmath>
5 #include <algorithm>
6 
7 TrapezoidalStripTopology::TrapezoidalStripTopology(int ns, float p, float l, float r0)
8  : theNumberOfStrips(ns), thePitch(p), theDistToBeam(r0), theDetHeight(l) {
10  theYAxOr = 1;
11 #ifdef VERBOSE
12  cout << "Constructing TrapezoidalStripTopology with"
13  << " nstrips = " << ns << " pitch = " << p << " length = " << l << " r0 =" << r0 << endl;
14 #endif
15 }
16 
17 TrapezoidalStripTopology::TrapezoidalStripTopology(int ns, float p, float l, float r0, int yAx)
18  : theNumberOfStrips(ns), thePitch(p), theDistToBeam(r0), theDetHeight(l), theYAxOr(yAx) {
20 #ifdef VERBOSE
21  cout << "Constructing TrapezoidalStripTopology with"
22  << " nstrips = " << ns << " pitch = " << p << " length = " << l << " r0 =" << r0 << " yAxOrientation =" << yAx
23  << endl;
24 #endif
25 }
26 
28  return LocalPoint(strip * thePitch + theOffset, 0.0);
29 }
30 
32  float y = mp.y() * theDetHeight;
33  float x = (mp.x() * thePitch + theOffset) * (theYAxOr * y + theDistToBeam) / theDistToBeam;
34  return LocalPoint(x, y);
35 }
36 
37 LocalError TrapezoidalStripTopology::localError(float strip, float stripErr2) const {
38  float lt, lc2, ls2, lslc;
39  float localL2, localP2;
40  float sl2, sp2;
41  // angle from strip to local frame (see CMS TN / 95-170)
43  lc2 = 1.f / (1. + lt * lt);
44  lslc = lt * lc2;
45  ls2 = 1.f - lc2;
46  localL2 = theDetHeight * theDetHeight / lc2;
47  localP2 = thePitch * thePitch * lc2;
48  sl2 = localL2 / 12.;
49  sp2 = stripErr2 * localP2;
50  return LocalError(lc2 * sp2 + ls2 * sl2, lslc * (sp2 - sl2), ls2 * sp2 + lc2 * sl2);
51 }
52 
54  float lt, lc2, ls2, lslc;
55  float localL, localP;
56  float sl2, sp2, spl;
57  // angle from strip to local frame (see CMS TN / 95-170)
58  lt = -(mp.x() * thePitch + theOffset) * theYAxOr / theDistToBeam;
59  lc2 = 1. / (1. + lt * lt);
60  lslc = lt * lc2;
61  ls2 = 1.f - lc2;
62  localL = theDetHeight / std::sqrt(lc2);
63  localP = localPitch(localPosition(mp));
64  sp2 = merr.uu() * localP * localP;
65  sl2 = merr.vv() * localL * localL;
66  spl = merr.uv() * localP * localL;
67  return LocalError(lc2 * sp2 + ls2 * sl2 - 2 * lslc * spl,
68  lslc * (sp2 - sl2) + (lc2 - ls2) * spl,
69  ls2 * sp2 + lc2 * sl2 + 2 * lslc * spl);
70 }
71 
73  float aStrip = ((lp.x() * theDistToBeam / (theYAxOr * lp.y() + theDistToBeam)) - theOffset) / thePitch;
74  if (aStrip < 0)
75  aStrip = 0;
76  else if (aStrip > theNumberOfStrips)
77  aStrip = theNumberOfStrips;
78  return aStrip;
79 }
80 
82  return MeasurementPoint(((lp.x() * theDistToBeam / (theYAxOr * lp.y() + theDistToBeam)) - theOffset) / thePitch,
83  lp.y() / theDetHeight);
84 }
85 
87  float lt, lc2, ls2, lslc;
88  float localL, localP;
89  float sl2, sp2, spl;
90  lt = -lp.x() / (theYAxOr * lp.y() + theDistToBeam) * theYAxOr;
91  lc2 = 1. / (1. + lt * lt);
92  lslc = lt * lc2;
93  ls2 = 1. - lc2;
94  localL = theDetHeight / std::sqrt(lc2);
95  localP = localPitch(lp);
96  sp2 = lc2 * lerr.xx() + ls2 * lerr.yy() + 2 * lslc * lerr.xy();
97  sl2 = ls2 * lerr.xx() + lc2 * lerr.yy() - 2 * lslc * lerr.xy();
98  spl = lslc * (lerr.yy() - lerr.xx()) + (lc2 - ls2) * lerr.xy();
99  return MeasurementError(sp2 / (localP * localP), spl / (localP * localL), sl2 / (localL * localL));
100 }
101 
103  return std::min(int(strip(lp)), theNumberOfStrips - 1);
104 }
105 
106 float TrapezoidalStripTopology::pitch() const { return thePitch; }
107 
109  float x = lp.x();
110  float y = theYAxOr * lp.y() + theDistToBeam;
111  return thePitch * y / (theDistToBeam * std::sqrt(1.f + x * x / (y * y)));
112 }
113 
115  return std::atan(-(strip * thePitch + theOffset) * theYAxOr / theDistToBeam);
116 }
117 
119 
120 float TrapezoidalStripTopology::shiftOffset(float pitch_fraction) {
121  theOffset += thePitch * pitch_fraction;
122  return theOffset;
123 }
124 
126  float ltan = -lp.x() / (theYAxOr * lp.y() + theDistToBeam) * theYAxOr;
127  float localL = theDetHeight * std::sqrt(1.f + ltan * ltan);
128  // float lcos2 = 1.f/(1.f+ltan*ltan);
129  // float localL = theDetHeight / std::sqrt(lcos2);
130 
131  return localL;
132 }
TrapezoidalStripTopology::stripAngle
float stripAngle(float strip) const override
Definition: TrapezoidalStripTopology.cc:114
Point2DBase
Definition: Point2DBase.h:9
TrapezoidalStripTopology::theOffset
float theOffset
Definition: TrapezoidalStripTopology.h:77
DDAxes::y
LocalError::xy
float xy() const
Definition: LocalError.h:23
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
min
T min(T a, T b)
Definition: MathUtil.h:58
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
TrapezoidalStripTopology::measurementPosition
MeasurementPoint measurementPosition(const LocalPoint &) const override
Definition: TrapezoidalStripTopology.cc:81
gather_cfg.cout
cout
Definition: gather_cfg.py:144
DDAxes::x
align::LocalPoint
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
TrapezoidalStripTopology::localPitch
float localPitch(const LocalPoint &) const override
Definition: TrapezoidalStripTopology.cc:108
TrapezoidalStripTopology::measurementError
MeasurementError measurementError(const LocalPoint &, const LocalError &) const override
Definition: TrapezoidalStripTopology.cc:86
TrapezoidalStripTopology::channel
int channel(const LocalPoint &) const override
Definition: TrapezoidalStripTopology.cc:102
TrapezoidalStripTopology::theNumberOfStrips
int theNumberOfStrips
Definition: TrapezoidalStripTopology.h:75
LocalError::xx
float xx() const
Definition: LocalError.h:22
MeasurementError
Definition: MeasurementError.h:8
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
Point3DBase< float, LocalTag >
MeasurementError::uv
float uv() const
Definition: MeasurementError.h:15
TrapezoidalStripTopology::strip
float strip(const LocalPoint &) const override
Definition: TrapezoidalStripTopology.cc:72
MeasurementPoint
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
Definition: MeasurementPoint.h:12
TrapezoidalStripTopology::pitch
float pitch() const override
Definition: TrapezoidalStripTopology.cc:106
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
TrapezoidalStripTopology::theYAxOr
int theYAxOr
Definition: TrapezoidalStripTopology.h:80
TrapezoidalStripTopology::theDetHeight
float theDetHeight
Definition: TrapezoidalStripTopology.h:79
TrapezoidalStripTopology::localError
LocalError localError(float strip, float stripErr2) const override
Definition: TrapezoidalStripTopology.cc:37
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:204
TrapezoidalStripTopology.h
TrapezoidalStripTopology::thePitch
float thePitch
Definition: TrapezoidalStripTopology.h:76
TrapezoidalStripTopology::shiftOffset
virtual float shiftOffset(float pitch_fraction)
Definition: TrapezoidalStripTopology.cc:120
TrapezoidalStripTopology::TrapezoidalStripTopology
TrapezoidalStripTopology(int nstrip, float pitch, float detheight, float r0)
Definition: TrapezoidalStripTopology.cc:7
TrapezoidalStripTopology::localPosition
LocalPoint localPosition(float strip) const override
Definition: TrapezoidalStripTopology.cc:27
MeasurementError::vv
float vv() const
Definition: MeasurementError.h:16
TrapezoidalStripTopology::nstrips
int nstrips() const override
Definition: TrapezoidalStripTopology.cc:118
MeasurementError::uu
float uu() const
Definition: MeasurementError.h:14
TrapezoidalStripTopology::theDistToBeam
float theDistToBeam
Definition: TrapezoidalStripTopology.h:78
TrapezoidalStripTopology::localStripLength
float localStripLength(const LocalPoint &aLP) const override
Definition: TrapezoidalStripTopology.cc:125
LocalError::yy
float yy() const
Definition: LocalError.h:24