Geometry
HGCalCommonData
plugins
HGCalNumberingInitialization.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
//
3
// Package: HGCalNumberingInitialization
4
// Class: HGCalNumberingInitialization
5
//
14
//
15
// Original Author: Sunanda Banerjee
16
// Created: Tue Mar 21 16:40:29 PDT 2013
17
//
18
19
// user include files
20
#include "
FWCore/Framework/interface/ESProducer.h
"
21
#include "
FWCore/Framework/interface/ModuleFactory.h
"
22
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
23
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
24
25
#include "
Geometry/HGCalCommonData/interface/HGCalDDDConstants.h
"
26
#include "
Geometry/HGCalCommonData/interface/HGCalParameters.h
"
27
#include "
Geometry/Records/interface/IdealGeometryRecord.h
"
28
29
//#define EDM_ML_DEBUG
30
31
class
HGCalNumberingInitialization
:
public
edm::ESProducer
{
32
public
:
33
HGCalNumberingInitialization
(
const
edm::ParameterSet
&);
34
~HGCalNumberingInitialization
()
override
;
35
36
typedef
std::unique_ptr<HGCalDDDConstants>
ReturnType
;
37
38
ReturnType
produce
(
const
IdealGeometryRecord
&);
39
40
private
:
41
edm::ESGetToken<HGCalParameters, IdealGeometryRecord>
hgParToken_
;
42
std::string
name_
;
43
};
44
45
HGCalNumberingInitialization::HGCalNumberingInitialization
(
const
edm::ParameterSet
& iConfig) {
46
name_
= iConfig.
getUntrackedParameter
<
std::string
>(
"Name"
);
47
#ifdef EDM_ML_DEBUG
48
edm::LogVerbatim
(
"HGCalGeom"
) <<
"HGCalNumberingInitialization for "
<<
name_
;
49
#endif
50
auto
cc
=
setWhatProduced
(
this
,
name_
);
51
hgParToken_
=
cc
.consumes<
HGCalParameters
>(
edm::ESInputTag
{
""
,
name_
});
52
}
53
54
HGCalNumberingInitialization::~HGCalNumberingInitialization
() {}
55
56
// ------------ method called to produce the data ------------
57
HGCalNumberingInitialization::ReturnType
HGCalNumberingInitialization::produce
(
const
IdealGeometryRecord
& iRecord) {
58
edm::LogVerbatim
(
"HGCalGeom"
) <<
"in HGCalNumberingInitialization::produce for "
<<
name_
;
59
const
auto
& pHGpar = iRecord.
get
(
hgParToken_
);
60
return
std::make_unique<HGCalDDDConstants>(&pHGpar,
name_
);
61
}
62
63
// define this as a plug-in
64
DEFINE_FWK_EVENTSETUP_MODULE
(
HGCalNumberingInitialization
);
HGCalNumberingInitialization::name_
std::string name_
Definition:
HGCalNumberingInitialization.cc:42
edm::ESInputTag
Definition:
ESInputTag.h:87
MessageLogger.h
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition:
ESProducer.h:163
ESProducer.h
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
HGCalNumberingInitialization::produce
ReturnType produce(const IdealGeometryRecord &)
Definition:
HGCalNumberingInitialization.cc:57
HGCalNumberingInitialization::HGCalNumberingInitialization
HGCalNumberingInitialization(const edm::ParameterSet &)
Definition:
HGCalNumberingInitialization.cc:45
HGCalNumberingInitialization::hgParToken_
edm::ESGetToken< HGCalParameters, IdealGeometryRecord > hgParToken_
Definition:
HGCalNumberingInitialization.cc:41
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition:
DependentRecordImplementation.h:109
edm::ParameterSet
Definition:
ParameterSet.h:47
IdealGeometryRecord.h
cc
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ESGetToken< HGCalParameters, IdealGeometryRecord >
HGCalParameters
Definition:
HGCalParameters.h:14
HGCalNumberingInitialization::ReturnType
std::unique_ptr< HGCalDDDConstants > ReturnType
Definition:
HGCalNumberingInitialization.cc:36
ModuleFactory.h
HGCalNumberingInitialization::~HGCalNumberingInitialization
~HGCalNumberingInitialization() override
Definition:
HGCalNumberingInitialization.cc:54
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
HGCalNumberingInitialization
Definition:
HGCalNumberingInitialization.cc:31
edm::ESProducer
Definition:
ESProducer.h:104
HGCalDDDConstants.h
ParameterSet.h
HGCalParameters.h
IdealGeometryRecord
Definition:
IdealGeometryRecord.h:25
Generated for CMSSW Reference Manual by
1.8.16