CMS 3D CMS Logo

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