CMS 3D CMS Logo

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

#include <ElectronicsQuantity.h>

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

Public Member Functions

 FEDQuantity ()
 
 FEDQuantity (std::vector< int > const &vFEDs)
 
virtual uint32_t getBin (HcalElectronicsId const &)
 
virtual std::vector< std::string > getLabels ()
 
virtual int getValue (HcalElectronicsId const &)
 
virtual FEDQuantitymakeCopy ()
 
virtual double max ()
 
virtual double min ()
 
virtual int nbins ()
 
virtual void setup (std::vector< int > const &vFEDs)
 
virtual ~FEDQuantity ()
 
- Public Member Functions inherited from hcaldqm::quantity::ElectronicsQuantity
 ElectronicsQuantity ()
 
 ElectronicsQuantity (ElectronicsQuantityType type, bool isLog=false)
 
virtual bool isCoordinate ()
 
virtual QuantityType type ()
 
virtual ~ElectronicsQuantity ()
 
- 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 int wofnbins ()
 
virtual ~Quantity ()
 

Protected Types

typedef boost::unordered_map< int, uint32_t > FEDMap
 

Protected Attributes

FEDMap _feds
 
- Protected Attributes inherited from hcaldqm::quantity::ElectronicsQuantity
ElectronicsQuantityType _type
 
- Protected Attributes inherited from hcaldqm::quantity::Quantity
AxisType _axistype
 
bool _isLog
 
std::string _name
 

Detailed Description

Definition at line 368 of file ElectronicsQuantity.h.

Member Typedef Documentation

typedef boost::unordered_map<int, uint32_t> hcaldqm::quantity::FEDQuantity::FEDMap
protected

Definition at line 387 of file ElectronicsQuantity.h.

Constructor & Destructor Documentation

hcaldqm::quantity::FEDQuantity::FEDQuantity ( )
inline

Definition at line 371 of file ElectronicsQuantity.h.

371 {}
hcaldqm::quantity::FEDQuantity::FEDQuantity ( std::vector< int > const &  vFEDs)
inline

Definition at line 372 of file ElectronicsQuantity.h.

References GeneralSetup::setup().

372  :
373  ElectronicsQuantity(fFED, false)
374  {this->setup(vFEDs);}
virtual void setup(std::vector< int > const &vFEDs)
virtual hcaldqm::quantity::FEDQuantity::~FEDQuantity ( )
inlinevirtual

Member Function Documentation

uint32_t hcaldqm::quantity::FEDQuantity::getBin ( HcalElectronicsId const &  eid)
virtual

Reimplemented from hcaldqm::quantity::ElectronicsQuantity.

Definition at line 772 of file ElectronicsQuantity.cc.

References getValue().

Referenced by BTagWeightCalculator.BTagWeightCalculator::calcJetWeightImpl().

773  {
774  return getValue(eid)+1;
775  }
virtual int getValue(HcalElectronicsId const &)
std::vector< std::string > hcaldqm::quantity::FEDQuantity::getLabels ( )
virtual

Reimplemented from hcaldqm::quantity::ElectronicsQuantity.

Definition at line 777 of file ElectronicsQuantity.cc.

References _feds, tablePrinter::labels, hcaldqm::quantity::Quantity::name(), AlCaHLTBitMon_QueryRunRegistry::string, and findQualityFiles::v.

778  {
779  std::vector<std::string> labels(_feds.size());
780  char name[5];
781  BOOST_FOREACH(FEDMap::value_type &v, _feds)
782  {
783  sprintf(name, "%d", v.first);
784  labels[v.second] = std::string(name);
785  }
786 
787  return labels;
788  }
virtual std::string name()
Definition: Quantity.h:47
int hcaldqm::quantity::FEDQuantity::getValue ( HcalElectronicsId const &  eid)
virtual

Reimplemented from hcaldqm::quantity::ElectronicsQuantity.

Definition at line 765 of file ElectronicsQuantity.cc.

References _feds, hcaldqm::utilities::crate2fed(), HcalElectronicsId::crateId(), HcalElectronicsId::dccid(), hcaldqm::constants::FED_VME_MIN, HcalElectronicsId::isVMEid(), and HcalElectronicsId::slot().

Referenced by getBin().

766  {
767  int fed = eid.isVMEid()?eid.dccid()+FED_VME_MIN:
768  utilities::crate2fed(eid.crateId(),eid.slot());
769  return _feds[fed];
770  }
uint16_t crate2fed(int crate, int slot)
Definition: Utilities.cc:30
int const FED_VME_MIN
Definition: Constants.h:98
virtual FEDQuantity* hcaldqm::quantity::FEDQuantity::makeCopy ( )
inlinevirtual

Reimplemented from hcaldqm::quantity::ElectronicsQuantity.

Definition at line 391 of file ElectronicsQuantity.h.

References AlCaHLTBitMon_ParallelJobs::p.

392  {
393  std::vector<int> vfeds;
394  BOOST_FOREACH(FEDMap::value_type &p, _feds)
395  {
396  vfeds.push_back(p.first);
397  }
398 
399  // MUST SORT BEFORE EXITING!
400  std::sort(vfeds.begin(), vfeds.end());
401  return new FEDQuantity(vfeds);
402  }
virtual double hcaldqm::quantity::FEDQuantity::max ( )
inlinevirtual

Reimplemented from hcaldqm::quantity::ElectronicsQuantity.

Definition at line 383 of file ElectronicsQuantity.h.

383 {return _feds.size();}
virtual double hcaldqm::quantity::FEDQuantity::min ( )
inlinevirtual

Reimplemented from hcaldqm::quantity::ElectronicsQuantity.

Definition at line 382 of file ElectronicsQuantity.h.

382 {return 0;}
virtual int hcaldqm::quantity::FEDQuantity::nbins ( )
inlinevirtual

Reimplemented from hcaldqm::quantity::ElectronicsQuantity.

Definition at line 381 of file ElectronicsQuantity.h.

381 {return _feds.size();}
void hcaldqm::quantity::FEDQuantity::setup ( std::vector< int > const &  vFEDs)
virtual

Definition at line 759 of file ElectronicsQuantity.cc.

References _feds, and mps_fire::i.

760  {
761  for (uint32_t i=0; i<vFEDs.size(); i++)
762  _feds.insert(std::make_pair(vFEDs[i], i));
763  }

Member Data Documentation

FEDMap hcaldqm::quantity::FEDQuantity::_feds
protected

Definition at line 388 of file ElectronicsQuantity.h.

Referenced by getLabels(), getValue(), and setup().