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 
45 class L1MuGMTReg {
46 
47  public:
49  L1MuGMTReg(int ninst = 2) : m_value(ninst, 0) { };
50 
52  virtual ~L1MuGMTReg() {};
53 
55  unsigned getValue(int idx) { return m_value[idx]; };
56 
58  unsigned getNumberOfInstances() { return m_value.size(); }
59 
61  virtual std::string getName() =0;
62 
63  protected:
64  std::vector<unsigned> m_value;
65 };
66 
67 //
69 //
71 //
72 
74 
75  public:
76  enum MergeMethods { takeDTCSC, takeRPC, byRank, byMinPt, byCombi, Special };
77 
79  L1MuGMTRegMMConfig(const std::string& param, MergeMethods def_brl, MergeMethods def_fwd) :
80  m_param(param) {
81  m_default[0] = def_brl;
82  m_default[1] = def_fwd;
83  setMergeMethod();
84  };
85 
87  ~L1MuGMTRegMMConfig() override {};
88 
90  std::string getName() override { return "MMConfig_" + m_param; };
91 
93  void setMergeMethod() {
94  static MergeMethods avlMethods[6] = { takeDTCSC, takeRPC, byRank, byMinPt, byCombi, Special };
95  std::string mn[6] = { "takeDT", "takeRPC", "byRank", "byMinPt", "byCombi", "Special" };
96 
97  MergeMethods mm;
98  std::string mm_str;
99 
100  mm = m_default[0];
101  if(m_param=="Phi") mm_str = L1MuGMTConfig::getGMTParams()->getMergeMethodPhiBrl();
102  else if(m_param=="Eta") mm_str = L1MuGMTConfig::getGMTParams()->getMergeMethodEtaBrl();
103  else if(m_param=="Pt") mm_str = L1MuGMTConfig::getGMTParams()->getMergeMethodPtBrl();
104  else if(m_param=="Charge") mm_str = L1MuGMTConfig::getGMTParams()->getMergeMethodChargeBrl();
105  for(int ii=0; ii<6; ii++) if(mm_str == mn[ii]) {mm = avlMethods[ii]; break;}
106  m_value[0] = 1 << (5-(int) MergeMethods(mm));
107  if ( L1MuGMTConfig::Debug(1) ) edm::LogVerbatim("GMT_Register_Info") << " "
108  << "MergeMethod" << m_param << "Brl"
109  << " is " << mm
110  << "( value " << m_value[0] << " )";
111 
112  mm = m_default[1];
113  mn[0] = "takeCSC";
114  if(m_param=="Phi") mm_str = L1MuGMTConfig::getGMTParams()->getMergeMethodPhiFwd();
115  else if(m_param=="Eta") mm_str = L1MuGMTConfig::getGMTParams()->getMergeMethodEtaFwd();
116  else if(m_param=="Pt") mm_str = L1MuGMTConfig::getGMTParams()->getMergeMethodPtFwd();
117  else if(m_param=="Charge") mm_str = L1MuGMTConfig::getGMTParams()->getMergeMethodChargeFwd();
118  for(int ii=0; ii<6; ii++) if(mm_str == mn[ii]) {mm = avlMethods[ii]; break;}
119  m_value[1] = 1 << (5-(int) MergeMethods(mm));
120  if ( L1MuGMTConfig::Debug(1) ) edm::LogVerbatim("GMT_Register_Info") << " "
121  << "MergeMethod" << m_param << "Fwd"
122  << " is " << mm
123  << "( value " << m_value[1] << " )";
124 
125 
126  };
127 
128  protected:
130  MergeMethods m_default[2];
131 } ;
132 
133 //
135 //
137 
139 public:
141 };
142 
143 //
145 //
147 
149  public:
151 };
152 
153 //
155 //
157 
159  public:
161 };
162 
163 //
165 //
167 
169  public:
171 };
172 
173 
174 
175 //
177 //
179 //
180 
182 
183  public:
185  L1MuGMTRegMMConfigMIPISO(const std::string& param, MergeMethods def_brl, MergeMethods def_fwd, bool def_and_brl, bool def_and_fwd) :
186  L1MuGMTRegMMConfig(param, def_brl, def_fwd) {
187 
188  bool doAND = false;
189 
190  if(m_param=="MIP") doAND = L1MuGMTConfig::getGMTParams()->getMergeMethodMIPSpecialUseANDBrl();
191  else if(m_param=="ISO") doAND = L1MuGMTConfig::getGMTParams()->getMergeMethodISOSpecialUseANDBrl();
192  if(doAND) m_value[0] |= 64;
193  if ( L1MuGMTConfig::Debug(1) ) edm::LogVerbatim("GMT_Register_Info") << " "
194  << "MergeMethod" << m_param << "SpecialUseANDBrl"
195  << " is " << doAND;
196 
197  if(m_param=="MIP") doAND = L1MuGMTConfig::getGMTParams()->getMergeMethodMIPSpecialUseANDFwd();
198  else if(m_param=="ISO") doAND = L1MuGMTConfig::getGMTParams()->getMergeMethodISOSpecialUseANDFwd();
199  if(doAND) m_value[1] |= 64;
200  if ( L1MuGMTConfig::Debug(1) ) edm::LogVerbatim("GMT_Register_Info") << " "
201  << "MergeMethod" << m_param << "SpecialUseANDFwd"
202  << " is " << doAND;
203 
204  };
205 
208 } ;
209 
210 
211 //
213 //
215 
217  public:
219 };
220 
221 //
223 //
225 
227  public:
229 };
230 
231 //
233 //
235 //
236 
238 
239  public:
242 
243  bool haloOverwrites;
244 
246  if (haloOverwrites) m_value[0] |= 64;
247  if ( L1MuGMTConfig::Debug(1) ) edm::LogVerbatim("GMT_Register_info") << " "
248  << "HaloOverwritesMatchedBrl"
249  << " is " << haloOverwrites;
250 
252  if (haloOverwrites) m_value[1] |= 64;
253  if ( L1MuGMTConfig::Debug(1) ) edm::LogVerbatim("GMT_Register_info") << " "
254  << "HaloOverwritesMatchedFwd"
255  << " is " << haloOverwrites;
256 
257  };
258 
260  ~L1MuGMTRegMMConfigSRK() override {};
261 } ;
262 
263 //
265 //
267 //
268 
270 
271  public:
274 
276  if ( L1MuGMTConfig::Debug(1) )
277  edm::LogVerbatim("GMT_Register_info") << " SortRankOffsetBrl is " << m_value[0];
278 
280  if ( L1MuGMTConfig::Debug(1) )
281  edm::LogVerbatim("GMT_Register_info") << " SortRankOffsetFwd is " << m_value[1];
282 
283  };
284 
286  std::string getName() override { return "SortRankOffset"; };
287 
290 } ;
291 
292 //
294 //
296 //
297 
299 
300  public:
303  setCDLConfig();
304  };
305 
307  ~L1MuGMTRegCDLConfig() override {};
308 
310  std::string getName() override { return std::string("CDLConfig"); };
311 
313  void setCDLConfig() {
314 
316  if ( L1MuGMTConfig::Debug(1) )
317  edm::LogVerbatim("GMT_Register_info") << " CDLConfigWordDTCSC is " << m_value[0];
318 
320  if ( L1MuGMTConfig::Debug(1) )
321  edm::LogVerbatim("GMT_Register_info") << " CDLConfigWordCSCDT is " << m_value[1];
322 
324  if ( L1MuGMTConfig::Debug(1) )
325  edm::LogVerbatim("GMT_Register_info") << " CDLConfigWordbRPCCSC is " << m_value[2];
326 
328  if ( L1MuGMTConfig::Debug(1) )
329  edm::LogVerbatim("GMT_Register_info") << " CDLConfigWordfRPCDT is " << m_value[3];
330 
331  };
332 
333  protected:
334 } ;
335 
336 
337 #endif
338 
339 
340 
341 
342 
343 
344 
345 
346 
347 
348 
349 
bool getHaloOverwritesMatchedBrl() const
const std::string & getMergeMethodPtFwd() const
~L1MuGMTRegSortRankOffset() override
Definition: L1MuGMTReg.h:289
std::string getName() override
get Name
Definition: L1MuGMTReg.h:90
~L1MuGMTRegMMConfigMIPISO() override
Definition: L1MuGMTReg.h:207
const std::string & getMergeMethodPhiBrl() const
std::string getName() override
get Name
Definition: L1MuGMTReg.h:310
GMT Register that implements additional AND/OR flag.
Definition: L1MuGMTReg.h:181
GMT Merge Method Config Register Phi.
Definition: L1MuGMTReg.h:138
~L1MuGMTRegCDLConfig() override
Definition: L1MuGMTReg.h:307
const std::string & getMergeMethodEtaBrl() const
std::string m_param
Definition: L1MuGMTReg.h:126
const std::string & getMergeMethodEtaFwd() const
unsigned getValue(int idx)
get Value
Definition: L1MuGMTReg.h:55
~L1MuGMTRegMMConfigSRK() override
Definition: L1MuGMTReg.h:260
L1MuGMTReg(int ninst=2)
default constructor
Definition: L1MuGMTReg.h:49
bool getHaloOverwritesMatchedFwd() const
GMT Register that implements enum of merge methods.
Definition: L1MuGMTReg.h:73
GMT Merge Method Config Register Charge.
Definition: L1MuGMTReg.h:168
unsigned getCDLConfigWordbRPCCSC() const
GMT Merge Method Config Register ISO.
Definition: L1MuGMTReg.h:226
std::vector< unsigned > m_value
Definition: L1MuGMTReg.h:64
unsigned getSortRankOffsetBrl() const
static bool Debug()
std::string getName() override
get Name
Definition: L1MuGMTReg.h:286
const std::string & getMergeMethodPhiFwd() const
unsigned getSortRankOffsetFwd() const
bool getMergeMethodMIPSpecialUseANDBrl() const
void setMergeMethod()
Definition: L1MuGMTReg.h:93
unsigned getCDLConfigWordDTCSC() const
GMT Register that implements Rank offset for merged cands.
Definition: L1MuGMTReg.h:269
GMT Register that implements Configuration of Cancel Decisison Logic.
Definition: L1MuGMTReg.h:298
GMT Register that implements additional Halo Overwrites Matched bit.
Definition: L1MuGMTReg.h:237
unsigned getCDLConfigWordCSCDT() const
bool getMergeMethodISOSpecialUseANDBrl() const
ii
Definition: cuy.py:588
GMT Merge Method Config Register Eta.
Definition: L1MuGMTReg.h:148
const std::string & getMergeMethodChargeBrl() const
static const L1MuGMTParameters * getGMTParams()
unsigned getCDLConfigWordfRPCDT() const
unsigned getNumberOfInstances()
get number on instances
Definition: L1MuGMTReg.h:58
GMT Merge Method Config Register Pt.
Definition: L1MuGMTReg.h:158
bool getMergeMethodISOSpecialUseANDFwd() const
GMT Merge Method Config Register MIP.
Definition: L1MuGMTReg.h:216
virtual ~L1MuGMTReg()
destructor
Definition: L1MuGMTReg.h:52
~L1MuGMTRegMMConfig() override
Definition: L1MuGMTReg.h:87
L1MuGMTRegMMConfigMIPISO(const std::string &param, MergeMethods def_brl, MergeMethods def_fwd, bool def_and_brl, bool def_and_fwd)
Definition: L1MuGMTReg.h:185
L1MuGMTRegMMConfig(const std::string &param, MergeMethods def_brl, MergeMethods def_fwd)
Definition: L1MuGMTReg.h:79
bool getMergeMethodMIPSpecialUseANDFwd() const
const std::string & getMergeMethodPtBrl() const
const std::string & getMergeMethodChargeFwd() const
virtual std::string getName()=0
get Name