CMS 3D CMS Logo

RPCRecoIdealDBLoader.cc
Go to the documentation of this file.
20 
21 class RPCRecoIdealDBLoader : public edm::one::EDAnalyzer<edm::one::WatchRuns> {
22 public:
24 
25  void beginRun(edm::Run const& iEvent, edm::EventSetup const&) override;
26  void analyze(edm::Event const& iEvent, edm::EventSetup const&) override {}
27  void endRun(edm::Run const& iEvent, edm::EventSetup const&) override {}
28 
29 private:
34 };
35 
37  fromDD4hep_ = iC.getUntrackedParameter<bool>("fromDD4hep", false);
38  dd4HepCompactViewToken_ = esConsumes<edm::Transition::BeginRun>();
39  compactViewToken_ = esConsumes<edm::Transition::BeginRun>();
40  muonGeomConstantsToken_ = esConsumes<edm::Transition::BeginRun>();
41 }
42 
46  if (!mydbservice.isAvailable()) {
47  edm::LogError("RPCRecoIdealDBLoader") << "PoolDBOutputService unavailable";
48  return;
49  }
50 
51  auto pMNDC = es.getHandle(muonGeomConstantsToken_);
53 
54  if (fromDD4hep_) {
56  const cms::DDCompactView& cpv = *pDD;
57  rpcpd.build(&cpv, *pMNDC, rig);
58  } else {
60  const DDCompactView& cpv = *pDD;
61  rpcpd.build(&cpv, *pMNDC, rig);
62  }
63  if (mydbservice->isNewTagRequest("RPCRecoGeometryRcd")) {
64  mydbservice->createOneIOV(rig, mydbservice->beginOfTime(), "RPCRecoGeometryRcd");
65  } else {
66  edm::LogError("RPCRecoIdealDBLoader") << "RPCRecoGeometryRcd Tag is already present.";
67  }
68 }
69 
edm::ESGetToken< cms::DDCompactView, IdealGeometryRecord > dd4HepCompactViewToken_
Log< level::Error, false > LogError
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:81
void createOneIOV(const T &payload, cond::Time_t firstSinceTime, const std::string &recordName)
void endRun(edm::Run const &iEvent, edm::EventSetup const &) override
void build(const DDCompactView *cview, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rgeo)
T getUntrackedParameter(std::string const &, T const &) const
int iEvent
Definition: GenABIO.cc:224
edm::ESGetToken< MuonGeometryConstants, IdealGeometryRecord > muonGeomConstantsToken_
bool isNewTagRequest(const std::string &recordName)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:151
RPCRecoIdealDBLoader(const edm::ParameterSet &)
void analyze(edm::Event const &iEvent, edm::EventSetup const &) override
ESTransientHandle< T > getTransientHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:162
void beginRun(edm::Run const &iEvent, edm::EventSetup const &) override
bool isAvailable() const
Definition: Service.h:40
Definition: Run.h:45
edm::ESGetToken< DDCompactView, IdealGeometryRecord > compactViewToken_