CMS 3D CMS Logo

SiStripBadStripFromQualityDBWriter.cc
Go to the documentation of this file.
10 
12 public:
15 
16  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
17 
18  void endRun(edm::Run const&, edm::EventSetup const&) override;
20 
21 private:
23  uint32_t openIOVAtTime_;
25 };
26 
28  : rcdName_{iConfig.getParameter<std::string>("record")},
29  openIOVAt_{iConfig.getUntrackedParameter<std::string>("OpenIovAt", "beginOfTime")},
30  openIOVAtTime_{iConfig.getUntrackedParameter<uint32_t>("OpenIovAtTime", 1)},
31  withFedErrHelper_{iConfig, consumesCollector(), true} {}
32 
35  desc.add<std::string>("record", "");
36  desc.addUntracked<std::string>("OpenIovAt", "beginOfTime");
37  desc.addUntracked<uint32_t>("OpenIovAtTime", 1);
39  descriptions.add("siStripBadStripFromQualityDBWriter", desc);
40 }
41 
43  withFedErrHelper_.endRun(iSetup);
44 }
45 
47  auto payload = std::make_unique<SiStripBadStrip>(withFedErrHelper_.getMergedQuality(getter));
50  if (dbservice.isAvailable()) {
51  if (openIOVAt_ == "beginOfTime")
52  time = dbservice->beginOfTime();
53  else if (openIOVAt_ == "currentTime")
54  time = dbservice->currentTime();
55  else
57 
58  dbservice->writeOneIOV(*payload, time, rcdName_);
59  } else {
60  edm::LogError("SiStripBadStripFromQualityDBWriter") << "Service is unavailable" << std::endl;
61  }
62 }
63 
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void endRun(edm::Run const &, edm::EventSetup const &) override
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
Log< level::Error, false > LogError
SiStripQualityWithFromFedErrorsHelper withFedErrHelper_
unsigned long long Time_t
Definition: Time.h:14
Hash writeOneIOV(const T &payload, Time_t time, const std::string &recordName)
const SiStripQuality & getMergedQuality(dqm::harvesting::DQMStore::IGetter &getter)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
bool isAvailable() const
Definition: Service.h:40
static void fillDescription(edm::ParameterSetDescription &desc)
Definition: Run.h:45