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  //the following line is needed to tell the framework what
42  // data is being produced
45 
46  //now do what ever other initialization is needed
47 
48  // { Et for each rank, eta bin 0 }, { Et for each rank, eta bin 1 }, ...
49  m_ecalEtThresholdsPosEta = iConfig.getParameter<std::vector<double> >("L1EcalEtThresholdsPositiveEta");
50  m_ecalEtThresholdsNegEta = iConfig.getParameter<std::vector<double> >("L1EcalEtThresholdsNegativeEta");
51  m_hcalEtThresholdsPosEta = iConfig.getParameter<std::vector<double> >("L1HcalEtThresholdsPositiveEta");
52  m_hcalEtThresholdsNegEta = iConfig.getParameter<std::vector<double> >("L1HcalEtThresholdsNegativeEta");
53 }
54 
56  // do anything here that needs to be done at desctruction time
57  // (e.g. close files, deallocate resources etc.)
58 }
59 
60 //
61 // member functions
62 //
63 
64 // ------------ method called to produce the data ------------
65 std::unique_ptr<L1CaloEcalScale> L1CaloInputScalesProducer::produceEcalScale(const L1CaloEcalScaleRcd& iRecord) {
66  auto pL1CaloEcalScale = std::make_unique<L1CaloEcalScale>();
67 
68  std::vector<double>::const_iterator posItr = m_ecalEtThresholdsPosEta.begin();
69  std::vector<double>::const_iterator negItr = m_ecalEtThresholdsNegEta.begin();
70 
71  for (unsigned short ieta = 1; ieta <= L1CaloEcalScale::nBinEta; ++ieta) {
72  for (unsigned short irank = 0; irank < L1CaloEcalScale::nBinRank; ++irank) {
73  pL1CaloEcalScale->setBin(irank, ieta, 1, *posItr);
74  pL1CaloEcalScale->setBin(irank, ieta, -1, *negItr);
75 
76  ++posItr;
77  ++negItr;
78  }
79  }
80 
81  return pL1CaloEcalScale;
82 }
83 
84 // ------------ method called to produce the data ------------
85 std::unique_ptr<L1CaloHcalScale> L1CaloInputScalesProducer::produceHcalScale(const L1CaloHcalScaleRcd& iRecord) {
86  auto pL1CaloHcalScale = std::make_unique<L1CaloHcalScale>();
87 
88  std::vector<double>::const_iterator posItr = m_hcalEtThresholdsPosEta.begin();
89 
90  std::vector<double>::const_iterator negItr = m_hcalEtThresholdsNegEta.begin();
91 
92  for (unsigned short ieta = 1; ieta <= L1CaloHcalScale::nBinEta; ++ieta) {
93  for (unsigned short irank = 0; irank < L1CaloHcalScale::nBinRank; ++irank) {
94  pL1CaloHcalScale->setBin(irank, ieta, 1, *posItr);
95  pL1CaloHcalScale->setBin(irank, ieta, -1, *negItr);
96 
97  ++posItr;
98  ++negItr;
99  }
100  }
101 
102  return pL1CaloHcalScale;
103 }
104 
105 //define this as a plug-in
106 //DEFINE_FWK_EVENTSETUP_MODULE(L1CaloInputScalesProducer);
L1CaloInputScalesProducer::m_hcalEtThresholdsNegEta
std::vector< double > m_hcalEtThresholdsNegEta
Definition: L1CaloInputScalesProducer.h:50
ESHandle.h
L1CaloEcalScaleRcd
Definition: L1CaloEcalScaleRcd.h:12
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
L1CaloHcalScale::nBinRank
static const unsigned short nBinRank
Definition: L1CaloHcalScale.h:31
L1CaloEcalScale::nBinRank
static const unsigned short nBinRank
Definition: L1CaloEcalScale.h:31
L1CaloInputScalesProducer::m_hcalEtThresholdsPosEta
std::vector< double > m_hcalEtThresholdsPosEta
Definition: L1CaloInputScalesProducer.h:49
L1CaloInputScalesProducer::L1CaloInputScalesProducer
L1CaloInputScalesProducer(const edm::ParameterSet &)
Definition: L1CaloInputScalesProducer.cc:40
L1CaloHcalScale::nBinEta
static const unsigned short nBinEta
Definition: L1CaloHcalScale.h:32
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
edm::ParameterSet
Definition: ParameterSet.h:47
L1CaloInputScalesProducer::produceHcalScale
std::unique_ptr< L1CaloHcalScale > produceHcalScale(const L1CaloHcalScaleRcd &)
Definition: L1CaloInputScalesProducer.cc:85
L1CaloInputScalesProducer::produceEcalScale
std::unique_ptr< L1CaloEcalScale > produceEcalScale(const L1CaloEcalScaleRcd &)
Definition: L1CaloInputScalesProducer.cc:65
L1CaloInputScalesProducer::m_ecalEtThresholdsPosEta
std::vector< double > m_ecalEtThresholdsPosEta
Definition: L1CaloInputScalesProducer.h:47
L1CaloInputScalesProducer::~L1CaloInputScalesProducer
~L1CaloInputScalesProducer() override
Definition: L1CaloInputScalesProducer.cc:55
L1CaloInputScalesProducer::m_ecalEtThresholdsNegEta
std::vector< double > m_ecalEtThresholdsNegEta
Definition: L1CaloInputScalesProducer.h:48
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
L1CaloEcalScale::nBinEta
static const unsigned short nBinEta
Definition: L1CaloEcalScale.h:32
L1CaloInputScalesProducer.h
L1CaloHcalScaleRcd
Definition: L1CaloHcalScaleRcd.h:13