CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
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 
#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)
bool getData(T &iHolder) const
Definition: EventSetup.h:122
int iEvent
Definition: GenABIO.cc:224
bool isNewTagRequest(const std::string &recordName)
bool isAvailable() const
Definition: Service.h:40
Transition
Definition: Transition.h:12
void analyze(edm::Event const &iEvent, edm::EventSetup const &) override
void beginRun(edm::Run const &iEvent, edm::EventSetup const &) override
ConstGeometricDetContainer deepComponents() const
void endRun(edm::Run const &iEvent, edm::EventSetup const &) override
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
Definition: Run.h:45