CMS 3D CMS Logo

L1MuGMTReg.h
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
3 //
11 //
12 //
13 // Author :
14 // H. Sakulin HEPHY Vienna
15 //
16 // Migrated to CMSSW:
17 // I. Mikulec
18 //
19 //--------------------------------------------------
20 #ifndef L1TriggerGlobalMuonTrigger_L1MuGMTReg_h
21 #define L1TriggerGlobalMuonTrigger_L1MuGMTReg_h
22 
23 //---------------
24 // C++ Headers --
25 //---------------
26 
27 #include <string>
28 #include <vector>
29 
30 //-------------------------------
31 // Collaborating Class Headers --
32 //-------------------------------
33 
37 
39 
40 // ---------------------
41 // -- Class Interface --
42 // ---------------------
43 
44 class L1MuGMTReg {
45 public:
47  L1MuGMTReg(int ninst = 2) : m_value(ninst, 0){};
48 
50  virtual ~L1MuGMTReg(){};
51 
53  unsigned getValue(int idx) { return m_value[idx]; };
54 
56  unsigned getNumberOfInstances() { return m_value.size(); }
57 
59  virtual std::string getName() = 0;
60 
61 protected:
62  std::vector<unsigned> m_value;
63 };
64 
65 //
67 //
69 //
70 
72 public:
74 
76  L1MuGMTRegMMConfig(const std::string& param, MergeMethods def_brl, MergeMethods def_fwd) : m_param(param) {
77  m_default[0] = def_brl;
78  m_default[1] = def_fwd;
80  };
81 
83  ~L1MuGMTRegMMConfig() override{};
84 
86  std::string getName() override { return "MMConfig_" + m_param; };
87 
89  void setMergeMethod() {
90  static MergeMethods avlMethods[6] = {takeDTCSC, takeRPC, byRank, byMinPt, byCombi, Special};
91  std::string mn[6] = {"takeDT", "takeRPC", "byRank", "byMinPt", "byCombi", "Special"};
92 
93  MergeMethods mm;
94  std::string mm_str;
95 
96  mm = m_default[0];
97  if (m_param == "Phi")
99  else if (m_param == "Eta")
101  else if (m_param == "Pt")
103  else if (m_param == "Charge")
105  for (int ii = 0; ii < 6; ii++)
106  if (mm_str == mn[ii]) {
107  mm = avlMethods[ii];
108  break;
109  }
110  m_value[0] = 1 << (5 - (int)MergeMethods(mm));
111  if (L1MuGMTConfig::Debug(1))
112  edm::LogVerbatim("GMT_Register_Info") << " "
113  << "MergeMethod" << m_param << "Brl"
114  << " is " << mm << "( value " << m_value[0] << " )";
115 
116  mm = m_default[1];
117  mn[0] = "takeCSC";
118  if (m_param == "Phi")
120  else if (m_param == "Eta")
122  else if (m_param == "Pt")
124  else if (m_param == "Charge")
126  for (int ii = 0; ii < 6; ii++)
127  if (mm_str == mn[ii]) {
128  mm = avlMethods[ii];
129  break;
130  }
131  m_value[1] = 1 << (5 - (int)MergeMethods(mm));
132  if (L1MuGMTConfig::Debug(1))
133  edm::LogVerbatim("GMT_Register_Info") << " "
134  << "MergeMethod" << m_param << "Fwd"
135  << " is " << mm << "( value " << m_value[1] << " )";
136  };
137 
138 protected:
141 };
142 
143 //
145 //
147 
149 public:
151 };
152 
153 //
155 //
157 
159 public:
161 };
162 
163 //
165 //
167 
169 public:
171 };
172 
173 //
175 //
177 
179 public:
182 };
183 
184 //
186 //
188 //
189 
191 public:
194  const std::string& param, MergeMethods def_brl, MergeMethods def_fwd, bool def_and_brl, bool def_and_fwd)
195  : L1MuGMTRegMMConfig(param, def_brl, def_fwd) {
196  bool doAND = false;
197 
198  if (m_param == "MIP")
200  else if (m_param == "ISO")
202  if (doAND)
203  m_value[0] |= 64;
204  if (L1MuGMTConfig::Debug(1))
205  edm::LogVerbatim("GMT_Register_Info") << " "
206  << "MergeMethod" << m_param << "SpecialUseANDBrl"
207  << " is " << doAND;
208 
209  if (m_param == "MIP")
211  else if (m_param == "ISO")
213  if (doAND)
214  m_value[1] |= 64;
215  if (L1MuGMTConfig::Debug(1))
216  edm::LogVerbatim("GMT_Register_Info") << " "
217  << "MergeMethod" << m_param << "SpecialUseANDFwd"
218  << " is " << doAND;
219  };
220 
223 };
224 
225 //
227 //
229 
231 public:
234 };
235 
236 //
238 //
240 
242 public:
245 };
246 
247 //
249 //
251 //
252 
254 public:
257  bool haloOverwrites;
258 
260  if (haloOverwrites)
261  m_value[0] |= 64;
262  if (L1MuGMTConfig::Debug(1))
263  edm::LogVerbatim("GMT_Register_info") << " "
264  << "HaloOverwritesMatchedBrl"
265  << " is " << haloOverwrites;
266 
268  if (haloOverwrites)
269  m_value[1] |= 64;
270  if (L1MuGMTConfig::Debug(1))
271  edm::LogVerbatim("GMT_Register_info") << " "
272  << "HaloOverwritesMatchedFwd"
273  << " is " << haloOverwrites;
274  };
275 
278 };
279 
280 //
282 //
284 //
285 
287 public:
291  if (L1MuGMTConfig::Debug(1))
292  edm::LogVerbatim("GMT_Register_info") << " SortRankOffsetBrl is " << m_value[0];
293 
295  if (L1MuGMTConfig::Debug(1))
296  edm::LogVerbatim("GMT_Register_info") << " SortRankOffsetFwd is " << m_value[1];
297  };
298 
300  std::string getName() override { return "SortRankOffset"; };
301 
304 };
305 
306 //
308 //
310 //
311 
313 public:
316 
318  ~L1MuGMTRegCDLConfig() override{};
319 
321  std::string getName() override { return std::string("CDLConfig"); };
322 
324  void setCDLConfig() {
326  if (L1MuGMTConfig::Debug(1))
327  edm::LogVerbatim("GMT_Register_info") << " CDLConfigWordDTCSC is " << m_value[0];
328 
330  if (L1MuGMTConfig::Debug(1))
331  edm::LogVerbatim("GMT_Register_info") << " CDLConfigWordCSCDT is " << m_value[1];
332 
334  if (L1MuGMTConfig::Debug(1))
335  edm::LogVerbatim("GMT_Register_info") << " CDLConfigWordbRPCCSC is " << m_value[2];
336 
338  if (L1MuGMTConfig::Debug(1))
339  edm::LogVerbatim("GMT_Register_info") << " CDLConfigWordfRPCDT is " << m_value[3];
340  };
341 
342 protected:
343 };
344 
345 #endif
Log< level::Info, true > LogVerbatim
~L1MuGMTRegSortRankOffset() override
Definition: L1MuGMTReg.h:303
std::string getName() override
get Name
Definition: L1MuGMTReg.h:86
~L1MuGMTRegMMConfigMIPISO() override
Definition: L1MuGMTReg.h:222
std::string getName() override
get Name
Definition: L1MuGMTReg.h:321
GMT Register that implements additional AND/OR flag.
Definition: L1MuGMTReg.h:190
GMT Merge Method Config Register Phi.
Definition: L1MuGMTReg.h:148
~L1MuGMTRegCDLConfig() override
Definition: L1MuGMTReg.h:318
std::string m_param
Definition: L1MuGMTReg.h:136
unsigned getCDLConfigWordfRPCDT() const
unsigned getCDLConfigWordbRPCCSC() const
unsigned getValue(int idx)
get Value
Definition: L1MuGMTReg.h:53
const std::string & getMergeMethodPtBrl() const
~L1MuGMTRegMMConfigSRK() override
Definition: L1MuGMTReg.h:277
L1MuGMTReg(int ninst=2)
default constructor
Definition: L1MuGMTReg.h:47
const std::string & getMergeMethodEtaBrl() const
GMT Register that implements enum of merge methods.
Definition: L1MuGMTReg.h:71
GMT Merge Method Config Register Charge.
Definition: L1MuGMTReg.h:178
GMT Merge Method Config Register ISO.
Definition: L1MuGMTReg.h:241
std::vector< unsigned > m_value
Definition: L1MuGMTReg.h:62
bool getHaloOverwritesMatchedFwd() const
static bool Debug()
bool getMergeMethodISOSpecialUseANDBrl() const
std::string getName() override
get Name
Definition: L1MuGMTReg.h:300
MergeMethods m_default[2]
Definition: L1MuGMTReg.h:140
const std::string & getMergeMethodPtFwd() const
unsigned getCDLConfigWordCSCDT() const
void setMergeMethod()
Definition: L1MuGMTReg.h:89
unsigned getCDLConfigWordDTCSC() const
GMT Register that implements Rank offset for merged cands.
Definition: L1MuGMTReg.h:286
const std::string & getMergeMethodChargeBrl() const
bool getMergeMethodMIPSpecialUseANDFwd() const
GMT Register that implements Configuration of Cancel Decisison Logic.
Definition: L1MuGMTReg.h:312
GMT Register that implements additional Halo Overwrites Matched bit.
Definition: L1MuGMTReg.h:253
bool getMergeMethodMIPSpecialUseANDBrl() const
ii
Definition: cuy.py:589
const std::string & getMergeMethodPhiBrl() const
GMT Merge Method Config Register Eta.
Definition: L1MuGMTReg.h:158
bool getMergeMethodISOSpecialUseANDFwd() const
static const L1MuGMTParameters * getGMTParams()
unsigned getNumberOfInstances()
get number on instances
Definition: L1MuGMTReg.h:56
GMT Merge Method Config Register Pt.
Definition: L1MuGMTReg.h:168
bool getHaloOverwritesMatchedBrl() const
GMT Merge Method Config Register MIP.
Definition: L1MuGMTReg.h:230
unsigned getSortRankOffsetBrl() const
virtual ~L1MuGMTReg()
destructor
Definition: L1MuGMTReg.h:50
~L1MuGMTRegMMConfig() override
Definition: L1MuGMTReg.h:83
const std::string & getMergeMethodPhiFwd() const
const std::string & getMergeMethodEtaFwd() const
L1MuGMTRegMMConfigMIPISO(const std::string &param, MergeMethods def_brl, MergeMethods def_fwd, bool def_and_brl, bool def_and_fwd)
Definition: L1MuGMTReg.h:193
L1MuGMTRegMMConfig(const std::string &param, MergeMethods def_brl, MergeMethods def_fwd)
Definition: L1MuGMTReg.h:76
unsigned getSortRankOffsetFwd() const
const std::string & getMergeMethodChargeFwd() const
virtual std::string getName()=0
get Name