CMS 3D CMS Logo

SiStripQualityWithFromFedErrorsHelper.h
Go to the documentation of this file.
1 #ifndef CALIBTRACKER_SISTRIPESPRODUCERS_INTERFACE_SISTRIPQUALITYHELPERS_H
2 #define CALIBTRACKER_SISTRIPESPRODUCERS_INTERFACE_SISTRIPQUALITYHELPERS_H
3 
4 #include <memory>
13 
15 
16 namespace sistrip {
21  std::unique_ptr<SiStripQuality> badStripFromFedErr(dqm::harvesting::DQMStore::IGetter& dqmStore,
22  const SiStripFedCabling& fedCabling,
23  float cutoff);
24 
30  std::unique_ptr<SiStripQuality> badStripFromFedErrLegacyDQMFile(const std::string& fileName,
31  unsigned int runNumber,
32  const SiStripFedCabling& fedCabling,
33  float cutoff);
34 
40 } // namespace sistrip
41 
43 public:
46  bool keepCopy = false) {
47  const auto& fedErrConfig = iConfig.getParameter<edm::ParameterSet>("BadComponentsFromFedErrors");
48  addBadCompFromFedErr_ = fedErrConfig.getParameter<bool>("Add");
49  fedErrCutoff_ = float(fedErrConfig.getParameter<double>("Cutoff"));
50  fedErrLegacyFile_ = fedErrConfig.getParameter<std::string>("LegacyDQMFile");
51  fedErrFileRunNumber_ = fedErrConfig.getParameter<unsigned int>("FileRunNumber");
53  edm::ESInputTag{"", iConfig.getParameter<std::string>("StripQualityLabel")});
56  }
57  // can be set if a copy should be made even if BadComponentsFromFedErrors is false
58  // (e.g. for producing a new payloads)
59  keepCopy_ = keepCopy || addBadCompFromFedErr_;
60  }
61 
63  desc.add<std::string>("StripQualityLabel", "");
65  descFedErr.add<bool>("Add", false);
66  descFedErr.add<double>("Cutoff", 0.8);
67  descFedErr.add<std::string>("LegacyDQMFile", "");
68  descFedErr.add<unsigned int>("FileRunNumber", -1);
69  desc.add<edm::ParameterSetDescription>("BadComponentsFromFedErrors", descFedErr);
70  }
71 
72  bool endRun(const edm::EventSetup&);
74 
77 
78 private:
79  bool addBadCompFromFedErr_ = false;
82  unsigned int fedErrFileRunNumber_;
86  std::unique_ptr<SiStripFedCabling> fedCabling_;
87  std::unique_ptr<SiStripQuality> mergedQuality_;
88  bool merged_ = false;
89  bool keepCopy_;
90 };
91 
92 #endif // CALIBTRACKER_SISTRIPESPRODUCERS_INTERFACE_SISTRIPQUALITYHELPERS_H
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ESWatcher< SiStripQualityRcd > stripQualityWatcher_
std::unique_ptr< SiStripQuality > badStripFromFedErr(dqm::harvesting::DQMStore::IGetter &dqmStore, const SiStripFedCabling &fedCabling, float cutoff)
edm::ESGetToken< SiStripFedCabling, SiStripFedCablingRcd > fedCablingToken_
sistrip classes
SiStripQualityWithFromFedErrorsHelper(const edm::ParameterSet &iConfig, edm::ConsumesCollector iC, bool keepCopy=false)
edm::ESGetToken< SiStripQuality, SiStripQualityRcd > stripQualityToken_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
const edm::ESGetToken< SiStripQuality, SiStripQualityRcd > & qualityToken() const
const SiStripQuality & getMergedQuality(dqm::harvesting::DQMStore::IGetter &getter)
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
static void fillDescription(edm::ParameterSetDescription &desc)
std::unique_ptr< SiStripQuality > badStripFromFedErrLegacyDQMFile(const std::string &fileName, unsigned int runNumber, const SiStripFedCabling &fedCabling, float cutoff)