Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:54:23

0001 //-------------------------------------------------
0002 //
0003 /**  \class DTTrigGeom
0004  *     Muon Barrel Trigger Geometry
0005  *
0006  *
0007  *
0008  *   \author C.Grandi
0009  *   \modifications S.Vanini
0010  */
0011 //
0012 //--------------------------------------------------
0013 #ifndef DT_TRIG_GEOM_H
0014 #define DT_TRIG_GEOM_H
0015 
0016 //------------------------------------
0017 // Collaborating Class Declarations --
0018 //------------------------------------
0019 
0020 //----------------------
0021 // Base Class Headers --
0022 //----------------------
0023 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0024 #include "DataFormats/GeometryVector/interface/LocalPoint.h"
0025 #include "DataFormats/MuonDetId/interface/DTBtiId.h"
0026 #include "DataFormats/MuonDetId/interface/DTChamberId.h"
0027 #include "DataFormats/MuonDetId/interface/DTLayerId.h"
0028 #include "DataFormats/MuonDetId/interface/DTSuperLayerId.h"
0029 #include "DataFormats/MuonDetId/interface/DTTracoId.h"
0030 #include "DataFormats/MuonDetId/interface/DTWireId.h"
0031 #include "Geometry/DTGeometry/interface/DTChamber.h"
0032 #include "L1TriggerConfig/DTTPGConfig/interface/DTConfig.h"
0033 //---------------
0034 // C++ Headers --
0035 //---------------
0036 
0037 //              ---------------------
0038 //              -- Class Interface --
0039 //              ---------------------
0040 
0041 class DTTrigGeom {
0042 public:
0043   /// Constructor
0044   DTTrigGeom(const DTChamber *stat, bool debug);
0045 
0046   /// Destructor
0047   ~DTTrigGeom();
0048 
0049   /// Associated chamber
0050   inline const DTChamber *stat() const { return _stat; }
0051 
0052   /// Identifier of the associated chamber
0053   inline DTChamberId statId() const { return _stat->id(); }
0054 
0055   /// Set/Update Geometry
0056   void setGeom(const DTChamber *stat);
0057 
0058   /// Return wheel number
0059   inline int wheel() const { return _stat->id().wheel(); }
0060 
0061   /// Return station number
0062   inline int station() const { return _stat->id().station(); }
0063 
0064   /// Return sector number
0065   inline int sector() const { return _stat->id().sector(); }
0066 
0067   // Access geometrical parameters
0068 
0069   /// Rotation angle of chamber (deg)
0070   inline float phiCh() const { return _PHICH; }
0071 
0072   /// Height of a cell (cm)
0073   inline float cellH() const { return _H; }
0074 
0075   /// Width of a cell (cm) i.e. distance between ywo wires
0076   inline float cellPitch() const { return _PITCH; }
0077 
0078   /// Distance between the phi view superlayers (cms)
0079   inline float distSL() const { return fabs(_ZSL[2] - _ZSL[0]); }
0080 
0081   /// Coordinate of center of the 2 Phi SL
0082   inline float ZcenterSL() const { return 0.5 * (_ZSL[2] + _ZSL[0]); }
0083 
0084   /// Radial coordinate in chamber frame of center of a superlayer
0085   float ZSL(int) const;
0086 
0087   /// Number of BTIs in a required superlayer (i.e. nCells in lay 1)
0088   inline int nCell(int sl) const { return (sl > 0 && sl <= 3) * _NCELL[sl - 1]; }
0089 
0090   // NEWGEOmetry update
0091   /// Staggering of first wire of layer respect to default: obsolete 19/6/06
0092   // int layerFEStaggering(int nsl, int nlay) const;
0093 
0094   /// Map tube number into hw wire number, and reverse hw num->tube
0095   /// (nb NOT in bti hardware number, this depends on connectors)
0096   int mapTubeInFEch(int nsl, int nlay, int ntube) const;
0097 
0098   /// Superlayer offset in chamber front-end frame, in cm.
0099   float phiSLOffset();
0100 
0101   /// Wire position in chamber frame
0102   LocalPoint tubePosInCh(int nsl, int nlay, int ntube) const;
0103 
0104   /// Front End position : 1=toward negative y, 0=toward positive y
0105   int posFE(int sl) const;
0106 
0107   // Local and global position of a trigger object
0108 
0109   /// Go to CMS coordinate system for a point
0110   GlobalPoint toGlobal(const LocalPoint p) const { return _stat->surface().toGlobal(p); }
0111 
0112   /// Go to CMS coordinate system for a vector
0113   GlobalVector toGlobal(const LocalVector v) const { return _stat->surface().toGlobal(v); }
0114 
0115   /// Go to Local coordinate system for a point
0116   LocalPoint toLocal(const GlobalPoint p) const { return _stat->surface().toLocal(p); }
0117 
0118   /// Go to Local coordinate system for a vector
0119   LocalVector toLocal(const GlobalVector v) const { return _stat->surface().toLocal(v); }
0120 
0121   /*!
0122       \verbatim
0123 
0124       NB: attention: in NEWGEO definition has changed:
0125 
0126        +---------+---------+---------+
0127        | 1  o    | 5  o    | 9  o    |
0128        +----+----+----+----+----+----+
0129             | 3  o    |  7 o    |
0130        +----+----+----+----+----+ - - - -> x/-x
0131        | 2  o    | 6  o    |
0132        +----+----+----+----+----+
0133             | 4  o    | 8  o    |
0134             +---------+---------+
0135             ^
0136             |
0137            x=0
0138       \endverbatim
0139     */
0140   /// Local position in chamber of a BTI
0141   LocalPoint localPosition(const DTBtiId) const;
0142 
0143   /*!
0144      \verbatim
0145 
0146      NB: attention: in NEWGEO definition has changed:
0147 
0148      +----+----+----+----+----+----+----+----+----+----+----+----+
0149      |  5 |  6 |  7 |  8 |  9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
0150      +----+----+----+----+----+----+----+----+----+----+----+----+
0151      \                                                           /
0152      | \                                                       /
0153      |   \                                                   /
0154      |     \                                               /
0155      |       \                                           /
0156  ----|------------------------------------------------------------------->
0157      |          \                                     /
0158      |            \                                 /
0159      |              \                             /
0160      |                \                         /
0161      |                  \                     /
0162      |                   +----+----+----+----+
0163      |                   |  1 |  2 |  3 |  4 |
0164      |                   +----+----+----+----+
0165      X=0
0166      ^
0167      |
0168     traco position
0169 
0170 
0171     \endverbatim
0172     */
0173   /// Local position in chamber of a TRACO
0174   LocalPoint localPosition(const DTTracoId) const;
0175 
0176   /// CMS position of a BTI
0177   inline GlobalPoint CMSPosition(const DTBtiId obj) const { return toGlobal(localPosition(obj)); }
0178 
0179   /// CMS position of a TRACO
0180   inline GlobalPoint CMSPosition(const DTTracoId obj) const { return toGlobal(localPosition(obj)); }
0181 
0182   /// Dump the geometry
0183   void dumpGeom() const;
0184 
0185   /// Dump the LUT for this chamber
0186   void dumpLUT(short int btic);
0187   void IEEE32toDSP(float f, short int &DSPmantissa, short int &DSPexp);
0188 
0189 private:
0190   /// Get the geometry from the station
0191   void getGeom();
0192 
0193 private:
0194   const DTChamber *_stat;  // Pointer to the chamber
0195 
0196   // geometrical parameters
0197   float _PHICH;   // angle of normal to the chamber in CMS frame (rad)
0198   float _H;       // height of a cell (cm)
0199   float _PITCH;   // width of a cell (cm)
0200   float _ZSL[3];  // Z coordinate of SL centers
0201   int _NCELL[3];  // number of cells (BTI) in SL each SL
0202   bool _debug;
0203 };
0204 
0205 #endif