test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 278 of file ElectronicsQuantity.h.

Member Typedef Documentation

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

Definition at line 297 of file ElectronicsQuantity.h.

Constructor & Destructor Documentation

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

Definition at line 281 of file ElectronicsQuantity.h.

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

Definition at line 282 of file ElectronicsQuantity.h.

References GeneralSetup::setup().

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

Definition at line 285 of file ElectronicsQuantity.h.

285 {}

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, HLT_25ns10e33_v2_cff::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:47
virtual FEDQuantity* hcaldqm::quantity::FEDQuantity::makeCopy ( )
inlinevirtual

Reimplemented from hcaldqm::quantity::ElectronicsQuantity.

Definition at line 301 of file ElectronicsQuantity.h.

References AlCaHLTBitMon_ParallelJobs::p.

302  {
303  std::vector<int> vfeds;
304  BOOST_FOREACH(FEDMap::value_type &p, _feds)
305  {
306  vfeds.push_back(p.first);
307  }
308 
309  // MUST SORT BEFORE EXITING!
310  std::sort(vfeds.begin(), vfeds.end());
311  return new FEDQuantity(vfeds);
312  }
virtual double hcaldqm::quantity::FEDQuantity::max ( )
inlinevirtual

Reimplemented from hcaldqm::quantity::ElectronicsQuantity.

Definition at line 293 of file ElectronicsQuantity.h.

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

Reimplemented from hcaldqm::quantity::ElectronicsQuantity.

Definition at line 292 of file ElectronicsQuantity.h.

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

Reimplemented from hcaldqm::quantity::ElectronicsQuantity.

Definition at line 291 of file ElectronicsQuantity.h.

291 {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 i.

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

Member Data Documentation

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

Definition at line 298 of file ElectronicsQuantity.h.

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