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 122 of file DTBlockedROChannelsTest.h.

Constructor & Destructor Documentation

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

Definition at line 411 of file DTBlockedROChannelsTest.cc.

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

411  :
412  init_(true)
413 {
414  int wheel = (ddu - 770)%5 - 2;
415 
416  // get the pointer to the corresondig histo
417  urosHName = "DT/00-DataIntegrity/Wheel" + to_string(wheel) + "/ROS" + to_string(ros)
418  + "/W" + to_string(wheel) + "_ROS" + to_string(ros) + "_ROSError";
419  meuROS = igetter.get(urosHName);
420 }
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:302
DTBlockedROChannelsTest::DTLinkBinsMap::DTLinkBinsMap ( )

Definition at line 422 of file DTBlockedROChannelsTest.cc.

DTBlockedROChannelsTest::DTLinkBinsMap::~DTLinkBinsMap ( )

Definition at line 425 of file DTBlockedROChannelsTest.cc.

425 {}

Member Function Documentation

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

Definition at line 427 of file DTBlockedROChannelsTest.cc.

References getValueLinkBin(), and linksAndValues.

427  {
428  linksAndValues[linkBin] = getValueLinkBin(linkBin);
429  }
double DTBlockedROChannelsTest::DTLinkBinsMap::getChamberPercentage ( DQMStore::IGetter igetter)

Definition at line 459 of file DTBlockedROChannelsTest.cc.

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

459  {
460  meuROS = igetter.get(urosHName);
461  int nChangedLinks = 0;
462 
463  for(map<int, int>::const_iterator linkAndValue = linksAndValues.begin();
464  linkAndValue != linksAndValues.end(); ++linkAndValue) {
465  if(linkChanged((*linkAndValue).first)) nChangedLinks++;
466  }
467  return 1.-((double)nChangedLinks/(double)linksAndValues.size());
468 }
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:302
int DTBlockedROChannelsTest::DTLinkBinsMap::getValueLinkBin ( int  linkBin) const
private

Definition at line 432 of file DTBlockedROChannelsTest.cc.

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

Referenced by addLinkBin(), and linkChanged().

432  {
433  if (!init_)
434  return 0;
435  int value = 0;
436  if(meuROS) {
437  value += (int)meuROS->getBinContent(5,linkBin); //ONLY NotOKFlag
438  }
439  return value;
440  }
Definition: value.py:1
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 442 of file DTBlockedROChannelsTest.cc.

References getValueLinkBin(), and linksAndValues.

Referenced by getChamberPercentage(), and readNewValues().

442  {
443  // check that this is a valid Link for this map (= it has been added!)
444  if(linksAndValues.find(linkBin) == linksAndValues.end()) {
445  LogWarning("DTDQM|DTRawToDigi|DTMonitorClient|DTBlockedROChannelsTest")
446  << "[DTLinkBinsMap]***Error: Link: " << linkBin << " is not valid" << endl;
447  return false;
448  }
449 
450  int newValue = getValueLinkBin(linkBin);
451  if(newValue > linksAndValues[linkBin]) {
452  linksAndValues[linkBin] = newValue;
453  return true;
454  }
455  return false;
456 }
void DTBlockedROChannelsTest::DTLinkBinsMap::readNewValues ( DQMStore::IGetter igetter)

Definition at line 471 of file DTBlockedROChannelsTest.cc.

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

471  {
472  meuROS = igetter.get(urosHName);
473 
474  for(map<int, int>::const_iterator linkAndValue = linksAndValues.begin();
475  linkAndValue != linksAndValues.end(); ++linkAndValue) {
476  linkChanged((*linkAndValue).first);
477  }
478 }
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:302

Member Data Documentation

bool DTBlockedROChannelsTest::DTLinkBinsMap::init_
private

Definition at line 143 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 149 of file DTBlockedROChannelsTest.h.

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