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