Geometry
HcalCommonData
plugins
CaloSimulationConstantsESModule.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
//
3
// Package: CaloSimulationConstantsESModule
4
// Class: CaloSimulationConstantsESModule
5
//
13
//
14
// Original Author: Sunanda Banerjee
15
// Created: Mon Aug 12 16:40:29 PDT 2019
16
//
17
//
18
19
#include <memory>
20
21
#include <
FWCore/Framework/interface/ModuleFactory.h
>
22
#include <
FWCore/Framework/interface/ESProducer.h
>
23
#include <
FWCore/MessageLogger/interface/MessageLogger.h
>
24
25
#include <
Geometry/HcalCommonData/interface/CaloSimulationConstants.h
>
26
#include <
Geometry/Records/interface/HcalSimNumberingRecord.h
>
27
28
//#define EDM_ML_DEBUG
29
30
class
CaloSimulationConstantsESModule
:
public
edm::ESProducer
{
31
public
:
32
CaloSimulationConstantsESModule
(
const
edm::ParameterSet
&);
33
34
using
ReturnType
= std::unique_ptr<CaloSimulationConstants>;
35
36
static
void
fillDescriptions
(
edm::ConfigurationDescriptions
&);
37
38
ReturnType
produce
(
const
HcalSimNumberingRecord
&);
39
40
private
:
41
edm::ESGetToken<CaloSimulationParameters, HcalParametersRcd>
parSimToken_
;
42
};
43
44
CaloSimulationConstantsESModule::CaloSimulationConstantsESModule
(
const
edm::ParameterSet
&) {
45
#ifdef EDM_ML_DEBUG
46
edm::LogVerbatim
(
"HcalGeom"
) <<
"constructing CaloSimulationConstantsESModule"
;
47
#endif
48
auto
cc
=
setWhatProduced
(
this
);
49
parSimToken_
=
cc
.consumesFrom<
CaloSimulationParameters
,
HcalParametersRcd
>(
edm::ESInputTag
{});
50
}
51
52
void
CaloSimulationConstantsESModule::fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions) {
53
edm::ParameterSetDescription
desc
;
54
descriptions.
add
(
"caloSimulationConstants"
,
desc
);
55
}
56
57
// ------------ method called to produce the data ------------
58
CaloSimulationConstantsESModule::ReturnType
CaloSimulationConstantsESModule::produce
(
59
const
HcalSimNumberingRecord
& iRecord) {
60
const
auto
& parSim = iRecord.
get
(
parSimToken_
);
61
return
std::make_unique<CaloSimulationConstants>(&parSim);
62
}
63
64
//define this as a plug-in
65
DEFINE_FWK_EVENTSETUP_MODULE
(
CaloSimulationConstantsESModule
);
edm::ESInputTag
Definition:
ESInputTag.h:87
CaloSimulationParameters
Definition:
CaloSimulationParameters.h:6
MessageLogger.h
HcalSimNumberingRecord.h
CaloSimulationConstantsESModule::produce
ReturnType produce(const HcalSimNumberingRecord &)
Definition:
CaloSimulationConstantsESModule.cc:58
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition:
ESProducer.h:163
edm::ParameterSetDescription
Definition:
ParameterSetDescription.h:52
ESProducer.h
HcalParametersRcd
Definition:
HcalParametersRcd.h:8
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition:
ConfigurationDescriptions.cc:57
CaloSimulationConstantsESModule::ReturnType
std::unique_ptr< CaloSimulationConstants > ReturnType
Definition:
CaloSimulationConstantsESModule.cc:34
CaloSimulationConstants.h
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition:
DependentRecordImplementation.h:103
edm::ConfigurationDescriptions
Definition:
ConfigurationDescriptions.h:28
edm::ParameterSet
Definition:
ParameterSet.h:47
CaloSimulationConstantsESModule::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &)
Definition:
CaloSimulationConstantsESModule.cc:52
cc
edm::ESGetToken< CaloSimulationParameters, HcalParametersRcd >
ModuleFactory.h
submitPVResolutionJobs.desc
string desc
Definition:
submitPVResolutionJobs.py:251
CaloSimulationConstantsESModule::CaloSimulationConstantsESModule
CaloSimulationConstantsESModule(const edm::ParameterSet &)
Definition:
CaloSimulationConstantsESModule.cc:44
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition:
ModuleFactory.h:60
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition:
MessageLogger.h:128
CaloSimulationConstantsESModule::parSimToken_
edm::ESGetToken< CaloSimulationParameters, HcalParametersRcd > parSimToken_
Definition:
CaloSimulationConstantsESModule.cc:41
edm::ESProducer
Definition:
ESProducer.h:104
CaloSimulationConstantsESModule
Definition:
CaloSimulationConstantsESModule.cc:30
HcalSimNumberingRecord
Definition:
HcalSimNumberingRecord.h:25
Generated for CMSSW Reference Manual by
1.8.16