Main Page
Namespaces
Classes
Package Documentation
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
19
// system include files
20
#include <memory>
21
22
// user include files
23
#include <
FWCore/Framework/interface/ModuleFactory.h
>
24
#include "
FWCore/Framework/interface/ESProducer.h
"
25
26
#include "
FWCore/Framework/interface/ESHandle.h
"
27
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
28
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
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
44
public
:
45
HGCalTopologyBuilder
(
const
edm::ParameterSet
& iP );
46
~HGCalTopologyBuilder
()
override
;
47
48
using
ReturnType
= std::unique_ptr<HGCalTopology>;
49
50
ReturnType
produce
(
const
IdealGeometryRecord
&);
51
52
private
:
53
// ----------member data ---------------------------
54
std::string
name_
;
55
int
det_
;
56
};
57
58
59
HGCalTopologyBuilder::HGCalTopologyBuilder
(
const
edm::ParameterSet
& iConfig) {
60
61
name_
= iConfig.
getParameter
<
std::string
>(
"Name"
);
62
det_
= iConfig.
getParameter
<
int
>(
"Type"
);
63
#ifdef EDM_ML_DEBUG
64
edm::LogVerbatim
(
"HGCalGeom"
) <<
"constructing HGCalTopology for "
<<
name_
65
<<
" and det "
<<
det_
;
66
#endif
67
setWhatProduced
(
this
,
name_
);
68
}
69
70
71
HGCalTopologyBuilder::~HGCalTopologyBuilder
() { }
72
73
//
74
// member functions
75
//
76
77
// ------------ method called to produce the data ------------
78
HGCalTopologyBuilder::ReturnType
79
HGCalTopologyBuilder::produce
(
const
IdealGeometryRecord
& iRecord ) {
80
81
edm::ESHandle<HGCalDDDConstants>
pHGDC;
82
iRecord.
get
(
name_
, pHGDC);
83
const
HGCalDDDConstants
& hgdc = (*pHGDC);
84
85
#ifdef EDM_ML_DEBUG
86
edm::LogVerbatim
(
"HGCalGeom"
) <<
"Create HGCalTopology(hgdc,det)"
;
87
#endif
88
return
std::make_unique<HGCalTopology>(hgdc,
det_
);
89
}
90
91
DEFINE_FWK_EVENTSETUP_MODULE
(
HGCalTopologyBuilder
);
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition:
ESProducer.h:116
HGCalTopologyBuilder::ReturnType
std::unique_ptr< HGCalTopology > ReturnType
Definition:
HGCalTopologyBuilder.cc:48
HGCalTopologyBuilder::produce
ReturnType produce(const IdealGeometryRecord &)
Definition:
HGCalTopologyBuilder.cc:79
MessageLogger.h
HGCalTopologyBuilder::det_
int det_
Definition:
HGCalTopologyBuilder.cc:55
HGCalTopologyBuilder::~HGCalTopologyBuilder
~HGCalTopologyBuilder() override
Definition:
HGCalTopologyBuilder.cc:71
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
ForwardSubdetector.h
edm::ESProducer
Definition:
ESProducer.h:98
ParameterSet.h
HGCalDDDConstants
Definition:
HGCalDDDConstants.h:24
edm::ESHandle
Definition:
DTSurvey.h:22
ESHandle.h
edm::LogVerbatim
Definition:
MessageLogger.h:271
IdealGeometryRecord
Definition:
IdealGeometryRecord.h:27
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition:
ModuleFactory.h:60
ESProducer.h
HGCalTopologyBuilder::name_
std::string name_
Definition:
HGCalTopologyBuilder.cc:54
IdealGeometryRecord.h
HGCalTopologyBuilder::HGCalTopologyBuilder
HGCalTopologyBuilder(const edm::ParameterSet &iP)
Definition:
HGCalTopologyBuilder.cc:59
HGCalTopologyBuilder
Definition:
HGCalTopologyBuilder.cc:42
HGCalDDDConstants.h
HGCalTopology.h
edm::ParameterSet
Definition:
ParameterSet.h:36
ModuleFactory.h
CaloSubdetectorTopology.h
edm::eventsetup::EventSetupRecord::get
bool get(HolderT &iHolder) const
Definition:
EventSetupRecord.h:109
Generated for CMSSW Reference Manual by
1.8.11