CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes | Static Private Attributes
DTTopology Class Reference

#include <DTTopology.h>

Inheritance diagram for DTTopology:
Topology

Public Types

enum  Side {
  zMin, zMax, xMin, xMax,
  yMin, yMax, none
}
 Sides of the cell. More...
 
- Public Types inherited from Topology
typedef Point2DBase< double,
LocalTag
Local2DPoint
 
typedef Vector2D::MathVector MathVector2D
 
typedef Basic2DVector< double > Vector2D
 

Public Member Functions

float cellHeight () const
 Returns the cell height. More...
 
float cellLenght () const
 
float cellWidth () const
 Returns the cell width. More...
 
int channel (const LocalPoint &p) const
 
int channels () const
 Returns the number of wires in the layer. More...
 
 DTTopology (int firstWire, int nChannels, float semilenght)
 Constructor: number of first wire, total # of wires in the layer and their lenght. More...
 
int firstChannel () const
 Returns the wire number of the first wire. More...
 
bool isWireValid (const int wireNumber) const
 
int lastChannel () const
 Returns the wire number of the last wire. More...
 
LocalError localError (const MeasurementPoint &, const MeasurementError &) const
 
LocalPoint localPosition (const MeasurementPoint &) const
 
MeasurementError measurementError (const LocalPoint &, const LocalError &) const
 Conversion to the measurement frame. More...
 
MeasurementPoint measurementPosition (const LocalPoint &) const
 
Side onWhichBorder (float x, float y, float z) const
 
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). More...
 
float sensibleHeight () const
 Returns the height of the actual sensible volume of the cell. More...
 
float sensibleWidth () const
 Returns the width of the actual sensible volume of the cell. More...
 
float wirePosition (int wireNumber) const
 Returns the x position in the layer of a given wire number. More...
 
virtual ~DTTopology ()
 
- Public Member Functions inherited from Topology
virtual int channel (const LocalPoint &lp, const LocalTrackAngles &) const
 conversion taking also the angle from the track state More...
 
virtual LocalError localError (const MeasurementPoint &mp, const MeasurementError &me, const LocalTrackPred &) const
 conversion taking also the angle from the predicted track state More...
 
virtual LocalPoint localPosition (const MeasurementPoint &mp, const LocalTrackPred &) const
 conversion taking also the angle from the predicted track state More...
 
virtual MeasurementError measurementError (const LocalPoint &lp, const LocalError &le, const LocalTrackAngles &) const
 conversion taking also the angle from the track state More...
 
virtual MeasurementPoint measurementPosition (const LocalPoint &lp, const LocalTrackAngles &) const
 conversion taking also the angle from the track state More...
 
virtual ~Topology ()
 

Private Attributes

int theFirstChannel
 
float theLength
 
int theNChannels
 
Local2DPoint theOffSet
 

Static Private Attributes

static const float IBeamThickness = 0.13
 
static const float IBeamWingLength = 0.635
 
static const float IBeamWingThickness = 0.13
 
static const float plateThickness = 0.15
 
static const float theHeight = 1.3
 
static const float theWidth = 4.2
 

Detailed Description

Conversion between the local frame of the DT DetUnits (i.e. a layer of cells in a superlayer) and the "measurement frame". This is a rectangular frame where x runs between (FirstCellNumber-0.5) and (LastCellNumber+0.5). Note that cell numbers follow the hardware convention, so that FirstCellNumber is either 1 or 2 depending of the layer.

Note that DTs measure a time, not a position, so unlike for strip detectors, there is no guarantee that a measurement in a cell will not end up in the neighbouring cell. This must be taken into account for all cases where a * LocalPoint is used as an argument, e.g. to get back the channel number. This will be an issue if wire misalignment is introduced.

The Topology interface is extended with methods relevant for the DT detectors, e.g. wirePosition(int), etc.

Author
R. Bellan - INFN Torino

Definition at line 28 of file DTTopology.h.

Member Enumeration Documentation

Sides of the cell.

Enumerator
zMin 
zMax 
xMin 
xMax 
yMin 
yMax 
none 

Definition at line 88 of file DTTopology.h.

Constructor & Destructor Documentation

DTTopology::DTTopology ( int  firstWire,
int  nChannels,
float  semilenght 
)

Constructor: number of first wire, total # of wires in the layer and their lenght.

Definition at line 22 of file DTTopology.cc.

References gather_cfg::cout, theFirstChannel, theHeight, theLength, theNChannels, theOffSet, and theWidth.

22  : theFirstChannel(firstWire),
24  theLength(semilenght*2){
26 
27 #ifdef VERBOSE
28  cout <<"Constructing DTTopology with:"<<endl
29  <<"number of wires = "<<theNChannels
30  <<", first wire number = "<<theFirstChannel<<endl
31  <<", width = "<<theWidth
32  <<", height = "<<theHeight
33  <<", length = "<<theLength
34  <<endl;
35 #endif
36 }
int theFirstChannel
Definition: DTTopology.h:97
int theNChannels
Definition: DTTopology.h:98
Point2DBase< double, LocalTag > Local2DPoint
Definition: Topology.h:55
Local2DPoint theOffSet
Definition: DTTopology.h:109
static const float theHeight
Definition: DTTopology.h:101
static const float theWidth
Definition: DTTopology.h:100
float theLength
Definition: DTTopology.h:102
tuple cout
Definition: gather_cfg.py:121
virtual DTTopology::~DTTopology ( )
inlinevirtual

Definition at line 34 of file DTTopology.h.

34 {}

Member Function Documentation

float DTTopology::cellHeight ( ) const
inline

Returns the cell height.

Definition at line 70 of file DTTopology.h.

References theHeight.

Referenced by FWRecoGeometryESProducer::addDTGeometry(), FWTGeoRecoGeometryESProducer::addDTGeometry(), and DTDigitizer::dumpHit().

70 {return theHeight;}
static const float theHeight
Definition: DTTopology.h:101
float DTTopology::cellLenght ( ) const
inline

Returns the cell length. This is the length of the sensitive volume, i.e. lenght of the wire minus the lenght of the two tappini (1.55 mm each)

Definition at line 73 of file DTTopology.h.

References theLength.

Referenced by FWRecoGeometryESProducer::addDTGeometry(), FWTGeoRecoGeometryESProducer::addDTGeometry(), DTDigitizer::dumpHit(), DTDigitizer::externalDelays(), DTTTrigSyncTOFCorr::offset(), DTTTrigSyncFromDB::offset(), and DTRecHitQuality::simHitDistFromFE().

73 {return theLength;}
float theLength
Definition: DTTopology.h:102
float DTTopology::cellWidth ( ) const
inline
int DTTopology::channel ( const LocalPoint p) const
virtual

Return the wire number, starting from a LocalPoint. This method is deprecated: when converting the position of a rechit, there is no guarantee that the converted value can be interpreted as the cell where the hit belongs, see note on neighbouring cells in the class header.

Implements Topology.

Definition at line 79 of file DTTopology.cc.

References theFirstChannel, theOffSet, theWidth, PV2DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::x().

Referenced by MuonSimHitProducer::produce().

80 {
81  return static_cast<int>( (lp.x()-theOffSet.x())/theWidth + theFirstChannel);
82 }
int theFirstChannel
Definition: DTTopology.h:97
Local2DPoint theOffSet
Definition: DTTopology.h:109
static const float theWidth
Definition: DTTopology.h:100
T x() const
Definition: PV2DBase.h:45
int DTTopology::channels ( ) const
inline
int DTTopology::firstChannel ( ) const
inline
bool DTTopology::isWireValid ( const int  wireNumber) const
inline

Definition at line 65 of file DTTopology.h.

References lastChannel(), and theFirstChannel.

Referenced by DTLinearDriftAlgo::compute(), DTLinearDriftFromDBAlgo::compute(), DTNoDriftAlgo::compute(), and wirePosition().

65 {return (wireNumber - (theFirstChannel - 1) <= 0 || wireNumber - lastChannel() > 0 ) ? false : true;}
int theFirstChannel
Definition: DTTopology.h:97
int lastChannel() const
Returns the wire number of the last wire.
Definition: DTTopology.h:80
int DTTopology::lastChannel ( ) const
inline
LocalError DTTopology::localError ( const MeasurementPoint ,
const MeasurementError me 
) const
virtual

Conversion between measurement coordinates and local cartesian coordinates.

Implements Topology.

Definition at line 58 of file DTTopology.cc.

References theLength, theWidth, MeasurementError::uu(), and MeasurementError::vv().

59 {
60  return LocalError(me.uu()*(theWidth*theWidth), 0,
61  me.vv()*(theLength*theLength));
62 }
float vv() const
float uu() const
static const float theWidth
Definition: DTTopology.h:100
float theLength
Definition: DTTopology.h:102
LocalPoint DTTopology::localPosition ( const MeasurementPoint mp) const
virtual

Conversion between measurement coordinates and local cartesian coordinates.

Implements Topology.

Definition at line 51 of file DTTopology.cc.

References theFirstChannel, theLength, theOffSet, theWidth, PV2DBase< T, PVType, FrameType >::x(), and PV2DBase< T, PVType, FrameType >::y().

52 {
53  return LocalPoint( (mp.x() - theFirstChannel)*theWidth + theOffSet.x() ,
54  (1-mp.y())*theLength + theOffSet.y());
55 }
T y() const
Definition: PV2DBase.h:46
int theFirstChannel
Definition: DTTopology.h:97
Local2DPoint theOffSet
Definition: DTTopology.h:109
static const float theWidth
Definition: DTTopology.h:100
float theLength
Definition: DTTopology.h:102
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
T x() const
Definition: PV2DBase.h:45
MeasurementError DTTopology::measurementError ( const LocalPoint ,
const LocalError le 
) const
virtual

Conversion to the measurement frame.

Implements Topology.

Definition at line 72 of file DTTopology.cc.

References theLength, theWidth, LocalError::xx(), and LocalError::yy().

73 {
74  return MeasurementError(le.xx()/(theWidth*theWidth),0,
75  le.yy()/(theLength*theLength));
76 }
float xx() const
Definition: LocalError.h:24
float yy() const
Definition: LocalError.h:26
static const float theWidth
Definition: DTTopology.h:100
float theLength
Definition: DTTopology.h:102
MeasurementPoint DTTopology::measurementPosition ( const LocalPoint lp) const
virtual

Conversion to the measurement frame. (Caveat: when converting the position of a rechit, there is no guarantee that the converted value can be interpreted as the cell where the hit belongs, see note on neighbouring cells in the class header.

Implements Topology.

Definition at line 65 of file DTTopology.cc.

References theFirstChannel, theLength, theOffSet, theWidth, PV2DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::x(), PV2DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::y().

66 {
67  return MeasurementPoint( static_cast<int>( (lp.x()-theOffSet.x())/theWidth + theFirstChannel),
68  1 - (lp.y()-theOffSet.y())/theLength);
69 }
T y() const
Definition: PV2DBase.h:46
int theFirstChannel
Definition: DTTopology.h:97
T y() const
Definition: PV3DBase.h:63
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
Local2DPoint theOffSet
Definition: DTTopology.h:109
static const float theWidth
Definition: DTTopology.h:100
float theLength
Definition: DTTopology.h:102
T x() const
Definition: PV2DBase.h:45
T x() const
Definition: PV3DBase.h:62
DTTopology::Side DTTopology::onWhichBorder ( float  x,
float  y,
float  z 
) const

Returns the side of the cell in which resides the point (x,y,z) (new cell geometry, i.e. with I-beam profiles).

Definition at line 109 of file DTTopology.cc.

References epsilon, IBeamWingLength, IBeamWingThickness, none, sensibleHeight(), sensibleWidth(), xMax, xMin, zMax, and zMin.

Referenced by DTDigitizer::computeTime(), DTDigitizer::dumpHit(), and DTHitAssociator::SimHitOK().

110 {
111 
112  // epsilon = Tolerance to determine if a hit starts/ends on the cell border.
113  // Current value comes from CMSIM, where hit position is
114  // always ~10um far from surface. For OSCAR the discrepancy is < 1um.
115  const float epsilon = 0.0015; // 15 um
116 
117  // with new geometry the cell shape is not rectangular, but is a
118  // rectangular with the I-beam "Wing" subtracted.
119  // The height of the Wing is 1.0 mm and the length is 6.35 mm: these 4
120  // volumens must be taken into account when the border is computed
121 
122  Side side = none;
123 
124  if ( fabs(z) > ( sensibleHeight()/2.-epsilon) ||
125  (fabs(x) > ( sensibleWidth()/2.-IBeamWingLength-epsilon) &&
126  fabs(z) > ( sensibleHeight()/2.-IBeamWingThickness-epsilon) ) ){ //FIXME
127 
128  if (z > 0.) side = zMax; // This is currently the INNER surface.
129  else side = zMin;
130  }
131 
132  else if ( fabs(x) > ( sensibleWidth()/2.-epsilon) ){
133  if (x > 0.) side = xMax;
134  else side = xMin;
135  } // FIXME: else if ymax, ymin...
136 
137  return side;
138 }
static const float IBeamWingLength
Definition: DTTopology.h:105
static const float IBeamWingThickness
Definition: DTTopology.h:104
float sensibleHeight() const
Returns the height of the actual sensible volume of the cell.
Definition: DTTopology.cc:45
float sensibleWidth() const
Returns the width of the actual sensible volume of the cell.
Definition: DTTopology.cc:39
float float float z
Side
Sides of the cell.
Definition: DTTopology.h:88
const double epsilon
Definition: DDAxes.h:10
DTTopology::Side DTTopology::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 at line 143 of file DTTopology.cc.

References epsilon, none, sensibleHeight(), sensibleWidth(), xMax, xMin, zMax, and zMin.

144 {
145 
146  // epsilon = Tolerance to determine if a hit starts/ends on the cell border.
147  // Current value comes from CMSIM, where hit position is
148  // always ~10um far from surface. For OSCAR the discrepancy is < 1um.
149  const float epsilon = 0.0015; // 15 um
150 
151  Side side = none;
152 
153  if ( fabs(z) > ( sensibleHeight()/2.-epsilon)) {
154  if (z > 0.) {
155  side = zMax; // This is currently the INNER surface.
156  } else {
157  side = zMin;
158  }
159  } else if ( fabs(x) > ( sensibleWidth()/2.-epsilon)) {
160  if (x > 0.) {
161  side = xMax;
162  } else {
163  side = xMin;
164  }
165  } // FIXME: else if ymax, ymin...
166 
167  return side;
168 }
float sensibleHeight() const
Returns the height of the actual sensible volume of the cell.
Definition: DTTopology.cc:45
float sensibleWidth() const
Returns the width of the actual sensible volume of the cell.
Definition: DTTopology.cc:39
float float float z
Side
Sides of the cell.
Definition: DTTopology.h:88
const double epsilon
Definition: DDAxes.h:10
float DTTopology::sensibleHeight ( ) const

Returns the height of the actual sensible volume of the cell.

Definition at line 45 of file DTTopology.cc.

References plateThickness, and theHeight.

Referenced by onWhichBorder(), and onWhichBorder_old().

46 {
48 }
static const float plateThickness
Definition: DTTopology.h:106
static const float theHeight
Definition: DTTopology.h:101
float DTTopology::sensibleWidth ( ) const

Returns the width of the actual sensible volume of the cell.

Definition at line 39 of file DTTopology.cc.

References IBeamThickness, and theWidth.

Referenced by onWhichBorder(), and onWhichBorder_old().

40 {
41  return theWidth-IBeamThickness;
42 }
static const float theWidth
Definition: DTTopology.h:100
static const float IBeamThickness
Definition: DTTopology.h:107
float DTTopology::wirePosition ( int  wireNumber) const

Returns the x position in the layer of a given wire number.

Definition at line 86 of file DTTopology.cc.

References edm::hlt::Exception, isWireValid(), lastChannel(), theFirstChannel, theOffSet, theWidth, and PV2DBase< T, PVType, FrameType >::x().

Referenced by DTResolutionAnalysisTask::analyze(), DTSegmentUpdator::calculateT0corr(), DTRecHitSegmentResidual::compute(), DTLinearDriftAlgo::compute(), DTLinearDriftFromDBAlgo::compute(), DTNoDriftAlgo::compute(), DTCalibValidation::compute(), DTDigitizer::computeTime(), DTDigiSyncTOFCorr::digitizerOffset(), DTSegmentUpdator::fit(), DTTrigGeom::getGeom(), DTTMax::InfoLayer::InfoLayer(), DTClusterer::initHits(), DTTrigGeom::localPosition(), DTTTrigSyncFromDB::offset(), DTTTrigSyncTOFCorr::offset(), DTLocalTriggerBaseTest::phiRange(), DTCalibValidation::recHitDistFromWire(), DTRecHitQuality::recHitDistFromWire(), GlobalRecHitsAnalyzer::recHitDistFromWire(), GlobalRecHitsProducer::recHitDistFromWire(), DTResidualCalibration::segmentToWireDistance(), DTRecHitQuality::simHitDistFromWire(), GlobalRecHitsAnalyzer::simHitDistFromWire(), GlobalRecHitsProducer::simHitDistFromWire(), DTHitAssociator::SimHitOK(), DTTrigGeom::tubePosInCh(), DTSegmentUpdator::updateHits(), and ValidateGeometry::validateDTLayerGeometry().

87 {
88  if (!isWireValid( wireNumber ))//- (theFirstChannel-1) <= 0. || wireNumber > lastChannel() )
89  throw cms::Exception("InvalidWireNumber") << "DTTopology::wirePosition:"
90  << " Requested wire number: "<< wireNumber
91  << " ,but the first wire number is "<< theFirstChannel
92  << " and the last wire number is "<< lastChannel()
93  << std::endl;
94  else
95  return (wireNumber - (theFirstChannel-1) - 0.5)*theWidth + theOffSet.x();
96 }
int theFirstChannel
Definition: DTTopology.h:97
int lastChannel() const
Returns the wire number of the last wire.
Definition: DTTopology.h:80
Local2DPoint theOffSet
Definition: DTTopology.h:109
static const float theWidth
Definition: DTTopology.h:100
bool isWireValid(const int wireNumber) const
Definition: DTTopology.h:65
T x() const
Definition: PV2DBase.h:45

Member Data Documentation

const float DTTopology::IBeamThickness = 0.13
staticprivate

Definition at line 107 of file DTTopology.h.

Referenced by sensibleWidth().

const float DTTopology::IBeamWingLength = 0.635
staticprivate

Definition at line 105 of file DTTopology.h.

Referenced by onWhichBorder().

const float DTTopology::IBeamWingThickness = 0.13
staticprivate

Definition at line 104 of file DTTopology.h.

Referenced by onWhichBorder().

const float DTTopology::plateThickness = 0.15
staticprivate

Definition at line 106 of file DTTopology.h.

Referenced by sensibleHeight().

int DTTopology::theFirstChannel
private
const float DTTopology::theHeight = 1.3
staticprivate

Definition at line 101 of file DTTopology.h.

Referenced by cellHeight(), DTTopology(), and sensibleHeight().

float DTTopology::theLength
private
int DTTopology::theNChannels
private

Definition at line 98 of file DTTopology.h.

Referenced by channels(), DTTopology(), and lastChannel().

Local2DPoint DTTopology::theOffSet
private

Definition at line 109 of file DTTopology.h.

Referenced by channel(), DTTopology(), localPosition(), measurementPosition(), and wirePosition().

const float DTTopology::theWidth = 4.2
staticprivate