CMS 3D CMS Logo

GlobalScales.cc
Go to the documentation of this file.
13 
14 #include <iostream>
15 #include <fstream>
16 #include <iomanip>
17 
18 
19 
22 
23 
24 // constructor
26 {
27 
28 
29 }
30 
31 // destructor
33 
34 }
35 
37 
38 
39 void l1t::GlobalScales::setLUT_CalMuEta(const std::string & lutName, std::vector<long long> lut)
40 {
41  if (m_lut_CalMuEta.count(lutName) != 0) {
42  LogTrace("GlobalScales") << " LUT \"" << lutName
43  << "\"already exists in the LUT map- not inserted!" << std::endl;
44  return;
45  }
46 
47  // Insert this LUT into the Table
48  m_lut_CalMuEta.insert(std::map<std::string, std::vector<long long>>::value_type(lutName,lut));
49 
50  return;
51 
52 }
53 
54 
55 void l1t::GlobalScales::setLUT_CalMuPhi(const std::string & lutName, std::vector<long long> lut)
56 {
57  if (m_lut_CalMuPhi.count(lutName) != 0) {
58  LogTrace("GlobalScales") << " LUT \"" << lutName
59  << "\"already exists in the LUT map- not inserted!" << std::endl;
60  return;
61  }
62 
63  // Insert this LUT into the Table
64  m_lut_CalMuPhi.insert(std::map<std::string, std::vector<long long>>::value_type(lutName,lut));
65 
66  return;
67 
68 }
69 
70 
71 void l1t::GlobalScales::setLUT_DeltaEta(const std::string & lutName, std::vector<long long> lut, unsigned int precision)
72 {
73  if (m_lut_DeltaEta.count(lutName) != 0) {
74  LogTrace("GlobalScales") << " LUT \"" << lutName
75  << "\"already exists in the LUT map- not inserted!" << std::endl;
76  return;
77  }
78 
79  // Insert this LUT into the Table
80  m_lut_DeltaEta.insert(std::map<std::string, std::vector<long long>>::value_type(lutName,lut));
82 
83  return;
84 
85 }
86 
87 void l1t::GlobalScales::setLUT_DeltaPhi(const std::string & lutName, std::vector<long long> lut, unsigned int precision)
88 {
89  if (m_lut_DeltaPhi.count(lutName) != 0) {
90  LogTrace("GlobalScales") << " LUT \"" << lutName
91  << "\"already exists in the LUT map- not inserted!" << std::endl;
92  return;
93  }
94 
95  // Insert this LUT into the Table
96  m_lut_DeltaPhi.insert(std::map<std::string, std::vector<long long>>::value_type(lutName,lut));
98 
99  return;
100 
101 }
102 
103 void l1t::GlobalScales::setLUT_Pt(const std::string & lutName, std::vector<long long> lut, unsigned int precision)
104 {
105  if (m_lut_Pt.count(lutName) != 0) {
106  LogTrace("GlobalScales") << " LUT \"" << lutName
107  << "\"already exists in the LUT map- not inserted!" << std::endl;
108  return;
109  }
110 
111  // Insert this LUT into the Table
112  m_lut_Pt.insert(std::map<std::string, std::vector<long long>>::value_type(lutName,lut));
114 
115  return;
116 
117 }
118 
119 void l1t::GlobalScales::setLUT_Cosh(const std::string & lutName, std::vector<long long> lut, unsigned int precision)
120 {
121  if (m_lut_Cosh.count(lutName) != 0) {
122  LogTrace("GlobalScales") << " LUT \"" << lutName
123  << "\"already exists in the LUT map- not inserted!" << std::endl;
124  return;
125  }
126 
127  // Insert this LUT into the Table
128  m_lut_Cosh.insert(std::map<std::string, std::vector<long long>>::value_type(lutName,lut));
130 
131  return;
132 
133 }
134 
135 void l1t::GlobalScales::setLUT_Cos(const std::string & lutName, std::vector<long long> lut, unsigned int precision)
136 {
137  if (m_lut_Cos.count(lutName) != 0) {
138  LogTrace("GlobalScales") << " LUT \"" << lutName
139  << "\"already exists in the LUT map- not inserted!" << std::endl;
140  return;
141  }
142 
143  // Insert this LUT into the Table
144  m_lut_Cos.insert(std::map<std::string, std::vector<long long>>::value_type(lutName,lut));
146 
147  return;
148 
149 }
150 
151 void l1t::GlobalScales::setLUT_Sin(const std::string & lutName, std::vector<long long> lut, unsigned int precision)
152 {
153  if (m_lut_Sin.count(lutName) != 0) {
154  LogTrace("GlobalScales") << " LUT \"" << lutName
155  << "\"already exists in the LUT map- not inserted!" << std::endl;
156  return;
157  }
158 
159  // Insert this LUT into the Table
160  m_lut_Sin.insert(std::map<std::string, std::vector<long long>>::value_type(lutName,lut));
162 
163  return;
164 
165 }
166 
167 
168 long long l1t::GlobalScales::getLUT_CalMuEta(const std::string & lutName, int element) const
169 {
170  long long value = 0;
171 
172  if(element < 0) {
173  edm::LogError("GlobalScales") << "Error: Negative index, " << element << ", requested for CalMuEta LUT ( " << lutName <<")"<< std::endl;
174  }else if(element >= (int)m_lut_CalMuEta.find(lutName)->second.size()) {
175  edm::LogError("GlobalScales") << "Error: Element Requested " << element << " too large for CalMuEta LUT (" << lutName <<") size = " << m_lut_CalMuEta.find(lutName)->second.size() << std::endl;
176  } else {
177  value = m_lut_CalMuEta.find(lutName)->second.at(element);
178  }
179  return value;
180 }
181 
182 long long l1t::GlobalScales::getLUT_CalMuPhi(const std::string & lutName, int element) const
183 {
184  long long value = 0;
185 
186  if(element < 0) {
187  edm::LogError("GlobalScales") << "Error: Negative index, " << element << ", requested for CalMuPhi LUT ( " << lutName <<")"<< std::endl;
188  } else if(element >= (int)m_lut_CalMuPhi.find(lutName)->second.size()) {
189  edm::LogError("GlobalScales") << "Error: Element Requested " << element << " too large for CalMuPhi LUT (" << lutName <<") size = " << m_lut_CalMuPhi.find(lutName)->second.size() << std::endl;
190  } else {
191  value = m_lut_CalMuPhi.find(lutName)->second.at(element);
192  }
193  return value;
194 }
195 
196 
197 long long l1t::GlobalScales::getLUT_DeltaEta(std::string lutName, int element) const
198 {
199  long long value = 0;
200 
201  //first check whether this LUT exists
202  if(m_lut_DeltaEta.find(lutName) == m_lut_DeltaEta.end()) {
203 
204  //does not exist. Check for oppoisite ordering
205  std::size_t pos = lutName.find("-");
206  std::string name = lutName.substr(pos+1);
207  name += "-";
208  name += lutName.substr(0,pos);
209 
210  //check again
211  if(m_lut_DeltaEta.find(name) == m_lut_DeltaEta.end()) {
212  edm::LogError("GlobalScales") << "Warning: No LUT by name "<< lutName << " or " << name << " exists! " << std::endl;
213  return value;
214  } else {
215  lutName = name;
216  }
217  }
218 
219  if(element < 0) {
220  edm::LogError("GlobalScales") << "Error: Negative index, " << element << ", requested for DeltaEta LUT ( " << lutName <<")"<< std::endl;
221  } else if (element >= (int)m_lut_DeltaEta.find(lutName)->second.size()) {
222  edm::LogError("GlobalScales") << "Error: Element Requested " << element << " too large for DeltaEta LUT (" << lutName <<") size = " << m_lut_DeltaEta.find(lutName)->second.size() << std::endl;
223  } else {
224  value = m_lut_DeltaEta.find(lutName)->second.at(element);
225  }
226  return value;
227 }
228 unsigned int l1t::GlobalScales::getPrec_DeltaEta(const std::string & lutName) const
229 {
230  unsigned int value = 0;
231 
232  if(m_Prec_DeltaEta.find(lutName) != m_Prec_DeltaEta.end()) {
233  value = m_Prec_DeltaEta.find(lutName)->second;
234  } else {
235 
236  //does not exist. Check for oppoisite ordering
237  std::size_t pos = lutName.find("-");
238  std::string name = lutName.substr(pos+1);
239  name += "-";
240  name += lutName.substr(0,pos);
241 
242  //check again
243  if(m_Prec_DeltaEta.find(name) != m_Prec_DeltaEta.end()) {
244  value = m_Prec_DeltaEta.find(name)->second;
245  } else {
246  edm::LogError("GlobalScales") << "Warning: LUT " << lutName << " for DeltaEta not found" << std::endl;
247  }
248  }
249  return value;
250 }
251 
252 
253 long long l1t::GlobalScales::getLUT_DeltaPhi(std::string lutName, int element) const
254 {
255  long long value = 0;
256 
257  //first check whether this LUT exists
258  if(m_lut_DeltaPhi.find(lutName) == m_lut_DeltaPhi.end()) {
259 
260  //does not exist. Check for oppoisite ordering
261  std::size_t pos = lutName.find("-");
262  std::string name = lutName.substr(pos+1);
263  name += "-";
264  name += lutName.substr(0,pos);
265 
266  //check again
267  if(m_lut_DeltaPhi.find(name) == m_lut_DeltaPhi.end()) {
268  edm::LogError("GlobalScales") << "Warning: No LUT by name "<< lutName << " or " << name << " exists! " << std::endl;
269  return value;
270  } else {
271  lutName = name;
272  }
273  }
274 
275  if(element < 0) {
276  edm::LogError("GlobalScales") << "Error: Negative index, " << element << ", requested for DeltaPhi LUT ( " << lutName <<")"<< std::endl;
277  } else if(element >= (int)m_lut_DeltaPhi.find(lutName)->second.size()) {
278  edm::LogError("GlobalScales") << "Error: Element Requested " << element << " too large for DeltaPhi LUT (" << lutName <<") size = " << m_lut_DeltaPhi.find(lutName)->second.size() << std::endl;
279  } else {
280  value = m_lut_DeltaPhi.find(lutName)->second.at(element);
281  }
282  return value;
283 }
284 unsigned int l1t::GlobalScales::getPrec_DeltaPhi(const std::string & lutName) const
285 {
286  unsigned int value = 0;
287 
288  if(m_Prec_DeltaPhi.find(lutName) != m_Prec_DeltaPhi.end()) {
289  value = m_Prec_DeltaPhi.find(lutName)->second;
290  } else {
291 
292  //does not exist. Check for oppoisite ordering
293  std::size_t pos = lutName.find("-");
294  std::string name = lutName.substr(pos+1);
295  name += "-";
296  name += lutName.substr(0,pos);
297 
298  //check again
299  if(m_Prec_DeltaPhi.find(name) != m_Prec_DeltaPhi.end()) {
300  value = m_Prec_DeltaPhi.find(name)->second;
301  } else {
302  edm::LogError("GlobalScales") << "Warning: LUT " << lutName << " for DeltaPhi not found" << std::endl;
303  }
304  }
305  return value;
306 }
307 
308 
309 long long l1t::GlobalScales::getLUT_Pt(const std::string & lutName, int element) const
310 {
311  long long value = 0;
312 
313  if(element < 0) {
314  edm::LogError("GlobalScales") << "Error: Negative index, " << element << ", requested for Pt LUT ( " << lutName <<")"<< std::endl;
315  } else if(element >= (int)m_lut_Pt.find(lutName)->second.size()) {
316  edm::LogError("GlobalScales") << "Error: Element Requested " << element << " too large for Pt LUT (" << lutName <<") size = " << m_lut_Pt.find(lutName)->second.size() << std::endl;
317  } else {
318  value = m_lut_Pt.find(lutName)->second.at(element);
319  }
320  return value;
321 }
322 unsigned int l1t::GlobalScales::getPrec_Pt(const std::string & lutName) const
323 {
324  unsigned int value = 0;
325 
326  if(m_Prec_Pt.find(lutName) != m_Prec_Pt.end()) {
327  value = m_Prec_Pt.find(lutName)->second;
328  } else {
329  edm::LogError("GlobalScales") << "Warning: LUT " << lutName << " for Pt not found" << std::endl;
330  }
331  return value;
332 }
333 
334 long long l1t::GlobalScales::getLUT_DeltaEta_Cosh(std::string lutName, int element) const
335 {
336  long long value = 0;
337 
338 
339  //first check whether this LUT exists
340  if(m_lut_Cosh.find(lutName) == m_lut_Cosh.end()) {
341 
342  //does not exist. Check for oppoisite ordering
343  std::size_t pos = lutName.find("-");
344  std::string name = lutName.substr(pos+1);
345  name += "-";
346  name += lutName.substr(0,pos);
347 
348  //check again
349  if(m_lut_Cosh.find(name) == m_lut_Cosh.end()) {
350  edm::LogError("GlobalScales") << "Warning: No LUT by name "<< lutName << " or " << name << " exists! " << std::endl;
351  return value;
352  } else {
353  lutName = name;
354  }
355  }
356 
357  if(element < 0) {
358  edm::LogError("GlobalScales") << "Error: Negative index, " << element << ", requested for Cosh LUT ( " << lutName <<")"<< std::endl;
359  } else if(element >= (int)m_lut_Cosh.find(lutName)->second.size()) {
360  edm::LogError("GlobalScales") << "Error: Element Requested " << element << " too large for Cosh LUT (" << lutName <<") size = " << m_lut_Cosh.find(lutName)->second.size() << std::endl;
361  } else {
362  value = m_lut_Cosh.find(lutName)->second.at(element);
363  }
364  return value;
365 }
366 unsigned int l1t::GlobalScales::getPrec_DeltaEta_Cosh(const std::string & lutName) const
367 {
368  unsigned int value = 0;
369 
370  if(m_Prec_Cosh.find(lutName) != m_Prec_Cosh.end()) {
371  value = m_Prec_Cosh.find(lutName)->second;
372  } else {
373 
374  //does not exist. Check for oppoisite ordering
375  std::size_t pos = lutName.find("-");
376  std::string name = lutName.substr(pos+1);
377  name += "-";
378  name += lutName.substr(0,pos);
379 
380  //check again
381  if(m_Prec_Cosh.find(name) != m_Prec_Cosh.end()) {
382  value = m_Prec_Cosh.find(name)->second;
383  } else {
384  edm::LogError("GlobalScales") << "Warning: LUT " << lutName << " for Cosh not found" << std::endl;
385  }
386  }
387  return value;
388 }
389 
390 long long l1t::GlobalScales::getLUT_DeltaPhi_Cos(std::string lutName, int element) const
391 {
392  long long value = 0;
393 
394  //first check whether this LUT exists
395  if(m_lut_Cos.find(lutName) == m_lut_Cos.end()) {
396 
397  //does not exist. Check for oppoisite ordering
398  std::size_t pos = lutName.find("-");
399  std::string name = lutName.substr(pos+1);
400  name += "-";
401  name += lutName.substr(0,pos);
402 
403  //check again
404  if(m_lut_Cos.find(name) == m_lut_Cos.end()) {
405  edm::LogError("GlobalScales") << "Warning: No LUT by name "<< lutName << " or " << name << " exists! " << std::endl;
406  return value;
407  } else {
408  lutName = name;
409  }
410  }
411 
412  if(element < 0) {
413  edm::LogError("GlobalScales") << "Error: Negative index, " << element << ", requested for Cos LUT ( " << lutName <<")"<< std::endl;
414  } else if(element >= (int)m_lut_DeltaPhi.find(lutName)->second.size()) {
415  edm::LogError("GlobalScales") << "Error: Element Requested " << element << " too large for Cos LUT (" << lutName <<") size = " << m_lut_Cos.find(lutName)->second.size() << std::endl;
416  } else {
417  value = m_lut_Cos.find(lutName)->second.at(element);
418  }
419  return value;
420 }
421 
422 long long l1t::GlobalScales::getLUT_Cos(const std::string & lutName, int element) const
423 {
424  long long value = 0;
425 
426  //first check whether this LUT exists
427  if(m_lut_Cos.find(lutName) == m_lut_Cos.end()) {
428  edm::LogError("GlobalScales") << "Warning: No LUT by name "<< lutName << " exists! " << std::endl;
429  return value;
430  }
431 
432  if(element < 0) {
433  edm::LogError("GlobalScales") << "Error: Negative index, " << element << ", requested for Cos LUT ( " << lutName <<")"<< std::endl;
434  } else if (element >= (int)m_lut_Cos.find(lutName)->second.size()) {
435  edm::LogError("GlobalScales") << "Error: Element Requested " << element << " too large for Cos LUT (" << lutName <<") size = " << m_lut_Cos.find(lutName)->second.size() << std::endl;
436  } else {
437  value = m_lut_Cos.find(lutName)->second.at(element);
438  }
439  return value;
440 }
441 
442 long long l1t::GlobalScales::getLUT_Sin(const std::string & lutName, int element) const
443 {
444  long long value = 0;
445 
446  //first check whether this LUT exists
447  if(m_lut_Sin.find(lutName) == m_lut_Sin.end()) {
448  edm::LogError("GlobalScales") << "Warning: No LUT by name "<< lutName << " exists! " << std::endl;
449  return value;
450  }
451 
452  if(element < 0) {
453  edm::LogError("GlobalScales") << "Error: Negative index, " << element << ", requested for Sin LUT ( " << lutName <<")"<< std::endl;
454  } else if(element >= (int)m_lut_Sin.find(lutName)->second.size()) {
455  edm::LogError("GlobalScales") << "Error: Element Requested " << element << " too large for Sin LUT (" << lutName <<") size = " << m_lut_Sin.find(lutName)->second.size() << std::endl;
456  } else {
457  value = m_lut_Sin.find(lutName)->second.at(element);
458  }
459  return value;
460 }
461 
462 unsigned int l1t::GlobalScales::getPrec_DeltaPhi_Cos(const std::string & lutName) const
463 {
464  unsigned int value = 0;
465 
466  if(m_Prec_Cos.find(lutName) != m_Prec_Cos.end()) {
467  value = m_Prec_Cos.find(lutName)->second;
468  } else {
469 
470  //does not exist. Check for oppoisite ordering
471  std::size_t pos = lutName.find("-");
472  std::string name = lutName.substr(pos+1);
473  name += "-";
474  name += lutName.substr(0,pos);
475 
476  //check again
477  if(m_Prec_Cos.find(name) != m_Prec_Cos.end()) {
478  value = m_Prec_Cos.find(name)->second;
479  } else {
480  edm::LogError("GlobalScales") << "Warning: LUT " << lutName << " for Cos not found" << std::endl;
481  }
482  }
483  return value;
484 }
485 
486 unsigned int l1t::GlobalScales::getPrec_Cos(const std::string & lutName) const
487 {
488  unsigned int value = 0;
489 
490  if(m_Prec_Sin.find(lutName) != m_Prec_Sin.end()) {
491  value = m_Prec_Sin.find(lutName)->second;
492  } else {
493  edm::LogError("GlobalScales") << "Warning: LUT " << lutName << " for Sin not found" << std::endl;
494  }
495  return value;
496 }
497 
498 unsigned int l1t::GlobalScales::getPrec_Sin(const std::string & lutName) const
499 {
500  unsigned int value = 0;
501 
502  if(m_Prec_Sin.find(lutName) != m_Prec_Sin.end()) {
503  value = m_Prec_Sin.find(lutName)->second;
504  } else {
505  edm::LogError("GlobalScales") << "Warning: LUT " << lutName << " for Sin not found" << std::endl;
506  }
507  return value;
508 }
509 
510 void l1t::GlobalScales::dumpAllLUTs(std::ostream& myCout) const
511 {
512 
513  for (std::map<std::string, std::vector<long long>>::const_iterator itr = m_lut_CalMuEta.begin(); itr != m_lut_CalMuEta.end(); itr++) {
514  dumpLUT(myCout,1,itr->first);
515  }
516 
517  for (std::map<std::string, std::vector<long long>>::const_iterator itr = m_lut_CalMuPhi.begin(); itr != m_lut_CalMuPhi.end(); itr++) {
518  dumpLUT(myCout,2,itr->first);
519  }
520 
521 
522  for (std::map<std::string, std::vector<long long>>::const_iterator itr = m_lut_DeltaEta.begin(); itr != m_lut_DeltaEta.end(); itr++) {
523  dumpLUT(myCout,3,itr->first);
524  }
525 
526 
527  for (std::map<std::string, std::vector<long long>>::const_iterator itr = m_lut_DeltaPhi.begin(); itr != m_lut_DeltaPhi.end(); itr++) {
528  dumpLUT(myCout,4,itr->first);
529  }
530 
531 
532  for (std::map<std::string, std::vector<long long>>::const_iterator itr = m_lut_Cosh.begin(); itr != m_lut_Cosh.end(); itr++) {
533  dumpLUT(myCout,5,itr->first);
534  }
535 
536 
537  for (std::map<std::string, std::vector<long long>>::const_iterator itr = m_lut_Cos.begin(); itr != m_lut_Cos.end(); itr++) {
538  dumpLUT(myCout,6,itr->first);
539  }
540 
541  for (std::map<std::string, std::vector<long long>>::const_iterator itr = m_lut_Sin.begin(); itr != m_lut_Sin.end(); itr++) {
542  dumpLUT(myCout,7,itr->first);
543  }
544 
545 
546  for (std::map<std::string, std::vector<long long>>::const_iterator itr = m_lut_Pt.begin(); itr != m_lut_Pt.end(); itr++) {
547  dumpLUT(myCout,8,itr->first);
548  }
549 }
550 
551 void l1t::GlobalScales::dumpLUT(std::ostream& myCout, int LUTtype, std::string name) const
552 {
553  std::vector<long long> dumpV;
554  unsigned int prec = 0;
555  std::string type = "Null";
556  switch(LUTtype) {
557  case 1: {
558  dumpV = m_lut_CalMuEta.find(name)->second;
559  type = "Cal-Mu Eta";
560  break;
561  }
562  case 2: {
563  dumpV = m_lut_CalMuPhi.find(name)->second;
564  type = "Cal-Mu Phi";
565  break;
566  }
567  case 3: {
568  dumpV = m_lut_DeltaEta.find(name)->second;
569  prec = m_Prec_DeltaEta.find(name)->second;
570  type = "Delta Eta";
571  break;
572  }
573  case 4: {
574  dumpV = m_lut_DeltaPhi.find(name)->second;
575  prec = m_Prec_DeltaPhi.find(name)->second;
576  type = "Delta Phi";
577  break;
578  }
579  case 5: {
580  dumpV = m_lut_Cosh.find(name)->second;
581  prec = m_Prec_Cosh.find(name)->second;
582  type = "Cosh";
583  break;
584  }
585  case 6: {
586  dumpV = m_lut_Cos.find(name)->second;
587  prec = m_Prec_Cos.find(name)->second;
588  type = "Cos";
589  break;
590  }
591  case 7: {
592  dumpV = m_lut_Sin.find(name)->second;
593  prec = m_Prec_Sin.find(name)->second;
594  type = "Sin";
595  break;
596  }
597  case 8: {
598  dumpV = m_lut_Pt.find(name)->second;
599  prec = m_Prec_Pt.find(name)->second;
600  type = "Pt";
601  break;
602  }
603  }
604 
605  myCout << "=========================================" << std::endl;
606  myCout << " LUT: " << type << " Table: " << name << " Size = " << dumpV.size() << " Precision " << prec << std::endl;
607  myCout << "=========================================" << std::endl;
608  for(int i=0; i<(int)dumpV.size(); i++) {
609  myCout << " Element " << i << " " << dumpV.at(i) << std::endl;
610  }
611 }
612 
613 void l1t::GlobalScales::print(std::ostream& myCout) const
614 {
615 
616  myCout << "\n ************* L1T Global Scales ************" << std::endl;
617 
618 
619  myCout << " Muon Scales: " << std::endl;
620  printScale(m_muScales,myCout);
621 
622  myCout << " EG Scales: "<< std::endl;
623  printScale(m_egScales,myCout);
624 
625  myCout << " Tau Scales: "<< std::endl;
626  printScale(m_tauScales,myCout);
627 
628  myCout << " Jet Scales: "<< std::endl;
629  printScale(m_jetScales,myCout);
630 
631 
632  myCout << " HTT Scales: "<< std::endl;
633  printScale(m_httScales,myCout);
634 
635  myCout << " ETT Scales: "<< std::endl;
636  printScale(m_ettScales,myCout);
637 
638  myCout << " HTM Scales: "<< std::endl;
639  printScale(m_htmScales,myCout);
640 
641  myCout << " ETM Scales: "<< std::endl;
642  printScale(m_etmScales,myCout);
643 
644 
645  myCout << std::endl;
646  myCout << " LUTs Stored: " << std::endl;
647  myCout << " CalMuEta:";
648  for (std::map<std::string, std::vector<long long>>::const_iterator itr = m_lut_CalMuEta.begin(); itr != m_lut_CalMuEta.end(); itr++) {
649  myCout << " " << itr->first;
650  }
651  myCout << std::endl;
652 
653  myCout << " CalMuPhi:";
654  for (std::map<std::string, std::vector<long long>>::const_iterator itr = m_lut_CalMuPhi.begin(); itr != m_lut_CalMuPhi.end(); itr++) {
655  myCout << " " << itr->first;
656  }
657  myCout << std::endl;
658 
659  myCout << " DeltaEta:";
660  for (std::map<std::string, std::vector<long long>>::const_iterator itr = m_lut_DeltaEta.begin(); itr != m_lut_DeltaEta.end(); itr++) {
661  myCout << " " << itr->first;
662  }
663  myCout << std::endl;
664 
665  myCout << " DeltaPhi:";
666  for (std::map<std::string, std::vector<long long>>::const_iterator itr = m_lut_DeltaPhi.begin(); itr != m_lut_DeltaPhi.end(); itr++) {
667  myCout << " " << itr->first;
668  }
669  myCout << std::endl;
670 
671  myCout << " Cos: ";
672  for (std::map<std::string, std::vector<long long>>::const_iterator itr = m_lut_Cos.begin(); itr != m_lut_Cos.end(); itr++) {
673  myCout << " " << itr->first;
674  }
675  myCout << std::endl;
676 
677  myCout << " Sin: ";
678  for (std::map<std::string, std::vector<long long>>::const_iterator itr = m_lut_Sin.begin(); itr != m_lut_Sin.end(); itr++) {
679  myCout << " " << itr->first;
680  }
681  myCout << std::endl;
682 
683  myCout << " Cosh: ";
684  for (std::map<std::string, std::vector<long long>>::const_iterator itr = m_lut_Cosh.begin(); itr != m_lut_Cosh.end(); itr++) {
685  myCout << " " << itr->first;
686  }
687  myCout << std::endl;
688 
689  myCout << " Pt: ";
690  for (std::map<std::string, std::vector<long long>>::const_iterator itr = m_lut_Pt.begin(); itr != m_lut_Pt.end(); itr++) {
691  myCout << " " << itr->first;
692  }
693  myCout << std::endl;
694 
695 }
696 void l1t::GlobalScales::printScale(ScaleParameters scale, std::ostream& myCout) const
697 {
698 
699  myCout << " Pt Min = " << std::setw(10) << scale.etMin
700  << " Pt Max = " << std::setw(10) << scale.etMax
701  << " Pt Step = " << std::setw(10) << scale.etStep
702  << " Number = " << std::setw(10) << scale.etBins.size()
703  << std::endl;
704  myCout << "\n";
705  for (int i=0; i< int(scale.etBins.size()); i++){
706  std::pair<double, double> binEdges = scale.etBins.at(i);
707  myCout << " etBins[" << i << "]\trange:\t" << binEdges.first << " - " << binEdges.second << std::endl;
708  }
709 
710  myCout << "\n Phi Min = " << std::setw(10) << scale.phiMin
711  << " Phi Max = " << std::setw(10) << scale.phiMax
712  << " Phi Step = " << std::setw(10) << scale.phiStep
713  << " Number = " << std::setw(10) << scale.phiBins.size()
714  << std::endl;
715  myCout << "\n";
716  for (int i=0; i< int(scale.phiBins.size()); i++){
717  std::pair<double, double> binEdges = scale.phiBins.at(i);
718  myCout << " phiBins[" << i << "]\trange:\t" << binEdges.first << " - " << binEdges.second << std::endl;
719  }
720 
721  myCout << "\n Eta Min = " << std::setw(10) << scale.etaMin
722  << " Eta Max = " << std::setw(10) << scale.etaMax
723  << " Eta Step = " << std::setw(10) << scale.etaStep
724  << " Number = " << std::setw(10) << scale.etaBins.size()
725  << std::endl;
726  myCout << "\n";
727  for (int i=0; i< int(scale.etaBins.size()); i++){
728  std::pair<double, double> binEdges = scale.etaBins.at(i);
729  myCout << " etaBins[" << i << "]\trange:\t" << binEdges.first << " - " << binEdges.second << std::endl;
730  }
731 
732 }
std::map< std::string, unsigned int > m_Prec_Pt
Definition: GlobalScales.h:153
type
Definition: HCALResponse.h:21
unsigned int getPrec_Cos(const std::string &lutName) const
unsigned int getPrec_Pt(const std::string &lutName) const
ScaleParameters m_ettScales
Definition: GlobalScales.h:133
long long getLUT_Sin(const std::string &lutName, int element) const
std::map< std::string, std::vector< long long > > m_lut_DeltaPhi
Definition: GlobalScales.h:144
ScaleParameters m_tauScales
Definition: GlobalScales.h:128
ScaleParameters m_jetScales
Definition: GlobalScales.h:131
std::map< std::string, unsigned int > m_Prec_Cosh
Definition: GlobalScales.h:154
std::vector< std::pair< double, double > > etaBins
Definition: GlobalScales.h:54
virtual ~GlobalScales()
Definition: GlobalScales.cc:32
std::map< std::string, std::vector< long long > > m_lut_CalMuPhi
Definition: GlobalScales.h:142
std::vector< std::pair< double, double > > phiBins
Definition: GlobalScales.h:49
std::string m_ScaleSetName
Definition: GlobalScales.h:125
unsigned int getPrec_DeltaEta_Cosh(const std::string &lutName) const
virtual void setLUT_CalMuPhi(const std::string &lutName, std::vector< long long > lut)
Definition: GlobalScales.cc:55
virtual void setLUT_DeltaEta(const std::string &lutName, std::vector< long long > lut, unsigned int precision)
Definition: GlobalScales.cc:71
long long getLUT_DeltaEta(std::string lutName, int element) const
unsigned int getPrec_Sin(const std::string &lutName) const
std::map< std::string, unsigned int > m_Prec_Cos
Definition: GlobalScales.h:155
ScaleParameters m_etmScales
Definition: GlobalScales.h:136
std::map< std::string, std::vector< long long > > m_lut_Sin
Definition: GlobalScales.h:148
ScaleParameters m_egScales
Definition: GlobalScales.h:127
std::map< std::string, unsigned int > m_Prec_DeltaEta
Definition: GlobalScales.h:151
virtual void dumpAllLUTs(std::ostream &myCout) const
ScaleParameters m_htmScales
Definition: GlobalScales.h:138
virtual void setLUT_Cos(const std::string &lutName, std::vector< long long > lut, unsigned int precision)
long long getLUT_DeltaPhi_Cos(std::string lutName, int element) const
long long getLUT_Cos(const std::string &lutName, int element) const
long long getLUT_Pt(const std::string &lutName, int element) const
unsigned int getPrec_DeltaEta(const std::string &lutName) const
virtual void print(std::ostream &myCout) const
std::map< std::string, std::vector< long long > > m_lut_Pt
Definition: GlobalScales.h:145
Definition: value.py:1
long long getLUT_CalMuPhi(const std::string &lutName, int element) const
virtual void setLUT_Cosh(const std::string &lutName, std::vector< long long > lut, unsigned int precision)
#define LogTrace(id)
ScaleParameters m_httScales
Definition: GlobalScales.h:135
long long getLUT_CalMuEta(const std::string &lutName, int element) const
virtual void dumpLUT(std::ostream &myCout, int LUTtype, std::string name) const
std::map< std::string, unsigned int > m_Prec_DeltaPhi
Definition: GlobalScales.h:152
std::vector< std::pair< double, double > > etBins
Definition: GlobalScales.h:44
long long getLUT_DeltaEta_Cosh(std::string lutName, int element) const
virtual void setLUT_DeltaPhi(const std::string &lutName, std::vector< long long > lut, unsigned int precision)
Definition: GlobalScales.cc:87
long long getLUT_DeltaPhi(std::string lutName, int element) const
std::map< std::string, std::vector< long long > > m_lut_DeltaEta
Definition: GlobalScales.h:143
std::map< std::string, std::vector< long long > > m_lut_CalMuEta
Definition: GlobalScales.h:141
virtual void setLUT_Pt(const std::string &lutName, std::vector< long long > lut, unsigned int precision)
typedef for a single object template
Definition: GlobalScales.h:39
unsigned int getPrec_DeltaPhi(const std::string &lutName) const
std::map< std::string, unsigned int > m_Prec_Sin
Definition: GlobalScales.h:156
std::map< std::string, std::vector< long long > > m_lut_Cosh
Definition: GlobalScales.h:146
virtual void setLUT_CalMuEta(const std::string &lutName, std::vector< long long > lut)
Definition: GlobalScales.cc:39
unsigned int getPrec_DeltaPhi_Cos(const std::string &lutName) const
virtual void setLUT_Sin(const std::string &lutName, std::vector< long long > lut, unsigned int precision)
std::map< std::string, std::vector< long long > > m_lut_Cos
Definition: GlobalScales.h:147
virtual std::string getScalesName() const
Definition: GlobalScales.cc:36
virtual void printScale(ScaleParameters scale, std::ostream &myCout) const
ScaleParameters m_muScales
Definition: GlobalScales.h:129