CMS 3D CMS Logo

L1CaloInputScalesProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: L1CaloInputScalesProducer
4 // Class: L1CaloInputScalesProducer
5 //
13 //
14 // Original Author: Jim Brooke
15 // Created: Fri May 16 16:09:43 CEST 2008
16 //
17 //
18 
19 // system include files
20 
21 // user include files
24 
25 //
26 // class decleration
27 //
28 
29 //
30 // constants, enums and typedefs
31 //
32 
33 //
34 // static data member definitions
35 //
36 
37 //
38 // constructors and destructor
39 //
41 {
42  //the following line is needed to tell the framework what
43  // data is being produced
46 
47  //now do what ever other initialization is needed
48 
49  // { Et for each rank, eta bin 0 }, { Et for each rank, eta bin 1 }, ...
51  iConfig.getParameter< std::vector<double> >("L1EcalEtThresholdsPositiveEta");
53  iConfig.getParameter< std::vector<double> >("L1EcalEtThresholdsNegativeEta");
55  iConfig.getParameter< std::vector<double> >("L1HcalEtThresholdsPositiveEta");
57  iConfig.getParameter< std::vector<double> >("L1HcalEtThresholdsNegativeEta");
58 }
59 
60 
62 {
63 
64  // do anything here that needs to be done at desctruction time
65  // (e.g. close files, deallocate resources etc.)
66 
67 }
68 
69 
70 //
71 // member functions
72 //
73 
74 // ------------ method called to produce the data ------------
75 std::unique_ptr<L1CaloEcalScale>
77 {
78  auto pL1CaloEcalScale = std::make_unique<L1CaloEcalScale>() ;
79 
80  std::vector< double >::const_iterator posItr =
81  m_ecalEtThresholdsPosEta.begin() ;
82  std::vector< double >::const_iterator negItr =
83  m_ecalEtThresholdsNegEta.begin() ;
84 
85  for( unsigned short ieta = 1 ;
86  ieta <= L1CaloEcalScale::nBinEta ;
87  ++ieta )
88  {
89  for( unsigned short irank = 0 ;
91  ++irank )
92  {
93  pL1CaloEcalScale->setBin( irank, ieta, 1, *posItr ) ;
94  pL1CaloEcalScale->setBin( irank, ieta, -1, *negItr ) ;
95 
96  ++posItr ;
97  ++negItr ;
98  }
99  }
100 
101  return pL1CaloEcalScale ;
102 }
103 
104 // ------------ method called to produce the data ------------
105 std::unique_ptr<L1CaloHcalScale>
107 {
108  auto pL1CaloHcalScale = std::make_unique<L1CaloHcalScale>() ;
109 
110  std::vector< double >::const_iterator posItr =
111  m_hcalEtThresholdsPosEta.begin() ;
112 
113  std::vector< double >::const_iterator negItr =
114  m_hcalEtThresholdsNegEta.begin() ;
115 
116 
117  for( unsigned short ieta = 1 ;
118  ieta <= L1CaloHcalScale::nBinEta ;
119  ++ieta )
120  {
121  for( unsigned short irank = 0 ;
123  ++irank )
124  {
125  pL1CaloHcalScale->setBin( irank, ieta, 1, *posItr ) ;
126  pL1CaloHcalScale->setBin( irank, ieta, -1, *negItr ) ;
127 
128  ++posItr ;
129  ++negItr ;
130  }
131  }
132 
133  return pL1CaloHcalScale ;
134 }
135 
136 //define this as a plug-in
137 //DEFINE_FWK_EVENTSETUP_MODULE(L1CaloInputScalesProducer);
T getParameter(std::string const &) const
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:124
std::unique_ptr< L1CaloEcalScale > produceEcalScale(const L1CaloEcalScaleRcd &)
std::vector< double > m_ecalEtThresholdsPosEta
L1CaloInputScalesProducer(const edm::ParameterSet &)
std::vector< double > m_hcalEtThresholdsNegEta
std::unique_ptr< L1CaloHcalScale > produceHcalScale(const L1CaloHcalScaleRcd &)
std::vector< double > m_hcalEtThresholdsPosEta
static const unsigned short nBinRank
std::vector< double > m_ecalEtThresholdsNegEta
static const unsigned short nBinRank
static const unsigned short nBinEta
static const unsigned short nBinEta