CMS 3D CMS Logo

MTDDetLayerGeometryESProducer.cc
Go to the documentation of this file.
1 
14 
18 
22 
24 
25 #include <memory>
26 #include <iostream>
27 
29 public:
32 
34  std::unique_ptr<MTDDetLayerGeometry> produce(const MTDRecoGeometryRecord& record);
35 
37 
38 private:
40 };
41 
42 using namespace edm;
43 
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
54  // Build ETL layers
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 
69  desc.addDefault(ps);
70 }
71 
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
static std::vector< DetLayer * > buildLayers(const MTDGeometry &geo)
Operations.
JetCorrectorParameters::Record record
Definition: classes.h:7
const std::string metname
ESHandle< ProductT > getHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
MTDDetLayerGeometryESProducer(const edm::ParameterSet &p)
Constructor.
void addDefault(ParameterSetDescription const &psetDescription)
static void fillDescriptions(edm::ConfigurationDescriptions &)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
std::unique_ptr< MTDDetLayerGeometry > produce(const MTDRecoGeometryRecord &record)
Produce MuonDeLayerGeometry.
edm::ESGetToken< MTDGeometry, MTDDigiGeometryRecord > geomToken_
HLT enums.
static std::pair< std::vector< DetLayer * >, std::vector< DetLayer * > > buildLayers(const MTDGeometry &geo)