#include <DTTopology.h>
Public Types | |
enum | Side { zMin, zMax, xMin, xMax, yMin, yMax, none } |
Sides of the cell. More... | |
Public Member Functions | |
float | cellHeight () const |
Returns the cell height. | |
float | cellLenght () const |
float | cellWidth () const |
Returns the cell width. | |
int | channel (const LocalPoint &p) const |
int | channels () const |
Returns the number of wires in the layer. | |
DTTopology (int firstWire, int nChannels, float semilenght) | |
Constructor: number of first wire, total # of wires in the layer and their lenght. | |
int | firstChannel () const |
Returns the wire number of the first wire. | |
bool | isWireValid (const int wireNumber) const |
int | lastChannel () const |
Returns the wire number of the last wire. | |
LocalError | localError (const MeasurementPoint &, const MeasurementError &) const |
LocalPoint | localPosition (const MeasurementPoint &) const |
MeasurementError | measurementError (const LocalPoint &, const LocalError &) const |
Conversion to the measurement frame. | |
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). | |
float | sensibleHeight () const |
Returns the height of the actual sensible volume of the cell. | |
float | sensibleWidth () const |
Returns the width of the actual sensible volume of the cell. | |
float | wirePosition (int wireNumber) const |
Returns the x position in the layer of a given wire number. | |
virtual | ~DTTopology () |
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 |
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.
Definition at line 30 of file DTTopology.h.
enum DTTopology::Side |
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 24 of file DTTopology.cc.
References gather_cfg::cout, theFirstChannel, theHeight, theLength, theNChannels, theOffSet, and theWidth.
: theFirstChannel(firstWire), theNChannels(nChannels), theLength(semilenght*2){ theOffSet = Local2DPoint(-theNChannels/2. * theWidth, -theLength/2.); #ifdef VERBOSE cout <<"Constructing DTTopology with:"<<endl <<"number of wires = "<<theNChannels <<", first wire number = "<<theFirstChannel<<endl <<", width = "<<theWidth <<", height = "<<theHeight <<", length = "<<theLength <<endl; #endif }
virtual DTTopology::~DTTopology | ( | ) | [inline, virtual] |
Definition at line 36 of file DTTopology.h.
{}
float DTTopology::cellHeight | ( | ) | const [inline] |
Returns the cell height.
Definition at line 72 of file DTTopology.h.
References theHeight.
Referenced by FWTGeoRecoGeometryESProducer::addDTGeometry(), FWRecoGeometryESProducer::addDTGeometry(), and DTDigitizer::dumpHit().
{return theHeight;}
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 75 of file DTTopology.h.
References theLength.
Referenced by FWTGeoRecoGeometryESProducer::addDTGeometry(), FWRecoGeometryESProducer::addDTGeometry(), DTDigitizer::dumpHit(), DTDigitizer::externalDelays(), DTTTrigSyncTOFCorr::offset(), DTTTrigSyncFromDB::offset(), and DTRecHitQuality::simHitDistFromFE().
{return theLength;}
float DTTopology::cellWidth | ( | ) | const [inline] |
Returns the cell width.
Definition at line 70 of file DTTopology.h.
References theWidth.
Referenced by FWTGeoRecoGeometryESProducer::addDTGeometry(), FWRecoGeometryESProducer::addDTGeometry(), DTDigitizer::dumpHit(), DTTrigGeomUtils::phiRange(), and DTTrigGeomUtils::thetaRange().
{return theWidth;}
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 81 of file DTTopology.cc.
References theFirstChannel, theOffSet, theWidth, PV3DBase< T, PVType, FrameType >::x(), and PV2DBase< T, PVType, FrameType >::x().
Referenced by MuonSimHitProducer::produce().
{ return static_cast<int>( (lp.x()-theOffSet.x())/theWidth + theFirstChannel); }
int DTTopology::channels | ( | ) | const [inline] |
Returns the number of wires in the layer.
Definition at line 77 of file DTTopology.h.
References theNChannels.
Referenced by FWTGeoRecoGeometryESProducer::addDTGeometry(), FWRecoGeometryESProducer::addDTGeometry(), DTTrigGeom::getGeom(), DTTrigGeomUtils::phiRange(), and DTTrigGeomUtils::thetaRange().
{return theNChannels;}
int DTTopology::firstChannel | ( | ) | const [inline] |
Returns the wire number of the first wire.
Definition at line 80 of file DTTopology.h.
References theFirstChannel.
Referenced by FWTGeoRecoGeometryESProducer::addDTGeometry(), FWRecoGeometryESProducer::addDTGeometry(), DTTPDeadWriter::analyze(), DTDigiForNoiseTask::analyze(), DTt0DBValidation::beginRun(), DTDigiForNoiseTask::bookHistos(), DTTrigGeom::getGeom(), DTLocalTriggerBaseTest::phiRange(), MuonSimHitProducer::produce(), DTFineDelayCorr::runClientDiagnostic(), and ValidateGeometry::validateDTLayerGeometry().
{return theFirstChannel;}
bool DTTopology::isWireValid | ( | const int | wireNumber | ) | const [inline] |
Definition at line 67 of file DTTopology.h.
References lastChannel(), and theFirstChannel.
Referenced by DTLinearDriftFromDBAlgo::compute(), DTNoDriftAlgo::compute(), DTLinearDriftAlgo::compute(), and wirePosition().
{return (wireNumber - (theFirstChannel - 1) <= 0 || wireNumber - lastChannel() > 0 ) ? false : true;}
int DTTopology::lastChannel | ( | ) | const [inline] |
Returns the wire number of the last wire.
Definition at line 82 of file DTTopology.h.
References theFirstChannel, and theNChannels.
Referenced by FWTGeoRecoGeometryESProducer::addDTGeometry(), FWRecoGeometryESProducer::addDTGeometry(), DTDigiForNoiseTask::analyze(), DTnoiseDBValidation::beginRun(), DTt0DBValidation::beginRun(), DTDigiForNoiseTask::bookHistos(), isWireValid(), DTLocalTriggerBaseTest::phiRange(), MuonSimHitProducer::produce(), ValidateGeometry::validateDTLayerGeometry(), and wirePosition().
{return theNChannels+theFirstChannel-1;}
LocalError DTTopology::localError | ( | const MeasurementPoint & | , |
const MeasurementError & | me | ||
) | const [virtual] |
Conversion between measurement coordinates and local cartesian coordinates.
Implements Topology.
Definition at line 60 of file DTTopology.cc.
References theLength, theWidth, MeasurementError::uu(), and MeasurementError::vv().
LocalPoint DTTopology::localPosition | ( | const MeasurementPoint & | mp | ) | const [virtual] |
Conversion between measurement coordinates and local cartesian coordinates.
Implements Topology.
Definition at line 53 of file DTTopology.cc.
References theFirstChannel, theLength, theOffSet, theWidth, PV2DBase< T, PVType, FrameType >::x(), and PV2DBase< T, PVType, FrameType >::y().
{ return LocalPoint( (mp.x() - theFirstChannel)*theWidth + theOffSet.x() , (1-mp.y())*theLength + theOffSet.y()); }
MeasurementError DTTopology::measurementError | ( | const LocalPoint & | , |
const LocalError & | le | ||
) | const [virtual] |
Conversion to the measurement frame.
Implements Topology.
Definition at line 74 of file DTTopology.cc.
References theLength, theWidth, LocalError::xx(), and LocalError::yy().
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 67 of file DTTopology.cc.
References theFirstChannel, theLength, theOffSet, theWidth, PV3DBase< T, PVType, FrameType >::x(), PV2DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV2DBase< T, PVType, FrameType >::y().
{ return MeasurementPoint( static_cast<int>( (lp.x()-theOffSet.x())/theWidth + theFirstChannel), 1 - (lp.y()-theOffSet.y())/theLength); }
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 111 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().
{ // epsilon = Tolerance to determine if a hit starts/ends on the cell border. // Current value comes from CMSIM, where hit position is // always ~10um far from surface. For OSCAR the discrepancy is < 1um. const float epsilon = 0.0015; // 15 um // with new geometry the cell shape is not rectangular, but is a // rectangular with the I-beam "Wing" subtracted. // The height of the Wing is 1.0 mm and the length is 6.35 mm: these 4 // volumens must be taken into account when the border is computed Side side = none; if ( fabs(z) > ( sensibleHeight()/2.-epsilon) || (fabs(x) > ( sensibleWidth()/2.-IBeamWingLength-epsilon) && fabs(z) > ( sensibleHeight()/2.-IBeamWingThickness-epsilon) ) ){ //FIXME if (z > 0.) side = zMax; // This is currently the INNER surface. else side = zMin; } else if ( fabs(x) > ( sensibleWidth()/2.-epsilon) ){ if (x > 0.) side = xMax; else side = xMin; } // FIXME: else if ymax, ymin... return side; }
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 145 of file DTTopology.cc.
References epsilon, none, sensibleHeight(), sensibleWidth(), xMax, xMin, zMax, and zMin.
{ // epsilon = Tolerance to determine if a hit starts/ends on the cell border. // Current value comes from CMSIM, where hit position is // always ~10um far from surface. For OSCAR the discrepancy is < 1um. const float epsilon = 0.0015; // 15 um Side side = none; if ( fabs(z) > ( sensibleHeight()/2.-epsilon)) { if (z > 0.) { side = zMax; // This is currently the INNER surface. } else { side = zMin; } } else if ( fabs(x) > ( sensibleWidth()/2.-epsilon)) { if (x > 0.) { side = xMax; } else { side = xMin; } } // FIXME: else if ymax, ymin... return side; }
float DTTopology::sensibleHeight | ( | ) | const |
Returns the height of the actual sensible volume of the cell.
Definition at line 47 of file DTTopology.cc.
References plateThickness, and theHeight.
Referenced by onWhichBorder(), and onWhichBorder_old().
{ return theHeight-plateThickness; }
float DTTopology::sensibleWidth | ( | ) | const |
Returns the width of the actual sensible volume of the cell.
Definition at line 41 of file DTTopology.cc.
References IBeamThickness, and theWidth.
Referenced by onWhichBorder(), and onWhichBorder_old().
{ return theWidth-IBeamThickness; }
float DTTopology::wirePosition | ( | int | wireNumber | ) | const |
Returns the x position in the layer of a given wire number.
Definition at line 88 of file DTTopology.cc.
References Exception, isWireValid(), lastChannel(), theFirstChannel, theOffSet, theWidth, and PV2DBase< T, PVType, FrameType >::x().
Referenced by DTResolutionAnalysisTask::analyze(), DTSegmentUpdator::calculateT0corr(), DTRecHitSegmentResidual::compute(), DTLinearDriftFromDBAlgo::compute(), DTNoDriftAlgo::compute(), DTLinearDriftAlgo::compute(), DTCalibValidation::compute(), DTDigitizer::computeTime(), DTDigiSyncTOFCorr::digitizerOffset(), DTTrigGeom::getGeom(), DTTMax::InfoLayer::InfoLayer(), DTMeantimerPatternReco::initHits(), DTTrigGeom::localPosition(), DTTTrigSyncTOFCorr::offset(), DTTTrigSyncFromDB::offset(), DTLocalTriggerBaseTest::phiRange(), DTRecHitQuality::recHitDistFromWire(), GlobalRecHitsProducer::recHitDistFromWire(), GlobalRecHitsAnalyzer::recHitDistFromWire(), DTCalibValidation::recHitDistFromWire(), DTResidualCalibration::segmentToWireDistance(), GlobalRecHitsProducer::simHitDistFromWire(), DTRecHitQuality::simHitDistFromWire(), GlobalRecHitsAnalyzer::simHitDistFromWire(), DTHitAssociator::SimHitOK(), DTTrigGeom::tubePosInCh(), DTSegmentUpdator::updateHits(), and ValidateGeometry::validateDTLayerGeometry().
{ if (!isWireValid( wireNumber ))//- (theFirstChannel-1) <= 0. || wireNumber > lastChannel() ) throw cms::Exception("InvalidWireNumber") << "DTTopology::wirePosition:" << " Requested wire number: "<< wireNumber << " ,but the first wire number is "<< theFirstChannel << " and the last wire number is "<< lastChannel() << std::endl; else return (wireNumber - (theFirstChannel-1) - 0.5)*theWidth + theOffSet.x(); }
const float DTTopology::IBeamThickness = 0.13 [static, private] |
Definition at line 109 of file DTTopology.h.
Referenced by sensibleWidth().
const float DTTopology::IBeamWingLength = 0.635 [static, private] |
Definition at line 107 of file DTTopology.h.
Referenced by onWhichBorder().
const float DTTopology::IBeamWingThickness = 0.13 [static, private] |
Definition at line 106 of file DTTopology.h.
Referenced by onWhichBorder().
const float DTTopology::plateThickness = 0.15 [static, private] |
Definition at line 108 of file DTTopology.h.
Referenced by sensibleHeight().
int DTTopology::theFirstChannel [private] |
Definition at line 99 of file DTTopology.h.
Referenced by channel(), DTTopology(), firstChannel(), isWireValid(), lastChannel(), localPosition(), measurementPosition(), and wirePosition().
const float DTTopology::theHeight = 1.3 [static, private] |
Definition at line 103 of file DTTopology.h.
Referenced by cellHeight(), DTTopology(), and sensibleHeight().
float DTTopology::theLength [private] |
Definition at line 104 of file DTTopology.h.
Referenced by cellLenght(), DTTopology(), localError(), localPosition(), measurementError(), and measurementPosition().
int DTTopology::theNChannels [private] |
Definition at line 100 of file DTTopology.h.
Referenced by channels(), DTTopology(), and lastChannel().
Local2DPoint DTTopology::theOffSet [private] |
Definition at line 111 of file DTTopology.h.
Referenced by channel(), DTTopology(), localPosition(), measurementPosition(), and wirePosition().
const float DTTopology::theWidth = 4.2 [static, private] |
Definition at line 102 of file DTTopology.h.
Referenced by cellWidth(), channel(), DTTopology(), localError(), localPosition(), measurementError(), measurementPosition(), sensibleWidth(), and wirePosition().