CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
DTBlockedROChannelsTest::DTRobBinsMap Class Reference

Public Member Functions

void addRobBin (int robBin)
 
 DTRobBinsMap (const int fed, const int ros, const DQMStore *dbe)
 
 DTRobBinsMap ()
 
double getChamberPercentage ()
 
void readNewValues ()
 
bool robChanged (int robBin)
 
 ~DTRobBinsMap ()
 

Private Member Functions

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

Private Attributes

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

Detailed Description

Definition at line 95 of file DTBlockedROChannelsTest.h.

Constructor & Destructor Documentation

DTBlockedROChannelsTest::DTRobBinsMap::DTRobBinsMap ( const int  fed,
const int  ros,
const DQMStore dbe 
)

Definition at line 297 of file DTBlockedROChannelsTest.cc.

References DTBlockedROChannelsTest::dbe, dduHName, DQMStore::get(), meDDU, meROS, rosHName, and theDbe.

297  : rosBin(ros),
298  rosValue(0) {
299  // get the pointer to the corresondig histo
300  stringstream mename; mename << "DT/00-DataIntegrity/FED" << fed << "/ROS" << ros
301  << "/FED" << fed << "_ROS" << ros << "_ROSError";
302  rosHName = mename.str();
303 
304  stringstream whname; whname << "DT/00-DataIntegrity/FED" << fed
305  << "/FED" << fed << "_ROSStatus";
306  dduHName = whname.str();
307 
308  meROS = dbe->get(rosHName);
309  meDDU = dbe->get(dduHName);
310 
311  theDbe = dbe;
312 }
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1270
DTBlockedROChannelsTest::DTRobBinsMap::DTRobBinsMap ( )

Definition at line 317 of file DTBlockedROChannelsTest.cc.

317  : meROS(0),
318  meDDU(0) {}
DTBlockedROChannelsTest::DTRobBinsMap::~DTRobBinsMap ( )

Definition at line 322 of file DTBlockedROChannelsTest.cc.

322 {}

Member Function Documentation

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

Definition at line 327 of file DTBlockedROChannelsTest.cc.

327  {
328  robsAndValues[robBin] = getValueRobBin(robBin);
329 }
double DTBlockedROChannelsTest::DTRobBinsMap::getChamberPercentage ( )

Definition at line 377 of file DTBlockedROChannelsTest.cc.

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

Definition at line 334 of file DTBlockedROChannelsTest.cc.

References relativeConstraints::value.

334  {
335  int value = 0;
336  if(meROS) {
337  value += (int)meROS->getBinContent(9,robBin);
338  value += (int)meROS->getBinContent(11,robBin);
339  }
340  return value;
341 }
double getBinContent(int binx) const
get content of bin (1-D)
int DTBlockedROChannelsTest::DTRobBinsMap::getValueRos ( ) const
private

Definition at line 346 of file DTBlockedROChannelsTest.cc.

References relativeConstraints::value.

346  {
347  int value = 0;
348  if(meDDU) {
349  value += (int)meDDU->getBinContent(2,rosBin);
350  value += (int)meDDU->getBinContent(10,rosBin);
351  }
352  return value;
353 }
double getBinContent(int binx) const
get content of bin (1-D)
void DTBlockedROChannelsTest::DTRobBinsMap::readNewValues ( )

Definition at line 397 of file DTBlockedROChannelsTest.cc.

397  {
398  meROS = theDbe->get(rosHName);
399  meDDU = theDbe->get(dduHName);
400 
401  rosValue = getValueRos();
402  for(map<int, int>::const_iterator robAndValue = robsAndValues.begin();
403  robAndValue != robsAndValues.end(); ++robAndValue) {
404  robChanged((*robAndValue).first);
405  }
406 }
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1270
bool DTBlockedROChannelsTest::DTRobBinsMap::robChanged ( int  robBin)

Definition at line 358 of file DTBlockedROChannelsTest.cc.

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

Member Data Documentation

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

Definition at line 126 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap().

const MonitorElement* DTBlockedROChannelsTest::DTRobBinsMap::meDDU
private

Definition at line 123 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap().

const MonitorElement* DTBlockedROChannelsTest::DTRobBinsMap::meROS
private

Definition at line 122 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap().

std::map<int, int> DTBlockedROChannelsTest::DTRobBinsMap::robsAndValues
private

Definition at line 119 of file DTBlockedROChannelsTest.h.

int DTBlockedROChannelsTest::DTRobBinsMap::rosBin
private

Definition at line 117 of file DTBlockedROChannelsTest.h.

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

Definition at line 125 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap().

int DTBlockedROChannelsTest::DTRobBinsMap::rosValue
private

Definition at line 120 of file DTBlockedROChannelsTest.h.

const DQMStore* DTBlockedROChannelsTest::DTRobBinsMap::theDbe
private

Definition at line 128 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap().