TrackingTools
RecoGeometry
plugins
GlobalDetLayerGeometryESProducer.cc
Go to the documentation of this file.
1
#include "
TrackingTools/RecoGeometry/plugins/GlobalDetLayerGeometryESProducer.h
"
2
3
#include "
FWCore/Framework/interface/EventSetup.h
"
4
#include "
FWCore/Framework/interface/ESHandle.h
"
5
#include "
FWCore/Framework/interface/ModuleFactory.h
"
6
#include "
FWCore/Framework/interface/ESProducer.h
"
7
8
#include <memory>
9
#include <string>
10
11
using namespace
edm
;
12
13
GlobalDetLayerGeometryESProducer::GlobalDetLayerGeometryESProducer
(
const
edm::ParameterSet
&
p
) {
14
std::string
myName =
p
.getParameter<
std::string
>(
"ComponentName"
);
15
setWhatProduced(
this
, myName).setConsumes(trackerToken_).setConsumes(muonToken_).setConsumes(mtdToken_);
16
}
17
18
GlobalDetLayerGeometryESProducer::~GlobalDetLayerGeometryESProducer
() {}
19
20
std::unique_ptr<DetLayerGeometry>
GlobalDetLayerGeometryESProducer::produce
(
const
RecoGeometryRecord
& iRecord) {
21
auto
const
&
tracker
= iRecord.
get
(trackerToken_);
22
auto
const
&
muon
= iRecord.
get
(muonToken_);
23
edm::ESHandle<MTDDetLayerGeometry>
mtd
;
24
25
// get the MTD if it is available
26
if
(
auto
mtdRecord = iRecord.
tryToGetRecord
<
MTDRecoGeometryRecord
>()) {
27
mtd
= mtdRecord->getHandle(mtdToken_);
28
if
(!
mtd
.isValid()) {
29
LogInfo
(
"GlobalDetLayergGeometryBuilder"
) <<
"No MTD geometry is available."
;
30
}
31
}
else
{
32
LogInfo
(
"GlobalDetLayerGeometryBuilder"
) <<
"No MTDDigiGeometryRecord is available."
;
33
}
34
35
// if we've got MTD initialize it
36
if
(
mtd
.isValid())
37
return
std::make_unique<GlobalDetLayerGeometry>(&
tracker
, &
muon
,
mtd
.product());
38
39
return
std::make_unique<GlobalDetLayerGeometry>(&
tracker
, &
muon
);
40
}
41
42
DEFINE_FWK_EVENTSETUP_MODULE
(
GlobalDetLayerGeometryESProducer
);
ESHandle.h
muon
Definition:
MuonCocktails.h:17
edm
HLT enums.
Definition:
AlignableModifier.h:19
AlCaHLTBitMon_ParallelJobs.p
p
Definition:
AlCaHLTBitMon_ParallelJobs.py:153
edm::LogInfo
Definition:
MessageLogger.h:254
ESProducer.h
edm::ESHandle< MTDDetLayerGeometry >
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition:
DependentRecordImplementation.h:112
GlobalDetLayerGeometryESProducer
Definition:
GlobalDetLayerGeometryESProducer.h:10
GlobalDetLayerGeometryESProducer::GlobalDetLayerGeometryESProducer
GlobalDetLayerGeometryESProducer(const edm::ParameterSet &p)
Definition:
GlobalDetLayerGeometryESProducer.cc:13
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
PbPb_ZMuSkimMuonDPG_cff.tracker
tracker
Definition:
PbPb_ZMuSkimMuonDPG_cff.py:60
GlobalDetLayerGeometryESProducer::produce
std::unique_ptr< DetLayerGeometry > produce(const RecoGeometryRecord &)
Definition:
GlobalDetLayerGeometryESProducer.cc:20
edm::ParameterSet
Definition:
ParameterSet.h:36
GlobalDetLayerGeometryESProducer::~GlobalDetLayerGeometryESProducer
~GlobalDetLayerGeometryESProducer() override
Definition:
GlobalDetLayerGeometryESProducer.cc:18
GlobalDetLayerGeometryESProducer.h
RecoGeometryRecord
Definition:
RecoGeometryRecord.h:15
MTDRecoGeometryRecord
Definition:
MTDRecoGeometryRecord.h:17
ModuleFactory.h
edm::eventsetup::DependentRecordImplementation::tryToGetRecord
std::optional< DepRecordT > tryToGetRecord() const
Definition:
DependentRecordImplementation.h:71
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition:
ModuleFactory.h:60
EventSetup.h
mtd_digitizer
Definition:
MTDDigitizer.h:35
Generated for CMSSW Reference Manual by
1.8.16