42 LogDebug(
"SiStripDcsInfo") <<
"SiStripDcsInfo::Deleting SiStripDcsInfo ";
48 LogDebug(
"SiStripDcsInfo") <<
"SiStripDcsInfo::Deleting SiStripDcsInfo ";
63 SubDetMEsMap.insert(std::pair<std::string, SubDetMEs >(tag, local_mes));
70 SubDetMEsMap.insert(std::pair<std::string, SubDetMEs >(tag, local_mes));
77 SubDetMEsMap.insert(std::pair<std::string, SubDetMEs >(tag, local_mes));
84 SubDetMEsMap.insert(std::pair<std::string, SubDetMEs >(tag, local_mes));
91 SubDetMEsMap.insert(std::pair<std::string, SubDetMEs >(tag, local_mes));
98 SubDetMEsMap.insert(std::pair<std::string, SubDetMEs >(tag, local_mes));
104 LogDebug (
"SiStripDcsInfo") <<
"SiStripDcsInfo:: Begining of Run";
111 if( eSetup.
find( recordKey ) !=
nullptr) {
117 std::vector<int> FedsInIds= sumFED->
m_fed_in;
118 for(
unsigned int it = 0; it < FedsInIds.size(); ++it) {
119 int fedID = FedsInIds[it];
120 if(fedID>=siStripFedIdMin && fedID<=siStripFedIdMax) ++
nFEDConnected_;
139 LogDebug(
"SiStripDcsInfo") <<
"SiStripDcsInfo::beginLuminosityBlock";
145 it->second.FaultyDetectors.clear();
155 LogDebug(
"SiStripDcsInfo") <<
"SiStripDcsInfo::endLuminosityBlock";
165 LogDebug (
"SiStripDcsInfo") <<
"SiStripDcsInfo::EndRun";
170 it->second.FaultyDetectors.clear();
195 me_name =
"SiStrip_" + it->first;
216 LogDebug(
"SiStripDcsInfo") <<
"SiStripDcsInfo::readCabling : " 217 <<
" Change in Cache";
220 std::vector<uint32_t> SelectedDetIds;
222 LogDebug(
"SiStripDcsInfo") <<
" SiStripDcsInfo::readCabling : " 223 <<
" Total Detectors " << SelectedDetIds.size();
228 it->second.TotalDetectors = 0;
231 for (std::vector<uint32_t>::const_iterator idetid=SelectedDetIds.begin(); idetid != SelectedDetIds.end(); ++idetid){
232 uint32_t detId = *idetid;
233 if (detId == 0 || detId == 0xFFFFFFFF)
continue;
237 std::map<std::string, SubDetMEs>::iterator iPos =
SubDetMEsMap.find(subdet_tag);
239 iPos->second.TotalDetectors++;
255 std::vector <uint32_t> FaultyDetIds;
257 LogDebug(
"SiStripDcsInfo") <<
" SiStripDcsInfo::readStatus : " 258 <<
" Faulty Detectors " << FaultyDetIds.size();
260 for (std::vector<uint32_t>::const_iterator ihvoff=FaultyDetIds.begin(); ihvoff!=FaultyDetIds.end();++ihvoff){
261 uint32_t detId_hvoff = (*ihvoff);
266 std::map<std::string, SubDetMEs>::iterator iPos =
SubDetMEsMap.find(subdet_tag);
268 std::vector<uint32_t>::iterator ibad =
std::find(iPos->second.FaultyDetectors.begin(), iPos->second.FaultyDetectors.end(), detId_hvoff);
269 if (ibad == iPos->second.FaultyDetectors.end()) iPos->second.FaultyDetectors.push_back( detId_hvoff);
279 float total_det = 0.0;
280 float faulty_det = 0.0;
283 int total_subdet = it->second.TotalDetectors;
284 int faulty_subdet = it->second.FaultyDetectors.size();
286 else fraction = 1.0 - faulty_subdet*1.0/total_subdet;
287 it->second.DcsFractionME->Reset();
288 it->second.DcsFractionME->Fill(fraction);
289 edm::LogInfo(
"SiStripDcsInfo") <<
" SiStripDcsInfo::fillStatus : Sub Detector " 290 << it->first <<
" Total Number " << total_subdet
291 <<
" Faulty ones " << faulty_subdet;
292 total_det += total_subdet;
293 faulty_det += faulty_subdet;
296 else fraction = 1 - faulty_det/total_det;
302 for (std::vector<uint32_t>::iterator ifaulty = it->second.FaultyDetectors.begin(); ifaulty != it->second.FaultyDetectors.end(); ifaulty++) {
303 uint32_t detId_faulty = (*ifaulty);
304 if(
IsLumiGoodDcs_) it->second.NLumiDetectorIsFaulty[detId_faulty]++;
316 it->second.DcsFractionME->Reset();
317 it->second.DcsFractionME->Fill(-1.0);
338 std::unordered_map<uint32_t,uint16_t> lumiCountBadModules = it->second.NLumiDetectorIsFaulty;
339 for(std::unordered_map<uint32_t,uint16_t>::iterator ilumibad = lumiCountBadModules.begin();
340 ilumibad != lumiCountBadModules.end(); ilumibad++) {
341 uint32_t ibad = (*ilumibad).first;
342 uint32_t nBadLumi = (*ilumibad).second;
344 std::string bad_module_folder = mechanical_dir +
"/" +
345 it->second.folder_name +
"/" 349 std::ostringstream detid_str;
351 std::string full_path = bad_module_folder +
"/" + detid_str.str();
static void setBadModuleFlag(std::string &hname, uint16_t &flg)
int64_t getIntValue() const
void endLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &iSetup) override
End Of Luminosity.
void addActiveDetectorsRawIds(std::vector< uint32_t > &) const
const std::string & pwd() const
SiStripDcsInfo(const edm::ParameterSet &ps)
Constructor.
#define DEFINE_FWK_MODULE(type)
static HCTypeTag findType(char const *iTypeName)
find a type based on the types name, if not found will return default HCTypeTag
float MaxAcceptableBadDcsLumi_
bool IsConnected(const uint32_t &det_id) const
void beginLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &eSetup) override
Begin Luminosity Block.
float MinAcceptableDcsDetFrac_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
MonitorElement * bookFloat(const char *name)
Book float.
const eventsetup::EventSetupRecord * find(const eventsetup::EventSetupRecordKey &) const
void setLumiFlag()
this ME is meant to be stored for each luminosity section
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")
MonitorElement * DcsFractionME
~SiStripDcsInfo() override
Destructor.
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
void Reset()
reset ME (ie. contents, errors, etc)
edm::ESHandle< SiStripDetVOff > siStripDetVOff_
void readCabling(edm::EventSetup const &)
void cd()
go to top directory (ie. root)
void beginRun(edm::Run const &run, edm::EventSetup const &eSetup) override
Begin Run.
MonitorElement * DcsFraction_
static void getSubDetectorTag(uint32_t det_id, std::string &subdet_tag, const TrackerTopology *tTopo)
void beginJob() override
BeginJob.
void endRun(edm::Run const &run, edm::EventSetup const &eSetup) override
EndRun.
edm::ESHandle< SiStripDetCabling > detCabling_
void analyze(edm::Event const &, edm::EventSetup const &) override
Analyze.
unsigned long long m_cacheIDCabling_
std::vector< uint32_t > FaultyDetectors
MonitorElement * bookInt(const char *name)
Book int.
void readStatus(edm::EventSetup const &)
static bool goToDir(DQMStore *dqm_store, std::string name)
T const * product() const
static void getTopFolderPath(DQMStore *dqm_store, std::string top_dir, std::string &path)
void setCurrentFolder(const std::string &fullpath)