|
|
Go to the documentation of this file.
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();
bool check(const edm::EventSetup &iSetup)
void addActiveDetectorsRawIds(std::vector< uint32_t > &) const
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
Log< level::Info, false > LogInfo
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
void endRun(edm::Run const &run, edm::EventSetup const &eSetup) override
static constexpr float MaxAcceptableBadDcsLumi_
void readCabling(edm::EventSetup const &)
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken2_
edm::ESGetToken< SiStripDetVOff, SiStripDetVOffRcd > detVOffToken0_
edm::ESGetToken< SiStripDetVOff, SiStripDetVOffRcd > detVOffToken1_
void readStatus(edm::EventSetup const &, int transition)
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken3_
void beginRun(edm::Run const &run, edm::EventSetup const &eSetup) override
std::optional< T > tryToGet() const
#define DEFINE_FWK_MODULE(type)
void bookStatus(DQMStore &dqm_store)
void addBadModules(DQMStore &dqm_store)
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
void setCurrentFolder(std::string const &fullpath) override
bool IsConnected(const uint32_t &det_id) const
edm::ESWatcher< SiStripFedCablingRcd > fedCablingWatcher_
edm::ESGetToken< RunInfo, RunInfoRcd > runInfoToken_
std::map< std::string, SubDetMEs > SubDetMEsMap
std::string pwd() override
void beginLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &eSetup) override
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken0_
void fillStatus(DQMStore &dqm_store)
void fillDummyStatus(DQMStore &dqm_store)
static bool goToDir(DQMStore &dqm_store, std::string const &name)
MonitorElement * bookInt(TString const &name, FUNC onbooking=NOOP())
MonitorElement * DcsFraction_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
void endLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &iSetup) override
UseScope< MonitorElementData::Scope::LUMI > UseLumiScope
SiStripDcsInfo(const edm::ParameterSet &ps)
static void getSubDetectorTag(uint32_t det_id, std::string &subdet_tag, const TrackerTopology *tTopo)
bool getData(T &iHolder) const
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken1_
virtual MonitorElement * get(std::string const &fullpath) const
const SiStripDetCabling * detCabling_
void analyze(edm::Event const &, edm::EventSetup const &) override
static constexpr float MinAcceptableDcsDetFrac_
edm::ESGetToken< SiStripDetCabling, SiStripDetCablingRcd > detCablingToken_
edm::ESGetToken< SiStripDetVOff, SiStripDetVOffRcd > detVOffToken2_
const std::string subdet_tag("SubDet")
static void setBadModuleFlag(std::string &hname, uint16_t &flg)
static void getTopFolderPath(DQMStore &dqm_store, std::string const &top_dir, std::string &path)