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