Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:09:42

0001 #ifndef DTTrigGeomUtils_H
0002 #define DTTrigGeomUtils_H
0003 
0004 /*
0005  * \file DTTrigGeomUtils.h
0006  *
0007  * \author C. Battilana - CIEMAT
0008  *
0009 */
0010 
0011 #include "FWCore/Framework/interface/ESHandle.h"
0012 #include "DataFormats/GeometryVector/interface/Pi.h"
0013 
0014 #include <cmath>
0015 
0016 class DTGeometry;
0017 class DTRecSegment4D;
0018 class DTChamberId;
0019 class L1MuDTChambPhDigi;
0020 
0021 class DTTrigGeomUtils {
0022 public:
0023   /// Constructor
0024   DTTrigGeomUtils(edm::ESHandle<DTGeometry> muonGeom, bool dirInDeg = true);
0025 
0026   /// Destructor
0027   virtual ~DTTrigGeomUtils();
0028 
0029   /// Compute phi range in local chamber coordinates
0030   void phiRange(const DTChamberId& id, float& min, float& max, int& nbins, float step = 15);
0031 
0032   /// Compute theta range in local chamber coordinates
0033   void thetaRange(const DTChamberId& id, float& min, float& max, int& nbins, float step = 15);
0034 
0035   /// Compute track coordinates with SC sector numbering
0036   void computeSCCoordinates(const DTRecSegment4D* track, int& scsec, float& x, float& xdir, float& y, float& ydir);
0037 
0038   /// Return local position (trigger RF) for a given trigger primitive
0039   float trigPos(const L1MuDTChambPhDigi* trig);
0040 
0041   /// Return local direction (trigger RF) for a given trigger primitive
0042   float trigDir(const L1MuDTChambPhDigi* trig);
0043 
0044   /// Compute Trigger x coordinate in chamber RF
0045   void trigToSeg(int st, float& x, float dir) { x -= tan(dir / radToDeg_) * zcn_[st - 1]; };
0046 
0047   /// Checks id the chamber has positive RF;
0048   bool hasPosRF(int wh, int sec) { return wh > 0 || (wh == 0 && sec % 4 > 1); };
0049 
0050 private:
0051   edm::ESHandle<DTGeometry> muonGeom_;
0052   float zcn_[4];
0053   float radToDeg_;
0054   float xCenter_[2];  // 0=4/13 - 1=10/14
0055 };
0056 
0057 #endif
0058 
0059 /* Local Variables: */
0060 /* show-trailing-whitespace: t */
0061 /* truncate-lines: t */
0062 /* End: */