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 
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 
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 }
L1EmEtScaleRcd.h
mps_fire.i
i
Definition: mps_fire.py:428
ESHandle.h
L1CaloEcalScaleRcd
Definition: L1CaloEcalScaleRcd.h:12
edm
HLT enums.
Definition: AlignableModifier.h:19
L1ScalesTester.h
gather_cfg.cout
cout
Definition: gather_cfg.py:144
L1CaloHcalScale.h
L1ScalesTester::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: L1ScalesTester.cc:23
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
L1CaloHcalScale::print
void print(std::ostream &s) const
Definition: L1CaloHcalScale.cc:75
L1JetEtScaleRcd
Definition: L1JetEtScaleRcd.h:30
L1CaloEcalScale::print
void print(std::ostream &s) const
Definition: L1CaloEcalScale.cc:75
edm::ESHandle
Definition: DTSurvey.h:22
L1CaloEtScale::linearLsb
double linearLsb() const
get LSB of linear input scale
Definition: L1CaloEtScale.h:54
edm::ParameterSet
Definition: ParameterSet.h:47
L1ScalesTester::L1ScalesTester
L1ScalesTester(const edm::ParameterSet &)
Definition: L1ScalesTester.cc:19
EgHLTOffHistBins_cfi.et
et
Definition: EgHLTOffHistBins_cfi.py:8
edm::EventSetup
Definition: EventSetup.h:57
L1CaloEtScale::rank
uint16_t rank(const uint16_t linear) const
convert from linear Et scale to rank scale
Definition: L1CaloEtScale.cc:52
get
#define get
L1CaloEtScale::print
void print(std::ostream &s) const
Definition: L1CaloEtScale.cc:85
L1CaloEtScale.h
L1CaloEcalScaleRcd.h
L1CaloHcalScaleRcd.h
L1CaloEcalScale.h
L1EmEtScaleRcd
Definition: L1EmEtScaleRcd.h:30
EventSetup.h
wplusjetsAnalysis_cfi.jetScale
jetScale
Definition: wplusjetsAnalysis_cfi.py:88
L1CaloEtScale::et
double et(const uint16_t rank) const
convert from rank to physically meaningful quantity
Definition: L1CaloEtScale.cc:68
L1JetEtScaleRcd.h
edm::Event
Definition: Event.h:73
L1CaloHcalScaleRcd
Definition: L1CaloHcalScaleRcd.h:13
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
L1ScalesTester::~L1ScalesTester
~L1ScalesTester() override
Definition: L1ScalesTester.cc:21