CMS 3D CMS Logo

GlobalCondition.cc
Go to the documentation of this file.
1 
17 // this class header
19 
20 // system include files
21 
22 // user include files
23 
24 // forward declarations
25 
26 
27 // constructor
28 // empty
30 {
31 
34  m_condChipNr = -1;
35  m_condRelativeBx = 0;
36 
37  // the rest of private members are C++ initialized
38 }
39 
40 // constructor from condition name
42 {
43  m_condName = cName;
44 
47  m_condChipNr = -1;
48  m_condRelativeBx = 0;
49 
50 }
51 
52 // constructor from condition name, category and type
54  const l1t::GtConditionCategory& cCategory,
55  const l1t::GtConditionType& cType)
56 {
57 
58  m_condName = cName;
59  m_condCategory = cCategory;
60  m_condType = cType;
61 
62  m_condChipNr = -1;
63  m_condRelativeBx = 0;
64 
65 }
66 
67 
68 
70 {
71  // empty
72 }
73 
74 // get number of trigger objects
75 const int GlobalCondition::nrObjects() const
76 {
77 
78  switch (m_condType) {
79 
80  case l1t::TypeNull:
81  case l1t::TypeExternal: {
82  return 0;
83  }
84 
85  break;
86  case l1t::TypeCent0:
87  case l1t::TypeCent1:
88  case l1t::TypeCent2:
89  case l1t::TypeCent3:
90  case l1t::TypeCent4:
91  case l1t::TypeCent5:
92  case l1t::TypeCent6:
93  case l1t::TypeCent7: {
94  return 0;
95  }
96 
97  case l1t::Type1s: {
98  return 1;
99  }
100 
101  break;
102  case l1t::Type2s:
103  case l1t::Type2wsc:
104  case l1t::Type2cor: {
105  return 2;
106  }
107 
108  break;
110  return 3;
111  }
112 
113  break;
114  case l1t::Type3s: {
115  return 3;
116  }
117 
118  break;
119  case l1t::Type4s: {
120  return 4;
121  }
122 
123  break;
124  case l1t::TypeETT:
125  case l1t::TypeETM:
126  case l1t::TypeHTT:
127  case l1t::TypeHTM:
128  case l1t::TypeETMHF:
129  case l1t::TypeTowerCount:
134  case l1t::TypeAsymEt:
135  case l1t::TypeAsymHt:
136  case l1t::TypeAsymEtHF:
137  case l1t::TypeAsymHtHF: {
138  return 1;
139  }
140 
141  break;
142  default: {
143  // TODO no such type, throw exception?
144  return 0;
145  }
146  break;
147  }
148 
149 }
150 
151 // get logic flag for conditions, same type of trigger objects,
152 // and with spatial correlations
153 const bool GlobalCondition::wsc() const
154 {
155 
156  if (m_condType == l1t::Type2wsc) {
157  return true;
158  }
159 
160  return false;
161 }
162 
163 // get logic flag for conditions, different type of trigger objects,
164 // and with spatial correlations
165 const bool GlobalCondition::corr() const
166 {
167 
168  if (m_condType == l1t::Type2cor) {
169  return true;
170  }
171 
172  return false;
173 }
174 
175 // print condition
176 void GlobalCondition::print(std::ostream& myCout) const
177 {
178 
179  myCout << "\n Condition name: " << m_condName << std::endl;
180 
181  switch (m_condCategory) {
182  case l1t::CondNull: {
183  myCout << " Condition category: " << "l1t::CondNull"
184  << " - it means not defined!"
185  << std::endl;
186  }
187 
188  break;
189  case l1t::CondMuon: {
190  myCout << " Condition category: " << "l1t::CondMuon" << std::endl;
191  }
192 
193  break;
194  case l1t::CondCalo: {
195  myCout << " Condition category: " << "l1t::CondCalo" << std::endl;
196  }
197 
198  break;
199  case l1t::CondEnergySum: {
200  myCout << " Condition category: " << "CondEnergySum" << std::endl;
201  }
202 
203  break;
204  case l1t::CondCorrelation: {
205  myCout << " Condition category: " << "CondCorrelation" << std::endl;
206  }
207 
208  break;
210  myCout << " Condition category: " << "CondCorrelationWithOverlapRemoval" << std::endl;
211  }
212 
213  break;
214  case l1t::CondExternal: {
215  myCout << " Condition category: " << "CondExternal" << std::endl;
216  }
217 
218  break;
219  default: {
220  myCout << " Condition category: " << m_condCategory
221  << " - no such category defined. Check l1t::GtConditionCategory enum."
222  << std::endl;
223 
224  }
225  break;
226  }
227 
228  switch (m_condType) {
229 
230  case l1t::TypeNull: {
231  myCout << " Condition type: " << "l1t::TypeNull"
232  << " - it means not defined!"
233  << std::endl;
234  }
235 
236  break;
237  case l1t::Type1s: {
238  myCout << " Condition type: " << "l1t::Type1s" << std::endl;
239  }
240 
241  break;
242  case l1t::Type2s: {
243  myCout << " Condition type: " << "l1t::Type2s" << std::endl;
244  }
245 
246  break;
248  myCout << " Condition type: " << "l1t::Type2corWithOverlapRemoval" << std::endl;
249  }
250 
251  break;
252  case l1t::Type2wsc: {
253  myCout << " Condition type: " << "l1t::Type2wsc" << std::endl;
254  }
255 
256  break;
257  case l1t::Type2cor: {
258  myCout << " Condition type: " << "l1t::Type2cor" << std::endl;
259  }
260 
261  break;
262  case l1t::Type3s: {
263  myCout << " Condition type: " << "l1t::Type3s" << std::endl;
264  }
265 
266  break;
267  case l1t::Type4s: {
268  myCout << " Condition type: " << "l1t::Type4s" << std::endl;
269  }
270 
271  break;
272  case l1t::TypeETM: {
273  myCout << " Condition type: " << "TypeETM" << std::endl;
274  }
275 
276  break;
277  case l1t::TypeETT: {
278  myCout << " Condition type: " << "TypeETT" << std::endl;
279  }
280 
281  break;
282  case l1t::TypeHTT: {
283  myCout << " Condition type: " << "TypeHTT" << std::endl;
284  }
285 
286  break;
287  case l1t::TypeHTM: {
288  myCout << " Condition type: " << "TypeHTM" << std::endl;
289  }
290 
291  break;
292  case l1t::TypeETMHF: {
293  myCout << " Condition type: " << "TypeETMHF" << std::endl;
294  }
295 
296  break;
297  case l1t::TypeTowerCount: {
298  myCout << " Condition type: " << "TypeTowerCount" << std::endl;
299  }
300 
301  break;
302  case l1t::TypeMinBiasHFP0: {
303  myCout << " Condition type: " << "TypeMinBiasHFP0" << std::endl;
304  }
305 
306  break;
307  case l1t::TypeMinBiasHFM0: {
308  myCout << " Condition type: " << "TypeMinBiasHFM0" << std::endl;
309  }
310 
311  break;
312  case l1t::TypeMinBiasHFP1: {
313  myCout << " Condition type: " << "TypeMinBiasHFP1" << std::endl;
314  }
315 
316  break;
317  case l1t::TypeMinBiasHFM1: {
318  myCout << " Condition type: " << "TypeMinBiasHFM1" << std::endl;
319  }
320 
321  break;
322  case l1t::TypeETTem: {
323  myCout << " Condition type: " << "TypeETTem" << std::endl;
324  }
325 
326  break;
327  case l1t::TypeAsymEt: {
328  myCout << " Condition type: " << "TypeAsymEt" << std::endl;
329  }
330 
331  break;
332  case l1t::TypeAsymHt: {
333  myCout << " Condition type: " << "TypeAsymHt" << std::endl;
334  }
335 
336  break;
337  case l1t::TypeAsymEtHF: {
338  myCout << " Condition type: " << "TypeAsymEtHF" << std::endl;
339  }
340 
341  break;
342  case l1t::TypeAsymHtHF: {
343  myCout << " Condition type: " << "TypeAsymHtHF" << std::endl;
344  }
345 
346  break;
347  case l1t::TypeCent0: {
348  myCout << " Condition type: " << "TypeCent0" << std::endl;
349  }
350 
351  break;
352  case l1t::TypeCent1: {
353  myCout << " Condition type: " << "TypeCent1" << std::endl;
354  }
355 
356  break;
357  case l1t::TypeCent2: {
358  myCout << " Condition type: " << "TypeCent2" << std::endl;
359  }
360 
361  break;
362  case l1t::TypeCent3: {
363  myCout << " Condition type: " << "TypeCent3" << std::endl;
364  }
365 
366  break;
367  case l1t::TypeCent4: {
368  myCout << " Condition type: " << "TypeCent4" << std::endl;
369  }
370 
371  break;
372  case l1t::TypeCent5: {
373  myCout << " Condition type: " << "TypeCent5" << std::endl;
374  }
375 
376  break;
377  case l1t::TypeCent6: {
378  myCout << " Condition type: " << "TypeCent6" << std::endl;
379  }
380 
381  break;
382  case l1t::TypeCent7: {
383  myCout << " Condition type: " << "TypeCent7" << std::endl;
384  }
385 
386  break;
387  case l1t::TypeExternal: {
388  myCout << " Condition type: " << "TypeExternal" << std::endl;
389  }
390 
391  break;
392  default: {
393  myCout << " Condition type: " << m_condType
394  << " - no such type defined. Check l1t::GtConditionType enum."
395  << std::endl;
396  }
397  break;
398  }
399 
400 
401  myCout << " Object types: ";
402 
403  for (unsigned int i = 0; i < m_objectType.size(); ++i) {
404 
405  switch (m_objectType[i]) {
406  case l1t::gtMu: {
407  myCout << " Mu ";
408  }
409 
410  break;
411  case l1t::gtEG: {
412  myCout << " EG ";
413  }
414 
415  break;
416 
417  case l1t::gtJet: {
418  myCout << " Jet ";
419  }
420 
421  break;
422 
423  case l1t::gtTau: {
424  myCout << " Tau ";
425  }
426 
427  break;
428  case l1t::gtETM: {
429  myCout << " ETM ";
430  }
431 
432  break;
433  case l1t::gtETT: {
434  myCout << " ETT ";
435  }
436 
437  break;
438  case l1t::gtHTT: {
439  myCout << " HTT ";
440  }
441 
442  break;
443  case l1t::gtHTM: {
444  myCout << " HTM ";
445  }
446 
447  break;
448 
449  case l1t::gtETMHF: {
450  myCout << " ETMHF ";
451  }
452 
453  break;
454  case l1t::gtTowerCount: {
455  myCout << " TowerCount ";
456  }
457 
458  break;
459  case l1t::gtMinBiasHFP0: {
460  myCout << " MinBiasHFP0 ";
461  }
462 
463  break;
464  case l1t::gtMinBiasHFM0: {
465  myCout << " MinBiasHFM0 ";
466  }
467 
468  break;
469  case l1t::gtMinBiasHFP1: {
470  myCout << " MinBiasHFP1 ";
471  }
472 
473  break;
474  case l1t::gtMinBiasHFM1: {
475  myCout << " MinBiasHFM1 ";
476  }
477 
478  break;
479  case l1t::gtETTem: {
480  myCout << " ETTem ";
481  }
482 
483  break;
484  case l1t::gtAsymmetryEt: {
485  myCout << " AsymmetryEt ";
486  }
487 
488  break;
489  case l1t::gtAsymmetryHt: {
490  myCout << " AsymmetryHt ";
491  }
492 
493  break;
494  case l1t::gtAsymmetryEtHF: {
495  myCout << " AsymmetryEtHF ";
496  }
497 
498  break;
499  case l1t::gtAsymmetryHtHF: {
500  myCout << " AsymmetryHtHF ";
501  }
502 
503  break;
504  case l1t::gtCentrality0: {
505  myCout << " Centrality0 ";
506  }
507 
508  break;
509  case l1t::gtCentrality1: {
510  myCout << " Centrality1 ";
511  }
512 
513  break;
514  case l1t::gtCentrality2: {
515  myCout << " Centrality2 ";
516  }
517 
518  break;
519  case l1t::gtCentrality3: {
520  myCout << " Centrality3 ";
521  }
522 
523  break;
524  case l1t::gtCentrality4: {
525  myCout << " Centrality4 ";
526  }
527 
528  break;
529  case l1t::gtCentrality5: {
530  myCout << " Centrality5 ";
531  }
532 
533  break;
534  case l1t::gtCentrality6: {
535  myCout << " Centrality6 ";
536  }
537 
538  break;
539  case l1t::gtCentrality7: {
540  myCout << " Centrality7 ";
541  }
542 
543  break;
544 
545  case l1t::gtExternal: {
546  myCout << " External ";
547  }
548 
549  break;
550  default: {
551  myCout << " Unknown type " << m_objectType[i];
552  }
553  break;
554  }
555  }
556 
557  myCout << std::endl;
558 
559  myCout << " \" >= \" flag: " << m_condGEq << std::endl;
560 
561  myCout << " Condition chip: " << m_condChipNr;
562 
563  if (m_condChipNr < 0) {
564  myCout << " - not properly initialized! ";
565  }
566 
567  myCout << std::endl;
568 
569  myCout << " Relative BX: " << m_condRelativeBx << std::endl;
570 
571 }
572 
573 // output stream operator
574 std::ostream& operator<<(std::ostream& os, const GlobalCondition& result)
575 {
576  result.print(os);
577  return os;
578 
579 }
580 
const int nrObjects() const
get number of trigger objects
friend std::ostream & operator<<(std::ostream &, const GlobalCondition &)
output stream operator
bool m_condGEq
the operator used for the condition (>=, =): true for >=
const bool wsc() const
virtual ~GlobalCondition()
destructor
GtConditionCategory
condition categories
std::string m_condName
the name of the condition
int m_condChipNr
condition is located on condition chip m_condChipNr
l1t::GtConditionCategory m_condCategory
the category of the condition
virtual void print(std::ostream &myCout) const
print condition
const bool corr() const
std::vector< l1t::GlobalObject > m_objectType
the trigger object type(s)
l1t::GtConditionType m_condType
the type of the condition (1s, etc)