CMS 3D CMS Logo

PTrackerParametersDBBuilder.cc
Go to the documentation of this file.
12 
13 class PTrackerParametersDBBuilder : public edm::one::EDAnalyzer<edm::one::WatchRuns> {
14 public:
16 
17  void beginRun(edm::Run const& iEvent, edm::EventSetup const&) override;
18  void analyze(edm::Event const& iEvent, edm::EventSetup const&) override {}
19  void endRun(edm::Run const& iEvent, edm::EventSetup const&) override {}
20 
21 private:
25 };
26 
28  fromDD4hep_ = iConfig.getParameter<bool>("fromDD4hep");
29  dd4HepCompactViewToken_ = esConsumes<edm::Transition::BeginRun>();
30  compactViewToken_ = esConsumes<edm::Transition::BeginRun>();
31 }
32 
36  if (!mydbservice.isAvailable()) {
37  edm::LogError("PTrackerParametersDBBuilder") << "PoolDBOutputService unavailable";
38  return;
39  }
40 
42 
43  if (!fromDD4hep_) {
45  builder.build(&(*cpv), ptp);
46  } else {
48  builder.build(&(*cpv), ptp);
49  }
50 
51  if (mydbservice->isNewTagRequest("PTrackerParametersRcd")) {
52  mydbservice->createOneIOV(ptp, mydbservice->beginOfTime(), "PTrackerParametersRcd");
53  } else {
54  edm::LogError("PTrackerParametersDBBuilder") << "PTrackerParameters and PTrackerParametersRcd Tag already present";
55  }
56 }
57 
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ESGetToken< cms::DDCompactView, IdealGeometryRecord > dd4HepCompactViewToken_
Log< level::Error, false > LogError
void createOneIOV(const T &payload, cond::Time_t firstSinceTime, const std::string &recordName)
int iEvent
Definition: GenABIO.cc:224
bool isNewTagRequest(const std::string &recordName)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void beginRun(edm::Run const &iEvent, edm::EventSetup const &) override
edm::ESGetToken< DDCompactView, IdealGeometryRecord > compactViewToken_
PTrackerParametersDBBuilder(const edm::ParameterSet &)
bool build(const DDCompactView *, PTrackerParameters &)
ESTransientHandle< T > getTransientHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:141
bool isAvailable() const
Definition: Service.h:40
void analyze(edm::Event const &iEvent, edm::EventSetup const &) override
Definition: Run.h:45
void endRun(edm::Run const &iEvent, edm::EventSetup const &) override