CMS 3D CMS Logo

GlobalTrackingGeometryESProducer.cc
Go to the documentation of this file.
1 
9 
11 
17 
18 #include <memory>
19 
20 using namespace edm;
21 
23  auto cc = setWhatProduced(this);
24  trackerToken_ = cc.consumesFrom<TrackerGeometry, TrackerDigiGeometryRecord>(edm::ESInputTag{});
25  mtdToken_ = cc.consumesFrom<MTDGeometry, MTDDigiGeometryRecord>(edm::ESInputTag{});
26  dtToken_ = cc.consumesFrom<DTGeometry, MuonGeometryRecord>(edm::ESInputTag{});
27  cscToken_ = cc.consumesFrom<CSCGeometry, MuonGeometryRecord>(edm::ESInputTag{});
28  rpcToken_ = cc.consumesFrom<RPCGeometry, MuonGeometryRecord>(edm::ESInputTag{});
29  gemToken_ = cc.consumesFrom<GEMGeometry, MuonGeometryRecord>(edm::ESInputTag{});
30  me0Token_ = cc.consumesFrom<ME0Geometry, MuonGeometryRecord>(edm::ESInputTag{});
31 }
32 
34 
35 std::unique_ptr<GlobalTrackingGeometry> GlobalTrackingGeometryESProducer::produce(
37  TrackerGeometry const* tk = nullptr;
38  MTDGeometry const* mtd = nullptr;
39  DTGeometry const* dt = nullptr;
40  CSCGeometry const* csc = nullptr;
41  RPCGeometry const* rpc = nullptr;
42  GEMGeometry const* gem = nullptr;
43  ME0Geometry const* me0 = nullptr;
44 
45  if (auto tkRecord = record.tryToGetRecord<TrackerDigiGeometryRecord>()) {
46  if (auto tkH = tkRecord->getHandle(trackerToken_)) {
47  tk = tkH.product();
48  } else {
49  LogWarning("GeometryGlobalTrackingGeometryBuilder") << "No Tracker geometry is available.";
50  }
51  } else {
52  LogWarning("GeometryGlobalTrackingGeometryBuilder") << "No TrackerDigiGeometryRecord is available.";
53  }
54 
55  if (auto mtdRecord = record.tryToGetRecord<MTDDigiGeometryRecord>()) {
56  if (auto mtdH = mtdRecord->getHandle(mtdToken_)) {
57  mtd = mtdH.product();
58  } else {
59  LogInfo("GeometryGlobalTrackingGeometryBuilder") << "No MTD geometry is available.";
60  }
61  } else {
62  LogInfo("GeometryGlobalTrackingGeometryBuilder") << "No MTDDigiGeometryRecord is available.";
63  }
64 
65  if (auto muonRecord = record.tryToGetRecord<MuonGeometryRecord>()) {
66  if (auto dtH = muonRecord->getHandle(dtToken_)) {
67  dt = dtH.product();
68  } else {
69  LogWarning("GeometryGlobalTrackingGeometryBuilder") << "No DT geometry is available.";
70  }
71 
72  if (auto cscH = muonRecord->getHandle(cscToken_)) {
73  csc = cscH.product();
74  } else {
75  LogWarning("GeometryGlobalTrackingGeometryBuilder") << "No CSC geometry is available.";
76  }
77 
78  if (auto rpcH = muonRecord->getHandle(rpcToken_)) {
79  rpc = rpcH.product();
80  } else {
81  LogWarning("GeometryGlobalTrackingGeometryBuilder") << "No RPC geometry is available.";
82  }
83 
84  if (auto gemH = muonRecord->getHandle(gemToken_)) {
85  gem = gemH.product();
86  } else {
87  LogInfo("GeometryGlobalTrackingGeometryBuilder") << "No GEM geometry is available.";
88  }
89 
90  if (auto me0H = muonRecord->getHandle(me0Token_)) {
91  me0 = me0H.product();
92  } else {
93  LogInfo("GeometryGlobalTrackingGeometryBuilder") << "No ME0 geometry is available.";
94  }
95 
96  } else {
97  LogWarning("GeometryGlobalTrackingGeometryBuilder") << "No MuonGeometryRecord is available.";
98  }
99 
101  return std::unique_ptr<GlobalTrackingGeometry>(builder.build(tk, mtd, dt, csc, rpc, gem, me0));
102 }
103 
float dt
Definition: AMPTWrapper.h:136
GlobalTrackingGeometryESProducer(const edm::ParameterSet &p)
Constructor.
Definition: L1Track.h:19
Log< level::Info, false > LogInfo
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
HLT enums.
GlobalTrackingGeometry * build(const TrackerGeometry *tk, const MTDGeometry *mtd, const DTGeometry *dt, const CSCGeometry *csc, const RPCGeometry *rpc, const GEMGeometry *gem, const ME0Geometry *me0)
Build the geometry.
Log< level::Warning, false > LogWarning
std::unique_ptr< GlobalTrackingGeometry > produce(const GlobalTrackingGeometryRecord &record)
Produce GlobalTrackingGeometry.