Geometry
HcalCommonData
plugins
HcalDDDRecConstantsESMoudle.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
//
3
// Package: HcalDDDRecConstantsESModule
4
// Class: HcalDDDRecConstantsESModule
5
//
13
//
14
// Original Author: Sunanda Banerjee
15
// Created: Tue Dec 24 16:40:29 PDT 2013
16
// $Id: HcalDDDRecConstantsESModule.cc,v 1.0 2013/12/24 12:47:41 sunanda Exp $
17
//
18
//
19
20
// system include files
21
#include <memory>
22
23
// user include files
24
#include <
FWCore/Framework/interface/ModuleFactory.h
>
25
#include <
FWCore/Framework/interface/ESProducer.h
>
26
#include <
FWCore/MessageLogger/interface/MessageLogger.h
>
27
28
#include <
CondFormats/GeometryObjects/interface/HcalParameters.h
>
29
#include <
Geometry/HcalCommonData/interface/HcalDDDSimConstants.h
>
30
#include <
Geometry/HcalCommonData/interface/HcalDDDRecConstants.h
>
31
#include <
Geometry/Records/interface/HcalRecNumberingRecord.h
>
32
33
//#define EDM_ML_DEBUG
34
35
class
HcalDDDRecConstantsESModule
:
public
edm::ESProducer
{
36
public
:
37
HcalDDDRecConstantsESModule
(
const
edm::ParameterSet
&);
38
~HcalDDDRecConstantsESModule
()
override
;
39
40
using
ReturnType
= std::unique_ptr<HcalDDDRecConstants>;
41
42
static
void
fillDescriptions
(
edm::ConfigurationDescriptions
&);
43
44
ReturnType
produce
(
const
HcalRecNumberingRecord
&);
45
46
private
:
47
edm::ESGetToken<HcalParameters, HcalParametersRcd>
parToken_
;
48
edm::ESGetToken<HcalDDDSimConstants, HcalSimNumberingRecord>
hdcToken_
;
49
};
50
51
HcalDDDRecConstantsESModule::HcalDDDRecConstantsESModule
(
const
edm::ParameterSet
& iConfig) {
52
#ifdef EDM_ML_DEBUG
53
edm::LogVerbatim
(
"HcalGeom"
) <<
"constructing HcalDDDRecConstantsESModule"
;
54
#endif
55
auto
cc
=
setWhatProduced
(
this
);
56
parToken_
=
cc
.consumesFrom<
HcalParameters
,
HcalParametersRcd
>(
edm::ESInputTag
{});
57
hdcToken_
=
cc
.consumesFrom<
HcalDDDSimConstants
,
HcalSimNumberingRecord
>(
edm::ESInputTag
{});
58
}
59
60
HcalDDDRecConstantsESModule::~HcalDDDRecConstantsESModule
() {}
61
62
void
HcalDDDRecConstantsESModule::fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions) {
63
edm::ParameterSetDescription
desc;
64
descriptions.
add
(
"hcalDDDRecConstants"
, desc);
65
}
66
67
// ------------ method called to produce the data ------------
68
HcalDDDRecConstantsESModule::ReturnType
HcalDDDRecConstantsESModule::produce
(
const
HcalRecNumberingRecord
& iRecord) {
69
#ifdef EDM_ML_DEBUG
70
edm::LogVerbatim
(
"HcalGeom"
) <<
"in HcalDDDRecConstantsESModule::produce"
;
71
#endif
72
const
auto
& par = iRecord.
get
(
parToken_
);
73
const
auto
& hdc = iRecord.
get
(
hdcToken_
);
74
75
return
std::make_unique<HcalDDDRecConstants>(&par, hdc);
76
}
77
78
//define this as a plug-in
79
DEFINE_FWK_EVENTSETUP_MODULE
(
HcalDDDRecConstantsESModule
);
edm::ESInputTag
Definition:
ESInputTag.h:87
MessageLogger.h
HcalDDDRecConstantsESModule::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &)
Definition:
HcalDDDRecConstantsESMoudle.cc:62
HcalDDDRecConstantsESModule::parToken_
edm::ESGetToken< HcalParameters, HcalParametersRcd > parToken_
Definition:
HcalDDDRecConstantsESMoudle.cc:47
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition:
ESProducer.h:138
HcalDDDRecConstantsESModule::hdcToken_
edm::ESGetToken< HcalDDDSimConstants, HcalSimNumberingRecord > hdcToken_
Definition:
HcalDDDRecConstantsESMoudle.cc:48
edm::ParameterSetDescription
Definition:
ParameterSetDescription.h:52
ESProducer.h
HcalParameters.h
HcalRecNumberingRecord.h
HcalParametersRcd
Definition:
HcalParametersRcd.h:8
HcalDDDSimConstants
Definition:
HcalDDDSimConstants.h:24
HcalDDDRecConstantsESModule::produce
ReturnType produce(const HcalRecNumberingRecord &)
Definition:
HcalDDDRecConstantsESMoudle.cc:68
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition:
ConfigurationDescriptions.cc:57
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition:
DependentRecordImplementation.h:112
HcalDDDRecConstantsESModule
Definition:
HcalDDDRecConstantsESMoudle.cc:35
HcalRecNumberingRecord
Definition:
HcalRecNumberingRecord.h:23
edm::ConfigurationDescriptions
Definition:
ConfigurationDescriptions.h:28
HcalDDDRecConstantsESModule::HcalDDDRecConstantsESModule
HcalDDDRecConstantsESModule(const edm::ParameterSet &)
Definition:
HcalDDDRecConstantsESMoudle.cc:51
edm::ParameterSet
Definition:
ParameterSet.h:36
HcalDDDRecConstantsESModule::ReturnType
std::unique_ptr< HcalDDDRecConstants > ReturnType
Definition:
HcalDDDRecConstantsESMoudle.cc:40
edm::LogVerbatim
Definition:
MessageLogger.h:297
HcalDDDRecConstantsESModule::~HcalDDDRecConstantsESModule
~HcalDDDRecConstantsESModule() override
Definition:
HcalDDDRecConstantsESMoudle.cc:60
cc
edm::ESGetToken< HcalParameters, HcalParametersRcd >
ModuleFactory.h
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition:
ModuleFactory.h:60
HcalParameters
Definition:
HcalParameters.h:6
HcalDDDRecConstants.h
edm::ESProducer
Definition:
ESProducer.h:101
HcalSimNumberingRecord
Definition:
HcalSimNumberingRecord.h:25
HcalDDDSimConstants.h
Generated for CMSSW Reference Manual by
1.8.16