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 
27 // constructor
28 // empty
30 {
31 
34  m_condChipNr = -1;
35  m_condRelativeBx = 0;
36 
37  // the rest of private members are C++ initialized
38 }
39 
40 // constructor from condition name
42 {
43  m_condName = cName;
44 
47  m_condChipNr = -1;
48  m_condRelativeBx = 0;
49 
50 }
51 
52 // constructor from condition name, category and type
54  const l1t::GtConditionCategory& cCategory,
55  const l1t::GtConditionType& cType)
56 {
57 
58  m_condName = cName;
59  m_condCategory = cCategory;
60  m_condType = cType;
61 
62  m_condChipNr = -1;
63  m_condRelativeBx = 0;
64 
65 }
66 
67 
68 
70 {
71  // empty
72 }
73 
74 // get number of trigger objects
75 const int GlobalCondition::nrObjects() const
76 {
77 
78  switch (m_condType) {
79 
80  case l1t::TypeNull:
81  case l1t::TypeExternal: {
82  return 0;
83  }
84 
85  break;
86  case l1t::Type1s: {
87  return 1;
88  }
89 
90  break;
91  case l1t::Type2s:
92  case l1t::Type2wsc:
93  case l1t::Type2cor: {
94  return 2;
95  }
96 
97  break;
99  return 3;
100  }
101 
102  break;
103  case l1t::Type3s: {
104  return 3;
105  }
106 
107  break;
108  case l1t::Type4s: {
109  return 4;
110  }
111 
112  break;
113  case l1t::TypeETT:
114  case l1t::TypeETM:
115  case l1t::TypeHTT:
116  case l1t::TypeHTM:
117  case l1t::TypeETMHF:
118  case l1t::TypeTowerCount:
122  case l1t::TypeMinBiasHFM1: {
123  return 1;
124  }
125 
126  break;
127  default: {
128  // TODO no such type, throw exception?
129  return 0;
130  }
131  break;
132  }
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 {
140 
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 {
152 
153  if (m_condType == l1t::Type2cor) {
154  return true;
155  }
156 
157  return false;
158 }
159 
160 // print condition
161 void GlobalCondition::print(std::ostream& myCout) const
162 {
163 
164  myCout << "\n Condition name: " << m_condName << std::endl;
165 
166  switch (m_condCategory) {
167  case l1t::CondNull: {
168  myCout << " Condition category: " << "l1t::CondNull"
169  << " - it means not defined!"
170  << std::endl;
171  }
172 
173  break;
174  case l1t::CondMuon: {
175  myCout << " Condition category: " << "l1t::CondMuon" << std::endl;
176  }
177 
178  break;
179  case l1t::CondCalo: {
180  myCout << " Condition category: " << "l1t::CondCalo" << std::endl;
181  }
182 
183  break;
184  case l1t::CondEnergySum: {
185  myCout << " Condition category: " << "CondEnergySum" << std::endl;
186  }
187 
188  break;
189  case l1t::CondCorrelation: {
190  myCout << " Condition category: " << "CondCorrelation" << std::endl;
191  }
192 
193  break;
195  myCout << " Condition category: " << "CondCorrelationWithOverlapRemoval" << std::endl;
196  }
197 
198  break;
199  case l1t::CondExternal: {
200  myCout << " Condition category: " << "CondExternal" << std::endl;
201  }
202 
203  break;
204  default: {
205  myCout << " Condition category: " << m_condCategory
206  << " - no such category defined. Check l1t::GtConditionCategory enum."
207  << std::endl;
208 
209  }
210  break;
211  }
212 
213  switch (m_condType) {
214 
215  case l1t::TypeNull: {
216  myCout << " Condition type: " << "l1t::TypeNull"
217  << " - it means not defined!"
218  << std::endl;
219  }
220 
221  break;
222  case l1t::Type1s: {
223  myCout << " Condition type: " << "l1t::Type1s" << std::endl;
224  }
225 
226  break;
227  case l1t::Type2s: {
228  myCout << " Condition type: " << "l1t::Type2s" << std::endl;
229  }
230 
231  break;
233  myCout << " Condition type: " << "l1t::Type2corWithOverlapRemoval" << std::endl;
234  }
235 
236  break;
237  case l1t::Type2wsc: {
238  myCout << " Condition type: " << "l1t::Type2wsc" << std::endl;
239  }
240 
241  break;
242  case l1t::Type2cor: {
243  myCout << " Condition type: " << "l1t::Type2cor" << std::endl;
244  }
245 
246  break;
247  case l1t::Type3s: {
248  myCout << " Condition type: " << "l1t::Type3s" << std::endl;
249  }
250 
251  break;
252  case l1t::Type4s: {
253  myCout << " Condition type: " << "l1t::Type4s" << std::endl;
254  }
255 
256  break;
257  case l1t::TypeETM: {
258  myCout << " Condition type: " << "TypeETM" << std::endl;
259  }
260 
261  break;
262  case l1t::TypeETT: {
263  myCout << " Condition type: " << "TypeETT" << std::endl;
264  }
265 
266  break;
267  case l1t::TypeHTT: {
268  myCout << " Condition type: " << "TypeHTT" << std::endl;
269  }
270 
271  break;
272  case l1t::TypeHTM: {
273  myCout << " Condition type: " << "TypeHTM" << std::endl;
274  }
275 
276  break;
277  case l1t::TypeETMHF: {
278  myCout << " Condition type: " << "TypeETMHF" << std::endl;
279  }
280 
281  break;
282  case l1t::TypeTowerCount: {
283  myCout << " Condition type: " << "TypeTowerCount" << std::endl;
284  }
285 
286  break;
287  case l1t::TypeMinBiasHFP0: {
288  myCout << " Condition type: " << "TypeMinBiasHFP0" << std::endl;
289  }
290 
291  break;
292  case l1t::TypeMinBiasHFM0: {
293  myCout << " Condition type: " << "TypeMinBiasHFM0" << std::endl;
294  }
295 
296  break;
297  case l1t::TypeMinBiasHFP1: {
298  myCout << " Condition type: " << "TypeMinBiasHFP1" << std::endl;
299  }
300 
301  break;
302  case l1t::TypeMinBiasHFM1: {
303  myCout << " Condition type: " << "TypeMinBiasHFM1" << std::endl;
304  }
305 
306  break;
307  case l1t::TypeETTem: {
308  myCout << " Condition type: " << "TypeETTem" << std::endl;
309  }
310 
311  break;
312  case l1t::TypeExternal: {
313  myCout << " Condition type: " << "TypeExternal" << std::endl;
314  }
315 
316  break;
317  default: {
318  myCout << " Condition type: " << m_condType
319  << " - no such type defined. Check l1t::GtConditionType enum."
320  << std::endl;
321  }
322  break;
323  }
324 
325 
326  myCout << " Object types: ";
327 
328  for (unsigned int i = 0; i < m_objectType.size(); ++i) {
329 
330  switch (m_objectType[i]) {
331  case l1t::gtMu: {
332  myCout << " Mu ";
333  }
334 
335  break;
336  case l1t::gtEG: {
337  myCout << " EG ";
338  }
339 
340  break;
341 
342  case l1t::gtJet: {
343  myCout << " Jet ";
344  }
345 
346  break;
347 
348  case l1t::gtTau: {
349  myCout << " Tau ";
350  }
351 
352  break;
353  case l1t::gtETM: {
354  myCout << " ETM ";
355  }
356 
357  break;
358  case l1t::gtETT: {
359  myCout << " ETT ";
360  }
361 
362  break;
363  case l1t::gtHTT: {
364  myCout << " HTT ";
365  }
366 
367  break;
368  case l1t::gtHTM: {
369  myCout << " HTM ";
370  }
371 
372  break;
373 
374  case l1t::gtETMHF: {
375  myCout << " ETMHF ";
376  }
377 
378  break;
379  case l1t::gtTowerCount: {
380  myCout << " TowerCount ";
381  }
382 
383  break;
384  case l1t::gtMinBiasHFP0: {
385  myCout << " MinBiasHFP0 ";
386  }
387 
388  break;
389  case l1t::gtMinBiasHFM0: {
390  myCout << " MinBiasHFM0 ";
391  }
392 
393  break;
394  case l1t::gtMinBiasHFP1: {
395  myCout << " MinBiasHFP1 ";
396  }
397 
398  break;
399  case l1t::gtMinBiasHFM1: {
400  myCout << " MinBiasHFM1 ";
401  }
402 
403  break;
404  case l1t::gtETTem: {
405  myCout << " ETTem ";
406  }
407 
408  break;
409  case l1t::gtExternal: {
410  myCout << " External ";
411  }
412 
413  break;
414  default: {
415  myCout << " Unknown type " << m_objectType[i];
416  }
417  break;
418  }
419  }
420 
421  myCout << std::endl;
422 
423  myCout << " \" >= \" flag: " << m_condGEq << std::endl;
424 
425  myCout << " Condition chip: " << m_condChipNr;
426 
427  if (m_condChipNr < 0) {
428  myCout << " - not properly initialized! ";
429  }
430 
431  myCout << std::endl;
432 
433  myCout << " Relative BX: " << m_condRelativeBx << std::endl;
434 
435 }
436 
437 // output stream operator
438 std::ostream& operator<<(std::ostream& os, const GlobalCondition& result)
439 {
440  result.print(os);
441  return os;
442 
443 }
444 
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)