Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:07:54

0001 #ifndef Geometry_DTGeometry_DTTopology_H
0002 #define Geometry_DTGeometry_DTTopology_H
0003 
0004 /** \class DTTopology
0005  *
0006  * Conversion between the local frame of the DT DetUnits (i.e. a layer
0007  * of cells in a superlayer) and the "measurement frame".
0008  * This is a rectangular frame where x runs between (FirstCellNumber-0.5)
0009  * and (LastCellNumber+0.5). Note that cell numbers follow the hardware
0010  * convention, so that FirstCellNumber is either 1 or 2 depending of the layer.
0011  *
0012  * Note that DTs measure a time, not a position, so unlike for strip detectors,
0013  * there is no guarantee that a measurement in a cell will not end up in
0014  * 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.
0015  * This will be an issue if wire misalignment is introduced.
0016  *
0017  * The Topology interface is extended with methods relevant for
0018  * the DT detectors, e.g. wirePosition(int), etc.
0019  *  
0020  *
0021  * \author R. Bellan - INFN Torino
0022  *
0023  */
0024 
0025 #include "Geometry/CommonTopologies/interface/Topology.h"
0026 #include "DataFormats/GeometryVector/interface/LocalPoint.h"
0027 
0028 class DTTopology : public Topology {
0029 public:
0030   /// Constructor: number of first wire, total # of wires in the layer and their lenght
0031   DTTopology(int firstWire, int nChannels, float semilenght);
0032 
0033   ~DTTopology() override {}
0034 
0035   /// Conversion between measurement coordinates
0036   /// and local cartesian coordinates.
0037   LocalPoint localPosition(const MeasurementPoint&) const override;
0038 
0039   /// Conversion between measurement coordinates
0040   /// and local cartesian coordinates.
0041   LocalError localError(const MeasurementPoint&, const MeasurementError&) const override;
0042 
0043   /// Conversion to the measurement frame.
0044   /// (Caveat: when converting the position of a rechit, there is no
0045   /// guarantee that the converted value can be interpreted as the cell
0046   /// where the hit belongs, see note on neighbouring cells in the class
0047   /// header.
0048   MeasurementPoint measurementPosition(const LocalPoint&) const override;
0049 
0050   /// Conversion to the measurement frame.
0051   MeasurementError measurementError(const LocalPoint&, const LocalError&) const override;
0052 
0053   /// Return the wire number, starting from a LocalPoint.
0054   /// This method is deprecated: when converting the position of a rechit,
0055   /// there is no guarantee that the converted value can be
0056   /// interpreted as the cell where the hit belongs, see note on
0057   /// neighbouring cells in the class header.
0058   int channel(const LocalPoint& p) const override;
0059 
0060   /// Returns the x position in the layer of a given wire number.
0061   float wirePosition(int wireNumber) const;
0062 
0063   //checks if a wire number is valid
0064   bool isWireValid(const int wireNumber) const {
0065     return (wireNumber - (theFirstChannel - 1) <= 0 || wireNumber - lastChannel() > 0) ? false : true;
0066   }
0067 
0068   /// Returns the cell width.
0069   float cellWidth() const { return theWidth; }
0070   /// Returns the cell height.
0071   float cellHeight() const { return theHeight; }
0072   /// Returns the cell length. This is the length of the sensitive volume,
0073   /// i.e. lenght of the wire minus the lenght of the two tappini (1.55 mm each)
0074   float cellLenght() const { return theLength; }
0075   /// Returns the number of wires in the layer
0076   int channels() const { return theNChannels; }
0077 
0078   /// Returns the wire number of the first wire
0079   int firstChannel() const { return theFirstChannel; }
0080   /// Returns the wire number of the last wire
0081   int lastChannel() const { return theNChannels + theFirstChannel - 1; }
0082 
0083   /// Returns the width of the actual sensible volume of the cell.
0084   float sensibleWidth() const;
0085   /// Returns the height of the actual sensible volume of the cell.
0086   float sensibleHeight() const;
0087 
0088   /// Sides of the cell
0089   enum Side { zMin, zMax, xMin, xMax, yMin, yMax, none };
0090 
0091   /// Returns the side of the cell in which resides the point (x,y,z) (new cell geometry,
0092   /// i.e. with I-beam profiles).
0093   Side onWhichBorder(float x, float y, float z) const;
0094   /// Returns the side of the cell in which resides the point (x,y,z) (old cell geometry).
0095   Side onWhichBorder_old(float x, float y, float z) const;
0096 
0097 private:
0098   int theFirstChannel;
0099   int theNChannels;
0100 
0101   static const float theWidth;
0102   static const float theHeight;
0103   float theLength;
0104 
0105   static const float IBeamWingThickness;
0106   static const float IBeamWingLength;
0107   static const float plateThickness;
0108   static const float IBeamThickness;
0109 
0110   Local2DPoint theOffSet;
0111 };
0112 
0113 #endif