CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
pat::HcalDepthEnergyFractions Class Reference

#include <HcalDepthEnergyFractions.h>

Public Member Functions

float fraction (unsigned int i) const
 
int fractionI (unsigned int i) const
 
const std::vector< float > & fractions () const
 
const std::vector< uint8_t > & fractionsI () const
 
 HcalDepthEnergyFractions (const std::vector< float > &v)
 
 HcalDepthEnergyFractions ()
 
void initFloatVector ()
 
void initUint8Vector ()
 
void reset (std::vector< float > v)
 

Private Attributes

std::vector< float > fractions_
 
std::vector< uint8_t > fractionsI_
 

Detailed Description

Definition at line 12 of file HcalDepthEnergyFractions.h.

Constructor & Destructor Documentation

pat::HcalDepthEnergyFractions::HcalDepthEnergyFractions ( const std::vector< float > &  v)
inlineexplicit
pat::HcalDepthEnergyFractions::HcalDepthEnergyFractions ( )
inline

Definition at line 21 of file HcalDepthEnergyFractions.h.

21 : fractions_(), fractionsI_() {}

Member Function Documentation

float pat::HcalDepthEnergyFractions::fraction ( unsigned int  i) const
inline

Definition at line 47 of file HcalDepthEnergyFractions.h.

References fractions_.

47  {
48  if (i < fractions_.size())
49  return fractions_[i];
50  else
51  return -1.;
52  }
int pat::HcalDepthEnergyFractions::fractionI ( unsigned int  i) const
inline

Definition at line 58 of file HcalDepthEnergyFractions.h.

References fractionsI_.

58  {
59  if (i < fractionsI_.size())
60  return int(fractionsI_[i]);
61  else
62  return -1; // physical range 0-200
63  }
const std::vector<float>& pat::HcalDepthEnergyFractions::fractions ( ) const
inline

Definition at line 44 of file HcalDepthEnergyFractions.h.

References fractions_.

44 { return fractions_; }
const std::vector<uint8_t>& pat::HcalDepthEnergyFractions::fractionsI ( ) const
inline

Definition at line 55 of file HcalDepthEnergyFractions.h.

References fractionsI_.

55 { return fractionsI_; }
void pat::HcalDepthEnergyFractions::initFloatVector ( )
inline

Definition at line 31 of file HcalDepthEnergyFractions.h.

References fractions_, and fractionsI_.

31  {
32  fractions_.clear();
33  for (auto fracI : fractionsI_)
34  fractions_.push_back(float(fracI) / 200.);
35  }
void pat::HcalDepthEnergyFractions::initUint8Vector ( )
inline

Definition at line 24 of file HcalDepthEnergyFractions.h.

References DivergingColor::frac, fractions_, and fractionsI_.

Referenced by HcalDepthEnergyFractions(), and reset().

24  {
25  fractionsI_.clear();
26  for (auto frac : fractions_)
27  fractionsI_.push_back((uint8_t)(frac * 200.));
28  }
void pat::HcalDepthEnergyFractions::reset ( std::vector< float >  v)
inline

Member Data Documentation

std::vector<float> pat::HcalDepthEnergyFractions::fractions_
private
std::vector<uint8_t> pat::HcalDepthEnergyFractions::fractionsI_
private

Definition at line 17 of file HcalDepthEnergyFractions.h.

Referenced by fractionI(), fractionsI(), initFloatVector(), and initUint8Vector().