35 LogDebug(
"SiStripDcsInfo") <<
"SiStripDcsInfo::Deleting SiStripDcsInfo ";
56 LogDebug (
"SiStripDcsInfo") <<
"SiStripDcsInfo:: Begining of Run";
66 runInfoRec->get(sumFED);
69 std::vector<int> FedsInIds = sumFED->
m_fed_in;
70 for(
unsigned int it = 0; it < FedsInIds.size(); ++it) {
71 int fedID = FedsInIds[it];
72 if (fedID >= siStripFedIdMin && fedID <= siStripFedIdMax)
92 LogDebug(
"SiStripDcsInfo") <<
"SiStripDcsInfo::beginLuminosityBlock";
98 subDetME.second.FaultyDetectors.clear();
108 LogDebug(
"SiStripDcsInfo") <<
"SiStripDcsInfo::endLuminosityBlock";
119 LogDebug (
"SiStripDcsInfo") <<
"SiStripDcsInfo::EndRun";
124 subDetME.second.FaultyDetectors.clear();
140 if (!strip_dir.empty())
150 if (!strip_dir.empty())
156 subDetME.DcsFractionME = dqm_store.
bookFloat(me_name);
173 LogDebug(
"SiStripDcsInfo") <<
"SiStripDcsInfo::readCabling : " 174 <<
" Change in Cache";
177 std::vector<uint32_t> SelectedDetIds;
179 LogDebug(
"SiStripDcsInfo") <<
" SiStripDcsInfo::readCabling : " 180 <<
" Total Detectors " << SelectedDetIds.size();
184 it->second.TotalDetectors = 0;
187 for (std::vector<uint32_t>::const_iterator idetid = SelectedDetIds.begin();
188 idetid != SelectedDetIds.end();
190 uint32_t detId = *idetid;
191 if (detId == 0 || detId == 0xFFFFFFFF)
continue;
195 std::map<std::string, SubDetMEs>::iterator iPos =
SubDetMEsMap.find(subdet_tag);
197 iPos->second.TotalDetectors++;
213 std::vector <uint32_t> FaultyDetIds;
215 LogDebug(
"SiStripDcsInfo") <<
" SiStripDcsInfo::readStatus : " 216 <<
" Faulty Detectors " << FaultyDetIds.size();
218 for (std::vector<uint32_t>::const_iterator ihvoff=FaultyDetIds.begin(); ihvoff!=FaultyDetIds.end();++ihvoff){
219 uint32_t detId_hvoff = (*ihvoff);
224 std::map<std::string, SubDetMEs>::iterator iPos =
SubDetMEsMap.find(subdet_tag);
226 std::vector<uint32_t>::iterator ibad =
std::find(iPos->second.FaultyDetectors.begin(), iPos->second.FaultyDetectors.end(), detId_hvoff);
227 if (ibad == iPos->second.FaultyDetectors.end()) iPos->second.FaultyDetectors.push_back( detId_hvoff);
240 float total_det = 0.0;
241 float faulty_det = 0.0;
244 int total_subdet = subDetMEs.TotalDetectors;
245 int faulty_subdet = subDetMEs.FaultyDetectors.size();
249 fraction = 1.0 - faulty_subdet * 1.0 / total_subdet;
250 subDetMEs.DcsFractionME->Reset();
251 subDetMEs.DcsFractionME->Fill(fraction);
253 <<
" SiStripDcsInfo::fillStatus : Sub Detector " <<
name 254 <<
" Total Number " << total_subdet <<
" Faulty ones " << faulty_subdet;
255 total_det += total_subdet;
256 faulty_det += faulty_subdet;
261 fraction = 1 - faulty_det / total_det;
268 for (
auto&
pr : SubDetMEsMap) {
269 for (
auto const detId_faulty :
pr.second.FaultyDetectors) {
270 pr.second.NLumiDetectorIsFaulty[detId_faulty]++;
285 pr.second.DcsFractionME->Reset();
286 pr.second.DcsFractionME->Fill(-1.0);
304 auto const& lumiCountBadModules =
pr.second.NLumiDetectorIsFaulty;
305 for (
auto const [ibad, nBadLumi] : lumiCountBadModules) {
307 std::string bad_module_folder = mechanical_dir +
"/" +
308 pr.second.folder_name +
313 std::ostringstream detid_str;
315 std::string full_path = bad_module_folder +
"/" + detid_str.str();
322 me = dqm_store.
bookInt(detid_str.str());
static void setBadModuleFlag(std::string &hname, uint16_t &flg)
std::optional< T > tryToGet() const
int64_t getIntValue() 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)
static float MaxAcceptableBadDcsLumi_
bool IsConnected(const uint32_t &det_id) const
void beginLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &eSetup) override
static float MinAcceptableDcsDetFrac_
MonitorElement * bookInt(char_string const &name)
Book int.
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
MonitorElement * bookFloat(char_string const &name)
Book float.
#define DEFINE_FWK_MODULE(type)
void setLumiFlag()
this ME is meant to be stored for each luminosity section
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
MonitorElement * get(std::string const &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
const std::string subdet_tag("SubDet")
void Reset()
reset ME (ie. contents, errors, etc)
std::string const & pwd() const
edm::ESHandle< SiStripDetCabling > detCabling_
edm::ESHandle< SiStripDetVOff > siStripDetVOff_
void setCurrentFolder(std::string const &fullpath)
void readCabling(edm::EventSetup const &)
void cd()
go to top directory (ie. root)
void beginRun(edm::Run const &run, edm::EventSetup const &eSetup) override
MonitorElement * DcsFraction_
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_
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)