CMS 3D CMS Logo

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