Geometry
CaloEventSetup
plugins
HGCalTopologyBuilder.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
//
3
// Package: CaloEventSetup
4
// Class: HGCalTopologyBuilder
5
//
13
//
14
// Original Author: Sunanda Banerjee
15
//
16
//
17
18
// system include files
19
#include <memory>
20
21
// user include files
22
#include <
FWCore/Framework/interface/ModuleFactory.h
>
23
#include "
FWCore/Framework/interface/ESProducer.h
"
24
25
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
26
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
27
#include "
FWCore/Utilities/interface/ESGetToken.h
"
28
29
#include "
Geometry/CaloTopology/interface/HGCalTopology.h
"
30
#include "
Geometry/CaloTopology/interface/CaloSubdetectorTopology.h
"
31
#include "
Geometry/HGCalCommonData/interface/HGCalDDDConstants.h
"
32
#include "
Geometry/Records/interface/IdealGeometryRecord.h
"
33
#include "
Geometry/CaloTopology/interface/CaloSubdetectorTopology.h
"
34
#include "
DataFormats/ForwardDetId/interface/ForwardSubdetector.h
"
35
36
//#define EDM_ML_DEBUG
37
38
//
39
// class decleration
40
//
41
42
class
HGCalTopologyBuilder
:
public
edm::ESProducer
{
43
public
:
44
HGCalTopologyBuilder
(
const
edm::ParameterSet
& iP);
45
~HGCalTopologyBuilder
()
override
;
46
47
using
ReturnType
= std::unique_ptr<HGCalTopology>;
48
49
ReturnType
produce
(
const
IdealGeometryRecord
&);
50
51
private
:
52
// ----------member data ---------------------------
53
edm::ESGetToken<HGCalDDDConstants, IdealGeometryRecord>
hgcToken_
;
54
int
det_
;
55
};
56
57
HGCalTopologyBuilder::HGCalTopologyBuilder
(
const
edm::ParameterSet
& iConfig) {
58
auto
name
= iConfig.
getParameter
<
std::string
>(
"Name"
);
59
det_
= iConfig.
getParameter
<
int
>(
"Type"
);
60
#ifdef EDM_ML_DEBUG
61
edm::LogVerbatim
(
"HGCalGeom"
) <<
"constructing HGCalTopology for "
<<
name
<<
" and det "
<<
det_
;
62
#endif
63
hgcToken_
=
setWhatProduced
(
this
,
name
).consumes<
HGCalDDDConstants
>(
edm::ESInputTag
{
""
,
name
});
64
}
65
66
HGCalTopologyBuilder::~HGCalTopologyBuilder
() {}
67
68
//
69
// member functions
70
//
71
72
// ------------ method called to produce the data ------------
73
HGCalTopologyBuilder::ReturnType
HGCalTopologyBuilder::produce
(
const
IdealGeometryRecord
& iRecord) {
74
const
HGCalDDDConstants
& hgdc = iRecord.
get
(
hgcToken_
);
75
76
#ifdef EDM_ML_DEBUG
77
edm::LogVerbatim
(
"HGCalGeom"
) <<
"Create HGCalTopology(hgdc,det)"
;
78
#endif
79
return
std::make_unique<HGCalTopology>(hgdc,
det_
);
80
}
81
82
DEFINE_FWK_EVENTSETUP_MODULE
(
HGCalTopologyBuilder
);
HGCalTopologyBuilder::hgcToken_
edm::ESGetToken< HGCalDDDConstants, IdealGeometryRecord > hgcToken_
Definition:
HGCalTopologyBuilder.cc:53
HGCalTopologyBuilder::ReturnType
std::unique_ptr< HGCalTopology > ReturnType
Definition:
HGCalTopologyBuilder.cc:47
edm::ESInputTag
Definition:
ESInputTag.h:87
MessageLogger.h
HGCalTopologyBuilder::produce
ReturnType produce(const IdealGeometryRecord &)
Definition:
HGCalTopologyBuilder.cc:73
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition:
ESProducer.h:138
ESProducer.h
ESGetToken.h
HGCalTopologyBuilder
Definition:
HGCalTopologyBuilder.cc:42
HGCalDDDConstants
Definition:
HGCalDDDConstants.h:25
ForwardSubdetector.h
HGCalTopologyBuilder::~HGCalTopologyBuilder
~HGCalTopologyBuilder() override
Definition:
HGCalTopologyBuilder.cc:66
HGCalTopology.h
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition:
DependentRecordImplementation.h:112
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition:
ParameterSet.h:36
edm::LogVerbatim
Definition:
MessageLogger.h:297
HGCalTopologyBuilder::HGCalTopologyBuilder
HGCalTopologyBuilder(const edm::ParameterSet &iP)
Definition:
HGCalTopologyBuilder.cc:57
IdealGeometryRecord.h
edm::ESGetToken< HGCalDDDConstants, IdealGeometryRecord >
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
CaloSubdetectorTopology.h
ModuleFactory.h
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition:
ModuleFactory.h:60
Skims_PA_cff.name
name
Definition:
Skims_PA_cff.py:17
HGCalTopologyBuilder::det_
int det_
Definition:
HGCalTopologyBuilder.cc:54
edm::ESProducer
Definition:
ESProducer.h:101
HGCalDDDConstants.h
ParameterSet.h
IdealGeometryRecord
Definition:
IdealGeometryRecord.h:27
Generated for CMSSW Reference Manual by
1.8.16