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
#include "
Geometry/Records/interface/MTDTopologyRcd.h
"
19
#include "
Geometry/MTDNumberingBuilder/interface/MTDTopology.h
"
20
21
#include "
ETLDetLayerGeometryBuilder.h
"
22
#include "
BTLDetLayerGeometryBuilder.h
"
23
#include "
RecoMTD/DetLayers/interface/MTDDetLayerGeometry.h
"
24
25
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
26
27
#include <memory>
28
#include <iostream>
29
30
class
MTDDetLayerGeometryESProducer
:
public
edm::ESProducer
{
31
public
:
33
MTDDetLayerGeometryESProducer
(
const
edm::ParameterSet
&
p
);
34
36
std::unique_ptr<MTDDetLayerGeometry>
produce
(
const
MTDRecoGeometryRecord
&
record
);
37
38
static
void
fillDescriptions
(
edm::ConfigurationDescriptions
&);
39
40
private
:
41
edm::ESGetToken<MTDGeometry, MTDDigiGeometryRecord>
geomToken_
;
42
edm::ESGetToken<MTDTopology, MTDTopologyRcd>
mtdtopoToken_
;
43
};
44
45
using namespace
edm
;
46
47
MTDDetLayerGeometryESProducer::MTDDetLayerGeometryESProducer
(
const
edm::ParameterSet
&
p
) {
48
auto
cc
= setWhatProduced(
this
);
49
geomToken_ =
cc
.consumes();
50
mtdtopoToken_ =
cc
.consumes();
51
}
52
53
std::unique_ptr<MTDDetLayerGeometry>
MTDDetLayerGeometryESProducer::produce
(
const
MTDRecoGeometryRecord
&
record
) {
54
auto
mtdDetLayerGeometry
= std::make_unique<MTDDetLayerGeometry>();
55
56
if
(
auto
mtd
=
record
.getHandle(geomToken_)) {
57
// Build BTL layers
58
mtdDetLayerGeometry
->addBTLLayers(
BTLDetLayerGeometryBuilder::buildLayers
(*
mtd
));
59
// Build ETL layers, depends on the scenario
60
if
(
auto
mtdtopo =
record
.getHandle(mtdtopoToken_)) {
61
mtdDetLayerGeometry
->addETLLayers(
ETLDetLayerGeometryBuilder::buildLayers
(*
mtd
, mtdtopo->getMTDTopologyMode()));
62
}
else
{
63
LogWarning
(
"MTDDetLayers"
) <<
"No MTD topology is available."
;
64
}
65
}
else
{
66
LogWarning
(
"MTDDetLayers"
) <<
"No MTD geometry is available."
;
67
}
68
69
// Sort layers properly
70
mtdDetLayerGeometry
->sortLayers();
71
72
return
mtdDetLayerGeometry
;
73
}
74
75
void
MTDDetLayerGeometryESProducer::fillDescriptions
(
edm::ConfigurationDescriptions
&
desc
) {
76
edm::ParameterSetDescription
ps;
77
desc
.addDefault(ps);
78
}
79
80
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:75
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:23
ETLDetLayerGeometryBuilder::buildLayers
static std::pair< std::vector< DetLayer * >, std::vector< DetLayer * > > buildLayers(const MTDGeometry &geo, const int mtdTopologyMode)
Definition:
ETLDetLayerGeometryBuilder.cc:21
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition:
MessageLogger.h:122
cc
ETLDetLayerGeometryBuilder.h
MTDDetLayerGeometryESProducer
Definition:
MTDDetLayerGeometryESProducer.cc:30
edm::ConfigurationDescriptions
Definition:
ConfigurationDescriptions.h:28
MTDDetLayerGeometryESProducer::MTDDetLayerGeometryESProducer
MTDDetLayerGeometryESProducer(const edm::ParameterSet &p)
Constructor.
Definition:
MTDDetLayerGeometryESProducer.cc:47
edm::ParameterSet
Definition:
ParameterSet.h:47
MTDDetLayerGeometryESProducer::produce
std::unique_ptr< MTDDetLayerGeometry > produce(const MTDRecoGeometryRecord &record)
Produce MuonDeLayerGeometry.
Definition:
MTDDetLayerGeometryESProducer.cc:53
MTDDetLayerGeometryESProducer::geomToken_
edm::ESGetToken< MTDGeometry, MTDDigiGeometryRecord > geomToken_
Definition:
MTDDetLayerGeometryESProducer.cc:41
MTDRecoGeometryRecord.h
edm::ESGetToken< MTDGeometry, MTDDigiGeometryRecord >
MTDRecoGeometryRecord
Definition:
MTDRecoGeometryRecord.h:18
ModuleFactory.h
submitPVResolutionJobs.desc
string desc
Definition:
submitPVResolutionJobs.py:251
MTDDetLayerGeometry.h
MTDTopologyRcd.h
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition:
ModuleFactory.h:60
mtdDetLayerGeometry_cfi.mtdDetLayerGeometry
mtdDetLayerGeometry
Definition:
mtdDetLayerGeometry_cfi.py:6
BTLDetLayerGeometryBuilder.h
MTDDetLayerGeometryESProducer::mtdtopoToken_
edm::ESGetToken< MTDTopology, MTDTopologyRcd > mtdtopoToken_
Definition:
MTDDetLayerGeometryESProducer.cc:42
EventSetup.h
edm::ESProducer
Definition:
ESProducer.h:104
ParameterSet.h
mtd_digitizer
Definition:
MTDDigitizer.h:35
MTDTopology.h
Generated for CMSSW Reference Manual by
1.8.16