Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 10:50:26

0001 //-------------------------------------------------
0002 //
0003 /**  \class MuonStub
0004  *
0005  *  Class that creates a super-primitive for all chambers
0006  *
0007  *
0008  *   M.Bachtis (UCLA)
0009  */
0010 //
0011 //--------------------------------------------------
0012 #ifndef L1TMUPHASE2GMTSTUB_H
0013 #define L1TMUPHASE2GMTSTUB_H
0014 //---------------
0015 // C++ Headers --
0016 //---------------
0017 
0018 #include <iosfwd>
0019 #include <vector>
0020 
0021 //----------------------
0022 // Base Class Headers --
0023 //----------------------
0024 
0025 //------------------------------------
0026 // Collaborating Class Declarations --
0027 //------------------------------------
0028 
0029 //#include "DataFormats/L1TMuon/interface/BMTF/L1MuBMTrackSegLoc.h"
0030 #include "DataFormats/L1Trigger/interface/BXVector.h"
0031 #include "DataFormats/Common/interface/Ref.h"
0032 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0033 
0034 //              ---------------------
0035 //              -- Class Interface --
0036 //              ---------------------
0037 
0038 namespace l1t {
0039 
0040   class MuonStub;
0041 
0042   typedef std::vector<MuonStub> MuonStubCollection;
0043   typedef edm::Ref<MuonStubCollection> MuonStubRef;
0044   typedef std::vector<edm::Ref<MuonStubCollection> > MuonStubRefVector;
0045 
0046   class MuonStub {
0047   public:
0048     /// default constructor
0049     MuonStub();
0050 
0051     /// constructor
0052     MuonStub(int etaRegion,
0053              int phiRegion,
0054              int depthRegion,
0055              uint tfLayer,
0056              int coord1,
0057              int coord2,
0058              int id,
0059              int bx,
0060              int quality,
0061              int eta1 = 0,
0062              int eta2 = 0,
0063              int etaQuality = -1,
0064              int type = 0);
0065     ~MuonStub();
0066     /// return wheel
0067     inline int etaRegion() const { return etaRegion_; }
0068     /// return sector
0069     inline int phiRegion() const { return phiRegion_; }
0070     /// return station
0071     inline int depthRegion() const { return depthRegion_; }
0072     /// return track finder layer
0073     inline uint tfLayer() const { return tfLayer_; }
0074     /// return phi
0075     inline int coord1() const { return coord1_; }
0076     /// return phib
0077     inline int coord2() const { return coord2_; }
0078     /// return quality code
0079     inline int quality() const { return quality_; }
0080     /// return tag (second TS tag)
0081     inline int id() const { return id_; }
0082     /// return bunch crossing
0083     inline int bxNum() const { return bxNum_; }
0084 
0085     /// return eta
0086     inline int eta1() const { return eta1_; }
0087     inline int eta2() const { return eta2_; }
0088     /// return first eta quality
0089     inline int etaQuality() const { return etaQuality_; }
0090     //return type
0091     inline int type() const { return type_; }
0092 
0093     inline bool isBarrel() const { return (type_ == 1); }
0094     inline bool isEndcap() const { return (type_ == 0); }
0095 
0096     inline double offline_coord1() const { return offline_coord1_; }
0097     inline double offline_coord2() const { return offline_coord2_; }
0098     inline double offline_eta1() const { return offline_eta1_; }
0099     inline double offline_eta2() const { return offline_eta2_; }
0100 
0101     void setOfflineQuantities(double coord1, double coord2, double eta1, double eta2) {
0102       offline_coord1_ = coord1;
0103       offline_coord2_ = coord2;
0104       offline_eta1_ = eta1;
0105       offline_eta2_ = eta2;
0106     }
0107     void setEta(int eta1, int eta2, int etaQ) {
0108       eta1_ = eta1;
0109       eta2_ = eta2;
0110       etaQuality_ = etaQ;
0111     }
0112 
0113     void setID(int id) { id_ = id; }
0114     /// equal operator
0115     bool operator==(const MuonStub&) const;
0116     /// unequal operator
0117     bool operator!=(const MuonStub&) const;
0118 
0119     void print() const;
0120 
0121   private:
0122     int etaRegion_;    //In the barrel this is wheel. In the endcap it is 6-ring
0123     int phiRegion_;    //In the barrel it is sector. In the endcap it is chamber
0124     int depthRegion_;  //Station
0125     uint tfLayer_;     //TF Layer
0126     int coord1_;       // global position angle in units of 30 degrees/2048
0127     int coord2_;       // bending angle  only in barrel for now
0128     int id_;           // stub id in case of more stubs per chamber
0129     int quality_;      //
0130     int bxNum_;        // bunch crossing identifier
0131     int eta1_;         // eta coordinate - in units of 3.0/512.
0132     int eta2_;         // eta coordinate - in units of 3.0/512.
0133     int etaQuality_;   // quality of the eta information
0134     int type_;         //Type: 0 TwinMux or DT, 1 RPC Barrel, 2 CSC, 3 RPC endcap
0135     /////////members that are not hardware but used for offline studies///////////////////////////////
0136     double offline_coord1_;  //offline coordinate 1
0137     double offline_coord2_;  //offline coordinate two
0138     double offline_eta1_;    //offline eta1
0139     double offline_eta2_;    //offline eta2
0140   };
0141 
0142 }  // namespace l1t
0143 #endif