CMS 3D CMS Logo

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 10 of file HFValueStruct.h.

Constructor & Destructor Documentation

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

Definition at line 13 of file HFValueStruct.cc.

References doEnCor_, doPU_, and v_.

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

Member Function Documentation

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

Definition at line 41 of file HFValueStruct.cc.

References doEnCor_, hfvv_, and indexByIeta().

Referenced by HFRecoEcalCandidateAlgo::correctEPosition().

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

Definition at line 78 of file HFValueStruct.cc.

References doEnCor_, hfvv_, and cuy::ii.

Referenced by HFValueStruct().

78  {
79  std::vector<double> vct;
80  if (doEnCor_) {
81  for (int ii = 0; ii < 13; ii++)
82  vct.push_back(hfvv_[ii]);
83  } else {
84  for (int ii = 0; ii < 13; ii++)
85  vct.push_back(1.0);
86  }
87  return vct;
88 }
std::vector< double > hfvv_
Definition: HFValueStruct.h:37
ii
Definition: cuy.py:590
int reco::HFValueStruct::ietaByIndex ( int &  indx) const
private

Definition at line 30 of file HFValueStruct.cc.

30 { return (indx > 13) ? (indx + 29 - 13) : (indx - 41); }
int reco::HFValueStruct::indexByIeta ( int &  ieta) const
private

Definition at line 29 of file HFValueStruct.cc.

References funct::abs().

Referenced by EnCor(), PUIntercept(), PUSlope(), setEnCor(), setPUIntercept(), and setPUSlope().

29 { return (ieta > 0) ? (abs(ieta) - 29 + 13) : (41 - abs(ieta)); }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double reco::HFValueStruct::PUIntercept ( int  ieta) const

Definition at line 55 of file HFValueStruct.cc.

References doPU_, hfvv_, and indexByIeta().

Referenced by HFRecoEcalCandidateAlgo::correctEPosition().

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

Definition at line 102 of file HFValueStruct.cc.

References doPU_, hfvv_, and cuy::ii.

Referenced by HFValueStruct().

102  {
103  std::vector<double> vct;
104  if (doPU_) {
105  for (int ii = 0; ii < 13; ii++)
106  vct.push_back(hfvv_[ii + 52]);
107  } else {
108  for (int ii = 0; ii < 13; ii++)
109  vct.push_back(1.0);
110  }
111  return vct;
112 }
std::vector< double > hfvv_
Definition: HFValueStruct.h:37
ii
Definition: cuy.py:590
double reco::HFValueStruct::PUSlope ( int  ieta) const

Definition at line 48 of file HFValueStruct.cc.

References doPU_, hfvv_, and indexByIeta().

Referenced by HFRecoEcalCandidateAlgo::correctEPosition().

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

Definition at line 90 of file HFValueStruct.cc.

References doPU_, hfvv_, and cuy::ii.

Referenced by HFValueStruct().

90  {
91  std::vector<double> vct;
92  if (doPU_) {
93  for (int ii = 0; ii < 13; ii++)
94  vct.push_back(hfvv_[ii + 26]);
95  } else {
96  for (int ii = 0; ii < 13; ii++)
97  vct.push_back(0.0);
98  }
99  return vct;
100 }
std::vector< double > hfvv_
Definition: HFValueStruct.h:37
ii
Definition: cuy.py:590
void reco::HFValueStruct::setEnCor ( int  ieta,
double  val 
)

Definition at line 64 of file HFValueStruct.cc.

References hfvv_, indexByIeta(), and heppy_batch::val.

Referenced by HFValueStruct().

64  {
65  int indx = indexByIeta(ieta);
66  hfvv_[indx] = val;
67 }
std::vector< double > hfvv_
Definition: HFValueStruct.h:37
int indexByIeta(int &ieta) const
void reco::HFValueStruct::setEnCor ( const std::vector< double > &  val)

Definition at line 115 of file HFValueStruct.cc.

References hfvv_, and cuy::ii.

115  {
116  for (int ii = 0; ii < 13; ii++)
117  hfvv_[ii] = val[ii];
118 }
std::vector< double > hfvv_
Definition: HFValueStruct.h:37
ii
Definition: cuy.py:590
void reco::HFValueStruct::setPUIntercept ( int  ieta,
double  val 
)

Definition at line 72 of file HFValueStruct.cc.

References hfvv_, indexByIeta(), and heppy_batch::val.

Referenced by HFValueStruct().

72  {
73  int indx = indexByIeta(ieta) + 52;
74  hfvv_[indx] = val;
75 }
std::vector< double > hfvv_
Definition: HFValueStruct.h:37
int indexByIeta(int &ieta) const
void reco::HFValueStruct::setPUIntercept ( const std::vector< double > &  val)

Definition at line 123 of file HFValueStruct.cc.

References hfvv_, and cuy::ii.

123  {
124  for (int ii = 0; ii < 13; ii++)
125  hfvv_[ii + 52] = val[ii];
126 }
std::vector< double > hfvv_
Definition: HFValueStruct.h:37
ii
Definition: cuy.py:590
void reco::HFValueStruct::setPUSlope ( int  ieta,
double  val 
)

Definition at line 68 of file HFValueStruct.cc.

References hfvv_, indexByIeta(), and heppy_batch::val.

Referenced by HFValueStruct().

68  {
69  int indx = indexByIeta(ieta) + 26;
70  hfvv_[indx] = val;
71 }
std::vector< double > hfvv_
Definition: HFValueStruct.h:37
int indexByIeta(int &ieta) const
void reco::HFValueStruct::setPUSlope ( const std::vector< double > &  val)

Definition at line 119 of file HFValueStruct.cc.

References hfvv_, and cuy::ii.

119  {
120  for (int ii = 0; ii < 13; ii++)
121  hfvv_[ii + 26] = val[ii];
122 }
std::vector< double > hfvv_
Definition: HFValueStruct.h:37
ii
Definition: cuy.py:590

Member Data Documentation

bool reco::HFValueStruct::doEnCor_
private

Definition at line 39 of file HFValueStruct.h.

Referenced by EnCor(), and HFValueStruct().

bool reco::HFValueStruct::doPU_
private

Definition at line 39 of file HFValueStruct.h.

Referenced by HFValueStruct(), PUIntercept(), and PUSlope().

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

Definition at line 37 of file HFValueStruct.h.

Referenced by EnCor(), PUIntercept(), PUSlope(), setEnCor(), setPUIntercept(), and setPUSlope().

int reco::HFValueStruct::v_
private

Definition at line 36 of file HFValueStruct.h.

Referenced by HFValueStruct().