CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes
ecaldqm::MESet::const_iterator Struct Reference

#include <MESet.h>

Inheritance diagram for ecaldqm::MESet::const_iterator:
ecaldqm::MESet::iterator

Public Member Functions

 const_iterator ()
 
 const_iterator (MESet const &_meSet, unsigned _iME=0, int _iBin=1)
 
 const_iterator (MESet const &, DetId const &)
 
 const_iterator (const_iterator const &_orig)
 
bool down ()
 
bool left ()
 
bool operator!= (const_iterator const &_rhs) const
 
const_iteratoroperator++ ()
 
ConstBin const * operator-> () const
 
const_iteratoroperator= (const_iterator const &_rhs)
 
bool operator== (const_iterator const &_rhs) const
 
bool right ()
 
const_iteratortoNextChannel ()
 
bool up ()
 

Protected Attributes

ConstBin bin_
 

Detailed Description

Definition at line 246 of file MESet.h.

Constructor & Destructor Documentation

ecaldqm::MESet::const_iterator::const_iterator ( )
inline

Definition at line 247 of file MESet.h.

247 : bin_() {}
ecaldqm::MESet::const_iterator::const_iterator ( MESet const &  _meSet,
unsigned  _iME = 0,
int  _iBin = 1 
)
inline

Definition at line 248 of file MESet.h.

248 : bin_(_meSet, _iME, _iBin) {}
ecaldqm::MESet::const_iterator::const_iterator ( MESet const &  _meSet,
DetId const &  _id 
)

Definition at line 357 of file MESet.cc.

References stringResolutionProvider_cfi::bin, bin_, ecaldqm::binning::findBin2D(), ecaldqm::binning::findPlotIndex(), ecaldqm::MESet::getBinType(), ecaldqm::MESet::getObjType(), ecaldqm::MESet::ConstBin::iBin, ecaldqm::MESet::ConstBin::iME, ecaldqm::MESet::ConstBin::otype, and ecaldqm::MESet::ConstBin::setMESet().

357  : bin_() {
358  binning::ObjectType otype(_meSet.getObjType());
359  unsigned iME(binning::findPlotIndex(otype, _id));
360  if (iME == unsigned(-1))
361  return;
362 
363  binning::BinningType btype(_meSet.getBinType());
364  int bin(binning::findBin2D(otype, btype, _id));
365  if (bin == 0)
366  return;
367 
368  bin_.setMESet(_meSet);
369  bin_.iME = iME;
370  bin_.iBin = bin;
371  bin_.otype = otype;
372  }
binning::ObjectType otype
Definition: MESet.h:144
bin
set the eta bin as selection string.
int findBin2D(ObjectType, BinningType, DetId const &)
unsigned findPlotIndex(ObjectType, DetId const &)
void setMESet(MESet const &_meSet)
Definition: MESet.h:189
ecaldqm::MESet::const_iterator::const_iterator ( const_iterator const &  _orig)
inline

Definition at line 250 of file MESet.h.

250 : bin_(_orig.bin_) {}

Member Function Documentation

bool ecaldqm::MESet::const_iterator::down ( )

Definition at line 453 of file MESet.cc.

References bin_, MonitorElement::DQM_KIND_TH2F, MonitorElement::DQM_KIND_TPROFILE2D, ecaldqm::MESet::ConstBin::getMESet(), ecaldqm::MESet::ConstBin::iBin, ecaldqm::MESet::ConstBin::iME, and callgraph::kind.

Referenced by ecaldqm::MESet::iterator::down().

453  {
454  MESet const *meSet(bin_.getMESet());
455  if (bin_.iME == unsigned(-1) || bin_.iBin < 1)
456  return false;
457 
458  MonitorElement::Kind kind(meSet->getKind());
460  return false;
461 
462  MonitorElement const *me(meSet->getME(bin_.iME));
463 
464  if (bin_.iBin / (me->getNbinsX() + 2) <= 1)
465  return false;
466 
467  bin_.iBin -= me->getNbinsX() + 2;
468 
469  return true;
470  }
MESet const * getMESet() const
Definition: MESet.h:190
bool ecaldqm::MESet::const_iterator::left ( )

Definition at line 472 of file MESet.cc.

References bin_, MonitorElement::DQM_KIND_TH2F, MonitorElement::DQM_KIND_TPROFILE2D, ecaldqm::MESet::ConstBin::getMESet(), ecaldqm::MESet::ConstBin::iBin, ecaldqm::MESet::ConstBin::iME, and callgraph::kind.

Referenced by svgfig.Curve.Samples::__len__(), and ecaldqm::MESet::iterator::left().

472  {
473  MESet const *meSet(bin_.getMESet());
474  if (bin_.iME == unsigned(-1) || bin_.iBin < 1)
475  return false;
476 
477  MonitorElement::Kind kind(meSet->getKind());
479  return false;
480 
481  MonitorElement const *me(meSet->getME(bin_.iME));
482 
483  if (bin_.iBin % (me->getNbinsX() + 2) <= 1)
484  return false;
485 
486  bin_.iBin -= 1;
487 
488  return true;
489  }
MESet const * getMESet() const
Definition: MESet.h:190
bool ecaldqm::MESet::const_iterator::operator!= ( const_iterator const &  _rhs) const
inline

Definition at line 256 of file MESet.h.

References bin_.

256 { return !(bin_ == _rhs.bin_); }
MESet::const_iterator & ecaldqm::MESet::const_iterator::operator++ ( void  )

Definition at line 374 of file MESet.cc.

References stringResolutionProvider_cfi::bin, bin_, MonitorElement::DQM_KIND_TH1F, MonitorElement::DQM_KIND_TH2F, MonitorElement::DQM_KIND_TPROFILE, MonitorElement::DQM_KIND_TPROFILE2D, ecaldqm::MESet::ConstBin::getMESet(), ecaldqm::binning::getObject(), ecaldqm::MESet::ConstBin::iBin, ecaldqm::MESet::ConstBin::iME, callgraph::kind, ecaldqm::binning::nObjType, and ecaldqm::MESet::ConstBin::otype.

Referenced by ecaldqm::MESet::iterator::operator++(), and toNextChannel().

374  {
375  unsigned &iME(bin_.iME);
376  MESet const *meSet(bin_.getMESet());
377 
378  if (iME == unsigned(-1))
379  return *this;
380 
381  int &bin(bin_.iBin);
383 
384  MonitorElement::Kind kind(meSet->getKind());
385  MonitorElement const *me(meSet->getME(iME));
386 
387  int nbinsX(me->getNbinsX());
388 
389  ++bin;
390  if (bin == 1) {
391  iME = 0;
392  me = meSet->getME(iME);
393  nbinsX = me->getNbinsX();
395  bin = nbinsX + 3;
396  otype = binning::getObject(meSet->getObjType(), iME);
397  }
398 
399  if (bin % (nbinsX + 2) == nbinsX + 1) {
401  bin / (nbinsX + 2) == me->getNbinsY()) {
402  iME += 1;
403  me = meSet->getME(iME);
404  if (!me) {
405  iME = unsigned(-1);
406  bin = -1;
407  otype = binning::nObjType;
408  } else {
409  nbinsX = me->getNbinsX();
411  bin = nbinsX + 3;
412  else
413  bin = 1;
414 
415  otype = binning::getObject(meSet->getObjType(), iME);
416  }
417  } else
418  bin += 2;
419  }
420 
421  return *this;
422  }
binning::ObjectType otype
Definition: MESet.h:144
ObjectType getObject(ObjectType, unsigned)
bin
set the eta bin as selection string.
MESet const * getMESet() const
Definition: MESet.h:190
ConstBin const* ecaldqm::MESet::const_iterator::operator-> ( ) const
inline

Definition at line 257 of file MESet.h.

References down, and up.

257 { return &bin_; }
const_iterator& ecaldqm::MESet::const_iterator::operator= ( const_iterator const &  _rhs)
inline

Definition at line 251 of file MESet.h.

References bin_.

Referenced by ecaldqm::MESet::iterator::operator=().

251  {
252  bin_ = _rhs.bin_;
253  return *this;
254  }
bool ecaldqm::MESet::const_iterator::operator== ( const_iterator const &  _rhs) const
inline

Definition at line 255 of file MESet.h.

References bin_.

255 { return bin_ == _rhs.bin_; }
bool ecaldqm::MESet::const_iterator::right ( )

Definition at line 491 of file MESet.cc.

References bin_, MonitorElement::DQM_KIND_TH2F, MonitorElement::DQM_KIND_TPROFILE2D, ecaldqm::MESet::ConstBin::getMESet(), ecaldqm::MESet::ConstBin::iBin, ecaldqm::MESet::ConstBin::iME, and callgraph::kind.

Referenced by ecaldqm::MESet::iterator::right().

491  {
492  MESet const *meSet(bin_.getMESet());
493  if (bin_.iME == unsigned(-1) || bin_.iBin < 1)
494  return false;
495 
496  MonitorElement::Kind kind(meSet->getKind());
498  return false;
499 
500  MonitorElement const *me(meSet->getME(bin_.iME));
501 
502  if (bin_.iBin % (me->getNbinsX() + 2) >= me->getNbinsX())
503  return false;
504 
505  bin_.iBin += 1;
506 
507  return true;
508  }
MESet const * getMESet() const
Definition: MESet.h:190
MESet::const_iterator & ecaldqm::MESet::const_iterator::toNextChannel ( )
bool ecaldqm::MESet::const_iterator::up ( )

Definition at line 434 of file MESet.cc.

References bin_, MonitorElement::DQM_KIND_TH2F, MonitorElement::DQM_KIND_TPROFILE2D, ecaldqm::MESet::ConstBin::getMESet(), ecaldqm::MESet::ConstBin::iBin, ecaldqm::MESet::ConstBin::iME, and callgraph::kind.

Referenced by ecaldqm::MESet::iterator::up().

434  {
435  MESet const *meSet(bin_.getMESet());
436  if (bin_.iME == unsigned(-1) || bin_.iBin < 1)
437  return false;
438 
439  MonitorElement::Kind kind(meSet->getKind());
441  return false;
442 
443  MonitorElement const *me(meSet->getME(bin_.iME));
444 
445  if (bin_.iBin / (me->getNbinsX() + 2) >= me->getNbinsY())
446  return false;
447 
448  bin_.iBin += me->getNbinsX() + 2;
449 
450  return true;
451  }
MESet const * getMESet() const
Definition: MESet.h:190

Member Data Documentation

ConstBin ecaldqm::MESet::const_iterator::bin_
protected