CMS 3D CMS Logo

DTTopology.cc
Go to the documentation of this file.
1 
9 
10 #include <iostream>
11 //#define EDM_ML_DEBUG
12 
13 // FIXME now put by hand, check the number!
14 
15 const float DTTopology::theWidth = 4.2; // cm
16 const float DTTopology::theHeight = 1.3; // cm ...
17 
18 const float DTTopology::IBeamWingThickness = 0.13; // cm
19 const float DTTopology::IBeamWingLength = 0.635; // cm
20 
21 const float DTTopology::plateThickness = 0.15; // aluminium plate: 1.5 mm
22 const float DTTopology::IBeamThickness = 0.13; // I-beam thickness: 1.3 mm
23 
24 DTTopology::DTTopology(int firstWire, int nChannels, float semilenght)
25  : theFirstChannel(firstWire), theNChannels(nChannels), theLength(semilenght * 2) {
27 
28 #ifdef EDM_ML_DEBUG
29  edm::LogVerbatim("DTGeometry") << "Constructing DTTopology with:" << std::endl
30  << "number of wires = " << theNChannels << ", first wire number = " << theFirstChannel
31  << std::endl
32  << ", width = " << theWidth << ", height = " << theHeight
33  << ", length = " << theLength;
34 #endif
35 }
36 
38 
40 
42  return LocalPoint((mp.x() - theFirstChannel) * theWidth + theOffSet.x(), (1 - mp.y()) * theLength + theOffSet.y());
43 }
44 
46  return LocalError(me.uu() * (theWidth * theWidth), 0, me.vv() * (theLength * theLength));
47 }
48 
50  return MeasurementPoint(static_cast<int>((lp.x() - theOffSet.x()) / theWidth + theFirstChannel),
51  1 - (lp.y() - theOffSet.y()) / theLength);
52 }
53 
55  return MeasurementError(le.xx() / (theWidth * theWidth), 0, le.yy() / (theLength * theLength));
56 }
57 
58 int DTTopology::channel(const LocalPoint& lp) const {
59  return static_cast<int>((lp.x() - theOffSet.x()) / theWidth + theFirstChannel);
60 }
61 
62 // return the x wire position in the layer, starting from its wire number.
63 float DTTopology::wirePosition(int wireNumber) const {
64  if (!isWireValid(wireNumber)) //- (theFirstChannel-1) <= 0. || wireNumber > lastChannel() )
65  throw cms::Exception("InvalidWireNumber")
66  << "DTTopology::wirePosition:"
67  << " Requested wire number: " << wireNumber << " ,but the first wire number is " << theFirstChannel
68  << " and the last wire number is " << lastChannel() << std::endl;
69  else
70  return (wireNumber - (theFirstChannel - 1) - 0.5) * theWidth + theOffSet.x();
71 }
72 
73 /*
74 // return the x wire position in the layer r.f., starting from its wire number.
75 float DTTopology::wirePosition(int wireNumber) const{
76  int layerCoord = theNChannels - wireNumber + theFirstChannel;
77  return (layerCoord - 0.5)*theWidth + theOffSet.x();
78 }
79 */
80 
81 //New cell geometry
82 DTTopology::Side DTTopology::onWhichBorder(float x, float /*y*/, float z) const {
83  // epsilon = Tolerance to determine if a hit starts/ends on the cell border.
84  // Current value comes from CMSIM, where hit position is
85  // always ~10um far from surface. For OSCAR the discrepancy is < 1um.
86  const float epsilon = 0.0015; // 15 um
87 
88  // with new geometry the cell shape is not rectangular, but is a
89  // rectangular with the I-beam "Wing" subtracted.
90  // The height of the Wing is 1.0 mm and the length is 6.35 mm: these 4
91  // volumens must be taken into account when the border is computed
92 
93  Side side = none;
94 
95  if (fabs(z) > (sensibleHeight() / 2. - epsilon) ||
96  (fabs(x) > (sensibleWidth() / 2. - IBeamWingLength - epsilon) &&
97  fabs(z) > (sensibleHeight() / 2. - IBeamWingThickness - epsilon))) { //FIXME
98 
99  if (z > 0.)
100  side = zMax; // This is currently the INNER surface.
101  else
102  side = zMin;
103  }
104 
105  else if (fabs(x) > (sensibleWidth() / 2. - epsilon)) {
106  if (x > 0.)
107  side = xMax;
108  else
109  side = xMin;
110  } // FIXME: else if ymax, ymin...
111 
112  return side;
113 }
114 
115 //Old geometry of the DT
116 DTTopology::Side DTTopology::onWhichBorder_old(float x, float /*y*/, float z) const {
117  // epsilon = Tolerance to determine if a hit starts/ends on the cell border.
118  // Current value comes from CMSIM, where hit position is
119  // always ~10um far from surface. For OSCAR the discrepancy is < 1um.
120  const float epsilon = 0.0015; // 15 um
121 
122  Side side = none;
123 
124  if (fabs(z) > (sensibleHeight() / 2. - epsilon)) {
125  if (z > 0.) {
126  side = zMax; // This is currently the INNER surface.
127  } else {
128  side = zMin;
129  }
130  } else if (fabs(x) > (sensibleWidth() / 2. - epsilon)) {
131  if (x > 0.) {
132  side = xMax;
133  } else {
134  side = xMin;
135  }
136  } // FIXME: else if ymax, ymin...
137 
138  return side;
139 }
Log< level::Info, true > LogVerbatim
static const float IBeamWingLength
Definition: DTTopology.h:106
float sensibleWidth() const
Returns the width of the actual sensible volume of the cell.
Definition: DTTopology.cc:37
MeasurementPoint measurementPosition(const LocalPoint &) const override
Definition: DTTopology.cc:49
static const float IBeamWingThickness
Definition: DTTopology.h:105
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
int theFirstChannel
Definition: DTTopology.h:98
static const float plateThickness
Definition: DTTopology.h:107
Side onWhichBorder(float x, float y, float z) const
Definition: DTTopology.cc:82
LocalError localError(const MeasurementPoint &, const MeasurementError &) const override
Definition: DTTopology.cc:45
int theNChannels
Definition: DTTopology.h:99
T x() const
Definition: PV2DBase.h:43
Point2DBase< double, LocalTag > Local2DPoint
Definition: Topology.h:53
LocalPoint localPosition(const MeasurementPoint &) const override
Definition: DTTopology.cc:41
float float float z
T y() const
Definition: PV2DBase.h:44
bool isWireValid(const int wireNumber) const
Definition: DTTopology.h:64
float yy() const
Definition: LocalError.h:24
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
static constexpr int nChannels
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
Side onWhichBorder_old(float x, float y, float z) const
Returns the side of the cell in which resides the point (x,y,z) (old cell geometry).
Definition: DTTopology.cc:116
Local2DPoint theOffSet
Definition: DTTopology.h:110
static const float theHeight
Definition: DTTopology.h:102
Side
Sides of the cell.
Definition: DTTopology.h:89
static const float theWidth
Definition: DTTopology.h:101
DTTopology(int firstWire, int nChannels, float semilenght)
Constructor: number of first wire, total # of wires in the layer and their lenght.
Definition: DTTopology.cc:24
MeasurementError measurementError(const LocalPoint &, const LocalError &) const override
Conversion to the measurement frame.
Definition: DTTopology.cc:54
float theLength
Definition: DTTopology.h:103
int channel(const LocalPoint &p) const override
Definition: DTTopology.cc:58
int lastChannel() const
Returns the wire number of the last wire.
Definition: DTTopology.h:81
float x
float xx() const
Definition: LocalError.h:22
static const float IBeamThickness
Definition: DTTopology.h:108
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
Definition: DTTopology.cc:63
float sensibleHeight() const
Returns the height of the actual sensible volume of the cell.
Definition: DTTopology.cc:39