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 
35  // the rest of private members are C++ initialized
36 }
37 
38 // constructor from condition name
39 L1GtCondition::L1GtCondition(const std::string& cName)
40 {
41  m_condName = cName;
42 
45  m_condChipNr = -1;
46 }
47 
48 // constructor from condition name, category and type
49 L1GtCondition::L1GtCondition(const std::string& cName,
50  const L1GtConditionCategory& cCategory,
51  const L1GtConditionType& cType)
52 {
53 
54  m_condName = cName;
55  m_condCategory = cCategory;
56  m_condType = cType;
57 
58  m_condChipNr = -1;
59 
60 }
61 
62 
63 
65 {
66  // empty
67 }
68 
69 // get number of trigger objects
70 const int L1GtCondition::nrObjects() const
71 {
72 
73  switch (m_condType) {
74 
75  case TypeNull:
76  case TypeExternal:
77  case TypeCastor:
78  case TypeBptx: {
79  return 0;
80  }
81 
82  break;
83  case Type1s: {
84  return 1;
85  }
86 
87  break;
88  case Type2s:
89  case Type2wsc:
90  case Type2cor: {
91  return 2;
92  }
93 
94  break;
95  case Type3s: {
96  return 3;
97  }
98 
99  break;
100  case Type4s: {
101  return 4;
102  }
103 
104  break;
105  case TypeETT:
106  case TypeETM:
107  case TypeHTT:
108  case TypeHTM:
109  case TypeJetCounts:
110  case TypeHfBitCounts:
111  case TypeHfRingEtSums: {
112  return 1;
113  }
114 
115  break;
116  default: {
117  // TODO no such type, throw exception?
118  return 0;
119  }
120  break;
121  }
122 
123 }
124 
125 // get logic flag for conditions, same type of trigger objects,
126 // and with spatial correlations
127 const bool L1GtCondition::wsc() const
128 {
129 
130  if (m_condType == Type2wsc) {
131  return true;
132  }
133 
134  return false;
135 }
136 
137 // get logic flag for conditions, different type of trigger objects,
138 // and with spatial correlations
139 const bool L1GtCondition::corr() const
140 {
141 
142  if (m_condType == Type2cor) {
143  return true;
144  }
145 
146  return false;
147 }
148 
149 // print condition
150 void L1GtCondition::print(std::ostream& myCout) const
151 {
152 
153  myCout << "\n Condition name: " << m_condName << std::endl;
154 
155  switch (m_condCategory) {
156  case CondNull: {
157  myCout << " Condition category: " << "CondNull"
158  << " - it means not defined!"
159  << std::endl;
160  }
161 
162  break;
163  case CondMuon: {
164  myCout << " Condition category: " << "CondMuon" << std::endl;
165  }
166 
167  break;
168  case CondCalo: {
169  myCout << " Condition category: " << "CondCalo" << std::endl;
170  }
171 
172  break;
173  case CondEnergySum: {
174  myCout << " Condition category: " << "CondEnergySum" << std::endl;
175  }
176 
177  break;
178  case CondJetCounts: {
179  myCout << " Condition category: " << "CondJetCounts" << std::endl;
180  }
181 
182  break;
183  case CondCorrelation: {
184  myCout << " Condition category: " << "CondCorrelation" << std::endl;
185  }
186 
187  break;
188  case CondCastor: {
189  myCout << " Condition category: " << "CondCastor" << std::endl;
190  }
191 
192  break;
193  case CondHfBitCounts: {
194  myCout << " Condition category: " << "CondHfBitCounts" << std::endl;
195  }
196 
197  break;
198  case CondHfRingEtSums: {
199  myCout << " Condition category: " << "CondHfRingEtSums" << std::endl;
200  }
201 
202  break;
203  case CondBptx: {
204  myCout << " Condition category: " << "CondBptx" << std::endl;
205  }
206 
207  break;
208  case CondExternal: {
209  myCout << " Condition category: " << "CondExternal" << std::endl;
210  }
211 
212  break;
213  default: {
214  myCout << " Condition category: " << m_condCategory
215  << " - no such category defined. Check L1GtConditionCategory enum."
216  << std::endl;
217 
218  }
219  break;
220  }
221 
222  switch (m_condType) {
223 
224  case TypeNull: {
225  myCout << " Condition type: " << "TypeNull"
226  << " - it means not defined!"
227  << std::endl;
228  }
229 
230  break;
231  case Type1s: {
232  myCout << " Condition type: " << "Type1s" << std::endl;
233  }
234 
235  break;
236  case Type2s: {
237  myCout << " Condition type: " << "Type2s" << std::endl;
238  }
239 
240  break;
241  case Type2wsc: {
242  myCout << " Condition type: " << "Type2wsc" << std::endl;
243  }
244 
245  break;
246  case Type2cor: {
247  myCout << " Condition type: " << "Type2cor" << std::endl;
248  }
249 
250  break;
251  case Type3s: {
252  myCout << " Condition type: " << "Type3s" << std::endl;
253  }
254 
255  break;
256  case Type4s: {
257  myCout << " Condition type: " << "Type4s" << std::endl;
258  }
259 
260  break;
261  case TypeETM: {
262  myCout << " Condition type: " << "TypeETM" << std::endl;
263  }
264 
265  break;
266  case TypeETT: {
267  myCout << " Condition type: " << "TypeETT" << std::endl;
268  }
269 
270  break;
271  case TypeHTT: {
272  myCout << " Condition type: " << "TypeHTT" << std::endl;
273  }
274 
275  break;
276  case TypeHTM: {
277  myCout << " Condition type: " << "TypeHTM" << std::endl;
278  }
279 
280  break;
281  case TypeJetCounts: {
282  myCout << " Condition type: " << "TypeJetCounts" << std::endl;
283  }
284 
285  break;
286  case TypeCastor: {
287  myCout << " Condition type: " << "TypeCastor" << std::endl;
288  }
289 
290  break;
291  case TypeHfBitCounts: {
292  myCout << " Condition type: " << "TypeHfBitCounts" << std::endl;
293  }
294 
295  break;
296  case TypeHfRingEtSums: {
297  myCout << " Condition type: " << "TypeHfRingEtSums" << std::endl;
298  }
299 
300  break;
301  case TypeBptx: {
302  myCout << " Condition type: " << "TypeBptx" << std::endl;
303  }
304 
305  break;
306  case TypeExternal: {
307  myCout << " Condition type: " << "TypeExternal" << std::endl;
308  }
309 
310  break;
311  default: {
312  myCout << " Condition type: " << m_condType
313  << " - no such type defined. Check L1GtConditionType enum."
314  << std::endl;
315  }
316  break;
317  }
318 
319 
320  myCout << " Object types: ";
321 
322  for (unsigned int i = 0; i < m_objectType.size(); ++i) {
323 
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  }
403  break;
404  }
405  }
406 
407  myCout << std::endl;
408 
409  myCout << " \" >= \" flag: " << m_condGEq << std::endl;
410 
411  myCout << " Condition chip: " << m_condChipNr;
412 
413  if (m_condChipNr < 0) {
414  myCout << " - not properly initialized! ";
415  }
416 
417  myCout << std::endl;
418 
419 }
420 
421 // output stream operator
422 std::ostream& operator<<(std::ostream& os, const L1GtCondition& result)
423 {
424  result.print(os);
425  return os;
426 
427 }
428 
int i
Definition: DBlmapReader.cc:9
const int nrObjects() const
get number of trigger objects
Definition: L1GtObject.h:41
Definition: L1GtObject.h:38
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
Definition: L1GtObject.h:40
L1GtConditionType m_condType
the type of the condition (1s, etc)
L1GtConditionCategory m_condCategory
the category of the condition
const bool wsc() const
tuple result
Definition: query.py:137
L1GtConditionCategory
condition categories
std::string m_condName
the name of the condition
const bool corr() const
Definition: L1GtObject.h:32
Definition: L1GtObject.h:39
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