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::TypeHTMHF:
117  case l1t::TypeTowerCount:
122  case l1t::TypeZDCP:
123  case l1t::TypeZDCM:
124  case l1t::TypeAXOL1TL:
125  case l1t::TypeAsymEt:
126  case l1t::TypeAsymHt:
127  case l1t::TypeAsymEtHF:
128  case l1t::TypeAsymHtHF: {
129  return 1;
130  }
131 
132  break;
133  default: {
134  // TODO no such type, throw exception?
135  return 0;
136  } break;
137  }
138 }
139 
140 // get logic flag for conditions, same type of trigger objects,
141 // and with spatial correlations
142 const bool GlobalCondition::wsc() const {
143  if (m_condType == l1t::Type2wsc) {
144  return true;
145  }
146 
147  return false;
148 }
149 
150 // get logic flag for conditions, different type of trigger objects,
151 // and with spatial correlations
152 const bool GlobalCondition::corr() const {
153  if (m_condType == l1t::Type2cor) {
154  return true;
155  }
156 
157  return false;
158 }
159 
160 // get logic flag for conditions, trigger objects are muons
161 const bool GlobalCondition::corrThree() const {
162  if (m_condType == l1t::Type3s) {
163  return true;
164  }
165 
166  return false;
167 }
168 
169 // print condition
170 void GlobalCondition::print(std::ostream& myCout) const {
171  myCout << "\n Condition name: " << m_condName << std::endl;
172 
173  switch (m_condCategory) {
174  case l1t::CondNull: {
175  myCout << " Condition category: "
176  << "l1t::CondNull"
177  << " - it means not defined!" << std::endl;
178  }
179 
180  break;
181  case l1t::CondMuon: {
182  myCout << " Condition category: "
183  << "l1t::CondMuon" << std::endl;
184  }
185 
186  break;
187  case l1t::CondMuonShower: {
188  myCout << " Condition category: "
189  << "l1t::CondMuonShower" << std::endl;
190  }
191 
192  break;
193  case l1t::CondCalo: {
194  myCout << " Condition category: "
195  << "l1t::CondCalo" << std::endl;
196  }
197 
198  break;
199  case l1t::CondEnergySum: {
200  myCout << " Condition category: "
201  << "CondEnergySum" << std::endl;
202  }
203 
204  break;
205  case l1t::CondEnergySumZdc: {
206  myCout << " Condition category: "
207  << "CondEnergySumZdc" << std::endl;
208  }
209 
210  break;
211  case l1t::CondAXOL1TL: {
212  myCout << " Condition category: "
213  << "CondAXOL1TL" << std::endl;
214  }
215 
216  break;
217  case l1t::CondCorrelation: {
218  myCout << " Condition category: "
219  << "CondCorrelation" << std::endl;
220  }
221 
222  break;
224  myCout << " Condition category: "
225  << "CondCorrelationThreeBody" << std::endl;
226  }
227 
228  break;
230  myCout << " Condition category: "
231  << "CondCorrelationWithOverlapRemoval" << std::endl;
232  }
233 
234  break;
235  case l1t::CondExternal: {
236  myCout << " Condition category: "
237  << "CondExternal" << std::endl;
238  }
239 
240  break;
241  default: {
242  myCout << " Condition category: " << m_condCategory
243  << " - no such category defined. Check l1t::GtConditionCategory enum." << std::endl;
244 
245  } break;
246  }
247 
248  switch (m_condType) {
249  case l1t::TypeNull: {
250  myCout << " Condition type: "
251  << "l1t::TypeNull"
252  << " - it means not defined!" << std::endl;
253  }
254 
255  break;
256  case l1t::Type1s: {
257  myCout << " Condition type: "
258  << "l1t::Type1s" << std::endl;
259  }
260 
261  break;
262  case l1t::Type2s: {
263  myCout << " Condition type: "
264  << "l1t::Type2s" << std::endl;
265  }
266 
267  break;
269  myCout << " Condition type: "
270  << "l1t::Type2corWithOverlapRemoval" << std::endl;
271  }
272 
273  break;
274  case l1t::Type2wsc: {
275  myCout << " Condition type: "
276  << "l1t::Type2wsc" << std::endl;
277  }
278 
279  break;
280  case l1t::Type2cor: {
281  myCout << " Condition type: "
282  << "l1t::Type2cor" << std::endl;
283  }
284 
285  break;
286  case l1t::Type3s: {
287  myCout << " Condition type: "
288  << "l1t::Type3s" << std::endl;
289  }
290 
291  break;
292  case l1t::Type4s: {
293  myCout << " Condition type: "
294  << "l1t::Type4s" << std::endl;
295  }
296 
297  break;
298  case l1t::TypeETM: {
299  myCout << " Condition type: "
300  << "TypeETM" << std::endl;
301  }
302 
303  break;
304  case l1t::TypeETT: {
305  myCout << " Condition type: "
306  << "TypeETT" << std::endl;
307  }
308 
309  break;
310  case l1t::TypeHTT: {
311  myCout << " Condition type: "
312  << "TypeHTT" << std::endl;
313  }
314 
315  break;
316  case l1t::TypeHTM: {
317  myCout << " Condition type: "
318  << "TypeHTM" << std::endl;
319  }
320 
321  break;
322  case l1t::TypeETMHF: {
323  myCout << " Condition type: "
324  << "TypeETMHF" << std::endl;
325  }
326 
327  break;
328  case l1t::TypeHTMHF: {
329  myCout << " Condition type: "
330  << "TypeHTMHF" << std::endl;
331  }
332 
333  break;
334  case l1t::TypeTowerCount: {
335  myCout << " Condition type: "
336  << "TypeTowerCount" << std::endl;
337  }
338 
339  break;
340  case l1t::TypeMinBiasHFP0: {
341  myCout << " Condition type: "
342  << "TypeMinBiasHFP0" << std::endl;
343  }
344 
345  break;
346  case l1t::TypeMinBiasHFM0: {
347  myCout << " Condition type: "
348  << "TypeMinBiasHFM0" << std::endl;
349  }
350 
351  break;
352  case l1t::TypeMinBiasHFP1: {
353  myCout << " Condition type: "
354  << "TypeMinBiasHFP1" << std::endl;
355  }
356 
357  break;
358  case l1t::TypeMinBiasHFM1: {
359  myCout << " Condition type: "
360  << "TypeMinBiasHFM1" << std::endl;
361  }
362 
363  break;
364  case l1t::TypeETTem: {
365  myCout << " Condition type: "
366  << "TypeETTem" << std::endl;
367  }
368 
369  break;
370  case l1t::TypeAsymEt: {
371  myCout << " Condition type: "
372  << "TypeAsymEt" << std::endl;
373  }
374 
375  break;
376  case l1t::TypeAsymHt: {
377  myCout << " Condition type: "
378  << "TypeAsymHt" << std::endl;
379  }
380 
381  break;
382  case l1t::TypeAsymEtHF: {
383  myCout << " Condition type: "
384  << "TypeAsymEtHF" << std::endl;
385  }
386 
387  break;
388  case l1t::TypeAsymHtHF: {
389  myCout << " Condition type: "
390  << "TypeAsymHtHF" << std::endl;
391  }
392 
393  break;
394  case l1t::TypeCent0: {
395  myCout << " Condition type: "
396  << "TypeCent0" << std::endl;
397  }
398 
399  break;
400  case l1t::TypeCent1: {
401  myCout << " Condition type: "
402  << "TypeCent1" << std::endl;
403  }
404 
405  break;
406  case l1t::TypeCent2: {
407  myCout << " Condition type: "
408  << "TypeCent2" << std::endl;
409  }
410 
411  break;
412  case l1t::TypeCent3: {
413  myCout << " Condition type: "
414  << "TypeCent3" << std::endl;
415  }
416 
417  break;
418  case l1t::TypeCent4: {
419  myCout << " Condition type: "
420  << "TypeCent4" << std::endl;
421  }
422 
423  break;
424  case l1t::TypeCent5: {
425  myCout << " Condition type: "
426  << "TypeCent5" << std::endl;
427  }
428 
429  break;
430  case l1t::TypeCent6: {
431  myCout << " Condition type: "
432  << "TypeCent6" << std::endl;
433  }
434 
435  break;
436  case l1t::TypeCent7: {
437  myCout << " Condition type: "
438  << "TypeCent7" << std::endl;
439  }
440 
441  break;
442  case l1t::TypeExternal: {
443  myCout << " Condition type: "
444  << "TypeExternal" << std::endl;
445  }
446 
447  break;
448  default: {
449  myCout << " Condition type: " << m_condType << " - no such type defined. Check l1t::GtConditionType enum."
450  << std::endl;
451  } break;
452  }
453 
454  myCout << " Object types: ";
455 
456  for (unsigned int i = 0; i < m_objectType.size(); ++i) {
457  switch (m_objectType[i]) {
458  case l1t::gtMu: {
459  myCout << " Mu ";
460  }
461 
462  break;
463  case l1t::gtMuShower: {
464  myCout << " MuShower ";
465  }
466 
467  break;
468  case l1t::gtEG: {
469  myCout << " EG ";
470  }
471 
472  break;
473 
474  case l1t::gtJet: {
475  myCout << " Jet ";
476  }
477 
478  break;
479 
480  case l1t::gtTau: {
481  myCout << " Tau ";
482  }
483 
484  break;
485  case l1t::gtETM: {
486  myCout << " ETM ";
487  }
488 
489  break;
490  case l1t::gtETT: {
491  myCout << " ETT ";
492  }
493 
494  break;
495  case l1t::gtHTT: {
496  myCout << " HTT ";
497  }
498 
499  break;
500  case l1t::gtHTM: {
501  myCout << " HTM ";
502  }
503 
504  break;
505 
506  case l1t::gtETMHF: {
507  myCout << " ETMHF ";
508  }
509 
510  break;
511  case l1t::gtHTMHF: {
512  myCout << " HTMHF ";
513  }
514 
515  break;
516  case l1t::gtTowerCount: {
517  myCout << " TowerCount ";
518  }
519 
520  break;
521  case l1t::gtMinBiasHFP0: {
522  myCout << " MinBiasHFP0 ";
523  }
524 
525  break;
526  case l1t::gtMinBiasHFM0: {
527  myCout << " MinBiasHFM0 ";
528  }
529 
530  break;
531  case l1t::gtMinBiasHFP1: {
532  myCout << " MinBiasHFP1 ";
533  }
534 
535  break;
536  case l1t::gtMinBiasHFM1: {
537  myCout << " MinBiasHFM1 ";
538  }
539 
540  break;
541  case l1t::gtETTem: {
542  myCout << " ETTem ";
543  }
544 
545  break;
546  case l1t::gtAsymmetryEt: {
547  myCout << " AsymmetryEt ";
548  }
549 
550  break;
551  case l1t::gtAsymmetryHt: {
552  myCout << " AsymmetryHt ";
553  }
554 
555  break;
556  case l1t::gtAsymmetryEtHF: {
557  myCout << " AsymmetryEtHF ";
558  }
559 
560  break;
561  case l1t::gtAsymmetryHtHF: {
562  myCout << " AsymmetryHtHF ";
563  }
564 
565  break;
566  case l1t::gtCentrality0: {
567  myCout << " Centrality0 ";
568  }
569 
570  break;
571  case l1t::gtCentrality1: {
572  myCout << " Centrality1 ";
573  }
574 
575  break;
576  case l1t::gtCentrality2: {
577  myCout << " Centrality2 ";
578  }
579 
580  break;
581  case l1t::gtCentrality3: {
582  myCout << " Centrality3 ";
583  }
584 
585  break;
586  case l1t::gtCentrality4: {
587  myCout << " Centrality4 ";
588  }
589 
590  break;
591  case l1t::gtCentrality5: {
592  myCout << " Centrality5 ";
593  }
594 
595  break;
596  case l1t::gtCentrality6: {
597  myCout << " Centrality6 ";
598  }
599 
600  break;
601  case l1t::gtCentrality7: {
602  myCout << " Centrality7 ";
603  }
604 
605  break;
606 
607  case l1t::gtExternal: {
608  myCout << " External ";
609  }
610 
611  break;
612  default: {
613  myCout << " Unknown type " << m_objectType[i];
614  } break;
615  }
616  }
617 
618  myCout << std::endl;
619 
620  myCout << " \" >= \" flag: " << m_condGEq << std::endl;
621 
622  myCout << " Condition chip: " << m_condChipNr;
623 
624  if (m_condChipNr < 0) {
625  myCout << " - not properly initialized! ";
626  }
627 
628  myCout << std::endl;
629 
630  myCout << " Relative BX: " << m_condRelativeBx << std::endl;
631 }
632 
633 // output stream operator
634 std::ostream& operator<<(std::ostream& os, const GlobalCondition& result) {
635  result.print(os);
636  return os;
637 }
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