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

Constructor & Destructor Documentation

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

Definition at line 287 of file DTBlockedROChannelsTest.cc.

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

288  : rosBin(ros), init_(true), rosValue(0) {
289  // get the pointer to the corresondig histo
290  // Legacy
291  stringstream mename;
292  mename << "DT/00-DataIntegrity/FED" << fed << "/ROS" << ros << "/FED" << fed << "_ROS" << ros << "_ROSError";
293  rosHName = mename.str();
294 
295  stringstream whname;
296  whname << "DT/00-DataIntegrity/FED" << fed << "/FED" << fed << "_ROSStatus";
297  dduHName = whname.str();
298 
299  meROS = igetter.get(rosHName);
300  meDDU = igetter.get(dduHName);
301 }
DTBlockedROChannelsTest::DTRobBinsMap::DTRobBinsMap ( )
DTBlockedROChannelsTest::DTRobBinsMap::~DTRobBinsMap ( )

Definition at line 305 of file DTBlockedROChannelsTest.cc.

305 {}

Member Function Documentation

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

Definition at line 308 of file DTBlockedROChannelsTest.cc.

References getValueRobBin(), and robsAndValues.

double DTBlockedROChannelsTest::DTRobBinsMap::getChamberPercentage ( DQMStore::IGetter igetter)

Definition at line 346 of file DTBlockedROChannelsTest.cc.

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

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

346  {
347  meROS = igetter.get(rosHName);
348  meDDU = igetter.get(dduHName);
349  int nChangedROBs = 0;
350 
351  // check if ros status has changed
352  int newValue = getValueRos();
353  if (newValue > rosValue) {
354  rosValue = newValue;
355  return 0.;
356  }
357 
358  for (map<int, int>::const_iterator robAndValue = robsAndValues.begin(); robAndValue != robsAndValues.end();
359  ++robAndValue) {
360  if (robChanged((*robAndValue).first))
361  nChangedROBs++;
362  }
363  return 1. - ((double)nChangedROBs / (double)robsAndValues.size());
364 }
int DTBlockedROChannelsTest::DTRobBinsMap::getValueRobBin ( int  robBin) const
private

Definition at line 310 of file DTBlockedROChannelsTest.cc.

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

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

310  {
311  if (init_)
312  return 0;
313  int value = 0;
314  if (meROS) {
315  value += (int)meROS->getBinContent(9, robBin);
316  value += (int)meROS->getBinContent(11, robBin);
317  }
318  return value;
319 }
Definition: value.py:1
virtual double getBinContent(int binx) const
get content of bin (1-D)
int DTBlockedROChannelsTest::DTRobBinsMap::getValueRos ( ) const
private

Definition at line 321 of file DTBlockedROChannelsTest.cc.

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

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

321  {
322  int value = 0;
323  if (meDDU) {
324  value += (int)meDDU->getBinContent(2, rosBin);
325  value += (int)meDDU->getBinContent(10, rosBin);
326  }
327  return value;
328 }
Definition: value.py:1
virtual 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 366 of file DTBlockedROChannelsTest.cc.

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

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

366  {
367  meROS = igetter.get(rosHName);
368  meDDU = igetter.get(dduHName);
369 
370  rosValue = getValueRos();
371  for (map<int, int>::const_iterator robAndValue = robsAndValues.begin(); robAndValue != robsAndValues.end();
372  ++robAndValue) {
373  robChanged((*robAndValue).first);
374  }
375 }
bool DTBlockedROChannelsTest::DTRobBinsMap::robChanged ( int  robBin)

Definition at line 330 of file DTBlockedROChannelsTest.cc.

References getValueRobBin(), and robsAndValues.

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

330  {
331  // check that this is a valid ROB for this map (= it has been added!)
332  if (robsAndValues.find(robBin) == robsAndValues.end()) {
333  LogWarning("DTDQM|DTRawToDigi|DTMonitorClient|DTBlockedROChannelsTest")
334  << "[DTRobBinsMap]***Error: ROB: " << robBin << " is not valid" << endl;
335  return false;
336  }
337 
338  int newValue = getValueRobBin(robBin);
339  if (newValue > robsAndValues[robBin]) {
340  robsAndValues[robBin] = newValue;
341  return true;
342  }
343  return false;
344 }

Member Data Documentation

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

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

Referenced by getValueRos().

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

Definition at line 110 of file DTBlockedROChannelsTest.h.

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

int DTBlockedROChannelsTest::DTRobBinsMap::rosValue
private

Definition at line 105 of file DTBlockedROChannelsTest.h.

Referenced by getChamberPercentage(), and readNewValues().