CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes
hcaldqm::quantity::RunNumber Class Reference

#include <ValueQuantity.h>

Inheritance diagram for hcaldqm::quantity::RunNumber:
hcaldqm::quantity::ValueQuantity hcaldqm::quantity::Quantity

Public Member Functions

uint32_t getBin (int run) override
 
std::vector< std::string > getLabels () override
 
int getValue (int run) override
 
double max () override
 
double min () override
 
std::string name () override
 
int nbins () override
 
 RunNumber ()
 
 RunNumber (std::vector< int > runs)
 
 ~RunNumber () override
 
- Public Member Functions inherited from hcaldqm::quantity::ValueQuantity
double getValue (double x) override
 
ValueQuantitymakeCopy () override
 
void setBits (TH1 *o) override
 
virtual void setLS (TH1 *o)
 
QuantityType type () override
 
 ValueQuantity ()
 
 ValueQuantity (ValueQuantityType type, bool isLog=false)
 
 ~ValueQuantity () override
 
- Public Member Functions inherited from hcaldqm::quantity::Quantity
virtual uint32_t getBin (double)
 
virtual uint32_t getBin (HcalDetId const &)
 
virtual uint32_t getBin (HcalElectronicsId const &)
 
virtual uint32_t getBin (HcalTrigTowerDetId const &)
 
virtual int getValue (HcalDetId const &)
 
virtual int getValue (HcalElectronicsId const &)
 
virtual int getValue (HcalTrigTowerDetId const &)
 
virtual bool isCoordinate ()
 
virtual bool isLog ()
 
 Quantity ()
 
 Quantity (std::string const &name, bool isLog)
 
virtual void setAxisType (AxisType at)
 
virtual void setLog (TH1 *o)
 
virtual void setMax (double)
 
virtual void setMin (double)
 
virtual void setNbins (int)
 
virtual void showOverflow (bool showOverflow)
 
virtual int wofnbins ()
 
virtual ~Quantity ()
 

Protected Attributes

std::vector< int > _runs
 
- Protected Attributes inherited from hcaldqm::quantity::ValueQuantity
ValueQuantityType _type
 
- Protected Attributes inherited from hcaldqm::quantity::Quantity
AxisType _axistype
 
bool _isLog
 
std::string _name
 
bool _showOverflow
 

Detailed Description

Definition at line 444 of file ValueQuantity.h.

Constructor & Destructor Documentation

◆ RunNumber() [1/2]

hcaldqm::quantity::RunNumber::RunNumber ( )
inline

Definition at line 446 of file ValueQuantity.h.

446 {}

◆ RunNumber() [2/2]

hcaldqm::quantity::RunNumber::RunNumber ( std::vector< int >  runs)
inline

Definition at line 447 of file ValueQuantity.h.

447 : _runs(runs) {}

◆ ~RunNumber()

hcaldqm::quantity::RunNumber::~RunNumber ( )
inlineoverride

Definition at line 448 of file ValueQuantity.h.

448 {}

Member Function Documentation

◆ getBin()

uint32_t hcaldqm::quantity::RunNumber::getBin ( int  run)
inlineoverridevirtual

Reimplemented from hcaldqm::quantity::Quantity.

Definition at line 477 of file ValueQuantity.h.

477 { return (this->getValue(run) + 1); }

References getValue().

Referenced by BTagWeightCalculator.BTagWeightCalculator::calcJetWeightImpl().

◆ getLabels()

std::vector<std::string> hcaldqm::quantity::RunNumber::getLabels ( )
inlineoverridevirtual

Reimplemented from hcaldqm::quantity::Quantity.

Definition at line 454 of file ValueQuantity.h.

454  {
455  char name[10];
456  std::vector<std::string> labels;
457  for (uint32_t i = 0; i < _runs.size(); i++) {
458  sprintf(name, "%d", _runs[i]);
459  labels.push_back(name);
460  }
461  return labels;
462  }

References _runs, mps_fire::i, SummaryClient_cfi::labels, and name().

◆ getValue()

int hcaldqm::quantity::RunNumber::getValue ( int  run)
inlineoverridevirtual

Reimplemented from hcaldqm::quantity::ValueQuantity.

Definition at line 463 of file ValueQuantity.h.

463  {
464  int ir = -1;
465  for (uint32_t i = 0; i < _runs.size(); i++)
466  if (_runs[i] == run) {
467  ir = (int)i;
468  break;
469  }
470 
471  if (ir == -1)
472  throw cms::Exception("HCALDQM") << "run number doens't exist " << run;
473 
474  return ir;
475  }

References _runs, Exception, mps_fire::i, createfilelist::int, and writedatasetfile::run.

Referenced by getBin().

◆ max()

double hcaldqm::quantity::RunNumber::max ( )
inlineoverridevirtual

Reimplemented from hcaldqm::quantity::ValueQuantity.

Definition at line 453 of file ValueQuantity.h.

453 { return _runs.size(); }

References _runs.

◆ min()

double hcaldqm::quantity::RunNumber::min ( )
inlineoverridevirtual

Reimplemented from hcaldqm::quantity::ValueQuantity.

Definition at line 452 of file ValueQuantity.h.

452 { return 0; }

◆ name()

std::string hcaldqm::quantity::RunNumber::name ( void  )
inlineoverridevirtual

Reimplemented from hcaldqm::quantity::Quantity.

Definition at line 450 of file ValueQuantity.h.

450 { return "Run"; }

Referenced by config.CFG::__str__(), validation.Sample::digest(), getLabels(), and VIDSelectorBase.VIDSelectorBase::initialize().

◆ nbins()

int hcaldqm::quantity::RunNumber::nbins ( )
inlineoverridevirtual

Reimplemented from hcaldqm::quantity::ValueQuantity.

Definition at line 451 of file ValueQuantity.h.

451 { return _runs.size(); }

References _runs.

Member Data Documentation

◆ _runs

std::vector<int> hcaldqm::quantity::RunNumber::_runs
protected

Definition at line 480 of file ValueQuantity.h.

Referenced by getLabels(), getValue(), max(), and nbins().

SummaryClient_cfi.labels
labels
Definition: SummaryClient_cfi.py:61
mps_fire.i
i
Definition: mps_fire.py:428
hcaldqm::quantity::RunNumber::_runs
std::vector< int > _runs
Definition: ValueQuantity.h:480
writedatasetfile.runs
runs
Definition: writedatasetfile.py:27
createfilelist.int
int
Definition: createfilelist.py:10
writedatasetfile.run
run
Definition: writedatasetfile.py:27
Exception
Definition: hltDiff.cc:245
hcaldqm::quantity::RunNumber::getValue
int getValue(int run) override
Definition: ValueQuantity.h:463
hcaldqm::quantity::RunNumber::name
std::string name() override
Definition: ValueQuantity.h:450