RecoMTD
DetLayers
plugins
MTDDetLayerGeometryESProducer.cc
Go to the documentation of this file.
1
9
#include "
FWCore/Framework/interface/ESProducer.h
"
10
#include "
FWCore/Framework/interface/ModuleFactory.h
"
11
#include "
FWCore/Framework/interface/EventSetup.h
"
12
#include "
FWCore/Framework/interface/ESHandle.h
"
13
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
14
15
#include "
RecoMTD/Records/interface/MTDRecoGeometryRecord.h
"
16
#include "
Geometry/Records/interface/MTDDigiGeometryRecord.h
"
17
#include "
Geometry/MTDGeometryBuilder/interface/MTDGeometry.h
"
18
19
#include "
ETLDetLayerGeometryBuilder.h
"
20
#include "
BTLDetLayerGeometryBuilder.h
"
21
#include "
RecoMTD/DetLayers/interface/MTDDetLayerGeometry.h
"
22
23
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
24
25
#include <memory>
26
#include <iostream>
27
28
class
MTDDetLayerGeometryESProducer
:
public
edm::ESProducer
{
29
public
:
31
MTDDetLayerGeometryESProducer
(
const
edm::ParameterSet
&
p
);
32
34
std::unique_ptr<MTDDetLayerGeometry>
produce
(
const
MTDRecoGeometryRecord
&
record
);
35
36
static
void
fillDescriptions
(
edm::ConfigurationDescriptions
&);
37
38
private
:
39
edm::ESGetToken<MTDGeometry, MTDDigiGeometryRecord>
geomToken_
;
40
};
41
42
using namespace
edm
;
43
44
MTDDetLayerGeometryESProducer::MTDDetLayerGeometryESProducer
(
const
edm::ParameterSet
&
p
) {
45
setWhatProduced(
this
).setConsumes(geomToken_);
46
}
47
48
std::unique_ptr<MTDDetLayerGeometry>
MTDDetLayerGeometryESProducer::produce
(
const
MTDRecoGeometryRecord
&
record
) {
49
auto
mtdDetLayerGeometry
= std::make_unique<MTDDetLayerGeometry>();
50
51
if
(
auto
mtd
=
record
.getHandle(geomToken_)) {
52
// Build BTL layers
53
mtdDetLayerGeometry
->addBTLLayers(
BTLDetLayerGeometryBuilder::buildLayers
(*
mtd
));
54
// Build ETL layers
55
mtdDetLayerGeometry
->addETLLayers(
ETLDetLayerGeometryBuilder::buildLayers
(*
mtd
));
56
}
else
{
57
const
std::string
metname
=
"MTD|RecoMTD|RecoMTDDetLayers|MTDDetLayerGeometryESProducer"
;
58
LogInfo
(
metname
) <<
"No MTD geometry is available."
;
59
}
60
61
// Sort layers properly
62
mtdDetLayerGeometry
->sortLayers();
63
64
return
mtdDetLayerGeometry
;
65
}
66
67
void
MTDDetLayerGeometryESProducer::fillDescriptions
(
edm::ConfigurationDescriptions
& desc) {
68
edm::ParameterSetDescription
ps;
69
desc.
addDefault
(ps);
70
}
71
72
DEFINE_FWK_EVENTSETUP_MODULE
(
MTDDetLayerGeometryESProducer
);
MessageLogger.h
ESHandle.h
edm
HLT enums.
Definition:
AlignableModifier.h:19
AlCaHLTBitMon_ParallelJobs.p
p
Definition:
AlCaHLTBitMon_ParallelJobs.py:153
MTDDetLayerGeometryESProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &)
Definition:
MTDDetLayerGeometryESProducer.cc:67
edm::LogInfo
Definition:
MessageLogger.h:254
MTDGeometry.h
edm::ParameterSetDescription
Definition:
ParameterSetDescription.h:52
ESProducer.h
GlobalPosition_Frontier_DevDB_cff.record
record
Definition:
GlobalPosition_Frontier_DevDB_cff.py:10
MTDDigiGeometryRecord.h
BTLDetLayerGeometryBuilder::buildLayers
static std::vector< DetLayer * > buildLayers(const MTDGeometry &geo)
Operations.
Definition:
BTLDetLayerGeometryBuilder.cc:21
ETLDetLayerGeometryBuilder.h
MTDDetLayerGeometryESProducer
Definition:
MTDDetLayerGeometryESProducer.cc:28
edm::ConfigurationDescriptions
Definition:
ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
MTDDetLayerGeometryESProducer::MTDDetLayerGeometryESProducer
MTDDetLayerGeometryESProducer(const edm::ParameterSet &p)
Constructor.
Definition:
MTDDetLayerGeometryESProducer.cc:44
edm::ParameterSet
Definition:
ParameterSet.h:36
MTDDetLayerGeometryESProducer::produce
std::unique_ptr< MTDDetLayerGeometry > produce(const MTDRecoGeometryRecord &record)
Produce MuonDeLayerGeometry.
Definition:
MTDDetLayerGeometryESProducer.cc:48
MTDDetLayerGeometryESProducer::geomToken_
edm::ESGetToken< MTDGeometry, MTDDigiGeometryRecord > geomToken_
Definition:
MTDDetLayerGeometryESProducer.cc:39
MTDRecoGeometryRecord.h
edm::ESGetToken< MTDGeometry, MTDDigiGeometryRecord >
MTDRecoGeometryRecord
Definition:
MTDRecoGeometryRecord.h:17
ETLDetLayerGeometryBuilder::buildLayers
static std::pair< std::vector< DetLayer * >, std::vector< DetLayer * > > buildLayers(const MTDGeometry &geo)
Definition:
ETLDetLayerGeometryBuilder.cc:17
ModuleFactory.h
MTDDetLayerGeometry.h
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition:
ModuleFactory.h:60
mtdDetLayerGeometry_cfi.mtdDetLayerGeometry
mtdDetLayerGeometry
Definition:
mtdDetLayerGeometry_cfi.py:3
BTLDetLayerGeometryBuilder.h
EventSetup.h
edm::ESProducer
Definition:
ESProducer.h:101
ParameterSet.h
mtd_digitizer
Definition:
MTDDigitizer.h:35
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition:
ConfigurationDescriptions.cc:99
metname
const std::string metname
Definition:
MuonSeedOrcaPatternRecognition.cc:43
Generated for CMSSW Reference Manual by
1.8.16