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 
MTDDigiGeometryRecord
Definition: MTDDigiGeometryRecord.h:15
DTGeometry
Definition: DTGeometry.h:28
edm::ESInputTag
Definition: ESInputTag.h:87
MessageLogger.h
ESHandle.h
edm
HLT enums.
Definition: AlignableModifier.h:19
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
ME0Geometry
Definition: ME0Geometry.h:12
edm::LogInfo
Definition: MessageLogger.h:254
GlobalPosition_Frontier_DevDB_cff.record
record
Definition: GlobalPosition_Frontier_DevDB_cff.py:10
GlobalTrackingGeometryRecord
Definition: GlobalTrackingGeometryRecord.h:17
GlobalTrackingGeometryESProducer::~GlobalTrackingGeometryESProducer
~GlobalTrackingGeometryESProducer() override
Destructor.
Definition: GlobalTrackingGeometryESProducer.cc:33
ForwardSubdetector.h
cc
CSCGeometry
Definition: CSCGeometry.h:24
dt
float dt
Definition: AMPTWrapper.h:136
GlobalTrackingGeometryBuilder
Definition: GlobalTrackingGeometryBuilder.h:22
csc
Definition: L1Track.h:19
TrackerDigiGeometryRecord
Definition: TrackerDigiGeometryRecord.h:15
GlobalTrackingGeometryESProducer
Definition: GlobalTrackingGeometryESProducer.h:30
NoRecordException.h
edm::LogWarning
Definition: MessageLogger.h:141
GlobalTrackingGeometryESProducer::GlobalTrackingGeometryESProducer
GlobalTrackingGeometryESProducer(const edm::ParameterSet &p)
Constructor.
Definition: GlobalTrackingGeometryESProducer.cc:22
edm::ParameterSet
Definition: ParameterSet.h:36
mixOne_premix_on_sim_cfi.me0
me0
Definition: mixOne_premix_on_sim_cfi.py:309
GlobalTrackingGeometryESProducer.h
GlobalTrackingGeometryBuilder.h
gem
Definition: AMC13Event.h:6
MTDGeometry
Definition: MTDGeometry.h:14
ModuleFactory.h
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
GEMGeometry
Definition: GEMGeometry.h:24
RPCGeometry
Definition: RPCGeometry.h:20
mtd_digitizer
Definition: MTDDigitizer.h:35
NoProxyException.h
GlobalTrackingGeometry.h
omtf::DataWord64::rpc
Definition: OmtfDataWord64.h:16
GlobalTrackingGeometryESProducer::produce
std::unique_ptr< GlobalTrackingGeometry > produce(const GlobalTrackingGeometryRecord &record)
Produce GlobalTrackingGeometry.
Definition: GlobalTrackingGeometryESProducer.cc:35
MuonGeometryRecord
Definition: MuonGeometryRecord.h:34
GlobalTrackingGeometryBuilder::build
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.
Definition: GlobalTrackingGeometryBuilder.cc:23
TrackerGeometry
Definition: TrackerGeometry.h:14