CMS 3D CMS Logo

PTrackerAdditionalParametersPerDetDBBuilder.cc
Go to the documentation of this file.
10 
12 public:
14 
15  void beginRun(edm::Run const& iEvent, edm::EventSetup const&) override;
16  void analyze(edm::Event const& iEvent, edm::EventSetup const&) override {}
17  void endRun(edm::Run const& iEvent, edm::EventSetup const&) override {}
18 
19 private:
21 };
22 
24  const edm::ParameterSet& iConfig)
25  : geomDetToken_(esConsumes<edm::Transition::BeginRun>()) {}
26 
30  if (!mydbservice.isAvailable()) {
31  edm::LogError("PTrackerAdditionalParametersPerDetDBBuilder") << "PoolDBOutputService unavailable";
32  return;
33  }
34 
35  const GeometricDet* gd = &es.getData(geomDetToken_);
36 
37  std::vector<const GeometricDet*> comp;
38  gd->deepComponents(comp);
39 
40  for (auto& i : comp) {
41  ptitp.setGeographicalId(i->geographicalId());
42  ptitp.setBricked(i->isBricked());
43  }
44 
45  if (mydbservice->isNewTagRequest("PTrackerAdditionalParametersPerDetRcd")) {
46  mydbservice->createOneIOV(ptitp, mydbservice->beginOfTime(), "PTrackerAdditionalParametersPerDetRcd");
47  } else {
48  edm::LogError("PTrackerAdditionalParametersPerDetDBBuilder")
49  << "PTrackerAdditionalParametersPerDet and PTrackerAdditionalParametersPerDetRcd Tag already present";
50  }
51 }
52 
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
Log< level::Error, false > LogError
const edm::ESGetToken< GeometricDet, IdealGeometryRecord > geomDetToken_
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)
Transition
Definition: Transition.h:12
void analyze(edm::Event const &iEvent, edm::EventSetup const &) override
bool getData(T &iHolder) const
Definition: EventSetup.h:122
void beginRun(edm::Run const &iEvent, edm::EventSetup const &) override
HLT enums.
void endRun(edm::Run const &iEvent, edm::EventSetup const &) override
ConstGeometricDetContainer deepComponents() const
bool isAvailable() const
Definition: Service.h:40
Definition: Run.h:45