CMS 3D CMS Logo

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

Public Member Functions

void addRobBin (int robBin)
 
 DTRobBinsMap (DQMStore::IGetter &igetter, const int fed, const int ros)
 
 DTRobBinsMap ()
 
double getChamberPercentage (DQMStore::IGetter &)
 
void init (bool v)
 
void readNewValues (DQMStore::IGetter &igetter)
 
bool robChanged (int robBin)
 
 ~DTRobBinsMap ()
 

Private Member Functions

int getValueRobBin (int robBin) const
 
int getValueRos () const
 

Private Attributes

std::string dduHName
 
bool init_
 
const MonitorElementmeDDU
 
const MonitorElementmeROS
 
std::map< int, int > robsAndValues
 
int rosBin
 
std::string rosHName
 
int rosValue
 

Detailed Description

Definition at line 83 of file DTBlockedROChannelsTest.h.

Constructor & Destructor Documentation

DTBlockedROChannelsTest::DTRobBinsMap::DTRobBinsMap ( DQMStore::IGetter igetter,
const int  fed,
const int  ros 
)

Definition at line 303 of file DTBlockedROChannelsTest.cc.

References dduHName, DQMStore::IGetter::get(), meDDU, meROS, and rosHName.

303  :
304  rosBin(ros),
305  init_(true),
306  rosValue(0)
307 {
308 
309  // get the pointer to the corresondig histo
310  // Legacy
311  stringstream mename; mename << "DT/00-DataIntegrity/FED" << fed << "/ROS" << ros
312  << "/FED" << fed << "_ROS" << ros << "_ROSError";
313  rosHName = mename.str();
314 
315  stringstream whname; whname << "DT/00-DataIntegrity/FED" << fed
316  << "/FED" << fed << "_ROSStatus";
317  dduHName = whname.str();
318 
319  meROS = igetter.get(rosHName);
320  meDDU = igetter.get(dduHName);
321 }
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:302
DTBlockedROChannelsTest::DTRobBinsMap::DTRobBinsMap ( )

Definition at line 323 of file DTBlockedROChannelsTest.cc.

323  : init_(true),
324  meROS(nullptr),
325  meDDU(nullptr){}
DTBlockedROChannelsTest::DTRobBinsMap::~DTRobBinsMap ( )

Definition at line 327 of file DTBlockedROChannelsTest.cc.

327 {}

Member Function Documentation

void DTBlockedROChannelsTest::DTRobBinsMap::addRobBin ( int  robBin)

Definition at line 332 of file DTBlockedROChannelsTest.cc.

References getValueRobBin(), and robsAndValues.

332  {
333  robsAndValues[robBin] = getValueRobBin(robBin);
334  }
double DTBlockedROChannelsTest::DTRobBinsMap::getChamberPercentage ( DQMStore::IGetter igetter)

Definition at line 379 of file DTBlockedROChannelsTest.cc.

References dduHName, DQMStore::IGetter::get(), getValueRos(), meDDU, meROS, robChanged(), robsAndValues, rosHName, and rosValue.

Referenced by init(), and DTBlockedROChannelsTest::DTLinkBinsMap::init().

379  {
380  meROS = igetter.get(rosHName);
381  meDDU = igetter.get(dduHName);
382  int nChangedROBs = 0;
383 
384  // check if ros status has changed
385  int newValue = getValueRos();
386  if(newValue > rosValue) {
387  rosValue= newValue;
388  return 0.;
389  }
390 
391  for(map<int, int>::const_iterator robAndValue = robsAndValues.begin();
392  robAndValue != robsAndValues.end(); ++robAndValue) {
393  if(robChanged((*robAndValue).first)) nChangedROBs++;
394  }
395  return 1.-((double)nChangedROBs/(double)robsAndValues.size());
396 }
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:302
int DTBlockedROChannelsTest::DTRobBinsMap::getValueRobBin ( int  robBin) const
private

Definition at line 339 of file DTBlockedROChannelsTest.cc.

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

Referenced by addRobBin(), init(), and robChanged().

339  {
340  if (init_)
341  return 0;
342  int value = 0;
343  if(meROS) {
344  value += (int)meROS->getBinContent(9,robBin);
345  value += (int)meROS->getBinContent(11,robBin);
346  }
347  return value;
348  }
Definition: value.py:1
double getBinContent(int binx) const
get content of bin (1-D)
int DTBlockedROChannelsTest::DTRobBinsMap::getValueRos ( ) const
private

Definition at line 352 of file DTBlockedROChannelsTest.cc.

References MonitorElement::getBinContent(), createfilelist::int, meDDU, rosBin, and relativeConstraints::value.

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

352  {
353  int value = 0;
354  if(meDDU) {
355  value += (int)meDDU->getBinContent(2,rosBin);
356  value += (int)meDDU->getBinContent(10,rosBin);
357  }
358  return value;
359 }
Definition: value.py:1
double getBinContent(int binx) const
get content of bin (1-D)
void DTBlockedROChannelsTest::DTRobBinsMap::init ( bool  v)
inline
void DTBlockedROChannelsTest::DTRobBinsMap::readNewValues ( DQMStore::IGetter igetter)

Definition at line 399 of file DTBlockedROChannelsTest.cc.

References dduHName, DQMStore::IGetter::get(), getValueRos(), meDDU, meROS, robChanged(), robsAndValues, rosHName, and rosValue.

Referenced by init(), and DTBlockedROChannelsTest::DTLinkBinsMap::init().

399  {
400  meROS = igetter.get(rosHName);
401  meDDU = igetter.get(dduHName);
402 
403  rosValue = getValueRos();
404  for(map<int, int>::const_iterator robAndValue = robsAndValues.begin();
405  robAndValue != robsAndValues.end(); ++robAndValue) {
406  robChanged((*robAndValue).first);
407  }
408 }
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:302
bool DTBlockedROChannelsTest::DTRobBinsMap::robChanged ( int  robBin)

Definition at line 362 of file DTBlockedROChannelsTest.cc.

References getValueRobBin(), and robsAndValues.

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

362  {
363  // check that this is a valid ROB for this map (= it has been added!)
364  if(robsAndValues.find(robBin) == robsAndValues.end()) {
365  LogWarning("DTDQM|DTRawToDigi|DTMonitorClient|DTBlockedROChannelsTest")
366  << "[DTRobBinsMap]***Error: ROB: " << robBin << " is not valid" << endl;
367  return false;
368  }
369 
370  int newValue = getValueRobBin(robBin);
371  if(newValue > robsAndValues[robBin]) {
372  robsAndValues[robBin] = newValue;
373  return true;
374  }
375  return false;
376 }

Member Data Documentation

std::string DTBlockedROChannelsTest::DTRobBinsMap::dduHName
private

Definition at line 116 of file DTBlockedROChannelsTest.h.

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

bool DTBlockedROChannelsTest::DTRobBinsMap::init_
private
const MonitorElement* DTBlockedROChannelsTest::DTRobBinsMap::meDDU
private
const MonitorElement* DTBlockedROChannelsTest::DTRobBinsMap::meROS
private
std::map<int, int> DTBlockedROChannelsTest::DTRobBinsMap::robsAndValues
private
int DTBlockedROChannelsTest::DTRobBinsMap::rosBin
private

Definition at line 106 of file DTBlockedROChannelsTest.h.

Referenced by getValueRos().

std::string DTBlockedROChannelsTest::DTRobBinsMap::rosHName
private

Definition at line 115 of file DTBlockedROChannelsTest.h.

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

int DTBlockedROChannelsTest::DTRobBinsMap::rosValue
private

Definition at line 110 of file DTBlockedROChannelsTest.h.

Referenced by getChamberPercentage(), and readNewValues().