CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
L1ScalesTester.cc
Go to the documentation of this file.
2 
5 
13 
14 #include <iostream>
15 
16 using std::cout;
17 using std::endl;
18 
19 L1ScalesTester::L1ScalesTester(const edm::ParameterSet& ps) { cout << "Constructing a L1ScalesTester" << endl; }
20 
22 
24  using namespace edm;
25 
27  es.get<L1EmEtScaleRcd>().get(emScale);
28 
29  cout << "L1EmEtScaleRcd :" << endl;
30  emScale->print(cout);
31  cout << endl;
32 
33  ESHandle<L1CaloEcalScale> ecalScale;
34  es.get<L1CaloEcalScaleRcd>().get(ecalScale);
35 
36  ESHandle<L1CaloHcalScale> hcalScale;
37  es.get<L1CaloHcalScaleRcd>().get(hcalScale);
38 
39  cout << " L1ColoEcalScale :" << endl;
40  ecalScale->print(cout);
41  cout << endl;
42 
43  cout << " L1ColoHcalScale :" << endl;
44  hcalScale->print(cout);
45  cout << endl;
46 
47  ESHandle<L1CaloEtScale> jetScale;
48  es.get<L1JetEtScaleRcd>().get(jetScale);
49 
50  cout << "L1JetEtScaleRcd :" << endl;
51  jetScale->print(cout);
52  cout << endl;
53 
54  // test EM lin-rank conversion
55  cout << "Testing EM linear-to-rank conversion" << endl;
56  for (unsigned short i = 0; i < 32; i++) {
57  unsigned rank = emScale->rank(i);
58  cout << "EM linear : " << i << ", Et : " << i * emScale->linearLsb() << " GeV, rank : " << rank << endl;
59  }
60  cout << endl;
61 
62  // test jet lin-rank conversion
63  cout << "Testing jet linear-to-rank conversion" << endl;
64  for (unsigned short i = 0; i < 32; i++) {
65  unsigned rank = jetScale->rank(i);
66  cout << "jet linear : " << i << ", Et : " << i * jetScale->linearLsb() << " GeV, rank : " << rank << endl;
67  }
68  cout << endl;
69 
70  // test EM rank-et conversion
71  cout << "Testing EM rank-to-Et conversion" << endl;
72  for (unsigned i = 0; i < 32; i++) {
73  double et = emScale->et(i);
74  cout << "EM rank : " << i << " Et : " << et << " GeV" << endl;
75  }
76  cout << endl;
77 
78  // test jet rank-et conversion
79  cout << "Testing jet rank-to-Et conversion" << endl;
80  for (unsigned i = 0; i < 32; i++) {
81  double et = jetScale->et(i);
82  cout << "jet rank : " << i << " Et : " << et << " GeV" << endl;
83  }
84  cout << endl;
85 }
L1ScalesTester(const edm::ParameterSet &)
void analyze(const edm::Event &, const edm::EventSetup &) override
T get() const
Definition: EventSetup.h:88
~L1ScalesTester() override
tuple cout
Definition: gather_cfg.py:144