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

Constructor & Destructor Documentation

◆ HFValueStruct() [1/2]

reco::HFValueStruct::HFValueStruct ( )
inline

Definition at line 12 of file HFValueStruct.h.

12 {}

◆ HFValueStruct() [2/2]

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

Definition at line 13 of file HFValueStruct.cc.

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 }

References doEnCor_, doPU_, and v_.

Member Function Documentation

◆ EnCor() [1/2]

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

Definition at line 78 of file HFValueStruct.cc.

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 }

References cuy::ii.

◆ EnCor() [2/2]

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

Definition at line 41 of file HFValueStruct.cc.

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

References LEDCalibrationChannels::ieta.

Referenced by HFRecoEcalCandidateAlgo::correctEPosition().

◆ ietaByIndex()

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); }

◆ indexByIeta()

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

Definition at line 29 of file HFValueStruct.cc.

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

References funct::abs(), and LEDCalibrationChannels::ieta.

◆ PUIntercept() [1/2]

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

Definition at line 102 of file HFValueStruct.cc.

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 }

References cuy::ii.

◆ PUIntercept() [2/2]

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

Definition at line 55 of file HFValueStruct.cc.

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

References LEDCalibrationChannels::ieta.

Referenced by HFRecoEcalCandidateAlgo::correctEPosition().

◆ PUSlope() [1/2]

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

Definition at line 90 of file HFValueStruct.cc.

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 }

References cuy::ii.

◆ PUSlope() [2/2]

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

Definition at line 48 of file HFValueStruct.cc.

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

References LEDCalibrationChannels::ieta.

Referenced by HFRecoEcalCandidateAlgo::correctEPosition().

◆ setEnCor() [1/2]

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

Definition at line 115 of file HFValueStruct.cc.

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

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

◆ setEnCor() [2/2]

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

Definition at line 64 of file HFValueStruct.cc.

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

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

◆ setPUIntercept() [1/2]

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

Definition at line 123 of file HFValueStruct.cc.

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

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

◆ setPUIntercept() [2/2]

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

Definition at line 72 of file HFValueStruct.cc.

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

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

◆ setPUSlope() [1/2]

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

Definition at line 119 of file HFValueStruct.cc.

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

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

◆ setPUSlope() [2/2]

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

Definition at line 68 of file HFValueStruct.cc.

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

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

Member Data Documentation

◆ doEnCor_

bool reco::HFValueStruct::doEnCor_
private

Definition at line 39 of file HFValueStruct.h.

Referenced by HFValueStruct().

◆ doPU_

bool reco::HFValueStruct::doPU_
private

Definition at line 39 of file HFValueStruct.h.

Referenced by HFValueStruct().

◆ hfvv_

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

Definition at line 37 of file HFValueStruct.h.

◆ v_

int reco::HFValueStruct::v_
private

Definition at line 36 of file HFValueStruct.h.

Referenced by HFValueStruct().

reco::HFValueStruct::indexByIeta
int indexByIeta(int &ieta) const
Definition: HFValueStruct.cc:29
reco::HFValueStruct::v_
int v_
Definition: HFValueStruct.h:36
reco::HFValueStruct::doPU_
bool doPU_
Definition: HFValueStruct.h:39
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
reco::HFValueStruct::doEnCor_
bool doEnCor_
Definition: HFValueStruct.h:39
heppy_batch.val
val
Definition: heppy_batch.py:351
reco::HFValueStruct::hfvv_
std::vector< double > hfvv_
Definition: HFValueStruct.h:37
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
BeamSplash_cfg.version
version
Definition: BeamSplash_cfg.py:45
cuy.ii
ii
Definition: cuy.py:590