CMS 3D CMS Logo

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