CMS 3D CMS Logo

GlobalDetLayerGeometryESProducer.cc
Go to the documentation of this file.
2 
7 
8 #include <memory>
9 #include <string>
10 
11 using namespace edm;
12 
14 {
15  std::string myName = p.getParameter<std::string>("ComponentName");
16  setWhatProduced(this,myName);
17 }
18 
20 
21 std::unique_ptr<DetLayerGeometry>
23 
27 
28  iRecord.getRecord<TrackerRecoGeometryRecord>().get(tracker);
29  iRecord.getRecord<MuonRecoGeometryRecord>().get(muon);
30 
31  // get the MTD if it is available
32  if(auto mtdRecord = iRecord.tryToGetRecord<MTDRecoGeometryRecord>()) {
33  mtdRecord->get(mtd);
34  if(!mtd.isValid()) {
35  LogInfo("GlobalDetLayergGeometryBuilder") << "No MTD geometry is available.";
36  }
37  } else {
38  LogInfo("GlobalDetLayerGeometryBuilder") << "No MTDDigiGeometryRecord is available.";
39  }
40 
41  // if we've got MTD initialize it
42  if( mtd.isValid() ) return std::make_unique<GlobalDetLayerGeometry>(tracker.product(), muon.product(), mtd.product());
43 
44  return std::make_unique<GlobalDetLayerGeometry>(tracker.product(), muon.product());
45 
46 }
47 
48 
T getParameter(std::string const &) const
GlobalDetLayerGeometryESProducer(const edm::ParameterSet &p)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
HLT enums.
bool isValid() const
Definition: ESHandle.h:44
std::unique_ptr< DetLayerGeometry > produce(const RecoGeometryRecord &)
T const * product() const
Definition: ESHandle.h:86