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