CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
EcalLiteDTUPedestalsESProducer.cc
Go to the documentation of this file.
1 #include <memory>
2 #include <string>
11 
12 //
13 // class declaration
14 //
15 
17 public:
19 
20  typedef std::unique_ptr<EcalLiteDTUPedestalsMap> ReturnType;
21 
23 
24 private:
29 };
30 
31 using namespace edm;
32 
34  std::string myname = p.getParameter<std::string>("ComponentName");
35  meanPedestalsGain10_ = p.getParameter<double>("MeanPedestalsGain10");
36  rmsPedestalsGain10_ = p.getParameter<double>("RMSPedestalsGain10");
37  meanPedestalsGain1_ = p.getParameter<double>("MeanPedestalsGain1");
38  rmsPedestalsGain1_ = p.getParameter<double>("RMSPedestalsGain1");
39  setWhatProduced(this);
40 }
43  const EcalLiteDTUPedestalsRcd& iRecord) {
44  auto prod = std::make_unique<EcalLiteDTUPedestalsMap>();
45 
46  for (unsigned int iChannel = 0; iChannel < ecalPh2::kEBChannels; iChannel++) {
47  EBDetId myEBDetId = EBDetId::unhashIndex(iChannel);
49  ped.setMean(0, meanPedestalsGain10_);
50  ped.setRMS(0, rmsPedestalsGain10_);
51 
52  ped.setMean(1, meanPedestalsGain1_);
53  ped.setRMS(1, rmsPedestalsGain1_);
54 
55  prod->insert(std::make_pair(myEBDetId, ped));
56  }
57 
58  return prod;
59 }
60 
61 //Define this as a plug-in
ReturnType produce(const EcalLiteDTUPedestalsRcd &iRecord)
EcalLiteDTUPedestalsESProducer(const edm::ParameterSet &p)
static constexpr unsigned int kEBChannels
Definition: EcalConstants.h:15
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
int setMean(unsigned int i, float value)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
Definition: EBDetId.h:110
int setRMS(unsigned int i, float value)
std::unique_ptr< EcalLiteDTUPedestalsMap > ReturnType