CMS 3D CMS Logo

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 
20  cout << "Constructing a L1ScalesTester" << endl;
21 }
22 
24 
25 }
26 
28  using namespace edm;
29 
31  es.get< L1EmEtScaleRcd >().get( emScale ) ;
32 
33  cout << "L1EmEtScaleRcd :" << endl;
34  emScale->print(cout);
35  cout << endl;
36 
38  es.get< L1CaloEcalScaleRcd >().get(ecalScale);
39 
41  es.get< L1CaloHcalScaleRcd >().get(hcalScale);
42 
43  cout << " L1ColoEcalScale :" << endl;
44  ecalScale->print(cout);
45  cout << endl;
46 
47  cout << " L1ColoHcalScale :" << endl;
48  hcalScale->print(cout);
49  cout << endl;
50 
52  es.get< L1JetEtScaleRcd >().get( jetScale ) ;
53 
54  cout << "L1JetEtScaleRcd :" << endl;
55  jetScale->print(cout);
56  cout << endl;
57 
58  // test EM lin-rank conversion
59  cout << "Testing EM linear-to-rank conversion" << endl;
60  for (unsigned short i=0; i<32; i++) {
61  unsigned rank = emScale->rank(i);
62  cout << "EM linear : " << i << ", Et : " << i*emScale->linearLsb() << " GeV, rank : " << rank << endl;
63  }
64  cout << endl;
65 
66  // test jet lin-rank conversion
67  cout << "Testing jet linear-to-rank conversion" << endl;
68  for (unsigned short i=0; i<32; i++) {
69  unsigned rank = jetScale->rank(i);
70  cout << "jet linear : " << i << ", Et : " << i*jetScale->linearLsb() << " GeV, rank : " << rank << endl;
71  }
72  cout << endl;
73 
74  // test EM rank-et conversion
75  cout << "Testing EM rank-to-Et conversion" << endl;
76  for (unsigned i=0; i<32; i++) {
77  double et = emScale->et(i);
78  cout << "EM rank : " << i << " Et : " << et << " GeV" << endl;
79  }
80  cout << endl;
81 
82  // test jet rank-et conversion
83  cout << "Testing jet rank-to-Et conversion" << endl;
84  for (unsigned i=0; i<32; i++) {
85  double et = jetScale->et(i);
86  cout << "jet rank : " << i << " Et : " << et << " GeV" << endl;
87  }
88  cout << endl;
89 
90 
91 }
void print(std::ostream &s) const
double et(const uint16_t rank) const
convert from rank to physically meaningful quantity
double linearLsb() const
get LSB of linear input scale
Definition: L1CaloEtScale.h:53
uint16_t rank(const uint16_t linear) const
convert from linear Et scale to rank scale
void print(std::ostream &s) const
L1ScalesTester(const edm::ParameterSet &)
void print(std::ostream &s) const
void analyze(const edm::Event &, const edm::EventSetup &) override
et
define resolution functions of each parameter
HLT enums.
T get() const
Definition: EventSetup.h:62
~L1ScalesTester() override