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 768 of file ElectronicsQuantity.cc.

References getValue().

Referenced by BTagWeightCalculator.BTagWeightCalculator::calcJetWeightImpl().

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

Reimplemented from hcaldqm::quantity::ElectronicsQuantity.

Definition at line 773 of file ElectronicsQuantity.cc.

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

774  {
775  std::vector<std::string> labels(_feds.size());
776  char name[5];
777  BOOST_FOREACH(FEDMap::value_type &v, _feds)
778  {
779  sprintf(name, "%d", v.first);
780  labels[v.second] = std::string(name);
781  }
782 
783  return labels;
784  }
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 761 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().

762  {
763  int fed = eid.isVMEid()?eid.dccid()+FED_VME_MIN:
764  utilities::crate2fed(eid.crateId(),eid.slot());
765  return _feds[fed];
766  }
uint16_t crate2fed(int crate, int slot)
Definition: Utilities.cc:27
int const FED_VME_MIN
Definition: Constants.h:55
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 755 of file ElectronicsQuantity.cc.

References _feds, and mps_fire::i.

756  {
757  for (uint32_t i=0; i<vFEDs.size(); i++)
758  _feds.insert(std::make_pair(vFEDs[i], i));
759  }

Member Data Documentation

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

Definition at line 388 of file ElectronicsQuantity.h.

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