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 init (bool v)
 
void readNewValues ()
 
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
 
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 303 of file DTBlockedROChannelsTest.cc.

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

303  : rosBin(ros),
304  init_(true),
305  rosValue(0)
306 {
307 
308  // get the pointer to the corresondig histo
309  stringstream mename; mename << "DT/00-DataIntegrity/FED" << fed << "/ROS" << ros
310  << "/FED" << fed << "_ROS" << ros << "_ROSError";
311  rosHName = mename.str();
312 
313  stringstream whname; whname << "DT/00-DataIntegrity/FED" << fed
314  << "/FED" << fed << "_ROSStatus";
315  dduHName = whname.str();
316 
317  meROS = dbe->get(rosHName);
318  meDDU = dbe->get(dduHName);
319 
320  theDbe = dbe;
321 }
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1473
DTBlockedROChannelsTest::DTRobBinsMap::DTRobBinsMap ( )
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.

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

Definition at line 384 of file DTBlockedROChannelsTest.cc.

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

Definition at line 339 of file DTBlockedROChannelsTest.cc.

References relativeConstraints::value.

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  }
double getBinContent(int binx) const
get content of bin (1-D)
int DTBlockedROChannelsTest::DTRobBinsMap::getValueRos ( ) const
private

Definition at line 353 of file DTBlockedROChannelsTest.cc.

References relativeConstraints::value.

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

Definition at line 404 of file DTBlockedROChannelsTest.cc.

404  {
405  meROS = theDbe->get(rosHName);
406  meDDU = theDbe->get(dduHName);
407 
408  rosValue = getValueRos();
409  for(map<int, int>::const_iterator robAndValue = robsAndValues.begin();
410  robAndValue != robsAndValues.end(); ++robAndValue) {
411  robChanged((*robAndValue).first);
412  }
413 }
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1473
bool DTBlockedROChannelsTest::DTRobBinsMap::robChanged ( int  robBin)

Definition at line 365 of file DTBlockedROChannelsTest.cc.

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

Member Data Documentation

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

Definition at line 128 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap().

bool DTBlockedROChannelsTest::DTRobBinsMap::init_
private

Definition at line 119 of file DTBlockedROChannelsTest.h.

Referenced by init().

const MonitorElement* DTBlockedROChannelsTest::DTRobBinsMap::meDDU
private

Definition at line 125 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap().

const MonitorElement* DTBlockedROChannelsTest::DTRobBinsMap::meROS
private

Definition at line 124 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap().

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

Definition at line 121 of file DTBlockedROChannelsTest.h.

int DTBlockedROChannelsTest::DTRobBinsMap::rosBin
private

Definition at line 118 of file DTBlockedROChannelsTest.h.

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

Definition at line 127 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap().

int DTBlockedROChannelsTest::DTRobBinsMap::rosValue
private

Definition at line 122 of file DTBlockedROChannelsTest.h.

const DQMStore* DTBlockedROChannelsTest::DTRobBinsMap::theDbe
private

Definition at line 130 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap().