CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
SiStripPopConFEDErrorsHandlerFromDQM Class Reference
Inheritance diagram for SiStripPopConFEDErrorsHandlerFromDQM:
SiStripDQMPopConSourceHandler< SiStripBadStrip > popcon::PopConSourceHandler< SiStripBadStrip >

Public Types

typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Public Types inherited from SiStripDQMPopConSourceHandler< SiStripBadStrip >
typedef dqm::legacy::DQMStore DQMStore
 
- Public Types inherited from popcon::PopConSourceHandler< SiStripBadStrip >
typedef std::map< Time_t, std::shared_ptr< SiStripBadStrip > > Container
 
typedef std::unique_ptr< SiStripBadStripRef
 
typedef PopConSourceHandler< SiStripBadStripself
 
typedef cond::Time_t Time_t
 
typedef SiStripBadStrip value_type
 

Public Member Functions

void dqmEndJob (DQMStore::IBooker &booker, DQMStore::IGetter &getter) override
 
SiStripBadStripgetObj () const override
 
void initES (const edm::EventSetup &iSetup) override
 
 SiStripPopConFEDErrorsHandlerFromDQM (const edm::ParameterSet &iConfig, edm::ConsumesCollector &&iC)
 
 ~SiStripPopConFEDErrorsHandlerFromDQM () override
 
- Public Member Functions inherited from SiStripDQMPopConSourceHandler< SiStripBadStrip >
virtual bool checkForCompatibility (const std::string &otherMetaData) const
 
virtual std::string getMetaDataString () const
 
void getNewObjects () override
 
std::string id () const override
 
 SiStripDQMPopConSourceHandler (const edm::ParameterSet &pset)
 
 ~SiStripDQMPopConSourceHandler () override
 
- Public Member Functions inherited from popcon::PopConSourceHandler< SiStripBadStrip >
void initialize (const cond::persistency::Session &dbSession, cond::TagInfo_t const &tagInfo, cond::LogDBEntry_t const &logDBEntry)
 
Ref lastPayload () const
 
cond::LogDBEntry_t const & logDBEntry () const
 
std::pair< Container const *, std::string const > operator() (const cond::persistency::Session &session, cond::TagInfo_t const &tagInfo, cond::LogDBEntry_t const &logDBEntry) const
 
 PopConSourceHandler ()
 
Container const & returnData ()
 
cond::TagInfo_t const & tagInfo () const
 
std::string const & userTextLog () const
 
virtual ~PopConSourceHandler ()
 

Private Member Functions

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)
 

Private Attributes

const SiStripFedCablingcabling_
 
unsigned int debug_
 
std::map< uint32_t, std::vector< unsigned int > > detIdErrors_
 
edm::ESGetToken< SiStripFedCabling, SiStripFedCablingRcdfedCablingToken_
 
edm::ESWatcher< SiStripFedCablingRcdfedCablingWatcher_
 
SiStripBadStrip obj_
 
double threshold_
 

Additional Inherited Members

- Protected Member Functions inherited from SiStripDQMPopConSourceHandler< SiStripBadStrip >
uint32_t getRunNumber () const
 
- Protected Member Functions inherited from popcon::PopConSourceHandler< SiStripBadStrip >
cond::persistency::SessiondbSession () const
 
- Protected Attributes inherited from popcon::PopConSourceHandler< SiStripBadStrip >
Container m_iovs
 
std::vector< std::pair< SiStripBadStrip *, Time_t > > m_to_transfer
 
std::string m_userTextLog
 

Detailed Description

Author
A.-M. Magnan, M. De Mattia
P. David update to PopConSourceHandler and DQMEDHarvester 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 14 of file SiStripPopConFEDErrorsDQM.cc.

Member Typedef Documentation

◆ DQMStore

Definition at line 17 of file SiStripPopConFEDErrorsDQM.cc.

◆ MonitorElement

Definition at line 16 of file SiStripPopConFEDErrorsDQM.cc.

Constructor & Destructor Documentation

◆ SiStripPopConFEDErrorsHandlerFromDQM()

SiStripPopConFEDErrorsHandlerFromDQM::SiStripPopConFEDErrorsHandlerFromDQM ( const edm::ParameterSet iConfig,
edm::ConsumesCollector &&  iC 
)
explicit

Definition at line 58 of file SiStripPopConFEDErrorsDQM.cc.

61  threshold_(iConfig.getUntrackedParameter<double>("Threshold", 0)),
62  debug_(iConfig.getUntrackedParameter<unsigned int>("Debug", 0)),
64  edm::LogInfo("SiStripFEDErrorsDQM") << "[SiStripFEDErrorsDQM::SiStripFEDErrorsDQM()]";
65 }
T getUntrackedParameter(std::string const &, T const &) const
edm::ESGetToken< SiStripFedCabling, SiStripFedCablingRcd > fedCablingToken_
Log< level::Info, false > LogInfo
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...

◆ ~SiStripPopConFEDErrorsHandlerFromDQM()

SiStripPopConFEDErrorsHandlerFromDQM::~SiStripPopConFEDErrorsHandlerFromDQM ( )
override

Definition at line 67 of file SiStripPopConFEDErrorsDQM.cc.

67  {
68  edm::LogInfo("SiStripFEDErrorsDQM") << "[SiStripFEDErrorsDQM::~SiStripFEDErrorsDQM]";
69 }
Log< level::Info, false > LogInfo

Member Function Documentation

◆ addBadAPV()

void SiStripPopConFEDErrorsHandlerFromDQM::addBadAPV ( const FedChannelConnection aConnection,
const unsigned short  aAPVNumber,
const unsigned short  aFlag,
unsigned int &  aCounter 
)
private

Definition at line 321 of file SiStripPopConFEDErrorsDQM.cc.

References addBadStrips(), FedChannelConnection::apvPairNumber(), FedChannelConnection::detId(), sistrip::invalid32_, and FedChannelConnection::isConnected().

Referenced by readHistogram().

324  {
325  if (!aConnection.isConnected()) {
326  edm::LogWarning("SiStripFEDErrorsDQM") << "[SiStripFEDErrorsDQM::addBadAPV] Warning, incompatible cabling ! "
327  "Channel is not connected, but entry found in histo ... "
328  << std::endl;
329  return;
330  }
331  unsigned int lDetid = aConnection.detId();
332  if (!lDetid || lDetid == sistrip::invalid32_) {
333  edm::LogWarning("SiStripFEDErrorsDQM")
334  << "[SiStripFEDErrorsDQM::addBadAPV] Warning, DetId is invalid: " << lDetid << std::endl;
335  return;
336  }
337  //unsigned short nChInModule = aConnection.nApvPairs();
338  unsigned short lApvNum = 0;
339  if (aAPVNumber < 2) {
340  lApvNum = 2 * aConnection.apvPairNumber();
341  addBadStrips(aConnection, lDetid, lApvNum, aFlag, aCounter);
342  }
343  if (aAPVNumber == 0 || aAPVNumber == 2) {
344  lApvNum = 2 * aConnection.apvPairNumber() + 1;
345  addBadStrips(aConnection, lDetid, lApvNum, aFlag, aCounter);
346  }
347 }
void addBadStrips(const FedChannelConnection &aConnection, const unsigned int aDetId, const unsigned short aApvNum, const unsigned short aFlag, unsigned int &aCounter)
static const uint32_t invalid32_
Definition: Constants.h:15
const uint32_t & detId() const
uint16_t apvPairNumber() const
Log< level::Warning, false > LogWarning

◆ 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 349 of file SiStripPopConFEDErrorsDQM.cc.

References detIdErrors_, SiStripBadStrip::encode(), FedChannelConnection::fedCh(), FedChannelConnection::fedId(), LogTrace, and obj_.

Referenced by addBadAPV().

353  {
354  // std::vector<unsigned int> lStripVector;
355  const unsigned short lFirstBadStrip = aApvNum * 128;
356  const unsigned short lConsecutiveBadStrips = 128;
357 
358  unsigned int lBadStripRange = obj_.encode(lFirstBadStrip, lConsecutiveBadStrips, aFlag);
359 
360  LogTrace("SiStripFEDErrorsDQM") << "[SiStripFEDErrorsDQM::addBadStrips] ---- Adding : detid " << aDetId << " (FED "
361  << aConnection.fedId() << ", Ch " << aConnection.fedCh() << ")"
362  << ", APV " << aApvNum << ", flag " << aFlag << std::endl;
363 
364  detIdErrors_[aDetId].push_back(lBadStripRange);
365 
366  // lStripVector.push_back(lBadStripRange);
367  // SiStripBadStrip::Range lRange(lStripVector.begin(),lStripVector.end());
368  // if ( !obj.put(aDetId,lRange) ) {
369  // edm::LogError("SiStripFEDErrorsDQM")<<"[SiStripFEDErrorsDQM::addBadStrips] detid already exists." << std::endl;
370  // }
371 
372  aCounter++;
373 }
#define LogTrace(id)
std::map< uint32_t, std::vector< unsigned int > > detIdErrors_
const uint16_t & fedId() const
const uint16_t & fedCh() const
unsigned int encode(const unsigned short &first, const unsigned short &NconsecutiveBadStrips, const unsigned short &flag=0)

◆ addErrors()

void SiStripPopConFEDErrorsHandlerFromDQM::addErrors ( )
private

Writes the errors to the db.

Definition at line 380 of file SiStripPopConFEDErrorsDQM.cc.

References SiStripBadStrip::decode(), detIdErrors_, SiStripBadStrip::encode(), SiStripBadStrip::data::firstStrip, SiStripBadStrip::data::flag, obj_, and SiStripBadStrip::put().

Referenced by dqmEndJob().

380  {
381  for (const auto& it : detIdErrors_) {
382  const std::vector<uint32_t>& lList = it.second;
383 
384  //map of first strip number and flag
385  //purpose is to encode all existing flags into a unique one...
386  std::map<unsigned short, unsigned short> lAPVMap;
387  for (auto cCont : lList) {
388  SiStripBadStrip::data lData = obj_.decode(cCont);
389  unsigned short lFlag = 0;
390  setFlagBit(lFlag, lData.flag);
391 
392  //std::cout << " -- Detid " << it.first << ", strip " << lData.firstStrip << ", flag " << lData.flag << std::endl;
393 
394  auto lInsert = lAPVMap.emplace(lData.firstStrip, lFlag);
395  if (!lInsert.second) {
396  //std::cout << " ---- Adding bit : " << lData.flag << " to " << lInsert.first->second << ": ";
397  setFlagBit(lInsert.first->second, lData.flag);
398  //std::cout << lInsert.first->second << std::endl;
399  }
400  }
401 
402  //encode the new flag
403  std::vector<unsigned int> lStripVector;
404  const unsigned short lConsecutiveBadStrips = 128;
405  lStripVector.reserve(lAPVMap.size());
406  for (const auto& lIter : lAPVMap) {
407  lStripVector.push_back(obj_.encode(lIter.first, lConsecutiveBadStrips, lIter.second));
408  }
409 
410  SiStripBadStrip::Range lRange(lStripVector.begin(), lStripVector.end());
411  if (!obj_.put(it.first, lRange)) {
412  edm::LogError("SiStripFEDErrorsDQM") << "[SiStripFEDErrorsDQM::addBadStrips] detid already exists." << std::endl;
413  }
414  }
415 }
Log< level::Error, false > LogError
std::map< uint32_t, std::vector< unsigned int > > detIdErrors_
unsigned short firstStrip
std::pair< ContainerIterator, ContainerIterator > Range
data decode(const unsigned int &value) const
bool put(const uint32_t &detID, const InputVector &vect)
unsigned int encode(const unsigned short &first, const unsigned short &NconsecutiveBadStrips, const unsigned short &flag=0)

◆ dqmEndJob()

void SiStripPopConFEDErrorsHandlerFromDQM::dqmEndJob ( DQMStore::IBooker booker,
DQMStore::IGetter getter 
)
overridevirtual

Reimplemented from SiStripDQMPopConSourceHandler< SiStripBadStrip >.

Definition at line 77 of file SiStripPopConFEDErrorsDQM.cc.

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(), 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.

77  {
79 
80  std::ostringstream lPath;
81  lPath << "Run " << getRunNumber() << "/SiStrip/Run summary/ReadoutView/";
82  const std::string lBaseDir = lPath.str();
83 
84  getter.setCurrentFolder(lBaseDir);
85  LogTrace("SiStripFEDErrorsDQM") << "[SiStripFEDErrorsDQM::readBadAPVs] Now in " << lBaseDir << std::endl;
86 
87  std::vector<std::pair<std::string, unsigned int> > lFedsFolder;
88  //for FED errors, use summary folder and fedId=0
89  //do not put a slash or "goToDir" won't work...
90  lFedsFolder.push_back(std::pair<std::string, unsigned int>("FedMonitoringSummary", 0));
91 
92  //for FE/channel/APV errors, they are written in a folder per FED,
93  //if there was at least one error.
94  //So just loop on folders and see which ones exist.
95  for (unsigned int ifed(FEDNumbering::MINSiStripFEDID); ifed <= FEDNumbering::MAXSiStripFEDID;
96  ifed++) { //loop on FEDs
97 
98  std::ostringstream lFedDir;
99  lFedDir << "FrontEndDriver" << ifed;
100  if (!getter.dirExists(lFedDir.str()))
101  continue;
102  else {
103  if (debug_)
104  LogTrace("SiStripFEDErrorsDQM") << "[SiStripFEDErrorsDQM::readBadAPVs] - Errors detected for FED " << ifed
105  << std::endl;
106  lFedsFolder.push_back(std::pair<std::string, unsigned int>(lFedDir.str(), ifed));
107  }
108  }
109  getter.cd();
110 
111  unsigned int nAPVsTotal = 0;
112  //retrieve total number of APVs valid and connected from cabling:
113  if (!cabling_) {
114  edm::LogError("SiStripFEDErrorsDQM") << "[SiStripFEDErrorsDQM::readBadAPVs] cabling not filled, return false "
115  << std::endl;
116  return;
117  }
118  auto lFedVec = cabling_->fedIds();
119  for (unsigned int iFed(0); iFed < lFedVec.size(); iFed++) {
120  if (*(lFedVec.begin() + iFed) < sistrip::FED_ID_MIN || *(lFedVec.begin() + iFed) > sistrip::FED_ID_MAX) {
121  edm::LogError("SiStripFEDErrorsDQM")
122  << "[SiStripFEDErrorsDQM::readBadAPVs] Invalid fedid : " << *(lFedVec.begin() + iFed) << std::endl;
123  continue;
124  }
125  auto lConnVec = cabling_->fedConnections(*(lFedVec.begin() + iFed));
126  for (unsigned int iConn(0); iConn < lConnVec.size(); iConn++) {
127  const FedChannelConnection& lConnection = *(lConnVec.begin() + iConn);
128  if (!lConnection.isConnected())
129  continue;
130  unsigned int lDetid = lConnection.detId();
131  if (!lDetid || lDetid == sistrip::invalid32_)
132  continue;
133  //2 APVs per channel....
134  nAPVsTotal += 2;
135  }
136  }
137 
138  edm::LogInfo("SiStripFEDErrorsDQM") << "[SiStripFEDErrorsDQM::readBadAPVs] Total number of APVs found : "
139  << nAPVsTotal << std::endl;
140 
141  unsigned int nAPVsWithErrorTotal = 0;
142  unsigned int nFolders = 0;
143  float lNorm = 0;
144  for (const auto& iFolder : lFedsFolder) {
145  const std::string lDirName = lBaseDir + "/" + iFolder.first;
146  const unsigned int lFedId = iFolder.second;
147 
148  if (!getter.dirExists(lDirName))
149  continue;
150 
151  std::vector<MonitorElement*> lMeVec = getter.getContents(lDirName);
152 
153  if (nFolders == 0) {
154  for (auto iMe : lMeVec) { //loop on ME found in directory
155  std::string lMeName = iMe->getName();
156  if (lMeName.find("nFEDErrors") != lMeName.npos) {
157  lNorm = iMe->getEntries();
158  }
159  }
160  //if norm histo has not been found, no point in continuing....
161  if (lNorm < 1) {
162  edm::LogError("SiStripFEDErrorsDQM")
163  << "[SiStripFEDErrorsDQM::readBadAPVs] nFEDErrors not found, norm is " << lNorm << std::endl;
164  return;
165  }
166  }
167 
168  unsigned int nAPVsWithError = 0;
169  for (auto iMe : lMeVec) { //loop on ME found in directory
170  if (iMe->getEntries() == 0)
171  continue;
172  const std::string lMeName = iMe->getName();
173 
174  bool lookForErrors = false;
175  if (nFolders == 0) {
176  //for the first element of lFedsFolder: this is FED errors
177  lookForErrors = lMeName.find("DataMissing") != lMeName.npos || lMeName.find("AnyFEDErrors") != lMeName.npos ||
178  (lMeName.find("CorruptBuffer") != lMeName.npos && lMeName.find("nFED") == lMeName.npos);
179  } else {
180  //for the others, it is channel or FE errors.
181  lookForErrors = lMeName.find("APVAddressError") != lMeName.npos || lMeName.find("APVError") != lMeName.npos ||
182  lMeName.find("BadMajorityAddresses") != lMeName.npos ||
183  lMeName.find("FEMissing") != lMeName.npos || lMeName.find("OOSBits") != lMeName.npos ||
184  lMeName.find("UnlockedBits") != lMeName.npos;
185  }
186 
187  if (lookForErrors)
188  readHistogram(iMe, nAPVsWithError, lNorm, lFedId);
189 
190  } //loop on ME found in directory
191 
192  nAPVsWithErrorTotal += nAPVsWithError;
193  ++nFolders;
194  } //loop on lFedsFolders
195 
196  edm::LogInfo("SiStripFEDErrorsDQM")
197  << "[SiStripFEDErrorsDQM::readBadAPVs] Total APVs with error found above threshold = " << nAPVsWithErrorTotal
198  << std::endl;
199 
200  getter.cd();
201 
202  addErrors();
203 }
static const uint16_t FED_ID_MIN
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
static const uint32_t invalid32_
Definition: Constants.h:15
virtual bool dirExists(std::string const &path) const
Definition: DQMStore.cc:769
Log< level::Error, false > LogError
#define LogTrace(id)
Class containning control, module, detector and connection information, at the level of a FED channel...
void addErrors()
Writes the errors to the db.
const uint32_t & detId() const
Log< level::Info, false > LogInfo
void readHistogram(MonitorElement *aMe, unsigned int &aCounter, const float aNorm, const unsigned int aFedId)
static const uint16_t FED_ID_MAX
FedsConstIterRange fedIds() const
ConnsConstIterRange fedConnections(uint16_t fed_id) const
virtual std::vector< dqm::harvesting::MonitorElement * > getContents(std::string const &path) const
Definition: DQMStore.cc:625

◆ getObj()

SiStripBadStrip * SiStripPopConFEDErrorsHandlerFromDQM::getObj ( ) const
overridevirtual

◆ initES()

void SiStripPopConFEDErrorsHandlerFromDQM::initES ( const edm::EventSetup iSetup)
overridevirtual

Reimplemented from SiStripDQMPopConSourceHandler< SiStripBadStrip >.

Definition at line 71 of file SiStripPopConFEDErrorsDQM.cc.

References cabling_, edm::ESWatcher< T >::check(), fedCablingToken_, fedCablingWatcher_, and edm::EventSetup::getData().

71  {
72  if (fedCablingWatcher_.check(iSetup)) {
74  }
75 }
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
edm::ESGetToken< SiStripFedCabling, SiStripFedCablingRcd > fedCablingToken_
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
edm::ESWatcher< SiStripFedCablingRcd > fedCablingWatcher_

◆ readHistogram()

void SiStripPopConFEDErrorsHandlerFromDQM::readHistogram ( MonitorElement aMe,
unsigned int &  aCounter,
const float  aNorm,
const unsigned int  aFedId 
)
private

Definition at line 207 of file SiStripPopConFEDErrorsDQM.cc.

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().

210  {
211  unsigned short lFlag = 0;
212  std::string lMeName = aMe->getName();
213  if (lMeName.find("DataMissing") != lMeName.npos) {
214  lFlag = 0;
215  } else if (lMeName.find("AnyFEDErrors") != lMeName.npos) {
216  lFlag = 1;
217  } else if (lMeName.find("CorruptBuffer") != lMeName.npos && lMeName.find("nFED") == lMeName.npos) {
218  lFlag = 2;
219  } else if (lMeName.find("FEMissing") != lMeName.npos) {
220  lFlag = 3;
221  } else if (lMeName.find("BadMajorityAddresses") != lMeName.npos) {
222  lFlag = 4;
223  } else if (lMeName.find("UnlockedBits") != lMeName.npos) {
224  lFlag = 5;
225  } else if (lMeName.find("OOSBits") != lMeName.npos) {
226  lFlag = 6;
227  } else if (lMeName.find("APVAddressError") != lMeName.npos) {
228  lFlag = 7;
229  } else if (lMeName.find("APVError") != lMeName.npos) {
230  lFlag = 8;
231  } else {
232  edm::LogError("SiStripFEDErrorsDQM") << "[SiStripFEDErrorsDQM::readHistogramError] Shouldn't be here ..."
233  << std::endl;
234  return;
235  }
236 
237  if (debug_) {
238  LogTrace("SiStripFEDErrorsDQM") << "[SiStripFEDErrorsDQM::readHistogramError] Reading histo : " << lMeName
239  << ", flag = " << lFlag << std::endl;
240  }
241 
242  unsigned int lNBins = aMe->getNbinsX();
243  int lBinShift = 0;
244  bool lIsFedHist = false;
245  bool lIsAPVHist = false;
246  bool lIsFeHist = false;
247  bool lIsChHist = false;
248 
249  if (lNBins > 200) {
250  lBinShift = FEDNumbering::MINSiStripFEDID - 1; //shift for FED ID from bin number
251  lIsFedHist = true;
252  } else {
253  lBinShift = -1; //shift for channel/APV/FE id from bin number
254  if (lNBins > 100)
255  lIsAPVHist = true;
256  else if (lNBins < 10)
257  lIsFeHist = true;
258  else
259  lIsChHist = true;
260  }
261 
262  if (debug_) {
263  LogTrace("SiStripFEDErrorsDQM") << "[SiStripFEDErrorsDQM::readHistogramError] lIsFedHist: " << lIsFedHist
264  << std::endl
265  << "[SiStripFEDErrorsDQM::readHistogramError] lIsAPVHist: " << lIsAPVHist
266  << std::endl
267  << "[SiStripFEDErrorsDQM::readHistogramError] lIsFeHist : " << lIsFeHist
268  << std::endl
269  << "[SiStripFEDErrorsDQM::readHistogramError] lIsChHist : " << lIsChHist
270  << std::endl;
271  }
272 
273  for (unsigned int ibin(1); ibin < lNBins + 1; ibin++) {
274  if (aMe->getBinContent(ibin) > 0) {
275  float lStat = aMe->getBinContent(ibin) * 1. / aNorm;
276  if (lStat <= threshold_) {
277  if (debug_)
278  LogTrace("SiStripFEDErrorsDQM")
279  << "[SiStripFEDErrorsDQM::readHistogramError] ---- Below threshold : " << lStat << std::endl;
280  continue;
281  }
282  if (lIsFedHist) {
283  unsigned int lFedId = ibin + lBinShift;
284  //loop on all enabled channels of this FED....
285  for (unsigned int iChId = 0; iChId < sistrip::FEDCH_PER_FED; iChId++) { //loop on channels
286  const FedChannelConnection& lConnection = cabling_->fedConnection(lFedId, iChId);
287  if (!lConnection.isConnected())
288  continue;
289  addBadAPV(lConnection, 0, lFlag, aCounter);
290  }
291  } else {
292  if (lIsFeHist) {
293  unsigned int iFeId = ibin + lBinShift;
294  //loop on all enabled channels of this FE....
295  for (unsigned int iFeCh = 0; iFeCh < sistrip::FEDCH_PER_FEUNIT; iFeCh++) { //loop on channels
296  unsigned int iChId = sistrip::FEDCH_PER_FEUNIT * iFeId + iFeCh;
297  const FedChannelConnection& lConnection = cabling_->fedConnection(aFedId, iChId);
298  if (!lConnection.isConnected())
299  continue;
300  addBadAPV(lConnection, 0, lFlag, aCounter);
301  }
302  } else {
303  unsigned int iChId = ibin + lBinShift;
304  if (lIsAPVHist) {
305  unsigned int iAPVid = iChId % 2 + 1;
306  iChId = static_cast<unsigned int>(iChId / 2.);
307  const FedChannelConnection& lConnection = cabling_->fedConnection(aFedId, iChId);
308  addBadAPV(lConnection, iAPVid, lFlag, aCounter);
309 
310  } //ifAPVhists
311  else {
312  const FedChannelConnection& lConnection = cabling_->fedConnection(aFedId, iChId);
313  addBadAPV(lConnection, 0, lFlag, aCounter);
314  }
315  } //if not FE hist
316  } //if not FED hist
317  } //if entries in histo
318  } //loop on bins
319 } //method readHistogram
FedChannelConnection fedConnection(uint16_t fed_id, uint16_t fed_ch) const
Log< level::Error, false > LogError
#define LogTrace(id)
Class containning control, module, detector and connection information, at the level of a FED channel...
void addBadAPV(const FedChannelConnection &aConnection, const unsigned short aAPVNumber, const unsigned short aFlag, unsigned int &aCounter)
static const uint16_t FEDCH_PER_FEUNIT
const std::string & getName() const
get name of ME
static const uint16_t FEDCH_PER_FED
virtual int getNbinsX() const
get # of bins in X-axis
virtual double getBinContent(int binx) const
get content of bin (1-D)

Member Data Documentation

◆ cabling_

const SiStripFedCabling* SiStripPopConFEDErrorsHandlerFromDQM::cabling_
private

Definition at line 48 of file SiStripPopConFEDErrorsDQM.cc.

Referenced by dqmEndJob(), initES(), and readHistogram().

◆ debug_

unsigned int SiStripPopConFEDErrorsHandlerFromDQM::debug_
private

Definition at line 45 of file SiStripPopConFEDErrorsDQM.cc.

Referenced by dqmEndJob(), and readHistogram().

◆ detIdErrors_

std::map<uint32_t, std::vector<unsigned int> > SiStripPopConFEDErrorsHandlerFromDQM::detIdErrors_
private

Definition at line 50 of file SiStripPopConFEDErrorsDQM.cc.

Referenced by addBadStrips(), and addErrors().

◆ fedCablingToken_

edm::ESGetToken<SiStripFedCabling, SiStripFedCablingRcd> SiStripPopConFEDErrorsHandlerFromDQM::fedCablingToken_
private

Definition at line 46 of file SiStripPopConFEDErrorsDQM.cc.

Referenced by initES().

◆ fedCablingWatcher_

edm::ESWatcher<SiStripFedCablingRcd> SiStripPopConFEDErrorsHandlerFromDQM::fedCablingWatcher_
private

Definition at line 47 of file SiStripPopConFEDErrorsDQM.cc.

Referenced by initES().

◆ obj_

SiStripBadStrip SiStripPopConFEDErrorsHandlerFromDQM::obj_
private

Definition at line 49 of file SiStripPopConFEDErrorsDQM.cc.

Referenced by addBadStrips(), addErrors(), dqmEndJob(), and getObj().

◆ threshold_

double SiStripPopConFEDErrorsHandlerFromDQM::threshold_
private

Definition at line 44 of file SiStripPopConFEDErrorsDQM.cc.

Referenced by readHistogram().