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 ()
 
 HcalDepthEnergyFractions (const std::vector< float > &v)
 
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

Definition at line 20 of file HcalDepthEnergyFractions.h.

References initUint8Vector().

◆ HcalDepthEnergyFractions() [2/2]

pat::HcalDepthEnergyFractions::HcalDepthEnergyFractions ( )
inline

Definition at line 21 of file HcalDepthEnergyFractions.h.

21 : fractions_(), fractionsI_() {}

Member Function Documentation

◆ fraction()

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

Definition at line 47 of file HcalDepthEnergyFractions.h.

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

References fractions_, and mps_fire::i.

◆ fractionI()

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

Definition at line 58 of file HcalDepthEnergyFractions.h.

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

References fractionsI_, and mps_fire::i.

◆ fractions()

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

Definition at line 44 of file HcalDepthEnergyFractions.h.

44 { return fractions_; }

References fractions_.

◆ fractionsI()

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

Definition at line 55 of file HcalDepthEnergyFractions.h.

55 { return fractionsI_; }

References fractionsI_.

◆ initFloatVector()

void pat::HcalDepthEnergyFractions::initFloatVector ( )
inline

Definition at line 31 of file HcalDepthEnergyFractions.h.

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

References fractions_, and fractionsI_.

◆ initUint8Vector()

void pat::HcalDepthEnergyFractions::initUint8Vector ( )
inline

Definition at line 24 of file HcalDepthEnergyFractions.h.

24  {
25  fractionsI_.clear();
26  for (auto frac : fractions_)
27  fractionsI_.push_back((uint8_t)(frac * 200.));
28  }

References cropTnPTrees::frac, fractions_, and fractionsI_.

Referenced by HcalDepthEnergyFractions(), and reset().

◆ reset()

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

Definition at line 38 of file HcalDepthEnergyFractions.h.

38  {
39  fractions_ = v;
41  }

References fractions_, initUint8Vector(), and findQualityFiles::v.

Referenced by pat::PATPackedCandidateProducer::produce().

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().

mps_fire.i
i
Definition: mps_fire.py:355
cropTnPTrees.frac
frac
Definition: cropTnPTrees.py:18
pat::HcalDepthEnergyFractions::fractionsI_
std::vector< uint8_t > fractionsI_
Definition: HcalDepthEnergyFractions.h:17
findQualityFiles.v
v
Definition: findQualityFiles.py:179
pat::HcalDepthEnergyFractions::initUint8Vector
void initUint8Vector()
Definition: HcalDepthEnergyFractions.h:24
pat::HcalDepthEnergyFractions::fractions_
std::vector< float > fractions_
Definition: HcalDepthEnergyFractions.h:15