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 390 of file ElectronicsQuantity.h.

Member Typedef Documentation

◆ CrateHashMap

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

Definition at line 391 of file ElectronicsQuantity.h.

Constructor & Destructor Documentation

◆ CrateQuantity() [1/3]

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

Definition at line 394 of file ElectronicsQuantity.h.

Referenced by makeCopy().

394 {}

◆ CrateQuantity() [2/3]

hcaldqm::quantity::CrateQuantity::CrateQuantity ( HcalElectronicsMap const *  emap)
inline

Definition at line 395 of file ElectronicsQuantity.h.

References setup().

◆ CrateQuantity() [3/3]

hcaldqm::quantity::CrateQuantity::CrateQuantity ( std::vector< int >  crates,
CrateHashMap  crateHashes 
)
inline

Definition at line 396 of file ElectronicsQuantity.h.

References setup().

396  : ElectronicsQuantity(fCrate, false) {
397  this->setup(crates, crateHashes);
398  }
virtual void setup(HcalElectronicsMap const *emap)

◆ ~CrateQuantity()

hcaldqm::quantity::CrateQuantity::~CrateQuantity ( )
inlineoverride

Definition at line 399 of file ElectronicsQuantity.h.

399 {}

Member Function Documentation

◆ getBin()

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

Reimplemented from hcaldqm::quantity::ElectronicsQuantity.

Definition at line 585 of file ElectronicsQuantity.cc.

References HLT_2022v15_cff::distance, runTauDisplay::eid, and spr::find().

Referenced by BTagWeightCalculator.BTagWeightCalculator::calcJetWeightImpl().

585  {
586  int crate = eid.crateId();
587  auto it = std::find(_crates.begin(), _crates.end(), crate);
588  if (it == _crates.end()) {
589  return 0;
590  } else {
591  return std::distance(_crates.begin(), it) + 1;
592  }
593  }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19

◆ getLabels()

std::vector< std::string > hcaldqm::quantity::CrateQuantity::getLabels ( )
overridevirtual

Reimplemented from hcaldqm::quantity::ElectronicsQuantity.

Definition at line 595 of file ElectronicsQuantity.cc.

References runTauDisplay::eid, SummaryClient_cfi::labels, and Skims_PA_cff::name.

595  {
596  std::vector<std::string> labels;
597  char name[5];
598  for (auto &it_crate : _crates) {
600  if (eid.isVMEid()) {
601  sprintf(name, "%dv", it_crate);
602  } else {
603  sprintf(name, "%du", it_crate);
604  }
605  labels.push_back(name);
606  }
607  return labels;
608  }
virtual std::string name()
Definition: Quantity.h:34
Readout chain identification for Hcal.

◆ getValue()

int hcaldqm::quantity::CrateQuantity::getValue ( HcalElectronicsId const &  eid)
overridevirtual

Reimplemented from hcaldqm::quantity::ElectronicsQuantity.

Definition at line 583 of file ElectronicsQuantity.cc.

References runTauDisplay::eid.

583 { return eid.crateId(); }

◆ makeCopy()

CrateQuantity* hcaldqm::quantity::CrateQuantity::makeCopy ( )
inlineoverridevirtual

Reimplemented from hcaldqm::quantity::ElectronicsQuantity.

Definition at line 416 of file ElectronicsQuantity.h.

References _crateHashes, _crates, and CrateQuantity().

416  {
417  // Make copies of the crate info
418  std::vector<int> tmpCrates;
419  std::map<int, uint32_t> tmpCrateHashes;
420  for (auto &it_crate : _crates) {
421  tmpCrates.push_back(it_crate);
422  tmpCrateHashes[it_crate] = _crateHashes[it_crate];
423  }
424  return new CrateQuantity(tmpCrates, tmpCrateHashes);
425  }

◆ max()

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

Reimplemented from hcaldqm::quantity::ElectronicsQuantity.

Definition at line 408 of file ElectronicsQuantity.h.

References _crates.

408 { return _crates.size(); }

◆ min()

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

Reimplemented from hcaldqm::quantity::ElectronicsQuantity.

Definition at line 407 of file ElectronicsQuantity.h.

407 { return 0; }

◆ nbins()

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

Reimplemented from hcaldqm::quantity::ElectronicsQuantity.

Definition at line 406 of file ElectronicsQuantity.h.

References _crates.

406 { return _crates.size(); }

◆ setup() [1/2]

void hcaldqm::quantity::CrateQuantity::setup ( HcalElectronicsMap const *  emap)
virtual

Definition at line 571 of file ElectronicsQuantity.cc.

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

Referenced by CrateQuantity().

571  {
574  }
std::map< int, uint32_t > getCrateHashMap(HcalElectronicsMap const *emap)
Definition: Utilities.cc:80
std::vector< int > getCrateList(HcalElectronicsMap const *emap)
Definition: Utilities.cc:66

◆ setup() [2/2]

virtual void hcaldqm::quantity::CrateQuantity::setup ( std::vector< int >  crates,
CrateHashMap  crateHashes 
)
virtual

Member Data Documentation

◆ _crateHashes

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

Definition at line 413 of file ElectronicsQuantity.h.

Referenced by makeCopy().

◆ _crates

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

Definition at line 412 of file ElectronicsQuantity.h.

Referenced by makeCopy(), max(), and nbins().