CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RectangularStripTopology.cc
Go to the documentation of this file.
2 
3 #include <iostream>
4 #include <cmath>
5 #include <algorithm>
6 
8  thePitch(p), theNumberOfStrips(ns), theStripLength(l) {
10 
11 #ifdef VERBOSE
12  cout <<"Constructing RectangularStripTopology with"
13  <<" nstrips = "<<ns
14  <<" pitch = "<<p
15  <<" length = "<<l
16  <<endl;
17 #endif
18 }
19 
22  return LocalPoint( strip*thePitch + theOffset, 0.0f);
23 }
24 
27  return LocalPoint( mp.x()*thePitch+theOffset, mp.y()*theStripLength);
28 }
29 
31 RectangularStripTopology::localError(float /*strip*/, float stripErr2) const{
32  return LocalError(stripErr2 * thePitch*thePitch,
33  0.f,
35 }
36 
39  const MeasurementError& merr) const{
40  return LocalError(merr.uu() * thePitch*thePitch,
41  merr.uv() * thePitch*theStripLength,
42  merr.vv() * theStripLength*theStripLength);
43 }
44 
45 float
47  float aStrip = (lp.x() - theOffset) / thePitch;
48  if (aStrip < 0 ) aStrip = 0;
49  else if (aStrip > theNumberOfStrips) aStrip = theNumberOfStrips;
50  return aStrip;
51 }
52 
55  return MeasurementPoint((lp.x()-theOffset)/thePitch,
56  lp.y()/theStripLength);
57 }
58 
61  const LocalError& lerr) const {
62  return MeasurementError(lerr.xx()/(thePitch*thePitch),
63  lerr.xy()/(thePitch*theStripLength),
65 }
66 
67 int
69  return std::min(int(strip(lp)),theNumberOfStrips-1);
70 }
71 
72 float
74  return thePitch;
75 }
76 
77 float
79  return thePitch;
80 }
81 
82 float
83 RectangularStripTopology::stripAngle(float /*strip*/) const {
84  return 0;
85 }
86 
87 int
89  return theNumberOfStrips;
90 }
91 
float xx() const
Definition: LocalError.h:24
float vv() const
T y() const
Definition: PV2DBase.h:45
void strip(std::string &input, const std::string &blanks=" \n\t")
Definition: stringTools.cc:16
virtual MeasurementError measurementError(const LocalPoint &, const LocalError &) const
T y() const
Definition: PV3DBase.h:62
#define min(a, b)
Definition: mlp_lapack.h:161
virtual LocalError localError(float strip, float stripErr2) const
float xy() const
Definition: LocalError.h:25
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
float yy() const
Definition: LocalError.h:26
virtual float stripAngle(float strip) const
RectangularStripTopology(int nstrips, float pitch, float detlength)
float uu() const
double f[11][100]
virtual int channel(const LocalPoint &) const
virtual float localPitch(const LocalPoint &) const
virtual float strip(const LocalPoint &) const
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
tuple cout
Definition: gather_cfg.py:121
virtual LocalPoint localPosition(float strip) const
virtual MeasurementPoint measurementPosition(const LocalPoint &) const
T x() const
Definition: PV2DBase.h:44
T x() const
Definition: PV3DBase.h:61
float uv() const