CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
L1GtCondition.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 // constructor
27 // empty
31  m_condChipNr = -1;
32  m_condGEq = false;
33 
34  // the rest of private members are C++ initialized
35 }
36 
37 // constructor from condition name
39  m_condName = cName;
40 
43  m_condChipNr = -1;
44 }
45 
46 // constructor from condition name, category and type
48  const L1GtConditionCategory& cCategory,
49  const L1GtConditionType& cType) {
50  m_condName = cName;
51  m_condCategory = cCategory;
52  m_condType = cType;
53 
54  m_condChipNr = -1;
55 }
56 
58  // empty
59 }
60 
61 // get number of trigger objects
62 const int L1GtCondition::nrObjects() const {
63  switch (m_condType) {
64  case TypeNull:
65  case TypeExternal:
66  case TypeCastor:
67  case TypeBptx: {
68  return 0;
69  }
70 
71  break;
72  case Type1s: {
73  return 1;
74  }
75 
76  break;
77  case Type2s:
78  case Type2wsc:
79  case Type2cor: {
80  return 2;
81  }
82 
83  break;
84  case Type3s: {
85  return 3;
86  }
87 
88  break;
89  case Type4s: {
90  return 4;
91  }
92 
93  break;
94  case TypeETT:
95  case TypeETM:
96  case TypeHTT:
97  case TypeHTM:
98  case TypeJetCounts:
99  case TypeHfBitCounts:
100  case TypeHfRingEtSums: {
101  return 1;
102  }
103 
104  break;
105  default: {
106  // TODO no such type, throw exception?
107  return 0;
108  } break;
109  }
110 }
111 
112 // get logic flag for conditions, same type of trigger objects,
113 // and with spatial correlations
114 const bool L1GtCondition::wsc() const {
115  if (m_condType == Type2wsc) {
116  return true;
117  }
118 
119  return false;
120 }
121 
122 // get logic flag for conditions, different type of trigger objects,
123 // and with spatial correlations
124 const bool L1GtCondition::corr() const {
125  if (m_condType == Type2cor) {
126  return true;
127  }
128 
129  return false;
130 }
131 
132 // print condition
133 void L1GtCondition::print(std::ostream& myCout) const {
134  myCout << "\n Condition name: " << m_condName << std::endl;
135 
136  switch (m_condCategory) {
137  case CondNull: {
138  myCout << " Condition category: "
139  << "CondNull"
140  << " - it means not defined!" << std::endl;
141  }
142 
143  break;
144  case CondMuon: {
145  myCout << " Condition category: "
146  << "CondMuon" << std::endl;
147  }
148 
149  break;
150  case CondCalo: {
151  myCout << " Condition category: "
152  << "CondCalo" << std::endl;
153  }
154 
155  break;
156  case CondEnergySum: {
157  myCout << " Condition category: "
158  << "CondEnergySum" << std::endl;
159  }
160 
161  break;
162  case CondJetCounts: {
163  myCout << " Condition category: "
164  << "CondJetCounts" << std::endl;
165  }
166 
167  break;
168  case CondCorrelation: {
169  myCout << " Condition category: "
170  << "CondCorrelation" << std::endl;
171  }
172 
173  break;
174  case CondCastor: {
175  myCout << " Condition category: "
176  << "CondCastor" << std::endl;
177  }
178 
179  break;
180  case CondHfBitCounts: {
181  myCout << " Condition category: "
182  << "CondHfBitCounts" << std::endl;
183  }
184 
185  break;
186  case CondHfRingEtSums: {
187  myCout << " Condition category: "
188  << "CondHfRingEtSums" << std::endl;
189  }
190 
191  break;
192  case CondBptx: {
193  myCout << " Condition category: "
194  << "CondBptx" << std::endl;
195  }
196 
197  break;
198  case CondExternal: {
199  myCout << " Condition category: "
200  << "CondExternal" << std::endl;
201  }
202 
203  break;
204  default: {
205  myCout << " Condition category: " << m_condCategory
206  << " - no such category defined. Check L1GtConditionCategory enum." << std::endl;
207 
208  } break;
209  }
210 
211  switch (m_condType) {
212  case TypeNull: {
213  myCout << " Condition type: "
214  << "TypeNull"
215  << " - it means not defined!" << std::endl;
216  }
217 
218  break;
219  case Type1s: {
220  myCout << " Condition type: "
221  << "Type1s" << std::endl;
222  }
223 
224  break;
225  case Type2s: {
226  myCout << " Condition type: "
227  << "Type2s" << std::endl;
228  }
229 
230  break;
231  case Type2wsc: {
232  myCout << " Condition type: "
233  << "Type2wsc" << std::endl;
234  }
235 
236  break;
237  case Type2cor: {
238  myCout << " Condition type: "
239  << "Type2cor" << std::endl;
240  }
241 
242  break;
243  case Type3s: {
244  myCout << " Condition type: "
245  << "Type3s" << std::endl;
246  }
247 
248  break;
249  case Type4s: {
250  myCout << " Condition type: "
251  << "Type4s" << std::endl;
252  }
253 
254  break;
255  case TypeETM: {
256  myCout << " Condition type: "
257  << "TypeETM" << std::endl;
258  }
259 
260  break;
261  case TypeETT: {
262  myCout << " Condition type: "
263  << "TypeETT" << std::endl;
264  }
265 
266  break;
267  case TypeHTT: {
268  myCout << " Condition type: "
269  << "TypeHTT" << std::endl;
270  }
271 
272  break;
273  case TypeHTM: {
274  myCout << " Condition type: "
275  << "TypeHTM" << std::endl;
276  }
277 
278  break;
279  case TypeJetCounts: {
280  myCout << " Condition type: "
281  << "TypeJetCounts" << std::endl;
282  }
283 
284  break;
285  case TypeCastor: {
286  myCout << " Condition type: "
287  << "TypeCastor" << std::endl;
288  }
289 
290  break;
291  case TypeHfBitCounts: {
292  myCout << " Condition type: "
293  << "TypeHfBitCounts" << std::endl;
294  }
295 
296  break;
297  case TypeHfRingEtSums: {
298  myCout << " Condition type: "
299  << "TypeHfRingEtSums" << std::endl;
300  }
301 
302  break;
303  case TypeBptx: {
304  myCout << " Condition type: "
305  << "TypeBptx" << std::endl;
306  }
307 
308  break;
309  case TypeExternal: {
310  myCout << " Condition type: "
311  << "TypeExternal" << std::endl;
312  }
313 
314  break;
315  default: {
316  myCout << " Condition type: " << m_condType << " - no such type defined. Check L1GtConditionType enum."
317  << std::endl;
318  } break;
319  }
320 
321  myCout << " Object types: ";
322 
323  for (unsigned int i = 0; i < m_objectType.size(); ++i) {
324  switch (m_objectType[i]) {
325  case Mu: {
326  myCout << " Mu ";
327  }
328 
329  break;
330  case NoIsoEG: {
331  myCout << " NoIsoEG ";
332  }
333 
334  break;
335  case IsoEG: {
336  myCout << " IsoEG ";
337  }
338 
339  break;
340  case CenJet: {
341  myCout << " CenJet ";
342  }
343 
344  break;
345  case ForJet: {
346  myCout << " ForJet ";
347  }
348 
349  break;
350  case TauJet: {
351  myCout << " TauJet ";
352  }
353 
354  break;
355  case ETM: {
356  myCout << " ETM ";
357  }
358 
359  break;
360  case ETT: {
361  myCout << " ETT ";
362  }
363 
364  break;
365  case HTT: {
366  myCout << " HTT ";
367  }
368 
369  break;
370  case HTM: {
371  myCout << " HTM ";
372  }
373 
374  break;
375  case JetCounts: {
376  myCout << " JetCounts ";
377  }
378 
379  break;
380  case HfBitCounts: {
381  myCout << " HfBitCounts ";
382  }
383 
384  break;
385  case HfRingEtSums: {
386  myCout << " HfRingEtSums ";
387  }
388 
389  break;
390  case BPTX: {
391  myCout << " BPTX ";
392  }
393 
394  break;
395  case GtExternal: {
396  myCout << " GtExternal ";
397  }
398 
399  break;
400  default: {
401  myCout << " Unknown type " << m_objectType[i];
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 
419 // output stream operator
420 std::ostream& operator<<(std::ostream& os, const L1GtCondition& result) {
421  result.print(os);
422  return os;
423 }
const int nrObjects() const
get number of trigger objects
Definition: L1GtObject.h:38
Definition: L1GtObject.h:35
L1GtConditionType
std::vector< L1GtObject > m_objectType
the trigger object type(s)
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:167
virtual void print(std::ostream &myCout) const
print condition
tuple result
Definition: mps_fire.py:311
Definition: L1GtObject.h:37
L1GtConditionType m_condType
the type of the condition (1s, etc)
L1GtConditionCategory m_condCategory
the category of the condition
const bool wsc() const
std::string m_condName
the name of the condition
const bool corr() const
Definition: L1GtObject.h:29
Definition: L1GtObject.h:36
bool m_condGEq
the operator used for the condition (&gt;=, =): true for &gt;=
L1GtConditionCategory
condition categories
int m_condChipNr
condition is located on condition chip m_condChipNr
virtual ~L1GtCondition()
destructor