CMS 3D CMS Logo

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 22 of file HcalDepthEnergyFractions.h.

Member Function Documentation

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

Definition at line 48 of file HcalDepthEnergyFractions.h.

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

Definition at line 59 of file HcalDepthEnergyFractions.h.

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

Definition at line 43 of file HcalDepthEnergyFractions.h.

References fractions_.

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

Definition at line 54 of file HcalDepthEnergyFractions.h.

References fractionsI_.

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

Definition at line 31 of file HcalDepthEnergyFractions.h.

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

Definition at line 25 of file HcalDepthEnergyFractions.h.

References DivergingColor::frac.

Referenced by HcalDepthEnergyFractions(), and reset().

25  {
26  fractionsI_.clear();
27  for (auto frac : fractions_) 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

Definition at line 16 of file HcalDepthEnergyFractions.h.

Referenced by fractions().

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

Definition at line 18 of file HcalDepthEnergyFractions.h.

Referenced by fractionsI().