SimCalorimetry
EcalSimProducers
plugins
EcalLiteDTUPedestalsESProducer.cc
Go to the documentation of this file.
1
#include <memory>
2
#include <string>
3
#include "
FWCore/Framework/interface/ModuleFactory.h
"
4
#include "
FWCore/Framework/interface/ESProducer.h
"
5
#include "
FWCore/Framework/interface/ESProductHost.h
"
6
#include "
FWCore/Framework/interface/ESHandle.h
"
7
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
8
#include "
CondFormats/DataRecord/interface/EcalLiteDTUPedestalsRcd.h
"
9
#include "
CondFormats/EcalObjects/interface/EcalLiteDTUPedestals.h
"
10
#include "
CondFormats/EcalObjects/src/classes.h
"
11
#include "
DataFormats/EcalDigi/interface/EcalConstants.h
"
12
13
//
14
// class declaration
15
//
16
17
class
EcalLiteDTUPedestalsESProducer
:
public
edm::ESProducer
{
18
public
:
19
EcalLiteDTUPedestalsESProducer
(
const
edm::ParameterSet
&
p
);
20
21
typedef
std::unique_ptr<EcalLiteDTUPedestalsMap>
ReturnType
;
22
23
ReturnType
produce
(
const
EcalLiteDTUPedestalsRcd
& iRecord);
24
25
private
:
26
double
meanPedestalsGain10_
;
27
double
rmsPedestalsGain10_
;
28
double
meanPedestalsGain1_
;
29
double
rmsPedestalsGain1_
;
30
};
31
32
using namespace
edm
;
33
34
EcalLiteDTUPedestalsESProducer::EcalLiteDTUPedestalsESProducer
(
const
edm::ParameterSet
&
p
) {
35
std::string
myname =
p
.getParameter<
std::string
>(
"ComponentName"
);
36
meanPedestalsGain10_ =
p
.getParameter<
double
>(
"MeanPedestalsGain10"
);
37
rmsPedestalsGain10_ =
p
.getParameter<
double
>(
"RMSPedestalsGain10"
);
38
meanPedestalsGain1_ =
p
.getParameter<
double
>(
"MeanPedestalsGain1"
);
39
rmsPedestalsGain1_ =
p
.getParameter<
double
>(
"RMSPedestalsGain1"
);
40
setWhatProduced(
this
);
41
}
43
EcalLiteDTUPedestalsESProducer::ReturnType
EcalLiteDTUPedestalsESProducer::produce
(
44
const
EcalLiteDTUPedestalsRcd
& iRecord) {
45
auto
prod
= std::make_unique<EcalLiteDTUPedestalsMap>();
46
47
for
(
unsigned
int
iChannel = 0; iChannel <
ecalPh2::kEBChannels
; iChannel++) {
48
EBDetId
myEBDetId =
EBDetId::unhashIndex
(iChannel);
49
EcalLiteDTUPedestals
ped;
50
ped.
setMean
(0, meanPedestalsGain10_);
51
ped.
setRMS
(0, rmsPedestalsGain10_);
52
53
ped.
setMean
(1, meanPedestalsGain1_);
54
ped.
setRMS
(1, rmsPedestalsGain1_);
55
56
prod
->insert(std::make_pair(myEBDetId, ped));
57
}
58
59
return
prod
;
60
}
61
62
//Define this as a plug-in
63
DEFINE_FWK_EVENTSETUP_MODULE
(
EcalLiteDTUPedestalsESProducer
);
ESHandle.h
EcalLiteDTUPedestalsESProducer::meanPedestalsGain10_
double meanPedestalsGain10_
Definition:
EcalLiteDTUPedestalsESProducer.cc:26
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
EcalLiteDTUPedestals.h
dumpMFGeometry_cfg.prod
prod
Definition:
dumpMFGeometry_cfg.py:24
EcalLiteDTUPedestalsESProducer::EcalLiteDTUPedestalsESProducer
EcalLiteDTUPedestalsESProducer(const edm::ParameterSet &p)
Definition:
EcalLiteDTUPedestalsESProducer.cc:34
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:27
EcalConstants.h
EcalLiteDTUPedestalsESProducer::meanPedestalsGain1_
double meanPedestalsGain1_
Definition:
EcalLiteDTUPedestalsESProducer.cc:28
EcalLiteDTUPedestalsESProducer::produce
ReturnType produce(const EcalLiteDTUPedestalsRcd &iRecord)
Definition:
EcalLiteDTUPedestalsESProducer.cc:43
EcalLiteDTUPedestals::setMean
int setMean(unsigned int i, float value)
Definition:
EcalLiteDTUPedestals.h:10
ModuleFactory.h
EcalLiteDTUPedestals::setRMS
int setRMS(unsigned int i, float value)
Definition:
EcalLiteDTUPedestals.h:18
EcalLiteDTUPedestalsESProducer::rmsPedestalsGain1_
double rmsPedestalsGain1_
Definition:
EcalLiteDTUPedestalsESProducer.cc:29
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
Generated for CMSSW Reference Manual by
1.8.16