|
|
|
void | addBadAPV (const FedChannelConnection &aConnection, const unsigned short aAPVNumber, const unsigned short aFlag, unsigned int &aCounter) |
|
void | addBadStrips (const FedChannelConnection &aConnection, const unsigned int aDetId, const unsigned short aApvNum, const unsigned short aFlag, unsigned int &aCounter) |
|
void | addErrors () |
| Writes the errors to the db. More...
|
|
void | readHistogram (MonitorElement *aMe, unsigned int &aCounter, const float aNorm, const unsigned int aFedId) |
|
- Author
- A.-M. Magnan, M. De Mattia
-
P. David update to PopConSourceHandler and DQMEDHarvester @EDAnalyzer to read modules flagged by the DQM due to FED errors as bad and write in the database with the proper error flag.
Definition at line 12 of file SiStripPopConFEDErrorsDQM.cc.
◆ DQMStore
◆ MonitorElement
◆ SiStripPopConFEDErrorsHandlerFromDQM()
SiStripPopConFEDErrorsHandlerFromDQM::SiStripPopConFEDErrorsHandlerFromDQM |
( |
const edm::ParameterSet & |
iConfig | ) |
|
|
explicit |
◆ ~SiStripPopConFEDErrorsHandlerFromDQM()
SiStripPopConFEDErrorsHandlerFromDQM::~SiStripPopConFEDErrorsHandlerFromDQM |
( |
| ) |
|
|
override |
◆ addBadAPV()
void SiStripPopConFEDErrorsHandlerFromDQM::addBadAPV |
( |
const FedChannelConnection & |
aConnection, |
|
|
const unsigned short |
aAPVNumber, |
|
|
const unsigned short |
aFlag, |
|
|
unsigned int & |
aCounter |
|
) |
| |
|
private |
Definition at line 329 of file SiStripPopConFEDErrorsDQM.cc.
334 edm::LogWarning(
"SiStripFEDErrorsDQM") <<
"[SiStripFEDErrorsDQM::addBadAPV] Warning, incompatible cabling ! "
335 "Channel is not connected, but entry found in histo ... "
339 unsigned int lDetid = aConnection.
detId();
342 <<
"[SiStripFEDErrorsDQM::addBadAPV] Warning, DetId is invalid: " << lDetid << std::endl;
346 unsigned short lApvNum = 0;
347 if (aAPVNumber < 2) {
349 addBadStrips(aConnection, lDetid, lApvNum, aFlag, aCounter);
351 if (aAPVNumber == 0 || aAPVNumber == 2) {
353 addBadStrips(aConnection, lDetid, lApvNum, aFlag, aCounter);
References addBadStrips(), FedChannelConnection::apvPairNumber(), FedChannelConnection::detId(), sistrip::invalid32_, and FedChannelConnection::isConnected().
Referenced by readHistogram().
◆ addBadStrips()
void SiStripPopConFEDErrorsHandlerFromDQM::addBadStrips |
( |
const FedChannelConnection & |
aConnection, |
|
|
const unsigned int |
aDetId, |
|
|
const unsigned short |
aApvNum, |
|
|
const unsigned short |
aFlag, |
|
|
unsigned int & |
aCounter |
|
) |
| |
|
private |
Definition at line 357 of file SiStripPopConFEDErrorsDQM.cc.
363 const unsigned short lFirstBadStrip = aApvNum * 128;
364 const unsigned short lConsecutiveBadStrips = 128;
366 unsigned int lBadStripRange =
obj_.
encode(lFirstBadStrip, lConsecutiveBadStrips, aFlag);
368 LogTrace(
"SiStripFEDErrorsDQM") <<
"[SiStripFEDErrorsDQM::addBadStrips] ---- Adding : detid " << aDetId <<
" (FED "
369 << aConnection.
fedId() <<
", Ch " << aConnection.
fedCh() <<
")"
370 <<
", APV " << aApvNum <<
", flag " << aFlag << std::endl;
References detIdErrors_, SiStripBadStrip::encode(), FedChannelConnection::fedCh(), FedChannelConnection::fedId(), LogTrace, and obj_.
Referenced by addBadAPV().
◆ addErrors()
void SiStripPopConFEDErrorsHandlerFromDQM::addErrors |
( |
| ) |
|
|
private |
Writes the errors to the db.
Definition at line 388 of file SiStripPopConFEDErrorsDQM.cc.
390 const std::vector<uint32_t>& lList = it.second;
394 std::map<unsigned short, unsigned short> lAPVMap;
395 for (
auto cCont : lList) {
397 unsigned short lFlag = 0;
398 setFlagBit(lFlag, lData.
flag);
402 auto lInsert = lAPVMap.emplace(lData.
firstStrip, lFlag);
403 if (!lInsert.second) {
405 setFlagBit(lInsert.first->second, lData.
flag);
411 std::vector<unsigned int> lStripVector;
412 const unsigned short lConsecutiveBadStrips = 128;
413 lStripVector.reserve(lAPVMap.size());
414 for (
const auto& lIter : lAPVMap) {
415 lStripVector.push_back(
obj_.
encode(lIter.first, lConsecutiveBadStrips, lIter.second));
419 if (!
obj_.
put(it.first, lRange)) {
420 edm::LogError(
"SiStripFEDErrorsDQM") <<
"[SiStripFEDErrorsDQM::addBadStrips] detid already exists." << std::endl;
References SiStripBadStrip::decode(), detIdErrors_, SiStripBadStrip::encode(), SiStripBadStrip::data::firstStrip, SiStripBadStrip::data::flag, obj_, and SiStripBadStrip::put().
Referenced by dqmEndJob().
◆ dqmEndJob()
Reimplemented from SiStripDQMPopConSourceHandler< SiStripBadStrip >.
Definition at line 83 of file SiStripPopConFEDErrorsDQM.cc.
88 std::ostringstream lPath;
89 lPath <<
"Run " <<
getRunNumber() <<
"/SiStrip/Run summary/ReadoutView/";
93 LogTrace(
"SiStripFEDErrorsDQM") <<
"[SiStripFEDErrorsDQM::readBadAPVs] Now in " << lBaseDir << std::endl;
95 std::vector<std::pair<std::string, unsigned int> > lFedsFolder;
98 lFedsFolder.push_back(std::pair<std::string, unsigned int>(
"FedMonitoringSummary", 0));
106 std::ostringstream lFedDir;
107 lFedDir <<
"FrontEndDriver" << ifed;
112 LogTrace(
"SiStripFEDErrorsDQM") <<
"[SiStripFEDErrorsDQM::readBadAPVs] - Errors detected for FED " << ifed
114 lFedsFolder.push_back(std::pair<std::string, unsigned int>(lFedDir.str(), ifed));
119 unsigned int nAPVsTotal = 0;
122 edm::LogError(
"SiStripFEDErrorsDQM") <<
"[SiStripFEDErrorsDQM::readBadAPVs] cabling not filled, return false "
127 for (
unsigned int iFed(0); iFed < lFedVec.size(); iFed++) {
130 <<
"[SiStripFEDErrorsDQM::readBadAPVs] Invalid fedid : " << *(lFedVec.begin() + iFed) << std::endl;
134 for (
unsigned int iConn(0); iConn < lConnVec.size(); iConn++) {
138 unsigned int lDetid = lConnection.
detId();
146 edm::LogInfo(
"SiStripFEDErrorsDQM") <<
"[SiStripFEDErrorsDQM::readBadAPVs] Total number of APVs found : "
147 << nAPVsTotal << std::endl;
149 unsigned int nAPVsWithErrorTotal = 0;
150 unsigned int nFolders = 0;
152 for (
const auto& iFolder : lFedsFolder) {
153 const std::string lDirName = lBaseDir +
"/" + iFolder.first;
154 const unsigned int lFedId = iFolder.second;
159 std::vector<MonitorElement*> lMeVec = getter.
getContents(lDirName);
162 for (
auto iMe : lMeVec) {
164 if (lMeName.find(
"nFEDErrors") != lMeName.npos) {
165 lNorm = iMe->getEntries();
171 <<
"[SiStripFEDErrorsDQM::readBadAPVs] nFEDErrors not found, norm is " << lNorm << std::endl;
176 unsigned int nAPVsWithError = 0;
177 for (
auto iMe : lMeVec) {
178 if (iMe->getEntries() == 0)
182 bool lookForErrors =
false;
185 lookForErrors = lMeName.find(
"DataMissing") != lMeName.npos || lMeName.find(
"AnyFEDErrors") != lMeName.npos ||
186 (lMeName.find(
"CorruptBuffer") != lMeName.npos && lMeName.find(
"nFED") == lMeName.npos);
189 lookForErrors = lMeName.find(
"APVAddressError") != lMeName.npos || lMeName.find(
"APVError") != lMeName.npos ||
190 lMeName.find(
"BadMajorityAddresses") != lMeName.npos ||
191 lMeName.find(
"FEMissing") != lMeName.npos || lMeName.find(
"OOSBits") != lMeName.npos ||
192 lMeName.find(
"UnlockedBits") != lMeName.npos;
200 nAPVsWithErrorTotal += nAPVsWithError;
205 <<
"[SiStripFEDErrorsDQM::readBadAPVs] Total APVs with error found above threshold = " << nAPVsWithErrorTotal
References addErrors(), cabling_, dqm::implementation::NavigatorBase::cd(), debug_, FedChannelConnection::detId(), dqm::implementation::IGetter::dirExists(), sistrip::FED_ID_MAX, sistrip::FED_ID_MIN, SiStripFedCabling::fedConnections(), SiStripFedCabling::fedIds(), fp_, edm::FileInPath::fullPath(), dqm::implementation::IGetter::getContents(), SiStripDQMPopConSourceHandler< SiStripBadStrip >::getRunNumber(), sistrip::invalid32_, FedChannelConnection::isConnected(), LogTrace, FEDNumbering::MAXSiStripFEDID, FEDNumbering::MINSiStripFEDID, obj_, readHistogram(), dqm::implementation::NavigatorBase::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.
◆ getObj()
◆ initES()
void SiStripPopConFEDErrorsHandlerFromDQM::initES |
( |
const edm::EventSetup & |
iSetup | ) |
|
|
overridevirtual |
◆ readHistogram()
void SiStripPopConFEDErrorsHandlerFromDQM::readHistogram |
( |
MonitorElement * |
aMe, |
|
|
unsigned int & |
aCounter, |
|
|
const float |
aNorm, |
|
|
const unsigned int |
aFedId |
|
) |
| |
|
private |
Definition at line 215 of file SiStripPopConFEDErrorsDQM.cc.
219 unsigned short lFlag = 0;
221 if (lMeName.find(
"DataMissing") != lMeName.npos) {
223 }
else if (lMeName.find(
"AnyFEDErrors") != lMeName.npos) {
225 }
else if (lMeName.find(
"CorruptBuffer") != lMeName.npos && lMeName.find(
"nFED") == lMeName.npos) {
227 }
else if (lMeName.find(
"FEMissing") != lMeName.npos) {
229 }
else if (lMeName.find(
"BadMajorityAddresses") != lMeName.npos) {
231 }
else if (lMeName.find(
"UnlockedBits") != lMeName.npos) {
233 }
else if (lMeName.find(
"OOSBits") != lMeName.npos) {
235 }
else if (lMeName.find(
"APVAddressError") != lMeName.npos) {
237 }
else if (lMeName.find(
"APVError") != lMeName.npos) {
240 edm::LogError(
"SiStripFEDErrorsDQM") <<
"[SiStripFEDErrorsDQM::readHistogramError] Shouldn't be here ..."
246 LogTrace(
"SiStripFEDErrorsDQM") <<
"[SiStripFEDErrorsDQM::readHistogramError] Reading histo : " << lMeName
247 <<
", flag = " << lFlag << std::endl;
252 bool lIsFedHist =
false;
253 bool lIsAPVHist =
false;
254 bool lIsFeHist =
false;
255 bool lIsChHist =
false;
264 else if (lNBins < 10)
271 LogTrace(
"SiStripFEDErrorsDQM") <<
"[SiStripFEDErrorsDQM::readHistogramError] lIsFedHist: " << lIsFedHist
273 <<
"[SiStripFEDErrorsDQM::readHistogramError] lIsAPVHist: " << lIsAPVHist
275 <<
"[SiStripFEDErrorsDQM::readHistogramError] lIsFeHist : " << lIsFeHist
277 <<
"[SiStripFEDErrorsDQM::readHistogramError] lIsChHist : " << lIsChHist
281 for (
unsigned int ibin(1); ibin < lNBins + 1; ibin++) {
287 <<
"[SiStripFEDErrorsDQM::readHistogramError] ---- Below threshold : " << lStat << std::endl;
291 unsigned int lFedId = ibin + lBinShift;
297 addBadAPV(lConnection, 0, lFlag, aCounter);
301 unsigned int iFeId = ibin + lBinShift;
308 addBadAPV(lConnection, 0, lFlag, aCounter);
311 unsigned int iChId = ibin + lBinShift;
313 unsigned int iAPVid = iChId % 2 + 1;
314 iChId = static_cast<unsigned int>(iChId / 2.);
316 addBadAPV(lConnection, iAPVid, lFlag, aCounter);
321 addBadAPV(lConnection, 0, lFlag, aCounter);
References addBadAPV(), cabling_, debug_, sistrip::FEDCH_PER_FED, sistrip::FEDCH_PER_FEUNIT, SiStripFedCabling::fedConnection(), dqm::impl::MonitorElement::getBinContent(), dqm::impl::MonitorElement::getName(), dqm::impl::MonitorElement::getNbinsX(), FedChannelConnection::isConnected(), LogTrace, FEDNumbering::MINSiStripFEDID, AlCaHLTBitMon_QueryRunRegistry::string, and threshold_.
Referenced by dqmEndJob().
◆ cabling_
◆ cablingCacheId_
uint32_t SiStripPopConFEDErrorsHandlerFromDQM::cablingCacheId_ |
|
private |
◆ debug_
unsigned int SiStripPopConFEDErrorsHandlerFromDQM::debug_ |
|
private |
◆ detIdErrors_
std::map<uint32_t, std::vector<unsigned int> > SiStripPopConFEDErrorsHandlerFromDQM::detIdErrors_ |
|
private |
◆ fp_
◆ obj_
◆ threshold_
double SiStripPopConFEDErrorsHandlerFromDQM::threshold_ |
|
private |
T const * product() const
virtual std::vector< dqm::harvesting::MonitorElement * > getContents(std::string const &path) const
static const uint32_t invalid32_
const uint16_t & fedCh() const
virtual void setCurrentFolder(std::string const &fullpath)
data decode(const unsigned int &value) const
FedChannelConnection fedConnection(uint16_t fed_id, uint16_t fed_ch) const
T getUntrackedParameter(std::string const &, T const &) const
static const uint16_t FED_ID_MIN
bool put(const uint32_t &detID, const InputVector &vect)
Log< level::Info, false > LogInfo
Log< level::Warning, false > LogWarning
std::map< uint32_t, std::vector< unsigned int > > detIdErrors_
std::pair< ContainerIterator, ContainerIterator > Range
void addBadAPV(const FedChannelConnection &aConnection, const unsigned short aAPVNumber, const unsigned short aFlag, unsigned int &aCounter)
uint32_t getRunNumber() const
const SiStripFedCabling * cabling_
Class containning control, module, detector and connection information, at the level of a FED channel...
const uint32_t & detId() const
unsigned short firstStrip
Log< level::Error, false > LogError
static const uint16_t FED_ID_MAX
const uint16_t & fedId() const
void addErrors()
Writes the errors to the db.
virtual int getNbinsX() const
get # of bins in X-axis
void addBadStrips(const FedChannelConnection &aConnection, const unsigned int aDetId, const unsigned short aApvNum, const unsigned short aFlag, unsigned int &aCounter)
const std::string & getName() const
get name of ME
static const uint16_t FEDCH_PER_FED
FedsConstIterRange fedIds() const
static const uint16_t FEDCH_PER_FEUNIT
uint16_t apvPairNumber() const
void readHistogram(MonitorElement *aMe, unsigned int &aCounter, const float aNorm, const unsigned int aFedId)
ConnsConstIterRange fedConnections(uint16_t fed_id) const
unsigned int encode(const unsigned short &first, const unsigned short &NconsecutiveBadStrips, const unsigned short &flag=0)
virtual double getBinContent(int binx) const
get content of bin (1-D)
virtual bool dirExists(std::string const &path) const
std::string fullPath() const