CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2_patch1/src/L1Trigger/DTUtilities/interface/DTTrigGeom.h

Go to the documentation of this file.
00001 //-------------------------------------------------
00002 //
00013 //
00014 //--------------------------------------------------
00015 #ifndef DT_TRIG_GEOM_H
00016 #define DT_TRIG_GEOM_H
00017 
00018 //------------------------------------
00019 // Collaborating Class Declarations --
00020 //------------------------------------
00021 
00022 //----------------------
00023 // Base Class Headers --
00024 //----------------------
00025 #include "DataFormats/MuonDetId/interface/DTChamberId.h"
00026 #include "DataFormats/MuonDetId/interface/DTSuperLayerId.h"
00027 #include "DataFormats/MuonDetId/interface/DTLayerId.h"
00028 #include "DataFormats/MuonDetId/interface/DTWireId.h"
00029 #include "Geometry/DTGeometry/interface/DTChamber.h"
00030 #include "L1TriggerConfig/DTTPGConfig/interface/DTConfig.h"
00031 #include "DataFormats/MuonDetId/interface/DTBtiId.h"
00032 #include "DataFormats/MuonDetId/interface/DTTracoId.h"
00033 #include "DataFormats/GeometryVector/interface/LocalPoint.h" 
00034 #include "DataFormats/GeometryVector/interface/GlobalPoint.h" 
00035 //---------------
00036 // C++ Headers --
00037 //---------------
00038 
00039 //              ---------------------
00040 //              -- Class Interface --
00041 //              ---------------------
00042 
00043 class DTTrigGeom {
00044 
00045   public:
00046 
00048     DTTrigGeom(DTChamber* stat, bool debug);
00049   
00051     ~DTTrigGeom();
00052  
00054     inline const DTChamber* stat() const { return _stat; }
00055 
00057     inline DTChamberId statId() const { return _stat->id(); }
00058 
00060     void setGeom(const DTChamber* stat);
00061 
00063     inline int wheel() const { return _stat->id().wheel(); }
00064 
00066     inline int station() const { return _stat->id().station(); }
00067 
00069     inline int sector() const { return _stat->id().sector(); }
00070 
00071     // Access geometrical parameters
00072 
00074     inline float phiCh() const { return _PHICH; }
00075 
00077     inline float cellH() const { return _H; }
00078 
00080     inline float cellPitch() const { return _PITCH; }
00081 
00083     inline float distSL() const { return fabs(_ZSL[2]-_ZSL[0]); }
00084 
00086     inline float ZcenterSL() const { return 0.5*(_ZSL[2]+_ZSL[0]); } 
00087 
00089     float ZSL(int) const;
00090 
00092     inline int nCell(int sl) const {
00093       return (sl>0&&sl<=3)*_NCELL[sl-1]; 
00094     }
00095 
00096     // NEWGEOmetry update
00098     // int layerFEStaggering(int nsl, int nlay) const; 
00099 
00102     int mapTubeInFEch(int nsl, int nlay, int ntube) const; 
00103 
00105     float phiSLOffset();
00106 
00108     LocalPoint tubePosInCh(int nsl, int nlay, int ntube) const;
00109 
00111     int posFE(int sl) const;
00112 
00113 
00114     // Local and global position of a trigger object
00115     
00117     GlobalPoint toGlobal(const LocalPoint p) const { return _stat->surface().toGlobal(p); }
00118 
00120     GlobalVector toGlobal(const LocalVector v) const { return _stat->surface().toGlobal(v); }
00121 
00123     LocalPoint toLocal(const GlobalPoint p) const { return _stat->surface().toLocal(p); }
00124 
00126     LocalVector toLocal(const GlobalVector v) const { return _stat->surface().toLocal(v); }
00127 
00147 
00148     LocalPoint localPosition(const DTBtiId) const;
00149 
00180 
00181     LocalPoint localPosition(const DTTracoId) const;
00182 
00184     inline GlobalPoint CMSPosition(const DTBtiId obj) const { 
00185       return  toGlobal(localPosition(obj));
00186     }
00187 
00189     inline GlobalPoint CMSPosition(const DTTracoId obj) const { 
00190       return toGlobal(localPosition(obj)); 
00191     }
00192 
00194     void dumpGeom() const;
00195 
00197     void dumpLUT(short int btic);
00198     void IEEE32toDSP(float f, short int & DSPmantissa, short int & DSPexp);
00199 
00200   private:
00201 
00203     void getGeom();
00204 
00205   private:
00206 
00207     const DTChamber* _stat;     // Pointer to the chamber
00208 
00209     // geometrical parameters
00210     float _PHICH;       // angle of normal to the chamber in CMS frame (rad)
00211     float _H;           // height of a cell (cm)
00212     float _PITCH;       // width of a cell (cm)
00213     float _ZSL[3];      // Z coordinate of SL centers
00214     int _NCELL[3];      // number of cells (BTI) in SL each SL
00215     bool _debug;
00216 
00217 };
00218 
00219 #endif