test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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;
98  case l1t::Type3s: {
99  return 3;
100  }
101 
102  break;
103  case l1t::Type4s: {
104  return 4;
105  }
106 
107  break;
108  case l1t::TypeETT:
109  case l1t::TypeETM:
110  case l1t::TypeHTT:
111  case l1t::TypeHTM:
112  case l1t::TypeETMHF:
113  case l1t::TypeTowerCount:
117  case l1t::TypeMinBiasHFM1: {
118  return 1;
119  }
120 
121  break;
122  default: {
123  // TODO no such type, throw exception?
124  return 0;
125  }
126  break;
127  }
128 
129 }
130 
131 // get logic flag for conditions, same type of trigger objects,
132 // and with spatial correlations
133 const bool GlobalCondition::wsc() const
134 {
135 
136  if (m_condType == l1t::Type2wsc) {
137  return true;
138  }
139 
140  return false;
141 }
142 
143 // get logic flag for conditions, different type of trigger objects,
144 // and with spatial correlations
145 const bool GlobalCondition::corr() const
146 {
147 
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 {
158 
159  myCout << "\n Condition name: " << m_condName << std::endl;
160 
161  switch (m_condCategory) {
162  case l1t::CondNull: {
163  myCout << " Condition category: " << "l1t::CondNull"
164  << " - it means not defined!"
165  << std::endl;
166  }
167 
168  break;
169  case l1t::CondMuon: {
170  myCout << " Condition category: " << "l1t::CondMuon" << std::endl;
171  }
172 
173  break;
174  case l1t::CondCalo: {
175  myCout << " Condition category: " << "l1t::CondCalo" << std::endl;
176  }
177 
178  break;
179  case l1t::CondEnergySum: {
180  myCout << " Condition category: " << "CondEnergySum" << std::endl;
181  }
182 
183  break;
184  case l1t::CondCorrelation: {
185  myCout << " Condition category: " << "CondCorrelation" << std::endl;
186  }
187 
188  break;
189  case l1t::CondExternal: {
190  myCout << " Condition category: " << "CondExternal" << std::endl;
191  }
192 
193  break;
194  default: {
195  myCout << " Condition category: " << m_condCategory
196  << " - no such category defined. Check l1t::GtConditionCategory enum."
197  << std::endl;
198 
199  }
200  break;
201  }
202 
203  switch (m_condType) {
204 
205  case l1t::TypeNull: {
206  myCout << " Condition type: " << "l1t::TypeNull"
207  << " - it means not defined!"
208  << std::endl;
209  }
210 
211  break;
212  case l1t::Type1s: {
213  myCout << " Condition type: " << "l1t::Type1s" << std::endl;
214  }
215 
216  break;
217  case l1t::Type2s: {
218  myCout << " Condition type: " << "l1t::Type2s" << std::endl;
219  }
220 
221  break;
222  case l1t::Type2wsc: {
223  myCout << " Condition type: " << "l1t::Type2wsc" << std::endl;
224  }
225 
226  break;
227  case l1t::Type2cor: {
228  myCout << " Condition type: " << "l1t::Type2cor" << std::endl;
229  }
230 
231  break;
232  case l1t::Type3s: {
233  myCout << " Condition type: " << "l1t::Type3s" << std::endl;
234  }
235 
236  break;
237  case l1t::Type4s: {
238  myCout << " Condition type: " << "l1t::Type4s" << std::endl;
239  }
240 
241  break;
242  case l1t::TypeETM: {
243  myCout << " Condition type: " << "TypeETM" << std::endl;
244  }
245 
246  break;
247  case l1t::TypeETT: {
248  myCout << " Condition type: " << "TypeETT" << std::endl;
249  }
250 
251  break;
252  case l1t::TypeHTT: {
253  myCout << " Condition type: " << "TypeHTT" << std::endl;
254  }
255 
256  break;
257  case l1t::TypeHTM: {
258  myCout << " Condition type: " << "TypeHTM" << std::endl;
259  }
260 
261  break;
262  case l1t::TypeETMHF: {
263  myCout << " Condition type: " << "TypeETMHF" << std::endl;
264  }
265 
266  break;
267  case l1t::TypeTowerCount: {
268  myCout << " Condition type: " << "TypeTowerCount" << std::endl;
269  }
270 
271  break;
272  case l1t::TypeMinBiasHFP0: {
273  myCout << " Condition type: " << "TypeMinBiasHFP0" << std::endl;
274  }
275 
276  break;
277  case l1t::TypeMinBiasHFM0: {
278  myCout << " Condition type: " << "TypeMinBiasHFM0" << std::endl;
279  }
280 
281  break;
282  case l1t::TypeMinBiasHFP1: {
283  myCout << " Condition type: " << "TypeMinBiasHFP1" << std::endl;
284  }
285 
286  break;
287  case l1t::TypeMinBiasHFM1: {
288  myCout << " Condition type: " << "TypeMinBiasHFM1" << std::endl;
289  }
290 
291  break;
292  case l1t::TypeETTem: {
293  myCout << " Condition type: " << "TypeETTem" << std::endl;
294  }
295 
296  break;
297  case l1t::TypeExternal: {
298  myCout << " Condition type: " << "TypeExternal" << std::endl;
299  }
300 
301  break;
302  default: {
303  myCout << " Condition type: " << m_condType
304  << " - no such type defined. Check l1t::GtConditionType enum."
305  << std::endl;
306  }
307  break;
308  }
309 
310 
311  myCout << " Object types: ";
312 
313  for (unsigned int i = 0; i < m_objectType.size(); ++i) {
314 
315  switch (m_objectType[i]) {
316  case l1t::gtMu: {
317  myCout << " Mu ";
318  }
319 
320  break;
321  case l1t::gtEG: {
322  myCout << " EG ";
323  }
324 
325  break;
326 
327  case l1t::gtJet: {
328  myCout << " Jet ";
329  }
330 
331  break;
332 
333  case l1t::gtTau: {
334  myCout << " Tau ";
335  }
336 
337  break;
338  case l1t::gtETM: {
339  myCout << " ETM ";
340  }
341 
342  break;
343  case l1t::gtETT: {
344  myCout << " ETT ";
345  }
346 
347  break;
348  case l1t::gtHTT: {
349  myCout << " HTT ";
350  }
351 
352  break;
353  case l1t::gtHTM: {
354  myCout << " HTM ";
355  }
356 
357  break;
358 
359  case l1t::gtETMHF: {
360  myCout << " ETMHF ";
361  }
362 
363  break;
364  case l1t::gtTowerCount: {
365  myCout << " TowerCount ";
366  }
367 
368  break;
369  case l1t::gtMinBiasHFP0: {
370  myCout << " MinBiasHFP0 ";
371  }
372 
373  break;
374  case l1t::gtMinBiasHFM0: {
375  myCout << " MinBiasHFM0 ";
376  }
377 
378  break;
379  case l1t::gtMinBiasHFP1: {
380  myCout << " MinBiasHFP1 ";
381  }
382 
383  break;
384  case l1t::gtMinBiasHFM1: {
385  myCout << " MinBiasHFM1 ";
386  }
387 
388  break;
389  case l1t::gtETTem: {
390  myCout << " ETTem ";
391  }
392 
393  break;
394  case l1t::gtExternal: {
395  myCout << " External ";
396  }
397 
398  break;
399  default: {
400  myCout << " Unknown type " << m_objectType[i];
401  }
402  break;
403  }
404  }
405 
406  myCout << std::endl;
407 
408  myCout << " \" >= \" flag: " << m_condGEq << std::endl;
409 
410  myCout << " Condition chip: " << m_condChipNr;
411 
412  if (m_condChipNr < 0) {
413  myCout << " - not properly initialized! ";
414  }
415 
416  myCout << std::endl;
417 
418  myCout << " Relative BX: " << m_condRelativeBx << std::endl;
419 
420 }
421 
422 // output stream operator
423 std::ostream& operator<<(std::ostream& os, const GlobalCondition& result)
424 {
425  result.print(os);
426  return os;
427 
428 }
429 
const int nrObjects() const
get number of trigger objects
int i
Definition: DBlmapReader.cc:9
bool m_condGEq
the operator used for the condition (&gt;=, =): true for &gt;=
std::vector< GlobalObject > m_objectType
the trigger object type(s)
const bool wsc() const
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:188
virtual ~GlobalCondition()
destructor
tuple result
Definition: mps_fire.py:84
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
l1t::GtConditionType m_condType
the type of the condition (1s, etc)