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

◆ HcalDepthEnergyFractions() [1/2]

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

◆ HcalDepthEnergyFractions() [2/2]

pat::HcalDepthEnergyFractions::HcalDepthEnergyFractions ( )
inline

Definition at line 21 of file HcalDepthEnergyFractions.h.

Member Function Documentation

◆ fraction()

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

Definition at line 47 of file HcalDepthEnergyFractions.h.

References fractions_, and mps_fire::i.

47  {
48  if (i < fractions_.size())
49  return fractions_[i];
50  else
51  return -1.;
52  }

◆ fractionI()

int pat::HcalDepthEnergyFractions::fractionI ( unsigned int  i) const
inline

Definition at line 58 of file HcalDepthEnergyFractions.h.

References fractionsI_, and mps_fire::i.

58  {
59  if (i < fractionsI_.size())
60  return int(fractionsI_[i]);
61  else
62  return -1; // physical range 0-200
63  }

◆ fractions()

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

Definition at line 44 of file HcalDepthEnergyFractions.h.

References fractions_.

44 { return fractions_; }

◆ fractionsI()

const std::vector<uint8_t>& pat::HcalDepthEnergyFractions::fractionsI ( ) const
inline

Definition at line 55 of file HcalDepthEnergyFractions.h.

References fractionsI_.

55 { return fractionsI_; }

◆ initFloatVector()

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  }

◆ initUint8Vector()

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  }

◆ reset()

void pat::HcalDepthEnergyFractions::reset ( std::vector< float >  v)
inline

Member Data Documentation

◆ fractions_

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

◆ fractionsI_

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

Definition at line 17 of file HcalDepthEnergyFractions.h.

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