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 // $Id: L1CaloInputScalesProducer.cc,v 1.2 2008/10/20 17:11:55 bachtis Exp $
17 //
18 //
19 
20 // system include files
21 
22 // user include files
25 
26 //
27 // class decleration
28 //
29 
30 //
31 // constants, enums and typedefs
32 //
33 
34 //
35 // static data member definitions
36 //
37 
38 //
39 // constructors and destructor
40 //
42 {
43  //the following line is needed to tell the framework what
44  // data is being produced
47 
48  //now do what ever other initialization is needed
49 
50  // { Et for each rank, eta bin 0 }, { Et for each rank, eta bin 1 }, ...
52  iConfig.getParameter< std::vector<double> >("L1EcalEtThresholdsPositiveEta");
54  iConfig.getParameter< std::vector<double> >("L1EcalEtThresholdsNegativeEta");
56  iConfig.getParameter< std::vector<double> >("L1HcalEtThresholdsPositiveEta");
58  iConfig.getParameter< std::vector<double> >("L1HcalEtThresholdsNegativeEta");
59 }
60 
61 
63 {
64 
65  // do anything here that needs to be done at desctruction time
66  // (e.g. close files, deallocate resources etc.)
67 
68 }
69 
70 
71 //
72 // member functions
73 //
74 
75 // ------------ method called to produce the data ------------
76 boost::shared_ptr<L1CaloEcalScale>
78 {
79  using namespace edm::es;
80  boost::shared_ptr<L1CaloEcalScale> pL1CaloEcalScale =
81  boost::shared_ptr<L1CaloEcalScale>( new L1CaloEcalScale ) ;
82 
83  std::vector< double >::const_iterator posItr =
84  m_ecalEtThresholdsPosEta.begin() ;
85  std::vector< double >::const_iterator negItr =
86  m_ecalEtThresholdsNegEta.begin() ;
87 
88  for( unsigned short ieta = 1 ;
89  ieta <= L1CaloEcalScale::nBinEta ;
90  ++ieta )
91  {
92  for( unsigned short irank = 0 ;
94  ++irank )
95  {
96  pL1CaloEcalScale->setBin( irank, ieta, 1, *posItr ) ;
97  pL1CaloEcalScale->setBin( irank, ieta, -1, *negItr ) ;
98 
99  ++posItr ;
100  ++negItr ;
101  }
102  }
103 
104  return pL1CaloEcalScale ;
105 }
106 
107 // ------------ method called to produce the data ------------
108 boost::shared_ptr<L1CaloHcalScale>
110 {
111  using namespace edm::es;
112  boost::shared_ptr<L1CaloHcalScale> pL1CaloHcalScale =
113  boost::shared_ptr<L1CaloHcalScale>( new L1CaloHcalScale ) ;
114 
115  std::vector< double >::const_iterator posItr =
116  m_hcalEtThresholdsPosEta.begin() ;
117 
118  std::vector< double >::const_iterator negItr =
119  m_hcalEtThresholdsNegEta.begin() ;
120 
121 
122  for( unsigned short ieta = 1 ;
123  ieta <= L1CaloHcalScale::nBinEta ;
124  ++ieta )
125  {
126  for( unsigned short irank = 0 ;
128  ++irank )
129  {
130  pL1CaloHcalScale->setBin( irank, ieta, 1, *posItr ) ;
131  pL1CaloHcalScale->setBin( irank, ieta, -1, *negItr ) ;
132 
133  ++posItr ;
134  ++negItr ;
135  }
136  }
137 
138  return pL1CaloHcalScale ;
139 }
140 
141 //define this as a plug-in
142 //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 &)