CMS 3D CMS Logo

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