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.setBigPixelsX(i->bigPixelsx());
43  ptitp.setBigPixelsY(i->bigPixelsy());
44  ptitp.setBigPixelsPitchX(i->bigPixelsPitchx());
45  ptitp.setBigPixelsPitchY(i->bigPixelsPitchy());
46  }
47 
48  if (mydbservice->isNewTagRequest("PTrackerAdditionalParametersPerDetRcd")) {
49  mydbservice->createOneIOV(ptitp, mydbservice->beginOfTime(), "PTrackerAdditionalParametersPerDetRcd");
50  } else {
51  edm::LogError("PTrackerAdditionalParametersPerDetDBBuilder")
52  << "PTrackerAdditionalParametersPerDet and PTrackerAdditionalParametersPerDetRcd Tag already present";
53  }
54 }
55 
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
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
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
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