CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
HcalQIEShape Class Reference

#include <HcalQIEShape.h>

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 (const float fValue[32])
 
 ~HcalQIEShape ()
 

Private Member Functions

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

Private Attributes

float mValues [129]
 

Detailed Description

Definition at line 17 of file HcalQIEShape.h.

Constructor & Destructor Documentation

HcalQIEShape::HcalQIEShape ( )

Definition at line 18 of file HcalQIEShape.cc.

References expand(), i, and mValues.

19 {
20  for (int i = 0; i < 32; i++) mValues [i] = binMin [i];
21  expand ();
22 }
int i
Definition: DBlmapReader.cc:9
float mValues[129]
Definition: HcalQIEShape.h:31
HcalQIEShape::~HcalQIEShape ( )

Definition at line 24 of file HcalQIEShape.cc.

24 {}

Member Function Documentation

float HcalQIEShape::center ( unsigned  fAdc) const

Definition at line 44 of file HcalQIEShape.cc.

References mValues.

Referenced by HcalQIECoder::charge().

44  {
45  if (fAdc < 128) {
46  if (fAdc % 32 == 31) return 0.5 * (3 * mValues [fAdc] - mValues [fAdc - 1]); // extrapolate
47  else return 0.5 * (mValues [fAdc] + mValues [fAdc + 1]); // interpolate
48  }
49  return 0.;
50 }
float mValues[129]
Definition: HcalQIEShape.h:31
void HcalQIEShape::expand ( )
private

Definition at line 26 of file HcalQIEShape.cc.

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

Referenced by HcalQIEShape(), and setLowEdges().

26  {
27  int scale = 1;
28  for (unsigned range = 1; range < 4; range++) {
29  scale = scale * 5;
30  unsigned index = range * 32;
31  mValues [index] = mValues [index - 2]; // link to previous range
32  for (unsigned i = 1; i < 32; i++) {
33  mValues [index + i] = mValues [index + i - 1] + scale * (mValues [i] - mValues [i - 1]);
34  }
35  }
36  mValues [128] = 2 * mValues [127] - mValues [126]; // extrapolate
37 }
int i
Definition: DBlmapReader.cc:9
float mValues[129]
Definition: HcalQIEShape.h:31
unsigned range(unsigned fAdc) const
Definition: HcalQIEShape.h:25
float HcalQIEShape::highEdge ( unsigned  fAdc) const

Definition at line 52 of file HcalQIEShape.cc.

References mValues.

Referenced by HcalQIECoder::adc().

52  {
53  if (fAdc < 128) return mValues [fAdc+1];
54  return 0.;
55 }
float mValues[129]
Definition: HcalQIEShape.h:31
unsigned HcalQIEShape::local ( unsigned  fAdc) const
inline

Definition at line 26 of file HcalQIEShape.h.

26 {return fAdc & 0x1f;}
float HcalQIEShape::lowEdge ( unsigned  fAdc) const

Definition at line 39 of file HcalQIEShape.cc.

References mValues.

39  {
40  if (fAdc < 128) return mValues [fAdc];
41  return 0.;
42 }
float mValues[129]
Definition: HcalQIEShape.h:31
unsigned HcalQIEShape::range ( unsigned  fAdc) const
inline

Definition at line 25 of file HcalQIEShape.h.

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

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

Definition at line 57 of file HcalQIEShape.cc.

References mValues.

Referenced by setLowEdges().

57  {
58  if (fAdc >= 32) return false;
59  mValues [fAdc] = fValue;
60  return true;
61 }
float mValues[129]
Definition: HcalQIEShape.h:31
bool HcalQIEShape::setLowEdges ( const float  fValue[32])

Definition at line 63 of file HcalQIEShape.cc.

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

63  {
64  bool result = true;
65  for (int adc = 0; adc < 32; adc++) result = result && setLowEdge (fValue [adc], adc);
66  expand ();
67  return result;
68 }
int adc(sample_type sample)
get the ADC sample (12 bits)
bool setLowEdge(float fValue, unsigned fAdc)
Definition: HcalQIEShape.cc:57
tuple result
Definition: query.py:137

Member Data Documentation

float HcalQIEShape::mValues[129]
private

Definition at line 31 of file HcalQIEShape.h.

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