CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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)},
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));
48  cond::Time_t time;
50  if (dbservice.isAvailable()) {
51  if (openIOVAt_ == "beginOfTime")
52  time = dbservice->beginOfTime();
53  else if (openIOVAt_ == "currentTime")
54  time = dbservice->currentTime();
55  else
56  time = openIOVAtTime_;
57 
58  dbservice->writeOneIOV(*payload, time, rcdName_);
59  } else {
60  edm::LogError("SiStripBadStripFromQualityDBWriter") << "Service is unavailable" << std::endl;
61  }
62 }
63 
T getUntrackedParameter(std::string const &, T const &) const
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
#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
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
bool isAvailable() const
Definition: Service.h:40
Hash writeOneIOV(const T &payload, Time_t time, const std::string &recordName)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const SiStripQuality & getMergedQuality(dqm::harvesting::DQMStore::IGetter &getter)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
static void fillDescription(edm::ParameterSetDescription &desc)
Definition: Run.h:45