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>
37 
38  TrackerGeometry const* tk = nullptr;
39  MTDGeometry const* mtd = nullptr;
40  DTGeometry const* dt = nullptr;
41  CSCGeometry const* csc = nullptr;
42  RPCGeometry const* rpc = nullptr;
43  GEMGeometry const* gem = nullptr;
44  ME0Geometry const* me0 = nullptr;
45 
46  if( auto tkRecord = record.tryToGetRecord<TrackerDigiGeometryRecord>() ) {
47  if(auto tkH = tkRecord->getHandle(trackerToken_)) {
48  tk = tkH.product();
49  } else {
50  LogWarning("GeometryGlobalTrackingGeometryBuilder") << "No Tracker geometry is available.";
51  }
52  } else {
53  LogWarning("GeometryGlobalTrackingGeometryBuilder") << "No TrackerDigiGeometryRecord is available.";
54  }
55 
56  if( auto mtdRecord = record.tryToGetRecord<MTDDigiGeometryRecord>() ) {
57  if(auto mtdH = mtdRecord->getHandle(mtdToken_)) {
58  mtd = mtdH.product();
59  } else {
60  LogInfo("GeometryGlobalTrackingGeometryBuilder") << "No MTD geometry is available.";
61  }
62  } else {
63  LogInfo("GeometryGlobalTrackingGeometryBuilder") << "No MTDDigiGeometryRecord is available.";
64  }
65 
66  if( auto muonRecord = record.tryToGetRecord<MuonGeometryRecord>() ) {
67  if(auto dtH = muonRecord->getHandle(dtToken_)) {
68  dt = dtH.product();
69  } else {
70  LogWarning("GeometryGlobalTrackingGeometryBuilder") << "No DT geometry is available.";
71  }
72 
73  if(auto cscH = muonRecord->getHandle(cscToken_)) {
74  csc = cscH.product();
75  } else {
76  LogWarning("GeometryGlobalTrackingGeometryBuilder") << "No CSC geometry is available.";
77  }
78 
79  if(auto rpcH = muonRecord->getHandle(rpcToken_)) {
80  rpc = rpcH.product();
81  } else {
82  LogWarning("GeometryGlobalTrackingGeometryBuilder") << "No RPC geometry is available.";
83  }
84 
85  if(auto gemH = muonRecord->getHandle(gemToken_)) {
86  gem = gemH.product();
87  } else {
88  LogInfo("GeometryGlobalTrackingGeometryBuilder") << "No GEM geometry is available.";
89  }
90 
91  if(auto me0H = muonRecord->getHandle(me0Token_)) {
92  me0 = me0H.product();
93  } else {
94  LogInfo("GeometryGlobalTrackingGeometryBuilder") << "No ME0 geometry is available.";
95  }
96 
97  } else {
98  LogWarning("GeometryGlobalTrackingGeometryBuilder") << "No MuonGeometryRecord is available.";
99  }
100 
102  return std::unique_ptr<GlobalTrackingGeometry>(builder.build(tk, mtd, dt, csc, rpc, gem, me0));
103 }
104 
float dt
Definition: AMPTWrapper.h:126
JetCorrectorParameters::Record record
Definition: classes.h:7
GlobalTrackingGeometryESProducer(const edm::ParameterSet &p)
Constructor.
Definition: AMC13Event.h:6
Definition: L1Track.h:19
#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.
std::unique_ptr< GlobalTrackingGeometry > produce(const GlobalTrackingGeometryRecord &record)
Produce GlobalTrackingGeometry.