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

Constructor & Destructor Documentation

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

Definition at line 226 of file DTBlockedROChannelsTest.cc.

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

226  :
227  rosBin(ros),
228  init_(true),
229  rosValue(0)
230 {
231 
232  // get the pointer to the corresondig histo
233  stringstream mename; mename << "DT/00-DataIntegrity/FED" << fed << "/ROS" << ros
234  << "/FED" << fed << "_ROS" << ros << "_ROSError";
235  rosHName = mename.str();
236 
237  stringstream whname; whname << "DT/00-DataIntegrity/FED" << fed
238  << "/FED" << fed << "_ROSStatus";
239  dduHName = whname.str();
240 
241  meROS = igetter.get(rosHName);
242  meDDU = igetter.get(dduHName);
243 }
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:301
DTBlockedROChannelsTest::DTRobBinsMap::DTRobBinsMap ( )
DTBlockedROChannelsTest::DTRobBinsMap::~DTRobBinsMap ( )

Definition at line 249 of file DTBlockedROChannelsTest.cc.

249 {}

Member Function Documentation

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

Definition at line 254 of file DTBlockedROChannelsTest.cc.

254  {
255  robsAndValues[robBin] = getValueRobBin(robBin);
256  }
double DTBlockedROChannelsTest::DTRobBinsMap::getChamberPercentage ( DQMStore::IGetter igetter)

Definition at line 306 of file DTBlockedROChannelsTest.cc.

References DQMStore::IGetter::get().

306  {
307  meROS = igetter.get(rosHName);
308  meDDU = igetter.get(dduHName);
309  int nChangedROBs = 0;
310 
311  // check if ros status has changed
312  int newValue = getValueRos();
313  if(newValue > rosValue) {
314  rosValue= newValue;
315  return 0.;
316  }
317 
318  for(map<int, int>::const_iterator robAndValue = robsAndValues.begin();
319  robAndValue != robsAndValues.end(); ++robAndValue) {
320  if(robChanged((*robAndValue).first)) nChangedROBs++;
321  }
322  return 1.-((double)nChangedROBs/(double)robsAndValues.size());
323 }
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:301
int DTBlockedROChannelsTest::DTRobBinsMap::getValueRobBin ( int  robBin) const
private

Definition at line 261 of file DTBlockedROChannelsTest.cc.

References relativeConstraints::value.

261  {
262  if (init_)
263  return 0;
264  int value = 0;
265  if(meROS) {
266  value += (int)meROS->getBinContent(9,robBin);
267  value += (int)meROS->getBinContent(11,robBin);
268  }
269  return value;
270  }
double getBinContent(int binx) const
get content of bin (1-D)
int DTBlockedROChannelsTest::DTRobBinsMap::getValueRos ( ) const
private

Definition at line 275 of file DTBlockedROChannelsTest.cc.

References relativeConstraints::value.

275  {
276  int value = 0;
277  if(meDDU) {
278  value += (int)meDDU->getBinContent(2,rosBin);
279  value += (int)meDDU->getBinContent(10,rosBin);
280  }
281  return value;
282 }
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 326 of file DTBlockedROChannelsTest.cc.

References DQMStore::IGetter::get().

326  {
327  meROS = igetter.get(rosHName);
328  meDDU = igetter.get(dduHName);
329 
330  rosValue = getValueRos();
331  for(map<int, int>::const_iterator robAndValue = robsAndValues.begin();
332  robAndValue != robsAndValues.end(); ++robAndValue) {
333  robChanged((*robAndValue).first);
334  }
335 }
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:301
bool DTBlockedROChannelsTest::DTRobBinsMap::robChanged ( int  robBin)

Definition at line 287 of file DTBlockedROChannelsTest.cc.

287  {
288  // check that this is a valid ROB for this map (= it has been added!)
289  if(robsAndValues.find(robBin) == robsAndValues.end()) {
290  LogWarning("DTDQM|DTRawToDigi|DTMonitorClient|DTBlockedROChannelsTest")
291  << "[DTRobBinsMap]***Error: ROB: " << robBin << " is not valid" << endl;
292  return false;
293  }
294 
295  int newValue = getValueRobBin(robBin);
296  if(newValue > robsAndValues[robBin]) {
297  robsAndValues[robBin] = newValue;
298  return true;
299  }
300  return false;
301 }

Member Data Documentation

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

Definition at line 113 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap().

bool DTBlockedROChannelsTest::DTRobBinsMap::init_
private

Definition at line 104 of file DTBlockedROChannelsTest.h.

Referenced by init().

const MonitorElement* DTBlockedROChannelsTest::DTRobBinsMap::meDDU
private

Definition at line 110 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap().

const MonitorElement* DTBlockedROChannelsTest::DTRobBinsMap::meROS
private

Definition at line 109 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap().

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

Definition at line 106 of file DTBlockedROChannelsTest.h.

int DTBlockedROChannelsTest::DTRobBinsMap::rosBin
private

Definition at line 103 of file DTBlockedROChannelsTest.h.

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

Definition at line 112 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap().

int DTBlockedROChannelsTest::DTRobBinsMap::rosValue
private

Definition at line 107 of file DTBlockedROChannelsTest.h.