CMS 3D CMS Logo

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