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