Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:22:07

0001 //-------------------------------------------------
0002 //
0003 /**  \class DTGeomSupplier
0004  *   Defines the ability to calculate coordinates
0005  *   of L1DT Trigger objects
0006  *
0007  *
0008  *   \author C.Grandi
0009  */
0010 //
0011 //--------------------------------------------------
0012 #ifndef DT_GEOM_SUPPLIER_H
0013 #define DT_GEOM_SUPPLIER_H
0014 
0015 //------------------------------------
0016 // Collaborating Class Declarations --
0017 //------------------------------------
0018 
0019 //----------------------
0020 // Base Class Headers --
0021 //----------------------
0022 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0023 #include "DataFormats/GeometryVector/interface/GlobalVector.h"
0024 #include "DataFormats/GeometryVector/interface/LocalPoint.h"
0025 #include "DataFormats/GeometryVector/interface/LocalVector.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/DTWireId.h"
0030 #include "Geometry/DTGeometry/interface/DTChamber.h"
0031 #include "L1Trigger/DTUtilities/interface/DTTrigData.h"
0032 #include "L1Trigger/DTUtilities/interface/DTTrigGeom.h"
0033 
0034 //---------------
0035 // C++ Headers --
0036 //---------------
0037 
0038 //              ---------------------
0039 //              -- Class Interface --
0040 //              ---------------------
0041 
0042 class DTGeomSupplier {
0043 public:
0044   ///  Constructor
0045   DTGeomSupplier(DTTrigGeom *geom) : _geom(geom) {}
0046 
0047   /// Destructor
0048   virtual ~DTGeomSupplier() {}
0049 
0050   /// Associated geometry
0051   inline DTTrigGeom *geom() const { return _geom; }
0052 
0053   /// Associated chamber
0054   inline const DTChamber *stat() const { return _geom->stat(); }
0055 
0056   /// Identifier of the associated chamber
0057   inline DTChamberId ChamberId() const { return _geom->statId(); }
0058 
0059   /// Return wheel number
0060   inline int wheel() const { return _geom->wheel(); }
0061 
0062   /// Return station number
0063   inline int station() const { return _geom->station(); }
0064 
0065   /// Return sector number
0066   inline int sector() const { return _geom->sector(); }
0067 
0068   /// Local position in chamber of a trigger-data object
0069   virtual LocalPoint localPosition(const DTTrigData *) const = 0;
0070 
0071   /// Local direction in chamber of a trigger-data object
0072   virtual LocalVector localDirection(const DTTrigData *) const = 0;
0073 
0074   /// CMS position in chamber of a trigger-data object
0075   inline GlobalPoint CMSPosition(const DTTrigData *trig) const { return _geom->toGlobal(localPosition(trig)); }
0076 
0077   /// CMS direction in chamber of a trigger -data object
0078   inline GlobalVector CMSDirection(const DTTrigData *trig) const { return _geom->toGlobal(localDirection(trig)); }
0079 
0080   /// Print a trigger-data object with also local and global position/direction
0081   virtual void print(const DTTrigData *trig) const;
0082 
0083 protected:
0084   DTTrigGeom *_geom;
0085 };
0086 
0087 #endif