CMS 3D CMS Logo

CastorQIEShape Class Reference

#include <CondFormats/CastorObjects/interface/CastorQIEShape.h>

List of all members.

Public Member Functions

 CastorQIEShape ()
float center (unsigned fAdc) const
float highEdge (unsigned fAdc) const
unsigned local (unsigned fAdc) const
float lowEdge (unsigned fAdc) const
unsigned range (unsigned fAdc) const
bool setLowEdges (const float fValue[32])
 ~CastorQIEShape ()

Private Member Functions

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

Private Attributes

float mValues [129]


Detailed Description

Definition at line 14 of file CastorQIEShape.h.


Constructor & Destructor Documentation

CastorQIEShape::CastorQIEShape (  ) 

Definition at line 15 of file CastorQIEShape.cc.

References binMin, expand(), i, and mValues.

00016 {
00017   for (int i = 0; i < 32; i++) mValues [i] = binMin [i];
00018   expand ();
00019 }

CastorQIEShape::~CastorQIEShape (  ) 

Definition at line 21 of file CastorQIEShape.cc.

00021 {}


Member Function Documentation

float CastorQIEShape::center ( unsigned  fAdc  )  const

Definition at line 41 of file CastorQIEShape.cc.

References mValues.

Referenced by CastorQIECoder::charge().

00041                                                  {
00042   if (fAdc < 128) {
00043     if (fAdc % 32 == 31) return 0.5 * (3 * mValues [fAdc] - mValues [fAdc - 1]); // extrapolate
00044     else       return 0.5 * (mValues [fAdc] + mValues [fAdc + 1]); // interpolate
00045   }
00046   return 0.;
00047 }

void CastorQIEShape::expand (  )  [private]

Definition at line 23 of file CastorQIEShape.cc.

References i, index, mValues, range(), and scale.

Referenced by CastorQIEShape(), and setLowEdges().

00023                              {
00024   int scale = 1;
00025   for (unsigned range = 1; range < 4; range++) {
00026     scale = scale * 5;
00027     unsigned index = range * 32;
00028     mValues [index] = mValues [index - 2]; // link to previous range
00029     for (unsigned i = 1; i < 32; i++) {
00030       mValues [index + i] =  mValues [index + i - 1] + scale * (mValues [i] - mValues [i - 1]);
00031     }
00032   }
00033   mValues [128] = 2 * mValues [127] - mValues [126]; // extrapolate
00034 }

float CastorQIEShape::highEdge ( unsigned  fAdc  )  const

Definition at line 49 of file CastorQIEShape.cc.

References mValues.

Referenced by CastorQIECoder::adc().

00049                                                    {
00050   if (fAdc < 128) return mValues [fAdc+1];
00051   return 0.;
00052 }

unsigned CastorQIEShape::local ( unsigned  fAdc  )  const [inline]

Definition at line 23 of file CastorQIEShape.h.

00023 {return fAdc & 0x1f;}

float CastorQIEShape::lowEdge ( unsigned  fAdc  )  const

Definition at line 36 of file CastorQIEShape.cc.

References mValues.

00036                                                   {
00037   if (fAdc < 128) return mValues [fAdc];
00038   return 0.;
00039 }

unsigned CastorQIEShape::range ( unsigned  fAdc  )  const [inline]

Definition at line 22 of file CastorQIEShape.h.

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

00022 {return (fAdc >> 5) & 0x3;}

bool CastorQIEShape::setLowEdge ( float  fValue,
unsigned  fAdc 
) [private]

Definition at line 54 of file CastorQIEShape.cc.

References mValues.

Referenced by setLowEdges().

00054                                                             {
00055   if (fAdc >= 32) return false; 
00056   mValues [fAdc] = fValue;
00057   return true;
00058 }

bool CastorQIEShape::setLowEdges ( const float  fValue[32]  ) 

Definition at line 60 of file CastorQIEShape.cc.

References ecalMGPA::adc(), expand(), HLT_VtxMuL3::result, and setLowEdge().

00060                                                          {
00061   bool result = true;
00062   for (int adc = 0; adc < 32; adc++) result = result && setLowEdge (fValue [adc], adc);
00063   expand ();
00064   return result;
00065 }


Member Data Documentation

float CastorQIEShape::mValues[129] [private]

Definition at line 28 of file CastorQIEShape.h.

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


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:16:14 2009 for CMSSW by  doxygen 1.5.4