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  setWhatProduced(this);
24 }
25 
27 
28 std::unique_ptr<GlobalTrackingGeometry>
30 
31  TrackerGeometry const* tk = nullptr;
32  MTDGeometry const* mtd = nullptr;
33  DTGeometry const* dt = nullptr;
34  CSCGeometry const* csc = nullptr;
35  RPCGeometry const* rpc = nullptr;
36  GEMGeometry const* gem = nullptr;
37  ME0Geometry const* me0 = nullptr;
38 
39  try {
41  record.getRecord<TrackerDigiGeometryRecord>().get(tkH);
42  if(tkH.isValid()) {
43  tk = tkH.product();
44  } else {
45  LogWarning("GeometryGlobalTrackingGeometryBuilder") << "No Tracker geometry is available.";
46  }
48  LogWarning("GeometryGlobalTrackingGeometryBuilder") << "No TrackerDigiGeometryRecord is available.";
49  }
50 
51  try {
53  record.getRecord<MTDDigiGeometryRecord>().get(mtdH);
54  if(mtdH.isValid()) {
55  mtd = mtdH.product();
56  } else {
57  LogWarning("GeometryGlobalTrackingGeometryBuilder") << "No MTD geometry is available.";
58  }
60  LogWarning("GeometryGlobalTrackingGeometryBuilder") << "No MTDDigiGeometryRecord is available.";
61  }
62 
63 
64  try {
66  record.getRecord<MuonGeometryRecord>().get(dtH);
67  if(dtH.isValid()) {
68  dt = dtH.product();
69  } else {
70  LogWarning("GeometryGlobalTrackingGeometryBuilder") << "No DT geometry is available.";
71  }
72 
74  record.getRecord<MuonGeometryRecord>().get(cscH);
75  if(cscH.isValid()) {
76  csc = cscH.product();
77  } else {
78  LogWarning("GeometryGlobalTrackingGeometryBuilder") << "No CSC geometry is available.";
79  }
80 
82  record.getRecord<MuonGeometryRecord>().get(rpcH);
83  if(rpcH.isValid()) {
84  rpc = rpcH.product();
85  } else {
86  LogWarning("GeometryGlobalTrackingGeometryBuilder") << "No RPC geometry is available.";
87  }
88 
90  record.getRecord<MuonGeometryRecord>().get(gemH);
91  if(gemH.isValid()) {
92  gem = gemH.product();
93  } else {
94  LogInfo("GeometryGlobalTrackingGeometryBuilder") << "No GEM geometry is available.";
95  }
96 
98  record.getRecord<MuonGeometryRecord>().get(me0H);
99  if(me0H.isValid()) {
100  me0 = me0H.product();
101  } else {
102  LogInfo("GeometryGlobalTrackingGeometryBuilder") << "No ME0 geometry is available.";
103  }
104 
106  LogWarning("GeometryGlobalTrackingGeometryBuilder") << "No MuonGeometryRecord is available.";
107  }
108 
110  return std::unique_ptr<GlobalTrackingGeometry>(builder.build(tk, mtd, dt, csc, rpc, gem, me0));
111 }
112 
float dt
Definition: AMPTWrapper.h:126
JetCorrectorParameters::Record record
Definition: classes.h:7
GlobalTrackingGeometryESProducer(const edm::ParameterSet &p)
Constructor.
A class for AMC data.
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.
bool isValid() const
Definition: ESHandle.h:45
T const * product() const
Definition: ESHandle.h:84
std::unique_ptr< GlobalTrackingGeometry > produce(const GlobalTrackingGeometryRecord &record)
Produce GlobalTrackingGeometry.