33 LogDebug(
"SiStripDcsInfo") <<
"SiStripDcsInfo::Deleting SiStripDcsInfo ";
50 LogDebug(
"SiStripDcsInfo") <<
"SiStripDcsInfo:: Begining of Run";
59 runInfoRec->get(sumFED);
62 std::vector<int> FedsInIds = sumFED->
m_fed_in;
63 for (
unsigned int it = 0; it < FedsInIds.size(); ++it) {
64 int fedID = FedsInIds[it];
65 if (fedID >= siStripFedIdMin && fedID <= siStripFedIdMax)
82 LogDebug(
"SiStripDcsInfo") <<
"SiStripDcsInfo::beginLuminosityBlock";
89 subDetME.second.FaultyDetectors.clear();
96 LogDebug(
"SiStripDcsInfo") <<
"SiStripDcsInfo::endLuminosityBlock";
106 LogDebug(
"SiStripDcsInfo") <<
"SiStripDcsInfo::EndRun";
112 subDetME.second.FaultyDetectors.clear();
127 if (!strip_dir.empty())
137 if (!strip_dir.empty())
143 subDetME.DcsFractionME = dqm_store.
bookFloat(me_name);
159 LogDebug(
"SiStripDcsInfo") <<
"SiStripDcsInfo::readCabling : " 160 <<
" Change in Cache";
163 std::vector<uint32_t> SelectedDetIds;
165 LogDebug(
"SiStripDcsInfo") <<
" SiStripDcsInfo::readCabling : " 166 <<
" Total Detectors " << SelectedDetIds.size();
170 it->second.TotalDetectors = 0;
173 for (std::vector<uint32_t>::const_iterator idetid = SelectedDetIds.begin(); idetid != SelectedDetIds.end();
175 uint32_t detId = *idetid;
176 if (detId == 0 || detId == 0xFFFFFFFF)
181 std::map<std::string, SubDetMEs>::iterator iPos =
SubDetMEsMap.find(subdet_tag);
183 iPos->second.TotalDetectors++;
198 std::vector<uint32_t> FaultyDetIds;
200 LogDebug(
"SiStripDcsInfo") <<
" SiStripDcsInfo::readStatus : " 201 <<
" Faulty Detectors " << FaultyDetIds.size();
203 for (std::vector<uint32_t>::const_iterator ihvoff = FaultyDetIds.begin(); ihvoff != FaultyDetIds.end(); ++ihvoff) {
204 uint32_t detId_hvoff = (*ihvoff);
210 std::map<std::string, SubDetMEs>::iterator iPos =
SubDetMEsMap.find(subdet_tag);
212 std::vector<uint32_t>::iterator ibad =
213 std::find(iPos->second.FaultyDetectors.begin(), iPos->second.FaultyDetectors.end(), detId_hvoff);
214 if (ibad == iPos->second.FaultyDetectors.end())
215 iPos->second.FaultyDetectors.push_back(detId_hvoff);
227 float total_det = 0.0;
228 float faulty_det = 0.0;
231 int total_subdet = subDetMEs.TotalDetectors;
232 int faulty_subdet = subDetMEs.FaultyDetectors.size();
236 fraction = 1.0 - faulty_subdet * 1.0 / total_subdet;
237 subDetMEs.DcsFractionME->Reset();
238 subDetMEs.DcsFractionME->Fill(fraction);
239 edm::LogInfo(
"SiStripDcsInfo") <<
" SiStripDcsInfo::fillStatus : Sub Detector " <<
name <<
" Total Number " 240 << total_subdet <<
" Faulty ones " << faulty_subdet;
241 total_det += total_subdet;
242 faulty_det += faulty_subdet;
247 fraction = 1 - faulty_det / total_det;
255 for (
auto&
pr : SubDetMEsMap) {
256 for (
auto const detId_faulty :
pr.second.FaultyDetectors) {
257 pr.second.NLumiDetectorIsFaulty[detId_faulty]++;
271 pr.second.DcsFractionME->Reset();
272 pr.second.DcsFractionME->Fill(-1.0);
288 auto const& lumiCountBadModules =
pr.second.NLumiDetectorIsFaulty;
289 for (
auto const [ibad, nBadLumi] : lumiCountBadModules) {
292 std::string bad_module_folder = mechanical_dir +
"/" +
pr.second.folder_name +
297 std::ostringstream detid_str;
299 std::string full_path = bad_module_folder +
"/" + detid_str.str();
306 me = dqm_store.
bookInt(detid_str.str());
static void setBadModuleFlag(std::string &hname, uint16_t &flg)
std::optional< T > tryToGet() const
void endLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &iSetup) override
void addActiveDetectorsRawIds(std::vector< uint32_t > &) const
void bookStatus(DQMStore &dqm_store)
SiStripDcsInfo(const edm::ParameterSet &ps)
void setLumiFlag()
this ME is meant to be stored for each luminosity section
virtual int64_t getIntValue() const
std::string const & pwd() const
static float MaxAcceptableBadDcsLumi_
bool IsConnected(const uint32_t &det_id) const
MonitorElement * bookInt(char_string const &name)
Book int.
void beginLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &eSetup) override
static float MinAcceptableDcsDetFrac_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
void cd()
go to top directory (ie. root)
virtual void Reset()
reset ME (ie. contents, errors, etc)
MonitorElement * get(std::string const &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
#define DEFINE_FWK_MODULE(type)
void fillStatus(DQMStore &dqm_store)
void getDetIds(std::vector< uint32_t > &DetIds_) const
std::map< std::string, SubDetMEs > SubDetMEsMap
std::vector< int > m_fed_in
const std::string subdet_tag("SubDet")
edm::ESHandle< SiStripDetCabling > detCabling_
edm::ESHandle< SiStripDetVOff > siStripDetVOff_
void readCabling(edm::EventSetup const &)
void beginRun(edm::Run const &run, edm::EventSetup const &eSetup) override
MonitorElement * DcsFraction_
void setCurrentFolder(std::string const &fullpath)
static void getSubDetectorTag(uint32_t det_id, std::string &subdet_tag, const TrackerTopology *tTopo)
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)
unsigned long long m_cacheIDCabling_
MonitorElement * bookFloat(char_string const &name)
Book float.
void addBadModules(DQMStore &dqm_store)
void readStatus(edm::EventSetup const &)
T const * product() const
static void getTopFolderPath(DQMStore &dqm_store, std::string const &top_dir, std::string &path)
void fillDummyStatus(DQMStore &dqm_store)