CMS 3D CMS Logo

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