Geometry
CaloEventSetup
plugins
FastTimeTopologyBuilder.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
//
3
// Package: CaloEventSetup
4
// Class: FastTimeTopologyBuilder
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/ParameterSet/interface/ParameterSet.h
"
26
#include "
FWCore/Utilities/interface/ESGetToken.h
"
27
#include "
Geometry/CaloTopology/interface/FastTimeTopology.h
"
28
#include "
Geometry/CaloTopology/interface/CaloSubdetectorTopology.h
"
29
#include "
Geometry/HGCalCommonData/interface/FastTimeDDDConstants.h
"
30
#include "
Geometry/Records/interface/IdealGeometryRecord.h
"
31
#include "
Geometry/CaloTopology/interface/CaloSubdetectorTopology.h
"
32
#include "
DataFormats/ForwardDetId/interface/ForwardSubdetector.h
"
33
34
//#define EDM_ML_DEBUG
35
36
//
37
// class decleration
38
//
39
40
class
FastTimeTopologyBuilder
:
public
edm::ESProducer
{
41
public
:
42
FastTimeTopologyBuilder
(
const
edm::ParameterSet
& iP);
43
~FastTimeTopologyBuilder
()
override
;
44
45
using
ReturnType
= std::unique_ptr<FastTimeTopology>;
46
47
ReturnType
produce
(
const
IdealGeometryRecord
&);
48
49
private
:
50
// ----------member data ---------------------------
51
edm::ESGetToken<FastTimeDDDConstants, IdealGeometryRecord>
ftlToken_
;
52
int
type_
;
53
ForwardSubdetector
subdet_
;
54
};
55
56
FastTimeTopologyBuilder::FastTimeTopologyBuilder
(
const
edm::ParameterSet
& iConfig) {
57
auto
name
= iConfig.
getUntrackedParameter
<
std::string
>(
"Name"
);
58
type_
= iConfig.
getUntrackedParameter
<
int
>(
"Type"
);
59
subdet_
=
FastTime
;
60
#ifdef EDM_ML_DEBUG
61
std::cout
<<
"constructing FastTimeTopology for "
<<
name
<<
" Type "
<<
type_
<< std::endl;
62
#endif
63
ftlToken_
=
setWhatProduced
(
this
,
name
).consumes<
FastTimeDDDConstants
>(
edm::ESInputTag
{
""
,
name
});
64
}
65
66
FastTimeTopologyBuilder::~FastTimeTopologyBuilder
() {}
67
68
//
69
// member functions
70
//
71
72
// ------------ method called to produce the data ------------
73
FastTimeTopologyBuilder::ReturnType
FastTimeTopologyBuilder::produce
(
const
IdealGeometryRecord
& iRecord) {
74
const
FastTimeDDDConstants
& hgdc = iRecord.
get
(
ftlToken_
);
75
76
#ifdef EDM_ML_DEBUG
77
std::cout
<<
"Create FastTimeTopology(hgdc,subdet,type)"
<< std::endl;
78
#endif
79
return
std::make_unique<FastTimeTopology>(hgdc,
subdet_
,
type_
);
80
}
81
82
DEFINE_FWK_EVENTSETUP_MODULE
(
FastTimeTopologyBuilder
);
FastTimeTopology.h
edm::ESInputTag
Definition:
ESInputTag.h:87
FastTimeTopologyBuilder::FastTimeTopologyBuilder
FastTimeTopologyBuilder(const edm::ParameterSet &iP)
Definition:
FastTimeTopologyBuilder.cc:56
FastTimeTopologyBuilder
Definition:
FastTimeTopologyBuilder.cc:40
ForwardSubdetector
ForwardSubdetector
Definition:
ForwardSubdetector.h:4
gather_cfg.cout
cout
Definition:
gather_cfg.py:144
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
FastTimeTopologyBuilder::ftlToken_
edm::ESGetToken< FastTimeDDDConstants, IdealGeometryRecord > ftlToken_
Definition:
FastTimeTopologyBuilder.cc:51
FastTimeDDDConstants
Definition:
FastTimeDDDConstants.h:19
ESGetToken.h
ForwardSubdetector.h
FastTimeTopologyBuilder::~FastTimeTopologyBuilder
~FastTimeTopologyBuilder() override
Definition:
FastTimeTopologyBuilder.cc:66
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition:
DependentRecordImplementation.h:109
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition:
ParameterSet.h:47
FastTimeDDDConstants.h
FastTime
Definition:
ForwardSubdetector.h:6
IdealGeometryRecord.h
FastTimeTopologyBuilder::type_
int type_
Definition:
FastTimeTopologyBuilder.cc:52
edm::ESGetToken< FastTimeDDDConstants, IdealGeometryRecord >
CaloSubdetectorTopology.h
ModuleFactory.h
FastTimeTopologyBuilder::subdet_
ForwardSubdetector subdet_
Definition:
FastTimeTopologyBuilder.cc:53
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition:
ModuleFactory.h:60
FastTimeTopologyBuilder::produce
ReturnType produce(const IdealGeometryRecord &)
Definition:
FastTimeTopologyBuilder.cc:73
Skims_PA_cff.name
name
Definition:
Skims_PA_cff.py:17
edm::ESProducer
Definition:
ESProducer.h:104
ParameterSet.h
IdealGeometryRecord
Definition:
IdealGeometryRecord.h:25
FastTimeTopologyBuilder::ReturnType
std::unique_ptr< FastTimeTopology > ReturnType
Definition:
FastTimeTopologyBuilder.cc:45
Generated for CMSSW Reference Manual by
1.8.16