CMS 3D CMS Logo

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