CMS 3D CMS Logo

MTDDetLayerGeometryESProducer.cc
Go to the documentation of this file.
1 
14 
20 
24 
26 
27 #include <memory>
28 #include <iostream>
29 
31 public:
34 
36  std::unique_ptr<MTDDetLayerGeometry> produce(const MTDRecoGeometryRecord& record);
37 
39 
40 private:
43 };
44 
45 using namespace edm;
46 
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
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 
77  desc.addDefault(ps);
78 }
79 
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