32 LogDebug(
"SiStripDcsInfo") <<
"SiStripDcsInfo::Deleting SiStripDcsInfo ";
49 LogDebug(
"SiStripDcsInfo") <<
"SiStripDcsInfo:: Begining of Run";
58 std::vector<int> FedsInIds = sumFED->m_fed_in;
59 for (
unsigned int it = 0; it < FedsInIds.size(); ++it) {
60 int fedID = FedsInIds[it];
61 if (fedID >= siStripFedIdMin && fedID <= siStripFedIdMax)
78 LogDebug(
"SiStripDcsInfo") <<
"SiStripDcsInfo::beginLuminosityBlock";
85 subDetME.second.FaultyDetectors.clear();
92 LogDebug(
"SiStripDcsInfo") <<
"SiStripDcsInfo::endLuminosityBlock";
102 LogDebug(
"SiStripDcsInfo") <<
"SiStripDcsInfo::EndRun";
108 subDetME.second.FaultyDetectors.clear();
123 if (!strip_dir.empty())
133 if (!strip_dir.empty())
139 subDetME.DcsFractionME = dqm_store.
bookFloat(me_name);
149 LogDebug(
"SiStripDcsInfo") <<
"SiStripDcsInfo::readCabling : " 150 <<
" Change in Cache";
153 std::vector<uint32_t> SelectedDetIds;
155 LogDebug(
"SiStripDcsInfo") <<
" SiStripDcsInfo::readCabling : " 156 <<
" Total Detectors " << SelectedDetIds.size();
160 it->second.TotalDetectors = 0;
163 for (std::vector<uint32_t>::const_iterator idetid = SelectedDetIds.begin(); idetid != SelectedDetIds.end();
165 uint32_t detId = *idetid;
166 if (detId == 0 || detId == 0xFFFFFFFF)
173 iPos->second.TotalDetectors++;
183 const auto& detVOff =
185 std::vector<uint32_t> FaultyDetIds;
186 detVOff.getDetIds(FaultyDetIds);
187 LogDebug(
"SiStripDcsInfo") <<
" SiStripDcsInfo::readStatus : " 188 <<
" Faulty Detectors " << FaultyDetIds.size();
190 for (std::vector<uint32_t>::const_iterator ihvoff = FaultyDetIds.begin(); ihvoff != FaultyDetIds.end(); ++ihvoff) {
191 uint32_t detId_hvoff = (*ihvoff);
199 std::vector<uint32_t>::iterator ibad =
200 std::find(iPos->second.FaultyDetectors.begin(), iPos->second.FaultyDetectors.end(), detId_hvoff);
201 if (ibad == iPos->second.FaultyDetectors.end())
202 iPos->second.FaultyDetectors.push_back(detId_hvoff);
214 float total_det = 0.0;
215 float faulty_det = 0.0;
218 int total_subdet = subDetMEs.TotalDetectors;
219 int faulty_subdet = subDetMEs.FaultyDetectors.size();
223 fraction = 1.0 - faulty_subdet * 1.0 / total_subdet;
224 subDetMEs.DcsFractionME->Reset();
225 subDetMEs.DcsFractionME->Fill(
fraction);
226 edm::LogInfo(
"SiStripDcsInfo") <<
" SiStripDcsInfo::fillStatus : Sub Detector " <<
name <<
" Total Number " 227 << total_subdet <<
" Faulty ones " << faulty_subdet;
228 total_det += total_subdet;
229 faulty_det += faulty_subdet;
234 fraction = 1 - faulty_det / total_det;
243 for (
auto const detId_faulty :
pr.second.FaultyDetectors) {
244 pr.second.NLumiDetectorIsFaulty[detId_faulty]++;
258 pr.second.DcsFractionME->Reset();
259 pr.second.DcsFractionME->Fill(-1.0);
275 auto const& lumiCountBadModules =
pr.second.NLumiDetectorIsFaulty;
276 for (
auto const [ibad, nBadLumi] : lumiCountBadModules) {
279 std::string bad_module_folder = mechanical_dir +
"/" +
pr.second.folder_name +
284 std::ostringstream detid_str;
286 std::string full_path = bad_module_folder +
"/" + detid_str.str();
static void setBadModuleFlag(std::string &hname, uint16_t &flg)
void endLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &iSetup) override
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
void bookStatus(DQMStore &dqm_store)
const SiStripDetCabling * detCabling_
edm::ESGetToken< SiStripDetVOff, SiStripDetVOffRcd > detVOffToken2_
SiStripDcsInfo(const edm::ParameterSet &ps)
edm::ESGetToken< SiStripDetVOff, SiStripDetVOffRcd > detVOffToken0_
#define DEFINE_FWK_MODULE(type)
void setCurrentFolder(std::string const &fullpath) override
std::optional< T > tryToGet() const
edm::ESGetToken< SiStripDetCabling, SiStripDetCablingRcd > detCablingToken_
std::string pwd() override
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken2_
void beginLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &eSetup) override
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
bool IsConnected(const uint32_t &det_id) const
edm::ESGetToken< RunInfo, RunInfoRcd > runInfoToken_
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
void fillStatus(DQMStore &dqm_store)
std::map< std::string, SubDetMEs > SubDetMEsMap
edm::ESWatcher< SiStripFedCablingRcd > fedCablingWatcher_
const std::string subdet_tag("SubDet")
bool getData(T &iHolder) const
UseScope< MonitorElementData::Scope::LUMI > UseLumiScope
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Log< level::Info, false > LogInfo
static constexpr float MaxAcceptableBadDcsLumi_
void readCabling(edm::EventSetup const &)
void readStatus(edm::EventSetup const &, int transition)
void beginRun(edm::Run const &run, edm::EventSetup const &eSetup) override
MonitorElement * bookInt(TString const &name, FUNC onbooking=NOOP())
MonitorElement * DcsFraction_
virtual MonitorElement * get(std::string const &fullpath) const
bool check(const edm::EventSetup &iSetup)
static void getSubDetectorTag(uint32_t det_id, std::string &subdet_tag, const TrackerTopology *tTopo)
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken3_
void endRun(edm::Run const &run, edm::EventSetup const &eSetup) override
void analyze(edm::Event const &, edm::EventSetup const &) override
static bool goToDir(DQMStore &dqm_store, std::string const &name)
edm::ESGetToken< SiStripDetVOff, SiStripDetVOffRcd > detVOffToken1_
void addBadModules(DQMStore &dqm_store)
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken1_
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken0_
static constexpr float MinAcceptableDcsDetFrac_
static void getTopFolderPath(DQMStore &dqm_store, std::string const &top_dir, std::string &path)
void addActiveDetectorsRawIds(std::vector< uint32_t > &) const
void fillDummyStatus(DQMStore &dqm_store)