CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
DTBlockedROChannelsTest::DTLinkBinsMap Class Reference

Public Member Functions

void addLinkBin (int linkBin)
 
 DTLinkBinsMap (DQMStore::IGetter &igetter, const int fed, const int mapSlot)
 
 DTLinkBinsMap ()
 
double getChamberPercentage (DQMStore::IGetter &)
 
void init (bool v)
 
bool linkChanged (int linkBin)
 
void readNewValues (DQMStore::IGetter &igetter)
 
 ~DTLinkBinsMap ()
 

Private Member Functions

int getValueLinkBin (int linkBin) const
 

Private Attributes

bool init_
 
std::map< int, int > linksAndValues
 
const MonitorElementmeuROS
 
std::string urosHName
 

Detailed Description

Definition at line 117 of file DTBlockedROChannelsTest.h.

Constructor & Destructor Documentation

DTBlockedROChannelsTest::DTLinkBinsMap::DTLinkBinsMap ( DQMStore::IGetter igetter,
const int  fed,
const int  mapSlot 
)

Definition at line 378 of file DTBlockedROChannelsTest.cc.

References dqm::dqmstoreimpl::DQMStore::IGetter::get(), meuROS, urosHName, and makeMuonMisalignmentScenario::wheel.

379  : init_(true) {
380  int wheel = (ddu - 770) % 5 - 2;
381 
382  // get the pointer to the corresondig histo
383  urosHName = "DT/00-DataIntegrity/Wheel" + to_string(wheel) + "/ROS" + to_string(ros) + "/W" + to_string(wheel) +
384  "_ROS" + to_string(ros) + "_ROSError";
385  meuROS = igetter.get(urosHName);
386 }
DTBlockedROChannelsTest::DTLinkBinsMap::DTLinkBinsMap ( )
DTBlockedROChannelsTest::DTLinkBinsMap::~DTLinkBinsMap ( )

Definition at line 390 of file DTBlockedROChannelsTest.cc.

390 {}

Member Function Documentation

void DTBlockedROChannelsTest::DTLinkBinsMap::addLinkBin ( int  linkBin)

Definition at line 392 of file DTBlockedROChannelsTest.cc.

References getValueLinkBin(), and linksAndValues.

392  {
393  linksAndValues[linkBin] = getValueLinkBin(linkBin);
394 }
double DTBlockedROChannelsTest::DTLinkBinsMap::getChamberPercentage ( DQMStore::IGetter igetter)

Definition at line 422 of file DTBlockedROChannelsTest.cc.

References dqm::dqmstoreimpl::DQMStore::IGetter::get(), linkChanged(), linksAndValues, meuROS, and urosHName.

422  {
423  meuROS = igetter.get(urosHName);
424  int nChangedLinks = 0;
425 
426  for (map<int, int>::const_iterator linkAndValue = linksAndValues.begin(); linkAndValue != linksAndValues.end();
427  ++linkAndValue) {
428  if (linkChanged((*linkAndValue).first))
429  nChangedLinks++;
430  }
431  return 1. - ((double)nChangedLinks / (double)linksAndValues.size());
432 }
int DTBlockedROChannelsTest::DTLinkBinsMap::getValueLinkBin ( int  linkBin) const
private

Definition at line 396 of file DTBlockedROChannelsTest.cc.

References dqm::impl::MonitorElement::getBinContent(), init_, createfilelist::int, meuROS, and relativeConstraints::value.

Referenced by addLinkBin(), and linkChanged().

396  {
397  if (!init_)
398  return 0;
399  int value = 0;
400  if (meuROS) {
401  value += (int)meuROS->getBinContent(5, linkBin); //ONLY NotOKFlag
402  }
403  return value;
404 }
Definition: value.py:1
virtual double getBinContent(int binx) const
get content of bin (1-D)
void DTBlockedROChannelsTest::DTLinkBinsMap::init ( bool  v)
inline
bool DTBlockedROChannelsTest::DTLinkBinsMap::linkChanged ( int  linkBin)

Definition at line 406 of file DTBlockedROChannelsTest.cc.

References getValueLinkBin(), and linksAndValues.

Referenced by getChamberPercentage(), and readNewValues().

406  {
407  // check that this is a valid Link for this map (= it has been added!)
408  if (linksAndValues.find(linkBin) == linksAndValues.end()) {
409  LogWarning("DTDQM|DTRawToDigi|DTMonitorClient|DTBlockedROChannelsTest")
410  << "[DTLinkBinsMap]***Error: Link: " << linkBin << " is not valid" << endl;
411  return false;
412  }
413 
414  int newValue = getValueLinkBin(linkBin);
415  if (newValue > linksAndValues[linkBin]) {
416  linksAndValues[linkBin] = newValue;
417  return true;
418  }
419  return false;
420 }
void DTBlockedROChannelsTest::DTLinkBinsMap::readNewValues ( DQMStore::IGetter igetter)

Definition at line 434 of file DTBlockedROChannelsTest.cc.

References dqm::dqmstoreimpl::DQMStore::IGetter::get(), linkChanged(), linksAndValues, meuROS, and urosHName.

434  {
435  meuROS = igetter.get(urosHName);
436 
437  for (map<int, int>::const_iterator linkAndValue = linksAndValues.begin(); linkAndValue != linksAndValues.end();
438  ++linkAndValue) {
439  linkChanged((*linkAndValue).first);
440  }
441 }

Member Data Documentation

bool DTBlockedROChannelsTest::DTLinkBinsMap::init_
private

Definition at line 138 of file DTBlockedROChannelsTest.h.

Referenced by getValueLinkBin().

std::map<int, int> DTBlockedROChannelsTest::DTLinkBinsMap::linksAndValues
private
const MonitorElement* DTBlockedROChannelsTest::DTLinkBinsMap::meuROS
private
std::string DTBlockedROChannelsTest::DTLinkBinsMap::urosHName
private

Definition at line 144 of file DTBlockedROChannelsTest.h.

Referenced by DTLinkBinsMap(), getChamberPercentage(), and readNewValues().