File indexing completed on 2024-07-16 02:42:43
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef L1TMUPHASE2GMTSTUB_H
0013 #define L1TMUPHASE2GMTSTUB_H
0014
0015
0016
0017
0018 #include <iosfwd>
0019 #include <vector>
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030 #include "DataFormats/L1Trigger/interface/BXVector.h"
0031 #include "DataFormats/Common/interface/Ref.h"
0032 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0033
0034
0035
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
0049 MuonStub();
0050
0051
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
0067 inline int etaRegion() const { return etaRegion_; }
0068
0069 inline int phiRegion() const { return phiRegion_; }
0070
0071 inline int depthRegion() const { return depthRegion_; }
0072
0073 inline uint tfLayer() const { return tfLayer_; }
0074
0075 inline int coord1() const { return coord1_; }
0076
0077 inline int coord2() const { return coord2_; }
0078
0079 inline int quality() const { return quality_; }
0080
0081 inline int id() const { return id_; }
0082 inline int index() const { return id_; }
0083
0084 inline int address() const {
0085 int addr = id_ | (phiRegion_ << 2);
0086 if (etaRegion_ >= 0) {
0087 return addr | (etaRegion_ << 8);
0088 } else {
0089 int twos_comp = ((-etaRegion_) ^ 0xf) + 1;
0090 return addr | (twos_comp << 8);
0091 }
0092 }
0093
0094 inline int kmtf_address() const {
0095 int addr = id_ | (phiRegion_ << 2);
0096 if (etaRegion_ >= 0) {
0097 return addr | (etaRegion_ << 6);
0098 } else {
0099 int twos_comp = ((-etaRegion_) ^ 0x7) + 1;
0100 return addr | (twos_comp << 6);
0101 }
0102 }
0103
0104
0105 inline int bxNum() const { return bxNum_; }
0106
0107
0108 inline int eta1() const { return eta1_; }
0109 inline int eta2() const { return eta2_; }
0110
0111 inline int etaQuality() const { return etaQuality_; }
0112
0113 inline int type() const { return type_; }
0114
0115 inline bool isBarrel() const { return (type_ == 1); }
0116 inline bool isEndcap() const { return (type_ == 0); }
0117
0118 inline double offline_coord1() const { return offline_coord1_; }
0119 inline double offline_coord2() const { return offline_coord2_; }
0120 inline double offline_eta1() const { return offline_eta1_; }
0121 inline double offline_eta2() const { return offline_eta2_; }
0122
0123 void setOfflineQuantities(double coord1, double coord2, double eta1, double eta2) {
0124 offline_coord1_ = coord1;
0125 offline_coord2_ = coord2;
0126 offline_eta1_ = eta1;
0127 offline_eta2_ = eta2;
0128 }
0129 void setEta(int eta1, int eta2, int etaQ) {
0130 eta1_ = eta1;
0131 eta2_ = eta2;
0132 etaQuality_ = etaQ;
0133 }
0134
0135 void setID(int id) { id_ = id; }
0136
0137 bool operator==(const MuonStub&) const;
0138
0139 bool operator!=(const MuonStub&) const;
0140
0141 void print() const;
0142
0143 private:
0144 int etaRegion_;
0145 int phiRegion_;
0146 int depthRegion_;
0147 uint tfLayer_;
0148 int coord1_;
0149 int coord2_;
0150 int id_;
0151 int quality_;
0152 int bxNum_;
0153 int eta1_;
0154 int eta2_;
0155 int etaQuality_;
0156 int type_;
0157
0158 double offline_coord1_;
0159 double offline_coord2_;
0160 double offline_eta1_;
0161 double offline_eta2_;
0162 };
0163
0164 }
0165 #endif