test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GlobalTrackingGeometryESProducer.cc
Go to the documentation of this file.
1 
9 
15 
16 #include <memory>
17 
18 using namespace edm;
19 
21  setWhatProduced(this);
22 }
23 
25 
26 boost::shared_ptr<GlobalTrackingGeometry>
28 
29  TrackerGeometry const* tk = nullptr;
30  DTGeometry const* dt = nullptr;
31  CSCGeometry const* csc = nullptr;
32  RPCGeometry const* rpc = nullptr;
33  GEMGeometry const* gem = nullptr;
34  ME0Geometry const* me0 = nullptr;
35 
36  try {
38  record.getRecord<TrackerDigiGeometryRecord>().get(tkH);
39  if(tkH.isValid()) {
40  tk = tkH.product();
41  } else {
42  LogWarning("GeometryGlobalTrackingGeometryBuilder") << "No Tracker geometry is available.";
43  }
45  LogWarning("GeometryGlobalTrackingGeometryBuilder") << "No TrackerDigiGeometryRecord is available.";
46  }
47 
48 
49  try {
51  record.getRecord<MuonGeometryRecord>().get(dtH);
52  if(dtH.isValid()) {
53  dt = dtH.product();
54  } else {
55  LogWarning("GeometryGlobalTrackingGeometryBuilder") << "No DT geometry is available.";
56  }
57 
59  record.getRecord<MuonGeometryRecord>().get(cscH);
60  if(cscH.isValid()) {
61  csc = cscH.product();
62  } else {
63  LogWarning("GeometryGlobalTrackingGeometryBuilder") << "No CSC geometry is available.";
64  }
65 
67  record.getRecord<MuonGeometryRecord>().get(rpcH);
68  if(rpcH.isValid()) {
69  rpc = rpcH.product();
70  } else {
71  LogWarning("GeometryGlobalTrackingGeometryBuilder") << "No RPC geometry is available.";
72  }
73 
75  record.getRecord<MuonGeometryRecord>().get(gemH);
76  if(gemH.isValid()) {
77  gem = gemH.product();
78  } else {
79  LogInfo("GeometryGlobalTrackingGeometryBuilder") << "No GEM geometry is available.";
80  }
81 
83  record.getRecord<MuonGeometryRecord>().get(me0H);
84  if(me0H.isValid()) {
85  me0 = me0H.product();
86  } else {
87  LogInfo("GeometryGlobalTrackingGeometryBuilder") << "No ME0 geometry is available.";
88  }
89 
91  LogWarning("GeometryGlobalTrackingGeometryBuilder") << "No MuonGeometryRecord is available.";
92  }
93 
95  return boost::shared_ptr<GlobalTrackingGeometry>(builder.build(tk, dt, csc, rpc, gem, me0));
96 }
97 
float dt
Definition: AMPTWrapper.h:126
boost::shared_ptr< GlobalTrackingGeometry > produce(const GlobalTrackingGeometryRecord &record)
Produce GlobalTrackingGeometry.
JetCorrectorParameters::Record record
Definition: classes.h:7
GlobalTrackingGeometryESProducer(const edm::ParameterSet &p)
Constructor.
T const * product() const
Definition: ESHandle.h:86
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
bool isValid() const
Definition: ESHandle.h:47
GlobalTrackingGeometry * build(const TrackerGeometry *tk, const DTGeometry *dt, const CSCGeometry *csc, const RPCGeometry *rpc, const GEMGeometry *gem, const ME0Geometry *me0)
Build the geometry.