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 12 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 14 of file HFValueStruct.cc.

References doEnCor_, doPU_, and v_.

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

Member Function Documentation

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

Definition at line 49 of file HFValueStruct.cc.

References doEnCor_, hfvv_, and indexByIeta().

Referenced by HFRecoEcalCandidateAlgo::correctEPosition().

49  {
50  int indx=indexByIeta(ieta);
51  if(doEnCor_) return hfvv_[indx];
52  else return 1.0;}
std::vector< double > hfvv_
Definition: HFValueStruct.h:46
int indexByIeta(int &ieta) const
std::vector< double > reco::HFValueStruct::EnCor ( ) const

Definition at line 76 of file HFValueStruct.cc.

References doEnCor_, hfvv_, and cuy::ii.

Referenced by HFValueStruct().

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;}
std::vector< double > hfvv_
Definition: HFValueStruct.h:46
ii
Definition: cuy.py:588
int reco::HFValueStruct::ietaByIndex ( int &  indx) const
private

Definition at line 33 of file HFValueStruct.cc.

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

Definition at line 30 of file HFValueStruct.cc.

References funct::abs().

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

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

Definition at line 57 of file HFValueStruct.cc.

References doPU_, hfvv_, and indexByIeta().

Referenced by HFRecoEcalCandidateAlgo::correctEPosition().

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

Definition at line 98 of file HFValueStruct.cc.

References doPU_, hfvv_, and cuy::ii.

Referenced by HFValueStruct().

98  {
99  std::vector<double> vct;
100  if(doPU_){
101  for(int ii=0;ii<13;ii++)
102  vct.push_back(hfvv_[ii+52]);
103  }else{
104  for(int ii=0;ii<13;ii++)
105  vct.push_back(1.0);
106  }
107  return vct;}
std::vector< double > hfvv_
Definition: HFValueStruct.h:46
ii
Definition: cuy.py:588
double reco::HFValueStruct::PUSlope ( int  ieta) const

Definition at line 53 of file HFValueStruct.cc.

References doPU_, hfvv_, and indexByIeta().

Referenced by HFRecoEcalCandidateAlgo::correctEPosition().

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

Definition at line 87 of file HFValueStruct.cc.

References doPU_, hfvv_, and cuy::ii.

Referenced by HFValueStruct().

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

Definition at line 63 of file HFValueStruct.cc.

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

Referenced by HFValueStruct().

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

Definition at line 110 of file HFValueStruct.cc.

References hfvv_, and cuy::ii.

110  {
111  for(int ii=0;ii<13;ii++) hfvv_[ii]=val[ii];}
std::vector< double > hfvv_
Definition: HFValueStruct.h:46
ii
Definition: cuy.py:588
void reco::HFValueStruct::setPUIntercept ( int  ieta,
double  val 
)

Definition at line 69 of file HFValueStruct.cc.

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

Referenced by HFValueStruct().

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

Definition at line 114 of file HFValueStruct.cc.

References hfvv_, and cuy::ii.

114  {
115  for(int ii=0;ii<13;ii++) hfvv_[ii+52]=val[ii];
116 }
std::vector< double > hfvv_
Definition: HFValueStruct.h:46
ii
Definition: cuy.py:588
void reco::HFValueStruct::setPUSlope ( int  ieta,
double  val 
)

Definition at line 66 of file HFValueStruct.cc.

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

Referenced by HFValueStruct().

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

Definition at line 112 of file HFValueStruct.cc.

References hfvv_, and cuy::ii.

112  {
113  for(int ii=0;ii<13;ii++) hfvv_[ii+26]=val[ii];}
std::vector< double > hfvv_
Definition: HFValueStruct.h:46
ii
Definition: cuy.py:588

Member Data Documentation

bool reco::HFValueStruct::doEnCor_
private

Definition at line 48 of file HFValueStruct.h.

Referenced by EnCor(), and HFValueStruct().

bool reco::HFValueStruct::doPU_
private

Definition at line 48 of file HFValueStruct.h.

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

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

Definition at line 46 of file HFValueStruct.h.

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

int reco::HFValueStruct::v_
private

Definition at line 45 of file HFValueStruct.h.

Referenced by HFValueStruct().