test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 boost::shared_ptr<L1CaloEcalScale>
77 {
78  using namespace edm::es;
79  boost::shared_ptr<L1CaloEcalScale> pL1CaloEcalScale =
80  boost::shared_ptr<L1CaloEcalScale>( new L1CaloEcalScale ) ;
81 
82  std::vector< double >::const_iterator posItr =
83  m_ecalEtThresholdsPosEta.begin() ;
84  std::vector< double >::const_iterator negItr =
85  m_ecalEtThresholdsNegEta.begin() ;
86 
87  for( unsigned short ieta = 1 ;
88  ieta <= L1CaloEcalScale::nBinEta ;
89  ++ieta )
90  {
91  for( unsigned short irank = 0 ;
93  ++irank )
94  {
95  pL1CaloEcalScale->setBin( irank, ieta, 1, *posItr ) ;
96  pL1CaloEcalScale->setBin( irank, ieta, -1, *negItr ) ;
97 
98  ++posItr ;
99  ++negItr ;
100  }
101  }
102 
103  return pL1CaloEcalScale ;
104 }
105 
106 // ------------ method called to produce the data ------------
107 boost::shared_ptr<L1CaloHcalScale>
109 {
110  using namespace edm::es;
111  boost::shared_ptr<L1CaloHcalScale> pL1CaloHcalScale =
112  boost::shared_ptr<L1CaloHcalScale>( new L1CaloHcalScale ) ;
113 
114  std::vector< double >::const_iterator posItr =
115  m_hcalEtThresholdsPosEta.begin() ;
116 
117  std::vector< double >::const_iterator negItr =
118  m_hcalEtThresholdsNegEta.begin() ;
119 
120 
121  for( unsigned short ieta = 1 ;
122  ieta <= L1CaloHcalScale::nBinEta ;
123  ++ieta )
124  {
125  for( unsigned short irank = 0 ;
127  ++irank )
128  {
129  pL1CaloHcalScale->setBin( irank, ieta, 1, *posItr ) ;
130  pL1CaloHcalScale->setBin( irank, ieta, -1, *negItr ) ;
131 
132  ++posItr ;
133  ++negItr ;
134  }
135  }
136 
137  return pL1CaloHcalScale ;
138 }
139 
140 //define this as a plug-in
141 //DEFINE_FWK_EVENTSETUP_MODULE(L1CaloInputScalesProducer);
T getParameter(std::string const &) const
std::vector< double > m_ecalEtThresholdsPosEta
L1CaloInputScalesProducer(const edm::ParameterSet &)
std::vector< double > m_hcalEtThresholdsNegEta
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
std::vector< double > m_hcalEtThresholdsPosEta
static const unsigned short nBinRank
std::vector< double > m_ecalEtThresholdsNegEta
boost::shared_ptr< L1CaloEcalScale > produceEcalScale(const L1CaloEcalScaleRcd &)
static const unsigned short nBinRank
static const unsigned short nBinEta
static const unsigned short nBinEta
boost::shared_ptr< L1CaloHcalScale > produceHcalScale(const L1CaloHcalScaleRcd &)