CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes | Private Types
hcaldqm::quantity::CrateQuantity Class Reference

#include <ElectronicsQuantity.h>

Inheritance diagram for hcaldqm::quantity::CrateQuantity:
hcaldqm::quantity::ElectronicsQuantity hcaldqm::quantity::Quantity

Public Member Functions

 CrateQuantity ()
 
 CrateQuantity (HcalElectronicsMap const *emap)
 
 CrateQuantity (std::vector< int > crates, CrateHashMap crateHashes)
 
uint32_t getBin (HcalElectronicsId const &) override
 
std::vector< std::string > getLabels () override
 
int getValue (HcalElectronicsId const &) override
 
CrateQuantitymakeCopy () override
 
double max () override
 
double min () override
 
int nbins () override
 
virtual void setup (HcalElectronicsMap const *emap)
 
virtual void setup (std::vector< int > crates, CrateHashMap crateHashes)
 
 ~CrateQuantity () override
 
- Public Member Functions inherited from hcaldqm::quantity::ElectronicsQuantity
 ElectronicsQuantity ()
 
 ElectronicsQuantity (ElectronicsQuantityType type, bool isLog=false)
 
bool isCoordinate () override
 
QuantityType type () override
 
 ~ElectronicsQuantity () override
 
- Public Member Functions inherited from hcaldqm::quantity::Quantity
virtual uint32_t getBin (HcalDetId const &)
 
virtual uint32_t getBin (HcalTrigTowerDetId const &)
 
virtual uint32_t getBin (int)
 
virtual uint32_t getBin (double)
 
virtual int getValue (HcalDetId const &)
 
virtual int getValue (HcalTrigTowerDetId const &)
 
virtual int getValue (int x)
 
virtual double getValue (double x)
 
virtual bool isLog ()
 
virtual std::string name ()
 
 Quantity ()
 
 Quantity (std::string const &name, bool isLog)
 
virtual void setAxisType (AxisType at)
 
virtual void setBits (TH1 *o)
 
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

CrateHashMap _crateHashes
 
std::vector< int > _crates
 
- Protected Attributes inherited from hcaldqm::quantity::ElectronicsQuantity
ElectronicsQuantityType _type
 
- Protected Attributes inherited from hcaldqm::quantity::Quantity
AxisType _axistype
 
bool _isLog
 
std::string _name
 
bool _showOverflow
 

Private Types

typedef std::map< int, uint32_t > CrateHashMap
 

Detailed Description

Definition at line 405 of file ElectronicsQuantity.h.

Member Typedef Documentation

typedef std::map<int, uint32_t> hcaldqm::quantity::CrateQuantity::CrateHashMap
private

Definition at line 406 of file ElectronicsQuantity.h.

Constructor & Destructor Documentation

hcaldqm::quantity::CrateQuantity::CrateQuantity ( )
inline

Definition at line 408 of file ElectronicsQuantity.h.

408 {}
hcaldqm::quantity::CrateQuantity::CrateQuantity ( HcalElectronicsMap const *  emap)
inline

Definition at line 409 of file ElectronicsQuantity.h.

References GeneralSetup::setup().

409  : ElectronicsQuantity(fCrate, false) {
410  this->setup(emap);
411  }
virtual void setup(HcalElectronicsMap const *emap)
hcaldqm::quantity::CrateQuantity::CrateQuantity ( std::vector< int >  crates,
CrateHashMap  crateHashes 
)
inline

Definition at line 412 of file ElectronicsQuantity.h.

References GeneralSetup::setup().

412  : ElectronicsQuantity(fCrate, false) {
413  this->setup(crates, crateHashes);
414  }
virtual void setup(HcalElectronicsMap const *emap)
hcaldqm::quantity::CrateQuantity::~CrateQuantity ( )
inlineoverride

Member Function Documentation

uint32_t hcaldqm::quantity::CrateQuantity::getBin ( HcalElectronicsId const &  eid)
overridevirtual

Reimplemented from hcaldqm::quantity::ElectronicsQuantity.

Definition at line 803 of file ElectronicsQuantity.cc.

References HcalElectronicsId::crateId(), SoftLeptonByDistance_cfi::distance, and spr::find().

Referenced by BTagWeightCalculator.BTagWeightCalculator::calcJetWeightImpl().

804  {
805  int crate = eid.crateId();
806  auto it = std::find(_crates.begin(), _crates.end(), crate);
807  if (it == _crates.end()) {
808  return 0;
809  } else {
810  return std::distance(_crates.begin(), it) + 1;
811  }
812  }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
std::vector< std::string > hcaldqm::quantity::CrateQuantity::getLabels ( )
overridevirtual

Reimplemented from hcaldqm::quantity::ElectronicsQuantity.

Definition at line 814 of file ElectronicsQuantity.cc.

References runTauDisplay::eid, HcalElectronicsId::isVMEid(), tablePrinter::labels, and dataset::name.

815  {
816  std::vector<std::string> labels;
817  char name[5];
818  for (auto& it_crate : _crates) {
820  if (eid.isVMEid()) {
821  sprintf(name, "%dv", it_crate);
822  } else {
823  sprintf(name, "%du", it_crate);
824  }
825  labels.push_back(name);
826  }
827  return labels;
828  }
virtual std::string name()
Definition: Quantity.h:47
Readout chain identification for Hcal.
int hcaldqm::quantity::CrateQuantity::getValue ( HcalElectronicsId const &  eid)
overridevirtual

Reimplemented from hcaldqm::quantity::ElectronicsQuantity.

Definition at line 798 of file ElectronicsQuantity.cc.

References HcalElectronicsId::crateId().

799  {
800  return eid.crateId();
801  }
CrateQuantity* hcaldqm::quantity::CrateQuantity::makeCopy ( )
inlineoverridevirtual

Reimplemented from hcaldqm::quantity::ElectronicsQuantity.

Definition at line 434 of file ElectronicsQuantity.h.

435  {
436  // Make copies of the crate info
437  std::vector<int> tmpCrates;
438  std::map<int, uint32_t> tmpCrateHashes;
439  for (auto& it_crate : _crates) {
440  tmpCrates.push_back(it_crate);
441  tmpCrateHashes[it_crate] = _crateHashes[it_crate];
442  }
443  return new CrateQuantity(tmpCrates, tmpCrateHashes);
444  }
double hcaldqm::quantity::CrateQuantity::max ( )
inlineoverridevirtual

Reimplemented from hcaldqm::quantity::ElectronicsQuantity.

Definition at line 426 of file ElectronicsQuantity.h.

References hcaldqm::quantity::ElectronicsQuantity::getLabels().

426 {return _crates.size();}
double hcaldqm::quantity::CrateQuantity::min ( )
inlineoverridevirtual

Reimplemented from hcaldqm::quantity::ElectronicsQuantity.

Definition at line 425 of file ElectronicsQuantity.h.

425 {return 0;}
int hcaldqm::quantity::CrateQuantity::nbins ( )
inlineoverridevirtual

Reimplemented from hcaldqm::quantity::ElectronicsQuantity.

Definition at line 422 of file ElectronicsQuantity.h.

422  {
423  return _crates.size();
424  }
void hcaldqm::quantity::CrateQuantity::setup ( HcalElectronicsMap const *  emap)
virtual

Definition at line 785 of file ElectronicsQuantity.cc.

References hcaldqm::utilities::getCrateHashMap(), and hcaldqm::utilities::getCrateList().

786  {
789  }
std::map< int, uint32_t > getCrateHashMap(HcalElectronicsMap const *emap)
Definition: Utilities.cc:77
std::vector< int > getCrateList(HcalElectronicsMap const *emap)
Definition: Utilities.cc:63
virtual void hcaldqm::quantity::CrateQuantity::setup ( std::vector< int >  crates,
CrateHashMap  crateHashes 
)
virtual

Member Data Documentation

CrateHashMap hcaldqm::quantity::CrateQuantity::_crateHashes
protected

Definition at line 431 of file ElectronicsQuantity.h.

std::vector<int> hcaldqm::quantity::CrateQuantity::_crates
protected

Definition at line 430 of file ElectronicsQuantity.h.