Main Page
Namespaces
Classes
Package Documentation
Geometry
HGCalCommonData
plugins
HGCalParametersESModule.cc
Go to the documentation of this file.
1
#include "
FWCore/Framework/interface/ModuleFactory.h
"
2
#include "
FWCore/Framework/interface/ESProducer.h
"
3
#include "
FWCore/Framework/interface/ESTransientHandle.h
"
4
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
5
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
6
#include "
Geometry/HGCalCommonData/interface/HGCalParameters.h
"
7
#include "
DetectorDescription/Core/interface/DDCompactView.h
"
8
#include "
Geometry/Records/interface/IdealGeometryRecord.h
"
9
#include "
Geometry/HGCalCommonData/interface/HGCalParametersFromDD.h
"
10
11
#include <memory>
12
13
//#define EDM_ML_DEBUG
14
15
class
HGCalParametersESModule
:
public
edm::ESProducer
{
16
public
:
17
HGCalParametersESModule
(
const
edm::ParameterSet
& );
18
~HGCalParametersESModule
(
void
)
override
;
19
20
typedef
std::shared_ptr<HGCalParameters>
ReturnType
;
21
22
ReturnType
produce
(
const
IdealGeometryRecord
&);
23
24
private
:
25
std::string
name_
,
namew_
,
namec_
,
namet_
;
26
};
27
28
HGCalParametersESModule::HGCalParametersESModule
(
const
edm::ParameterSet
& iC) {
29
30
name_
= iC.
getUntrackedParameter
<
std::string
>(
"Name"
);
31
namew_
= iC.
getUntrackedParameter
<
std::string
>(
"NameW"
);
32
namec_
= iC.
getUntrackedParameter
<
std::string
>(
"NameC"
);
33
namet_
= iC.
getUntrackedParameter
<
std::string
>(
"NameT"
);
34
edm::LogInfo
(
"HGCalGeom"
) <<
"HGCalParametersESModule for "
<<
name_
<<
":"
35
<< namew_ <<
":"
<< namec_ <<
":"
<<
namet_
;
36
#ifdef EDM_ML_DEBUG
37
std::cout
<<
"HGCalParametersESModule for "
<<
name_
<<
":"
<< namew_ <<
":"
38
<< namec_ <<
":"
<< namet_ << std::endl;
39
#endif
40
setWhatProduced
(
this
,
name_
);
41
}
42
43
HGCalParametersESModule::~HGCalParametersESModule
() {}
44
45
HGCalParametersESModule::ReturnType
46
HGCalParametersESModule::produce
(
const
IdealGeometryRecord
& iRecord) {
47
edm::LogInfo
(
"HGCalGeom"
)
48
<<
"HGCalParametersESModule::produce(const IdealGeometryRecord& iRecord)"
;
49
edm::ESTransientHandle<DDCompactView>
cpv;
50
iRecord.
get
(cpv);
51
52
HGCalParameters
* ptp =
new
HGCalParameters
(
name_
);
53
HGCalParametersFromDD
builder;
54
builder.
build
(&(*cpv), *ptp,
name_
,
namew_
,
namec_
,
namet_
);
55
56
return
ReturnType
(ptp) ;
57
}
58
59
//define this as a plug-in
60
DEFINE_FWK_EVENTSETUP_MODULE
(
HGCalParametersESModule
);
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
MessageLogger.h
HGCalParametersFromDD::build
bool build(const DDCompactView *, HGCalParameters &, const std::string &, const std::string &, const std::string &, const std::string &)
Definition:
HGCalParametersFromDD.cc:51
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
HGCalParametersESModule::produce
ReturnType produce(const IdealGeometryRecord &)
Definition:
HGCalParametersESModule.cc:46
HGCalParametersESModule::namec_
std::string namec_
Definition:
HGCalParametersESModule.cc:25
HGCalParametersESModule::name_
std::string name_
Definition:
HGCalParametersESModule.cc:25
edm::ESProducer::setWhatProduced
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition:
ESProducer.h:115
edm::ESProducer
Definition:
ESProducer.h:97
ParameterSet.h
HGCalParametersESModule::ReturnType
std::shared_ptr< HGCalParameters > ReturnType
Definition:
HGCalParametersESModule.cc:20
edm::eventsetup::EventSetupRecord::get
void get(HolderT &iHolder) const
Definition:
EventSetupRecord.h:105
HGCalParametersFromDD
Definition:
HGCalParametersFromDD.h:11
HGCalParameters
Definition:
HGCalParameters.h:14
HGCalParameters.h
edm::LogInfo
Definition:
MessageLogger.h:238
IdealGeometryRecord
Definition:
IdealGeometryRecord.h:27
HGCalParametersFromDD.h
HGCalParametersESModule::~HGCalParametersESModule
~HGCalParametersESModule(void) override
Definition:
HGCalParametersESModule.cc:43
HGCalParametersESModule
Definition:
HGCalParametersESModule.cc:15
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition:
ModuleFactory.h:60
ESProducer.h
IdealGeometryRecord.h
HGCalParametersESModule::namew_
std::string namew_
Definition:
HGCalParametersESModule.cc:25
HGCalParametersESModule::HGCalParametersESModule
HGCalParametersESModule(const edm::ParameterSet &)
Definition:
HGCalParametersESModule.cc:28
ESTransientHandle.h
edm::ParameterSet
Definition:
ParameterSet.h:36
ModuleFactory.h
edm::ESTransientHandle
Definition:
ESTransientHandle.h:41
gather_cfg.cout
cout
Definition:
gather_cfg.py:144
DDCompactView.h
HGCalParametersESModule::namet_
std::string namet_
Definition:
HGCalParametersESModule.cc:25
Generated for CMSSW Reference Manual by
1.8.11