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  auto mtd = record.getHandle(geomToken_);
56  auto mtdtopo = record.getHandle(mtdtopoToken_);
57 
58  //The BTL and ETL builders are now called internally by the MTDDetLayerGeometry.
59  //This allows external plugings to use and build the object.
60  mtdDetLayerGeometry->buildLayers(&(*mtd), &(*mtdtopo));
61 
62  // Sort layers properly
63  mtdDetLayerGeometry->sortLayers();
64 
65  return mtdDetLayerGeometry;
66 }
67 
70  desc.addDefault(ps);
71 }
72 
MTDDetLayerGeometryESProducer(const edm::ParameterSet &p)
Constructor.
static void fillDescriptions(edm::ConfigurationDescriptions &)
edm::ESGetToken< MTDTopology, MTDTopologyRcd > mtdtopoToken_
std::unique_ptr< MTDDetLayerGeometry > produce(const MTDRecoGeometryRecord &record)
Produce MuonDeLayerGeometry.
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
edm::ESGetToken< MTDGeometry, MTDDigiGeometryRecord > geomToken_
HLT enums.