CMS 3D CMS Logo

EcalLiteDTUPedestalsESProducer.cc
Go to the documentation of this file.
1 #include <memory>
2 #include <string>
12 
13 //
14 // class declaration
15 //
16 
18 public:
20 
21  typedef std::unique_ptr<EcalLiteDTUPedestalsMap> ReturnType;
22 
24  //Add 2 nov 2020:
27 private:
32 };
33 
34 using namespace edm;
35 
37  std::string myname = p.getParameter<std::string>("ComponentName");
38  meanPedestalsGain10_ = p.getParameter<double>("MeanPedestalsGain10");
39  rmsPedestalsGain10_ = p.getParameter<double>("RMSPedestalsGain10");
40  meanPedestalsGain1_ = p.getParameter<double>("MeanPedestalsGain1");
41  rmsPedestalsGain1_ = p.getParameter<double>("RMSPedestalsGain1");
42  auto cc = setWhatProduced(this);
43  pedestalToken_ = cc.consumes<EcalLiteDTUPedestalsMap>();
44 }
47  const EcalLiteDTUPedestalsRcd& iRecord) {
48  auto prod = std::make_unique<EcalLiteDTUPedestalsMap>();
49 
50  for (unsigned int iChannel = 0; iChannel < ecalPh2::kEBChannels; iChannel++) {
51  EBDetId myEBDetId = EBDetId::unhashIndex(iChannel);
53  ped.setMean(0, meanPedestalsGain10_);
54  ped.setRMS(0, rmsPedestalsGain10_);
55 
56  ped.setMean(1, meanPedestalsGain1_);
57  ped.setRMS(1, rmsPedestalsGain1_);
58 
59  prod->insert(std::make_pair(myEBDetId, ped));
60  }
61 
62  return prod;
63 }
64 
65 //Define this as a plug-in
ESHandle.h
EcalLiteDTUPedestalsESProducer::meanPedestalsGain10_
double meanPedestalsGain10_
Definition: EcalLiteDTUPedestalsESProducer.cc:28
EcalLiteDTUPedestalsRcd
Definition: EcalLiteDTUPedestalsRcd.h:5
EBDetId
Definition: EBDetId.h:17
edm
HLT enums.
Definition: AlignableModifier.h:19
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
EBDetId::unhashIndex
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
Definition: EBDetId.h:110
EcalLiteDTUPedestals
Definition: EcalLiteDTUPedestals.h:8
ESProducer.h
EcalLiteDTUPedestalsRcd.h
EcalLiteDTUPedestalsESProducer
Definition: EcalLiteDTUPedestalsESProducer.cc:17
EcalCondObjectContainer
Definition: EcalCondObjectContainer.h:13
cc
EcalLiteDTUPedestals.h
dumpMFGeometry_cfg.prod
prod
Definition: dumpMFGeometry_cfg.py:24
EcalLiteDTUPedestalsESProducer::EcalLiteDTUPedestalsESProducer
EcalLiteDTUPedestalsESProducer(const edm::ParameterSet &p)
Definition: EcalLiteDTUPedestalsESProducer.cc:36
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:47
EcalLiteDTUPedestalsESProducer::ReturnType
std::unique_ptr< EcalLiteDTUPedestalsMap > ReturnType
Definition: EcalLiteDTUPedestalsESProducer.cc:21
EcalLiteDTUPedestalsESProducer::rmsPedestalsGain10_
double rmsPedestalsGain10_
Definition: EcalLiteDTUPedestalsESProducer.cc:29
EcalConstants.h
EcalLiteDTUPedestalsESProducer::meanPedestalsGain1_
double meanPedestalsGain1_
Definition: EcalLiteDTUPedestalsESProducer.cc:30
EcalLiteDTUPedestalsESProducer::produce
ReturnType produce(const EcalLiteDTUPedestalsRcd &iRecord)
Definition: EcalLiteDTUPedestalsESProducer.cc:46
EcalLiteDTUPedestals::setMean
int setMean(unsigned int i, float value)
Definition: EcalLiteDTUPedestals.h:10
edm::ESGetToken
Definition: EventSetup.h:48
EcalLiteDTUPedestalsESProducer::pedestalToken_
edm::ESGetToken< EcalLiteDTUPedestalsMap, EcalLiteDTUPedestalsRcd > pedestalToken_
Definition: EcalLiteDTUPedestalsESProducer.cc:25
ModuleFactory.h
EcalLiteDTUPedestals::setRMS
int setRMS(unsigned int i, float value)
Definition: EcalLiteDTUPedestals.h:18
EcalLiteDTUPedestalsESProducer::rmsPedestalsGain1_
double rmsPedestalsGain1_
Definition: EcalLiteDTUPedestalsESProducer.cc:31
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
edm::ESProducer
Definition: ESProducer.h:104
ESProductHost.h
ParameterSet.h
ecalPh2::kEBChannels
static constexpr unsigned int kEBChannels
Definition: EcalConstants.h:15
classes.h