CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

HcalQIEShape Class Reference

#include <HcalQIEShape.h>

List of all members.

Public Member Functions

float center (unsigned fAdc) const
 HcalQIEShape ()
float highEdge (unsigned fAdc) const
unsigned local (unsigned fAdc) const
float lowEdge (unsigned fAdc) const
unsigned range (unsigned fAdc) const
bool setLowEdges (unsigned int nVals, const float *fValue)
 ~HcalQIEShape ()

Private Member Functions

void expand ()
bool setLowEdge (float fValue, unsigned fAdc)

Private Attributes

std::vector< float > mValues
unsigned int nbins_

Detailed Description

Definition at line 17 of file HcalQIEShape.h.


Constructor & Destructor Documentation

HcalQIEShape::HcalQIEShape ( )

Definition at line 11 of file HcalQIEShape.cc.

  :nbins_(0)
{
}
HcalQIEShape::~HcalQIEShape ( )

Definition at line 16 of file HcalQIEShape.cc.

{}

Member Function Documentation

float HcalQIEShape::center ( unsigned  fAdc) const

Definition at line 37 of file HcalQIEShape.cc.

References mValues, and nbins_.

Referenced by HcalQIECoder::charge().

                                               {
  if (fAdc < 4*nbins_) {
    if (fAdc % nbins_ == nbins_-1) return 0.5 * (3 * mValues [fAdc] - mValues [fAdc - 1]); // extrapolate
    else       return 0.5 * (mValues [fAdc] + mValues [fAdc + 1]); // interpolate
  }
  return 0.;
}
void HcalQIEShape::expand ( ) [private]

Definition at line 18 of file HcalQIEShape.cc.

References i, getHLTprescales::index, mValues, nbins_, range(), and pileupReCalc_HLTpaths::scale.

Referenced by setLowEdges().

                           {
  int scale = 1;
  for (unsigned range = 1; range < 4; range++) {
    int factor = nbins_ == 32 ? 5 : 8;  // QIE8/QIE10 -> 5/8
    scale *= factor;
    unsigned index = range * nbins_;
    mValues [index] = mValues [index - 2]; // link to previous range
    for (unsigned i = 1; i < nbins_; i++) {
      mValues [index + i] =  mValues [index + i - 1] + scale * (mValues [i] - mValues [i - 1]);
    }
  }
  mValues [nbins_*4] = 2 * mValues [nbins_*4-1] - mValues [nbins_*4-2]; // extrapolate
}
float HcalQIEShape::highEdge ( unsigned  fAdc) const

Definition at line 45 of file HcalQIEShape.cc.

References mValues, and nbins_.

Referenced by HcalQIECoder::adc().

                                                 {
  if (fAdc < 4*nbins_) return mValues [fAdc+1];
  return 0.;
}
unsigned HcalQIEShape::local ( unsigned  fAdc) const [inline]

Definition at line 26 of file HcalQIEShape.h.

References nbins_, and tmp.

                                       {
    unsigned tmp = nbins_ == 32 ? (fAdc & 0x1f) : (fAdc & 0x3f) ;
    return   tmp;
  }
float HcalQIEShape::lowEdge ( unsigned  fAdc) const

Definition at line 32 of file HcalQIEShape.cc.

References mValues, and nbins_.

                                                {
  if (fAdc < 4*nbins_) return mValues [fAdc];
  return 0.;
}
unsigned HcalQIEShape::range ( unsigned  fAdc) const [inline]

Definition at line 25 of file HcalQIEShape.h.

Referenced by HcalQIECoder::charge(), and expand().

{return (fAdc >> 5) & 0x3;}
bool HcalQIEShape::setLowEdge ( float  fValue,
unsigned  fAdc 
) [private]

Definition at line 50 of file HcalQIEShape.cc.

References mValues, and nbins_.

Referenced by setLowEdges().

                                                          {
  if (fAdc >= nbins_) return false; 
  mValues [fAdc] = fValue;
  return true;
}
bool HcalQIEShape::setLowEdges ( unsigned int  nVals,
const float *  fValue 
)

Definition at line 56 of file HcalQIEShape.cc.

References ecalMGPA::adc(), expand(), mValues, pileupCalc::nbins, nbins_, query::result, and setLowEdge().

Referenced by HcalQIEData::setupShape().

                                                                       {
  nbins_=nbins;
  mValues.clear();
  mValues.resize(4*nbins_+1);
  bool result = true;
  for (unsigned int adc = 0; adc < nbins_; adc++) result = result && setLowEdge (fValue [adc], adc);
  expand ();
  return result;
}

Member Data Documentation

std::vector<float> HcalQIEShape::mValues [private]

Definition at line 35 of file HcalQIEShape.h.

Referenced by center(), expand(), highEdge(), lowEdge(), setLowEdge(), and setLowEdges().

unsigned int HcalQIEShape::nbins_ [private]

Definition at line 36 of file HcalQIEShape.h.

Referenced by center(), expand(), highEdge(), local(), lowEdge(), setLowEdge(), and setLowEdges().