CMS 3D CMS Logo

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

#include <HFValueStruct.h>

Public Member Functions

double EnCor (int ieta) const
 
std::vector< double > EnCor () const
 
 HFValueStruct ()
 
 HFValueStruct (const int &version, const std::vector< double > &vect)
 
double PUIntercept (int ieta) const
 
std::vector< double > PUIntercept () const
 
double PUSlope (int ieta) const
 
std::vector< double > PUSlope () const
 
void setEnCor (int ieta, double val)
 
void setEnCor (const std::vector< double > &val)
 
void setPUIntercept (int ieta, double val)
 
void setPUIntercept (const std::vector< double > &val)
 
void setPUSlope (int ieta, double val)
 
void setPUSlope (const std::vector< double > &val)
 

Private Member Functions

int ietaByIndex (int &indx) const
 
int indexByIeta (int &ieta) const
 

Private Attributes

bool doEnCor_
 
bool doPU_
 
std::vector< double > hfvv_
 
int v_
 

Detailed Description

Definition at line 8 of file HFValueStruct.h.

Constructor & Destructor Documentation

◆ HFValueStruct() [1/2]

reco::HFValueStruct::HFValueStruct ( )
inline

Definition at line 10 of file HFValueStruct.h.

10 {}

◆ HFValueStruct() [2/2]

reco::HFValueStruct::HFValueStruct ( const int &  version,
const std::vector< double > &  vect 
)

Definition at line 11 of file HFValueStruct.cc.

References doEnCor_, doPU_, and v_.

11  : v_(version), hfvv_(vect) {
12  //if(v_==-1) hfvv_=SetHfvvFromDB_();
13  //v==99 will always give defaults
14 
15  //version control, add in versions as they appear!!
16  if (v_ == 0 || v_ == 1)
17  doEnCor_ = true;
18  else
19  doEnCor_ = false;
20 
21  if (v_ == 1)
22  doPU_ = true;
23  else
24  doPU_ = false;
25 }
std::vector< double > hfvv_
Definition: HFValueStruct.h:35

Member Function Documentation

◆ EnCor() [1/2]

double reco::HFValueStruct::EnCor ( int  ieta) const

Definition at line 39 of file HFValueStruct.cc.

References hcalRecHitTable_cff::ieta.

Referenced by HFRecoEcalCandidateAlgo::correctEPosition().

39  {
40  int indx = indexByIeta(ieta);
41  if (doEnCor_)
42  return hfvv_[indx];
43  else
44  return 1.0;
45 }
std::vector< double > hfvv_
Definition: HFValueStruct.h:35
int indexByIeta(int &ieta) const

◆ EnCor() [2/2]

std::vector< double > reco::HFValueStruct::EnCor ( ) const

Definition at line 76 of file HFValueStruct.cc.

References cuy::ii.

76  {
77  std::vector<double> vct;
78  if (doEnCor_) {
79  for (int ii = 0; ii < 13; ii++)
80  vct.push_back(hfvv_[ii]);
81  } else {
82  for (int ii = 0; ii < 13; ii++)
83  vct.push_back(1.0);
84  }
85  return vct;
86 }
std::vector< double > hfvv_
Definition: HFValueStruct.h:35
ii
Definition: cuy.py:589

◆ ietaByIndex()

int reco::HFValueStruct::ietaByIndex ( int &  indx) const
private

Definition at line 28 of file HFValueStruct.cc.

28 { return (indx > 13) ? (indx + 29 - 13) : (indx - 41); }

◆ indexByIeta()

int reco::HFValueStruct::indexByIeta ( int &  ieta) const
private

Definition at line 27 of file HFValueStruct.cc.

References hcalRecHitTable_cff::ieta.

27 { return (ieta > 0) ? (ieta - 29 + 13) : (41 + ieta); }

◆ PUIntercept() [1/2]

double reco::HFValueStruct::PUIntercept ( int  ieta) const

Definition at line 53 of file HFValueStruct.cc.

References hcalRecHitTable_cff::ieta.

Referenced by HFRecoEcalCandidateAlgo::correctEPosition().

53  {
54  int indx = indexByIeta(ieta) + 52;
55  if (doPU_)
56  return hfvv_[indx];
57  else
58  return 1.0;
59 }
std::vector< double > hfvv_
Definition: HFValueStruct.h:35
int indexByIeta(int &ieta) const

◆ PUIntercept() [2/2]

std::vector< double > reco::HFValueStruct::PUIntercept ( ) const

Definition at line 100 of file HFValueStruct.cc.

References cuy::ii.

100  {
101  std::vector<double> vct;
102  if (doPU_) {
103  for (int ii = 0; ii < 13; ii++)
104  vct.push_back(hfvv_[ii + 52]);
105  } else {
106  for (int ii = 0; ii < 13; ii++)
107  vct.push_back(1.0);
108  }
109  return vct;
110 }
std::vector< double > hfvv_
Definition: HFValueStruct.h:35
ii
Definition: cuy.py:589

◆ PUSlope() [1/2]

double reco::HFValueStruct::PUSlope ( int  ieta) const

Definition at line 46 of file HFValueStruct.cc.

References hcalRecHitTable_cff::ieta.

Referenced by HFRecoEcalCandidateAlgo::correctEPosition().

46  {
47  int indx = indexByIeta(ieta) + 26;
48  if (doPU_)
49  return hfvv_[indx];
50  else
51  return 0.0;
52 }
std::vector< double > hfvv_
Definition: HFValueStruct.h:35
int indexByIeta(int &ieta) const

◆ PUSlope() [2/2]

std::vector< double > reco::HFValueStruct::PUSlope ( ) const

Definition at line 88 of file HFValueStruct.cc.

References cuy::ii.

88  {
89  std::vector<double> vct;
90  if (doPU_) {
91  for (int ii = 0; ii < 13; ii++)
92  vct.push_back(hfvv_[ii + 26]);
93  } else {
94  for (int ii = 0; ii < 13; ii++)
95  vct.push_back(0.0);
96  }
97  return vct;
98 }
std::vector< double > hfvv_
Definition: HFValueStruct.h:35
ii
Definition: cuy.py:589

◆ setEnCor() [1/2]

void reco::HFValueStruct::setEnCor ( int  ieta,
double  val 
)

Definition at line 62 of file HFValueStruct.cc.

References hcalRecHitTable_cff::ieta, and heppy_batch::val.

62  {
63  int indx = indexByIeta(ieta);
64  hfvv_[indx] = val;
65 }
std::vector< double > hfvv_
Definition: HFValueStruct.h:35
int indexByIeta(int &ieta) const

◆ setEnCor() [2/2]

void reco::HFValueStruct::setEnCor ( const std::vector< double > &  val)

Definition at line 113 of file HFValueStruct.cc.

References cuy::ii, and heppy_batch::val.

113  {
114  for (int ii = 0; ii < 13; ii++)
115  hfvv_[ii] = val[ii];
116 }
std::vector< double > hfvv_
Definition: HFValueStruct.h:35
ii
Definition: cuy.py:589

◆ setPUIntercept() [1/2]

void reco::HFValueStruct::setPUIntercept ( int  ieta,
double  val 
)

Definition at line 70 of file HFValueStruct.cc.

References hcalRecHitTable_cff::ieta, and heppy_batch::val.

70  {
71  int indx = indexByIeta(ieta) + 52;
72  hfvv_[indx] = val;
73 }
std::vector< double > hfvv_
Definition: HFValueStruct.h:35
int indexByIeta(int &ieta) const

◆ setPUIntercept() [2/2]

void reco::HFValueStruct::setPUIntercept ( const std::vector< double > &  val)

Definition at line 121 of file HFValueStruct.cc.

References cuy::ii, and heppy_batch::val.

121  {
122  for (int ii = 0; ii < 13; ii++)
123  hfvv_[ii + 52] = val[ii];
124 }
std::vector< double > hfvv_
Definition: HFValueStruct.h:35
ii
Definition: cuy.py:589

◆ setPUSlope() [1/2]

void reco::HFValueStruct::setPUSlope ( int  ieta,
double  val 
)

Definition at line 66 of file HFValueStruct.cc.

References hcalRecHitTable_cff::ieta, and heppy_batch::val.

66  {
67  int indx = indexByIeta(ieta) + 26;
68  hfvv_[indx] = val;
69 }
std::vector< double > hfvv_
Definition: HFValueStruct.h:35
int indexByIeta(int &ieta) const

◆ setPUSlope() [2/2]

void reco::HFValueStruct::setPUSlope ( const std::vector< double > &  val)

Definition at line 117 of file HFValueStruct.cc.

References cuy::ii, and heppy_batch::val.

117  {
118  for (int ii = 0; ii < 13; ii++)
119  hfvv_[ii + 26] = val[ii];
120 }
std::vector< double > hfvv_
Definition: HFValueStruct.h:35
ii
Definition: cuy.py:589

Member Data Documentation

◆ doEnCor_

bool reco::HFValueStruct::doEnCor_
private

Definition at line 37 of file HFValueStruct.h.

Referenced by HFValueStruct().

◆ doPU_

bool reco::HFValueStruct::doPU_
private

Definition at line 37 of file HFValueStruct.h.

Referenced by HFValueStruct().

◆ hfvv_

std::vector<double> reco::HFValueStruct::hfvv_
private

Definition at line 35 of file HFValueStruct.h.

◆ v_

int reco::HFValueStruct::v_
private

Definition at line 34 of file HFValueStruct.h.

Referenced by HFValueStruct().