CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

reco::HFValueStruct Class Reference

#include <HFValueStruct.h>

List of all members.

Public Member Functions

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


Constructor & Destructor Documentation

reco::HFValueStruct::HFValueStruct ( ) [inline]

Definition at line 17 of file HFValueStruct.h.

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

Definition at line 14 of file HFValueStruct.cc.

References doEnCor_, doPU_, and v_.

                                                                                 : v_(version),hfvv_(vect) {
  //if(v_==-1) hfvv_=SetHfvvFromDB_();
  //v==99 will always give defaults
  
  //version control, add in versions as they appear!!
  if(v_==0 || v_==1) doEnCor_=true;
  else  doEnCor_=false;
  
  if(v_==1) doPU_=true;
  else doPU_=false;
  
  
}

Member Function Documentation

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

Definition at line 49 of file HFValueStruct.cc.

Referenced by HFRecoEcalCandidateAlgo::correctEPosition().

                                            {
  int indx=indexByIeta(ieta);
  if(doEnCor_) return hfvv_[indx];
  else return 1.0;}
std::vector< double > reco::HFValueStruct::EnCor ( ) const

Definition at line 76 of file HFValueStruct.cc.

References cuy::ii.

                                               {
  std::vector<double> vct;
  if(doEnCor_){
    for(int ii=0;ii<13;ii++)
      vct.push_back(hfvv_[ii]);
  }else{
    for(int ii=0;ii<13;ii++)
      vct.push_back(1.0);
  }
  return vct;}
int reco::HFValueStruct::ietaByIndex ( int &  indx) const [private]

Definition at line 33 of file HFValueStruct.cc.

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

Definition at line 30 of file HFValueStruct.cc.

References abs.

                                                {
  return (ieta>0)?(abs(ieta)-29+13):(41-abs(ieta));
}
std::vector< double > reco::HFValueStruct::PUIntercept ( ) const

Definition at line 98 of file HFValueStruct.cc.

References cuy::ii.

                                                     {  
  std::vector<double> vct;
  if(doPU_){
    for(int ii=0;ii<13;ii++)
      vct.push_back(hfvv_[ii+52]);
  }else{
    for(int ii=0;ii<13;ii++)
      vct.push_back(1.0);
  }
  return vct;}
double reco::HFValueStruct::PUIntercept ( int  ieta) const

Definition at line 57 of file HFValueStruct.cc.

Referenced by HFRecoEcalCandidateAlgo::correctEPosition().

                                                  {
  int indx=indexByIeta(ieta)+52;
  if(doPU_) return hfvv_[indx];
  else return 1.0;}
double reco::HFValueStruct::PUSlope ( int  ieta) const

Definition at line 53 of file HFValueStruct.cc.

Referenced by HFRecoEcalCandidateAlgo::correctEPosition().

                                              {
  int indx=indexByIeta(ieta)+26;
  if(doPU_) return hfvv_[indx];
  else return 0.0;}
std::vector< double > reco::HFValueStruct::PUSlope ( ) const

Definition at line 87 of file HFValueStruct.cc.

References cuy::ii.

                                                 {
  std::vector<double> vct;
  if(doPU_){
    for(int ii=0;ii<13;ii++)
      vct.push_back(hfvv_[ii+26]);
  }else{
    for(int ii=0;ii<13;ii++)
      vct.push_back(0.0);
  }
  return vct;}
void reco::HFValueStruct::setEnCor ( int  ieta,
double  val 
)

Definition at line 63 of file HFValueStruct.cc.

                                                   {
  int indx=indexByIeta(ieta);
  hfvv_[indx]=val;}
void reco::HFValueStruct::setEnCor ( const std::vector< double > &  val)

Definition at line 110 of file HFValueStruct.cc.

References cuy::ii.

                                                            {
  for(int ii=0;ii<13;ii++) hfvv_[ii]=val[ii];}
void reco::HFValueStruct::setPUIntercept ( const std::vector< double > &  val)

Definition at line 114 of file HFValueStruct.cc.

References cuy::ii.

                                                                  {
  for(int ii=0;ii<13;ii++) hfvv_[ii+52]=val[ii];
}
void reco::HFValueStruct::setPUIntercept ( int  ieta,
double  val 
)

Definition at line 69 of file HFValueStruct.cc.

                                                         {
  int indx=indexByIeta(ieta)+52;
  hfvv_[indx]=val;}
void reco::HFValueStruct::setPUSlope ( const std::vector< double > &  val)

Definition at line 112 of file HFValueStruct.cc.

References cuy::ii.

                                                              {
  for(int ii=0;ii<13;ii++) hfvv_[ii+26]=val[ii];}
void reco::HFValueStruct::setPUSlope ( int  ieta,
double  val 
)

Definition at line 66 of file HFValueStruct.cc.

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

Member Data Documentation

Definition at line 48 of file HFValueStruct.h.

Referenced by HFValueStruct().

Definition at line 48 of file HFValueStruct.h.

Referenced by HFValueStruct().

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

Definition at line 46 of file HFValueStruct.h.

int reco::HFValueStruct::v_ [private]

Definition at line 45 of file HFValueStruct.h.

Referenced by HFValueStruct().