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

std::vector< double > EnCor () const
 
double EnCor (int ieta) const
 
 HFValueStruct ()
 
 HFValueStruct (const int &version, const std::vector< double > &vect)
 
std::vector< double > PUIntercept () const
 
double PUIntercept (int ieta) const
 
std::vector< double > PUSlope () const
 
double PUSlope (int ieta) const
 
void setEnCor (const std::vector< double > &val)
 
void setEnCor (int ieta, double val)
 
void setPUIntercept (const std::vector< double > &val)
 
void setPUIntercept (int ieta, double val)
 
void setPUSlope (const std::vector< double > &val)
 
void setPUSlope (int ieta, 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.

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 }

References doEnCor_, doPU_, and v_.

Member Function Documentation

◆ EnCor() [1/2]

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

Definition at line 76 of file HFValueStruct.cc.

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 }

References cuy::ii.

◆ EnCor() [2/2]

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

Definition at line 39 of file HFValueStruct.cc.

39  {
40  int indx = indexByIeta(ieta);
41  if (doEnCor_)
42  return hfvv_[indx];
43  else
44  return 1.0;
45 }

References LEDCalibrationChannels::ieta.

Referenced by HFRecoEcalCandidateAlgo::correctEPosition().

◆ 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.

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

References LEDCalibrationChannels::ieta.

◆ PUIntercept() [1/2]

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

Definition at line 100 of file HFValueStruct.cc.

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 }

References cuy::ii.

◆ PUIntercept() [2/2]

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

Definition at line 53 of file HFValueStruct.cc.

53  {
54  int indx = indexByIeta(ieta) + 52;
55  if (doPU_)
56  return hfvv_[indx];
57  else
58  return 1.0;
59 }

References LEDCalibrationChannels::ieta.

Referenced by HFRecoEcalCandidateAlgo::correctEPosition().

◆ PUSlope() [1/2]

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

Definition at line 88 of file HFValueStruct.cc.

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 }

References cuy::ii.

◆ PUSlope() [2/2]

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

Definition at line 46 of file HFValueStruct.cc.

46  {
47  int indx = indexByIeta(ieta) + 26;
48  if (doPU_)
49  return hfvv_[indx];
50  else
51  return 0.0;
52 }

References LEDCalibrationChannels::ieta.

Referenced by HFRecoEcalCandidateAlgo::correctEPosition().

◆ setEnCor() [1/2]

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

Definition at line 113 of file HFValueStruct.cc.

113  {
114  for (int ii = 0; ii < 13; ii++)
115  hfvv_[ii] = val[ii];
116 }

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

◆ setEnCor() [2/2]

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

Definition at line 62 of file HFValueStruct.cc.

62  {
63  int indx = indexByIeta(ieta);
64  hfvv_[indx] = val;
65 }

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

◆ setPUIntercept() [1/2]

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

Definition at line 121 of file HFValueStruct.cc.

121  {
122  for (int ii = 0; ii < 13; ii++)
123  hfvv_[ii + 52] = val[ii];
124 }

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

◆ setPUIntercept() [2/2]

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

Definition at line 70 of file HFValueStruct.cc.

70  {
71  int indx = indexByIeta(ieta) + 52;
72  hfvv_[indx] = val;
73 }

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

◆ setPUSlope() [1/2]

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

Definition at line 117 of file HFValueStruct.cc.

117  {
118  for (int ii = 0; ii < 13; ii++)
119  hfvv_[ii + 26] = val[ii];
120 }

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

◆ setPUSlope() [2/2]

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

Definition at line 66 of file HFValueStruct.cc.

66  {
67  int indx = indexByIeta(ieta) + 26;
68  hfvv_[indx] = val;
69 }

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

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

reco::HFValueStruct::indexByIeta
int indexByIeta(int &ieta) const
Definition: HFValueStruct.cc:27
reco::HFValueStruct::v_
int v_
Definition: HFValueStruct.h:34
reco::HFValueStruct::doPU_
bool doPU_
Definition: HFValueStruct.h:37
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
reco::HFValueStruct::doEnCor_
bool doEnCor_
Definition: HFValueStruct.h:37
heppy_batch.val
val
Definition: heppy_batch.py:351
reco::HFValueStruct::hfvv_
std::vector< double > hfvv_
Definition: HFValueStruct.h:35
BeamSplash_cfg.version
version
Definition: BeamSplash_cfg.py:45
cuy.ii
ii
Definition: cuy.py:590