CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RPCTBMuon.h
Go to the documentation of this file.
1 #ifndef L1Trigger_RPCTBMuon_h
2 #define L1Trigger_RPCTBMuon_h
5 
6 
7 //---------------------------------------------------------------------------
8 //output of the Pac (one LogCone),
9 //used in m_TBGhostBuster
10 //input and output of the m_TBGhostBuster
11 
19 class RPCTBMuon: public RPCMuon {
20 public:
21  enum MuonBitsType {
28  };
29 public:
31  RPCTBMuon();
32 
33  RPCTBMuon(int ptCode, int quality, int sign, int patternNum, unsigned short firedPlanes);
34 
35  RPCTBMuon(int ptCode, int quality, int sign, MuonBitsType muonBitsType);
36 
37  RPCTBMuon(const RPCPacMuon& pacMuon);
38 
39  int getCode() const;
40 
41  void setCode(int code);
42 
43  void setPhiAddr(int phiAddr);
44 
45  void setSectorAddr(int sectorAddr);
46 
47  void setEtaAddr(int etaAddr);
48 
49  void setAddress(int etaAddr, int phiAddr);
50 
51  void setAddress(int tbNumber, int tbTower, int phiAddr);
52 
53  void setGBData(unsigned int gbData);
54 
55  int getEtaAddr() const;
56 
57  int getPhiAddr() const;
58 
59  int getSegmentAddr() const;
60 
61  int getSectorAddr() const;
62 
63  int getContinSegmAddr() const;
64 
65  void setCodeAndPhiAddr(int code, int phiAddr);
66 
67  void setCodeAndEtaAddr(int code, int etaAddr);
68 
69  int getGBData() const;
70 
72 
73  std::string printDebugInfo(int debugFormat) const;
74 
75  std::string printExtDebugInfo(int, int, int) const;
76 
77  void setGBDataKilledFirst();
78 
79  void setGBDataKilledLast();
80 
81  bool gBDataKilledFirst() const;
82 
83  bool gBDataKilledLast() const;
84 
85 //------need to perform ghost - busting ------------
86  void kill();
87 
90  bool wasKilled() const;
91 
94  bool isLive() const;
95 //aaa
97  struct TMuonMore : public std::less<RPCTBMuon> {
98  bool operator()(const RPCTBMuon& muonL,
99  const RPCTBMuon& muonR) const {
100  return muonL.getCode() > muonR.getCode();
101  }
102  };
103 
104  unsigned int toBits(MuonBitsType muonBitsType) const;
105 
106  unsigned int toBits() const {
107  return toBits(m_muonBitsType);
108  }
109 
110  void fromBits(MuonBitsType muonBitsType, unsigned int value);
111 
112  std::string toString(int format) const;
113 
114 private:
116 //------ hardware signals------------------------
117  unsigned int m_EtaAddress;
118 
119  unsigned int m_PhiAddress;
120 
126  unsigned int m_GBData;
127 
128 //------- need to perform ghost - busting ---------
129  bool m_Killed;
130 
131 //------ conversion to hardware signals------------------------
132 public:
133  class PACOut {
134  private:
135  static const int m_qualBitsCnt = 3; static const unsigned int m_qualBitsMask = 0x7;
136  static const int m_ptBitsCnt = 5; static const unsigned int m_ptBitsMask = 0x1f;
137  static const int m_signBitsCnt = 1; static const unsigned int m_signBitsMask = 0x1;
138  public:
139  static unsigned int toBits(const RPCTBMuon& muon);
140  static void fromBits(RPCTBMuon& muon, unsigned int value);
141 
142  static const int getMuonBitsCnt() {
144  }
145  };
146  friend class PACOut;
147 
148 class TBOut {
149  private:
150  static const int m_qualBitsCnt = 3; static const unsigned int m_qualBitsMask = 0x7;
151  static const int m_ptBitsCnt = 5; static const unsigned int m_ptBitsMask = 0x1f;
152  static const int m_signBitsCnt = 1; static const unsigned int m_signBitsMask = 0x1;
153  static const int m_phiBitsCnt = 4; static const unsigned int m_phiBitsMask = 0xf;
154  static const int m_etaBitsCnt = 2; static const unsigned int m_etaBitsMask = 0x3;
155  static const int m_gbDataBitsCnt=2; static const unsigned int m_gbDataBitsMask = 0x3;
156 
157  public:
158  static unsigned int toBits(const RPCTBMuon& muon);
159  static void fromBits(RPCTBMuon& muon, unsigned int value);
160  };
161  friend class TBOut;
162 
163  class TCOut {
164  private:
165  static const int m_gbDataBitsCnt=2; static const unsigned int m_gbDataBitsMask = 0x3;
166  static const int m_etaBitsCnt = 6; static const unsigned int m_etaBitsMask = 0x3f;
167  static const int m_phiBitsCnt = 4; static const unsigned int m_phiBitsMask = 0xf;
168  static const int m_qualBitsCnt = 3; static const unsigned int m_qualBitsMask = 0x7;
169  static const int m_ptBitsCnt = 5; static const unsigned int m_ptBitsMask = 0x1f;
170  static const int m_signBitsCnt = 1; static const unsigned int m_signBitsMask = 0x1;
171  public:
172  static unsigned int toBits(const RPCTBMuon& muon);
173  static void fromBits(RPCTBMuon& muon, unsigned int value);
174  };
175  friend class TCOut;
176 
177 
178  class HSBOut {
179  private:
180  static const int m_signBitsCnt = 1; static const unsigned int m_signBitsMask = 0x1;
181  static const int m_ptBitsCnt = 5; static const unsigned int m_ptBitsMask = 0x1f;
182  static const int m_qualBitsCnt = 3; static const unsigned int m_qualBitsMask = 0x7;
183  static const int m_phiBitsCnt = 7; static const unsigned int m_phiBitsMask = 0x7f;
184  static const int m_etaBitsCnt = 6; static const unsigned int m_etaBitsMask = 0x3f;
185  public:
186  static unsigned int toBits(const RPCTBMuon& muon);
187  static void fromBits(RPCTBMuon& muon, unsigned int value);
188  };
189  friend class HSBOut;
190 
191  class FSBOut {
192  private:
193  static const int m_phiBitsCnt = 8; static const unsigned int m_phiBitsMask = 0xff;
194  static const int m_ptBitsCnt = 5; static const unsigned int m_ptBitsMask = 0x1f;
195  static const int m_qualBitsCnt = 3; static const unsigned int m_qualBitsMask = 0x7;
196  static const int m_etaBitsCnt = 6; static const unsigned int m_etaBitsMask = 0x3f;
197  static const int m_signBitsCnt = 1; static const unsigned int m_signBitsMask = 0x1;
198  public:
199  static unsigned int toBits(const RPCTBMuon& muon);
200  static void fromBits(RPCTBMuon& muon, unsigned int value);
201  };
202  friend class FSBOut;
203 
204 };
205 
206 typedef std::vector<RPCTBMuon> L1RpcTBMuonsVec;
207 typedef std::vector<L1RpcTBMuonsVec> L1RpcTBMuonsVec2;
208 
209 #endif
210 
bool gBDataKilledLast() const
Definition: RPCTBMuon.cc:163
static const unsigned int m_ptBitsMask
Definition: RPCTBMuon.h:181
static const int m_ptBitsCnt
Definition: RPCTBMuon.h:181
static const int m_ptBitsCnt
Definition: RPCTBMuon.h:136
static const int m_qualBitsCnt
Definition: RPCTBMuon.h:135
static const int m_etaBitsCnt
Definition: RPCTBMuon.h:154
static const int m_signBitsCnt
Definition: RPCTBMuon.h:197
unsigned int m_GBData
Definition: RPCTBMuon.h:126
static const int m_phiBitsCnt
Definition: RPCTBMuon.h:167
static void fromBits(RPCTBMuon &muon, unsigned int value)
Definition: RPCTBMuon.cc:351
static const int m_ptBitsCnt
Definition: RPCTBMuon.h:194
std::string getGBDataBitStr() const
Definition: RPCTBMuon.cc:146
std::string toString(int format) const
Definition: RPCTBMuon.cc:366
static const unsigned int m_signBitsMask
Definition: RPCTBMuon.h:197
double sign(double x)
static const unsigned int m_gbDataBitsMask
Definition: RPCTBMuon.h:165
static const int m_qualBitsCnt
Definition: RPCTBMuon.h:150
int getSegmentAddr() const
Definition: RPCTBMuon.cc:128
static const int m_gbDataBitsCnt
Definition: RPCTBMuon.h:155
unsigned int m_PhiAddress
Definition: RPCTBMuon.h:119
unsigned int toBits() const
Definition: RPCTBMuon.h:106
int getCode() const
Combined quality and ptCode, 8 bits [7...6 m_Quality, 5...1 m_PtCode, 0 sign], used in GhoustBusters...
Definition: RPCTBMuon.cc:88
static const int m_signBitsCnt
Definition: RPCTBMuon.h:180
static const unsigned int m_phiBitsMask
Definition: RPCTBMuon.h:153
static const unsigned int m_etaBitsMask
Definition: RPCTBMuon.h:184
static const unsigned int m_qualBitsMask
Definition: RPCTBMuon.h:182
void setCodeAndEtaAddr(int code, int etaAddr)
Definition: RPCTBMuon.cc:139
void kill()
Definition: RPCTBMuon.cc:167
static unsigned int toBits(const RPCTBMuon &muon)
Definition: RPCTBMuon.cc:309
static const unsigned int m_etaBitsMask
Definition: RPCTBMuon.h:196
static const int m_etaBitsCnt
Definition: RPCTBMuon.h:196
static const unsigned int m_ptBitsMask
Definition: RPCTBMuon.h:194
bool isLive() const
Definition: RPCTBMuon.cc:179
static void fromBits(RPCTBMuon &muon, unsigned int value)
Definition: RPCTBMuon.cc:323
void setGBData(unsigned int gbData)
Definition: RPCTBMuon.cc:120
static const unsigned int m_signBitsMask
Definition: RPCTBMuon.h:152
static const int m_qualBitsCnt
Definition: RPCTBMuon.h:168
std::vector< RPCTBMuon > L1RpcTBMuonsVec
Definition: RPCTBMuon.h:206
static void fromBits(RPCTBMuon &muon, unsigned int value)
Definition: RPCTBMuon.cc:263
static unsigned int toBits(const RPCTBMuon &muon)
Definition: RPCTBMuon.cc:252
static const unsigned int m_phiBitsMask
Definition: RPCTBMuon.h:167
static const int m_phiBitsCnt
Definition: RPCTBMuon.h:193
bool operator()(const RPCTBMuon &muonL, const RPCTBMuon &muonR) const
Definition: RPCTBMuon.h:98
int getSectorAddr() const
Definition: RPCTBMuon.cc:130
static const int getMuonBitsCnt()
Definition: RPCTBMuon.h:142
void setGBDataKilledFirst()
Definition: RPCTBMuon.cc:157
static const unsigned int m_qualBitsMask
Definition: RPCTBMuon.h:135
static const int m_signBitsCnt
Definition: RPCTBMuon.h:152
void setAddress(int etaAddr, int phiAddr)
Definition: RPCTBMuon.cc:110
static unsigned int toBits(const RPCTBMuon &muon)
Definition: RPCTBMuon.cc:296
std::vector< L1RpcTBMuonsVec > L1RpcTBMuonsVec2
Definition: RPCTBMuon.h:207
void setEtaAddr(int etaAddr)
Definition: RPCTBMuon.cc:108
static const unsigned int m_signBitsMask
Definition: RPCTBMuon.h:170
static const int m_ptBitsCnt
Definition: RPCTBMuon.h:169
void setCodeAndPhiAddr(int code, int phiAddr)
Definition: RPCTBMuon.cc:134
static const unsigned int m_gbDataBitsMask
Definition: RPCTBMuon.h:155
static const unsigned int m_etaBitsMask
Definition: RPCTBMuon.h:166
static const unsigned int m_phiBitsMask
Definition: RPCTBMuon.h:183
int getContinSegmAddr() const
Definition: RPCTBMuon.cc:132
static void fromBits(RPCTBMuon &muon, unsigned int value)
Definition: RPCTBMuon.cc:286
static const int m_ptBitsCnt
Definition: RPCTBMuon.h:151
static const unsigned int m_etaBitsMask
Definition: RPCTBMuon.h:154
static const unsigned int m_qualBitsMask
Definition: RPCTBMuon.h:195
static const int m_signBitsCnt
Definition: RPCTBMuon.h:170
std::string printDebugInfo(int debugFormat) const
Gives debuging info in human readable format (1) or technicall format (2)
Definition: RPCTBMuon.cc:55
static const int m_phiBitsCnt
Definition: RPCTBMuon.h:153
static const unsigned int m_qualBitsMask
Definition: RPCTBMuon.h:150
bool m_Killed
true means that muon was killed during GB
Definition: RPCTBMuon.h:129
void setCode(int code)
Sets combined code: 8 bits [7...5 m_Quality, 4...0 m_PtCode].
Definition: RPCTBMuon.cc:98
static const int m_etaBitsCnt
Definition: RPCTBMuon.h:184
static const int m_etaBitsCnt
Definition: RPCTBMuon.h:166
static const int m_qualBitsCnt
Definition: RPCTBMuon.h:195
int getEtaAddr() const
Definition: RPCTBMuon.cc:124
void fromBits(MuonBitsType muonBitsType, unsigned int value)
Definition: RPCTBMuon.cc:223
static const int m_qualBitsCnt
Definition: RPCTBMuon.h:182
int getGBData() const
Definition: RPCTBMuon.cc:144
static const int m_gbDataBitsCnt
Definition: RPCTBMuon.h:165
int getPhiAddr() const
Definition: RPCTBMuon.cc:126
static const unsigned int m_ptBitsMask
Definition: RPCTBMuon.h:169
MuonBitsType m_muonBitsType
Definition: RPCTBMuon.h:115
bool wasKilled() const
Definition: RPCTBMuon.cc:171
static const int m_phiBitsCnt
Definition: RPCTBMuon.h:183
RPCTBMuon()
Empty muon.
Definition: RPCTBMuon.cc:14
bool gBDataKilledFirst() const
Definition: RPCTBMuon.cc:161
unsigned int m_EtaAddress
Definition: RPCTBMuon.h:117
static unsigned int toBits(const RPCTBMuon &muon)
Definition: RPCTBMuon.cc:273
static const unsigned int m_ptBitsMask
Definition: RPCTBMuon.h:151
static const unsigned int m_signBitsMask
Definition: RPCTBMuon.h:137
void setSectorAddr(int sectorAddr)
Definition: RPCTBMuon.cc:106
void setPhiAddr(int phiAddr)
Definition: RPCTBMuon.cc:104
Used in sorting.
Definition: RPCTBMuon.h:97
static void fromBits(RPCTBMuon &muon, unsigned int value)
Definition: RPCTBMuon.cc:245
static const unsigned int m_qualBitsMask
Definition: RPCTBMuon.h:168
void setGBDataKilledLast()
Definition: RPCTBMuon.cc:159
static const int m_signBitsCnt
Definition: RPCTBMuon.h:137
std::string printExtDebugInfo(int, int, int) const
static const unsigned int m_signBitsMask
Definition: RPCTBMuon.h:180
static const unsigned int m_phiBitsMask
Definition: RPCTBMuon.h:193
static const unsigned int m_ptBitsMask
Definition: RPCTBMuon.h:136
static unsigned int toBits(const RPCTBMuon &muon)
Definition: RPCTBMuon.cc:332