CMS 3D CMS Logo

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, LocalTagLocal2DPoint
 
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 override
 
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 override
 
LocalPoint localPosition (const MeasurementPoint &) const override
 
MeasurementError measurementError (const LocalPoint &, const LocalError &) const override
 Conversion to the measurement frame. More...
 
MeasurementPoint measurementPosition (const LocalPoint &) const override
 
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...
 
 ~DTTopology () override
 
- 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

◆ Side

Sides of the cell.

Enumerator
zMin 
zMax 
xMin 
xMax 
yMin 
yMax 
none 

Definition at line 89 of file DTTopology.h.

89 { zMin, zMax, xMin, xMax, yMin, yMax, none };

Constructor & Destructor Documentation

◆ DTTopology()

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.

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 }

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

◆ ~DTTopology()

DTTopology::~DTTopology ( )
inlineoverride

Definition at line 33 of file DTTopology.h.

33 {}

Member Function Documentation

◆ cellHeight()

float DTTopology::cellHeight ( ) const
inline

◆ cellLenght()

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 74 of file DTTopology.h.

74 { return theLength; }

References theLength.

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

◆ cellWidth()

float DTTopology::cellWidth ( ) const
inline

◆ channel()

int DTTopology::channel ( const LocalPoint p) const
overridevirtual

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 54 of file DTTopology.cc.

54  {
55  return static_cast<int>((lp.x() - theOffSet.x()) / theWidth + theFirstChannel);
56 }

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

Referenced by HoughGrouping::associateHits(), and MuonSimHitProducer::produce().

◆ channels()

int DTTopology::channels ( ) const
inline

◆ firstChannel()

int DTTopology::firstChannel ( ) const
inline

◆ isWireValid()

bool DTTopology::isWireValid ( const int  wireNumber) const
inline

Definition at line 64 of file DTTopology.h.

64  {
65  return (wireNumber - (theFirstChannel - 1) <= 0 || wireNumber - lastChannel() > 0) ? false : true;
66  }

References funct::false, lastChannel(), and theFirstChannel.

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

◆ lastChannel()

int DTTopology::lastChannel ( ) const
inline

◆ localError()

LocalError DTTopology::localError ( const MeasurementPoint ,
const MeasurementError me 
) const
overridevirtual

Conversion between measurement coordinates and local cartesian coordinates.

Implements Topology.

Definition at line 41 of file DTTopology.cc.

41  {
42  return LocalError(me.uu() * (theWidth * theWidth), 0, me.vv() * (theLength * theLength));
43 }

References hlt_dqm_clientPB-live_cfg::me, theLength, and theWidth.

◆ localPosition()

LocalPoint DTTopology::localPosition ( const MeasurementPoint mp) const
overridevirtual

Conversion between measurement coordinates and local cartesian coordinates.

Implements Topology.

Definition at line 37 of file DTTopology.cc.

37  {
38  return LocalPoint((mp.x() - theFirstChannel) * theWidth + theOffSet.x(), (1 - mp.y()) * theLength + theOffSet.y());
39 }

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

◆ measurementError()

MeasurementError DTTopology::measurementError ( const LocalPoint ,
const LocalError le 
) const
overridevirtual

Conversion to the measurement frame.

Implements Topology.

Definition at line 50 of file DTTopology.cc.

50  {
51  return MeasurementError(le.xx() / (theWidth * theWidth), 0, le.yy() / (theLength * theLength));
52 }

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

◆ measurementPosition()

MeasurementPoint DTTopology::measurementPosition ( const LocalPoint lp) const
overridevirtual

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 45 of file DTTopology.cc.

45  {
46  return MeasurementPoint(static_cast<int>((lp.x() - theOffSet.x()) / theWidth + theFirstChannel),
47  1 - (lp.y() - theOffSet.y()) / theLength);
48 }

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().

◆ onWhichBorder()

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 78 of file DTTopology.cc.

78  {
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 }

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

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

◆ onWhichBorder_old()

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 112 of file DTTopology.cc.

112  {
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 }

References geometryDiff::epsilon, none, sensibleHeight(), sensibleWidth(), x, xMax, xMin, z, zMax, and zMin.

◆ sensibleHeight()

float DTTopology::sensibleHeight ( ) const

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

Definition at line 35 of file DTTopology.cc.

35 { return theHeight - plateThickness; }

References plateThickness, and theHeight.

Referenced by onWhichBorder(), and onWhichBorder_old().

◆ sensibleWidth()

float DTTopology::sensibleWidth ( ) const

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

Definition at line 33 of file DTTopology.cc.

33 { return theWidth - IBeamThickness; }

References IBeamThickness, and theWidth.

Referenced by onWhichBorder(), and onWhichBorder_old().

◆ wirePosition()

float DTTopology::wirePosition ( int  wireNumber) const

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

Definition at line 59 of file DTTopology.cc.

59  {
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 }

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

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

Member Data Documentation

◆ IBeamThickness

const float DTTopology::IBeamThickness = 0.13
staticprivate

Definition at line 108 of file DTTopology.h.

Referenced by sensibleWidth().

◆ IBeamWingLength

const float DTTopology::IBeamWingLength = 0.635
staticprivate

Definition at line 106 of file DTTopology.h.

Referenced by onWhichBorder().

◆ IBeamWingThickness

const float DTTopology::IBeamWingThickness = 0.13
staticprivate

Definition at line 105 of file DTTopology.h.

Referenced by onWhichBorder().

◆ plateThickness

const float DTTopology::plateThickness = 0.15
staticprivate

Definition at line 107 of file DTTopology.h.

Referenced by sensibleHeight().

◆ theFirstChannel

int DTTopology::theFirstChannel
private

◆ theHeight

const float DTTopology::theHeight = 1.3
staticprivate

Definition at line 102 of file DTTopology.h.

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

◆ theLength

float DTTopology::theLength
private

◆ theNChannels

int DTTopology::theNChannels
private

Definition at line 99 of file DTTopology.h.

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

◆ theOffSet

Local2DPoint DTTopology::theOffSet
private

Definition at line 110 of file DTTopology.h.

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

◆ theWidth

const float DTTopology::theWidth = 4.2
staticprivate
DTTopology::xMax
Definition: DTTopology.h:89
funct::false
false
Definition: Factorize.h:29
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
LocalError::xx
float xx() const
Definition: LocalError.h:22
MeasurementError
Definition: MeasurementError.h:8
DDAxes::z
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::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::yMin
Definition: DTTopology.h:89
DTTopology::theLength
float theLength
Definition: DTTopology.h:103
Exception
Definition: hltDiff.cc:246
DTTopology::zMin
Definition: DTTopology.h:89
DTTopology::yMax
Definition: DTTopology.h:89
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::theWidth
static const float theWidth
Definition: DTTopology.h:101
DTTopology::xMin
Definition: DTTopology.h:89
LocalError::yy
float yy() const
Definition: LocalError.h:24