CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DTTopology.cc
Go to the documentation of this file.
1 
10 
11 #include <iostream>
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): theFirstChannel(firstWire),
25  theNChannels(nChannels),
26  theLength(semilenght*2){
28 
29 #ifdef VERBOSE
30  cout <<"Constructing DTTopology with:"<<endl
31  <<"number of wires = "<<theNChannels
32  <<", first wire number = "<<theFirstChannel<<endl
33  <<", width = "<<theWidth
34  <<", height = "<<theHeight
35  <<", length = "<<theLength
36  <<endl;
37 #endif
38 }
39 
40 const float DTTopology::sensibleWidth() const{
41  return theWidth-IBeamThickness;
42 }
43 
44 const float DTTopology::sensibleHeight() const{
46 }
47 
49  return LocalPoint( (mp.x() - theFirstChannel)*theWidth + theOffSet.x() ,
50  (1-mp.y())*theLength + theOffSet.y());
51 }
52 
54  return LocalError(me.uu()*(theWidth*theWidth), 0,
55  me.vv()*(theLength*theLength));
56 }
57 
59  return MeasurementPoint( static_cast<int>( (lp.x()-theOffSet.x())/theWidth + theFirstChannel),
60  1 - (lp.y()-theOffSet.y())/theLength);
61 }
62 
64  return MeasurementError(le.xx()/(theWidth*theWidth),0,
65  le.yy()/(theLength*theLength));
66 }
67 
68 int DTTopology::channel( const LocalPoint& lp) const{
69  return static_cast<int>( (lp.x()-theOffSet.x())/theWidth + theFirstChannel);
70 }
71 
72 // return the x wire position in the layer, starting from its wire number.
73 float DTTopology::wirePosition(int wireNumber) const{
74  if (wireNumber - (theFirstChannel-1) <= 0 || wireNumber > lastChannel() )
75  throw cms::Exception("InvalidWireNumber") << "DTTopology::wirePosition:"
76  << " Requested wire number: "<< wireNumber
77  << " ,but the first wire number is "<< theFirstChannel
78  << " and the last wire number is "<< lastChannel()
79  << std::endl;
80  else
81  return (wireNumber - (theFirstChannel-1) - 0.5)*theWidth + theOffSet.x();
82 }
83 
84 /*
85 // return the x wire position in the layer r.f., starting from its wire number.
86 float DTTopology::wirePosition(int wireNumber) const{
87  int layerCoord = theNChannels - wireNumber + theFirstChannel;
88  return (layerCoord - 0.5)*theWidth + theOffSet.x();
89 }
90 */
91 
92 
93 //New cell geometry
94 DTTopology::Side DTTopology::onWhichBorder(float x, float y, float z) const{
95 
96  // epsilon = Tolerance to determine if a hit starts/ends on the cell border.
97  // Current value comes from CMSIM, where hit position is
98  // always ~10um far from surface. For OSCAR the discrepancy is < 1um.
99  const float epsilon = 0.0015; // 15 um
100 
101  // with new geometry the cell shape is not rectangular, but is a
102  // rectangular with the I-beam "Wing" subtracted.
103  // The height of the Wing is 1.0 mm and the length is 6.35 mm: these 4
104  // volumens must be taken into account when the border is computed
105 
106  Side side = none;
107 
108  if ( fabs(z) > ( sensibleHeight()/2.-epsilon) ||
109  (fabs(x) > ( sensibleWidth()/2.-IBeamWingLength-epsilon) &&
110  fabs(z) > ( sensibleHeight()/2.-IBeamWingThickness-epsilon) ) ){ //FIXME
111 
112  if (z > 0.) side = zMax; // This is currently the INNER surface.
113  else side = zMin;
114  }
115 
116  else if ( fabs(x) > ( sensibleWidth()/2.-epsilon) ){
117  if (x > 0.) side = xMax;
118  else side = xMin;
119  } // FIXME: else if ymax, ymin...
120 
121  return side;
122 }
123 
124 
125 //Old geometry of the DT
127 
128  // epsilon = Tolerance to determine if a hit starts/ends on the cell border.
129  // Current value comes from CMSIM, where hit position is
130  // always ~10um far from surface. For OSCAR the discrepancy is < 1um.
131  const float epsilon = 0.0015; // 15 um
132 
133  Side side = none;
134 
135  if ( fabs(z) > ( sensibleHeight()/2.-epsilon)) {
136  if (z > 0.) {
137  side = zMax; // This is currently the INNER surface.
138  } else {
139  side = zMin;
140  }
141  } else if ( fabs(x) > ( sensibleWidth()/2.-epsilon)) {
142  if (x > 0.) {
143  side = xMax;
144  } else {
145  side = xMin;
146  }
147  } // FIXME: else if ymax, ymin...
148 
149  return side;
150 }
151 
const int lastChannel() const
Returns the wire number of the last wire.
Definition: DTTopology.h:82
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
Definition: DTTopology.cc:73
static const float IBeamWingLength
Definition: DTTopology.h:107
float xx() const
Definition: LocalError.h:19
static const float IBeamWingThickness
Definition: DTTopology.h:106
float vv() const
T y() const
Definition: PV2DBase.h:40
Side onWhichBorder(float x, float y, float z) const
Definition: DTTopology.cc:94
int theFirstChannel
Definition: DTTopology.h:99
static const float plateThickness
Definition: DTTopology.h:108
int channel(const LocalPoint &p) const
Definition: DTTopology.cc:68
T y() const
Definition: PV3DBase.h:57
int theNChannels
Definition: DTTopology.h:100
Point2DBase< double, LocalTag > Local2DPoint
Definition: Topology.h:50
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
MeasurementError measurementError(const LocalPoint &, const LocalError &) const
Conversion to the measurement frame.
Definition: DTTopology.cc:63
Definition: DDAxes.h:10
float yy() const
Definition: LocalError.h:21
const float sensibleHeight() const
Returns the height of the actual sensible volume of the cell.
Definition: DTTopology.cc:44
float uu() const
Local2DPoint theOffSet
Definition: DTTopology.h:111
static const float theHeight
Definition: DTTopology.h:103
const float sensibleWidth() const
Returns the width of the actual sensible volume of the cell.
Definition: DTTopology.cc:40
Side
Sides of the cell.
Definition: DTTopology.h:90
static const float theWidth
Definition: DTTopology.h:102
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
LocalError localError(const MeasurementPoint &, const MeasurementError &) const
Definition: DTTopology.cc:53
LocalPoint localPosition(const MeasurementPoint &) const
Definition: DTTopology.cc:48
float theLength
Definition: DTTopology.h:104
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:126
MeasurementPoint measurementPosition(const LocalPoint &) const
Definition: DTTopology.cc:58
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
tuple cout
Definition: gather_cfg.py:41
const double epsilon
T x() const
Definition: PV2DBase.h:39
T x() const
Definition: PV3DBase.h:56
static const float IBeamThickness
Definition: DTTopology.h:109