SimCalorimetry
EcalSimProducers
plugins
EcalCATIAGainRatiosESProducer.cc
Go to the documentation of this file.
1
#include <memory>
2
#include <string>
3
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
4
#include "
FWCore/Framework/interface/ModuleFactory.h
"
5
#include "
FWCore/Framework/interface/ESProducer.h
"
6
#include "
FWCore/Framework/interface/ESProductHost.h
"
7
#include "
FWCore/Framework/interface/ESHandle.h
"
8
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
9
#include "
CondFormats/DataRecord/interface/EcalCATIAGainRatiosRcd.h
"
10
#include "
CondFormats/EcalObjects/interface/EcalCATIAGainRatios.h
"
11
#include "
CondFormats/EcalObjects/src/classes.h
"
12
//
13
// class declaration
14
//
15
const
int
kEBChannels
=
ecalPh2::kEBChannels
;
16
17
class
EcalCATIAGainRatiosESProducer
:
public
edm::ESProducer
{
18
public
:
19
EcalCATIAGainRatiosESProducer
(
const
edm::ParameterSet
&
p
);
20
21
typedef
std::unique_ptr<EcalCATIAGainRatios>
ReturnType
;
22
23
ReturnType
produce
(
const
EcalCATIAGainRatiosRcd
& iRecord);
24
25
private
:
26
double
catiaGainRatio_
;
27
};
28
29
using namespace
edm
;
30
31
EcalCATIAGainRatiosESProducer::EcalCATIAGainRatiosESProducer
(
const
edm::ParameterSet
&
p
) {
32
std::string
myname =
p
.getParameter<
std::string
>(
"ComponentName"
);
33
catiaGainRatio_ =
p
.getParameter<
double
>(
"CATIAGainRatio"
);
34
setWhatProduced(
this
);
35
}
37
EcalCATIAGainRatiosESProducer::ReturnType
EcalCATIAGainRatiosESProducer::produce
(
const
EcalCATIAGainRatiosRcd
& iRecord) {
38
auto
prod
= std::make_unique<EcalCATIAGainRatios>();
39
for
(
int
iChannel = 0; iChannel <
kEBChannels
; iChannel++) {
40
EBDetId
myEBDetId =
EBDetId::unhashIndex
(iChannel);
41
double
val
= catiaGainRatio_;
42
prod
->setValue(myEBDetId.
rawId
(),
val
);
43
}
44
45
return
prod
;
46
}
47
48
//Define this as a plug-in
49
DEFINE_FWK_EVENTSETUP_MODULE
(
EcalCATIAGainRatiosESProducer
);
ESHandle.h
EBDetId
Definition:
EBDetId.h:17
edm
HLT enums.
Definition:
AlignableModifier.h:19
EBDetId::unhashIndex
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
Definition:
EBDetId.h:110
ESProducer.h
EcalCATIAGainRatiosRcd.h
EcalCATIAGainRatiosRcd
Definition:
EcalCATIAGainRatiosRcd.h:5
dumpMFGeometry_cfg.prod
prod
Definition:
dumpMFGeometry_cfg.py:24
EcalCATIAGainRatiosESProducer
Definition:
EcalCATIAGainRatiosESProducer.cc:17
EcalCATIAGainRatiosESProducer::catiaGainRatio_
double catiaGainRatio_
Definition:
EcalCATIAGainRatiosESProducer.cc:26
EcalCATIAGainRatiosESProducer::ReturnType
std::unique_ptr< EcalCATIAGainRatios > ReturnType
Definition:
EcalCATIAGainRatiosESProducer.cc:21
edm::ParameterSet
Definition:
ParameterSet.h:47
AlCaHLTBitMon_ParallelJobs.p
def p
Definition:
AlCaHLTBitMon_ParallelJobs.py:153
EcalCATIAGainRatios.h
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
kEBChannels
const int kEBChannels
Definition:
EcalCATIAGainRatiosESProducer.cc:15
ModuleFactory.h
heppy_batch.val
val
Definition:
heppy_batch.py:351
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition:
DetId.h:57
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition:
ModuleFactory.h:60
EcalCATIAGainRatiosESProducer::produce
ReturnType produce(const EcalCATIAGainRatiosRcd &iRecord)
Definition:
EcalCATIAGainRatiosESProducer.cc:37
EcalCATIAGainRatiosESProducer::EcalCATIAGainRatiosESProducer
EcalCATIAGainRatiosESProducer(const edm::ParameterSet &p)
Definition:
EcalCATIAGainRatiosESProducer.cc:31
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