CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
CastorQIEShape Class Reference

#include <CastorQIEShape.h>

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::CastorQIEShape ( )

Definition at line 13 of file CastorQIEShape.cc.

13  {
14  for (int i = 0; i < 32; i++)
15  mValues[i] = binMin[i];
16  expand();
17 }

References expand(), mps_fire::i, and mValues.

◆ ~CastorQIEShape()

CastorQIEShape::~CastorQIEShape ( )

Definition at line 19 of file CastorQIEShape.cc.

19 {}

Member Function Documentation

◆ center()

float CastorQIEShape::center ( unsigned  fAdc) const

Definition at line 40 of file CastorQIEShape.cc.

40  {
41  if (fAdc < 128) {
42  if (fAdc % 32 == 31)
43  return 0.5 * (3 * mValues[fAdc] - mValues[fAdc - 1]); // extrapolate
44  else
45  return 0.5 * (mValues[fAdc] + mValues[fAdc + 1]); // interpolate
46  }
47  return 0.;
48 }

References mValues.

Referenced by CastorQIECoder::charge().

◆ expand()

void CastorQIEShape::expand ( )
private

Definition at line 21 of file CastorQIEShape.cc.

21  {
22  int scale = 1;
23  for (unsigned range = 1; range < 4; range++) {
24  scale = scale * 5;
25  unsigned index = range * 32;
26  mValues[index] = mValues[index - 2]; // link to previous range
27  for (unsigned i = 1; i < 32; i++) {
28  mValues[index + i] = mValues[index + i - 1] + scale * (mValues[i] - mValues[i - 1]);
29  }
30  }
31  mValues[128] = 2 * mValues[127] - mValues[126]; // extrapolate
32 }

References mps_fire::i, mValues, range(), and HLT_FULL_cff::scale.

Referenced by CastorQIEShape(), and setLowEdges().

◆ highEdge()

float CastorQIEShape::highEdge ( unsigned  fAdc) const

Definition at line 50 of file CastorQIEShape.cc.

50  {
51  if (fAdc >= 128)
52  return 0;
53  if (fAdc == 127)
54  return mValues[fAdc + 1];
55  if (fAdc % 32 == 31)
56  return mValues[fAdc + 3];
57  return mValues[fAdc + 1];
58 }

References mValues.

Referenced by CastorQIECoder::adc().

◆ local()

unsigned CastorQIEShape::local ( unsigned  fAdc) const
inline

Definition at line 23 of file CastorQIEShape.h.

23 { return fAdc & 0x1f; }

◆ lowEdge()

float CastorQIEShape::lowEdge ( unsigned  fAdc) const

Definition at line 34 of file CastorQIEShape.cc.

34  {
35  if (fAdc < 128)
36  return mValues[fAdc];
37  return 0.;
38 }

References mValues.

Referenced by CastorDbASCIIIO::dumpObject().

◆ range()

unsigned CastorQIEShape::range ( unsigned  fAdc) const
inline

Definition at line 22 of file CastorQIEShape.h.

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

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

◆ setLowEdge()

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

Definition at line 60 of file CastorQIEShape.cc.

60  {
61  if (fAdc >= 32)
62  return false;
63  mValues[fAdc] = fValue;
64  return true;
65 }

References mValues.

Referenced by setLowEdges().

◆ setLowEdges()

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

Definition at line 67 of file CastorQIEShape.cc.

67  {
68  bool result = true;
69  for (int adc = 0; adc < 32; adc++)
70  result = result && setLowEdge(fValue[adc], adc);
71  expand();
72  return result;
73 }

References ecalLiteDTU::adc(), expand(), mps_fire::result, and setLowEdge().

Member Data Documentation

◆ mValues

float CastorQIEShape::mValues[129]
private

Definition at line 29 of file CastorQIEShape.h.

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

mps_fire.i
i
Definition: mps_fire.py:428
HLT_FULL_cff.scale
scale
Definition: HLT_FULL_cff.py:6634
ecalLiteDTU::adc
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
Definition: EcalLiteDTUSample.h:12
CastorQIEShape::expand
void expand()
Definition: CastorQIEShape.cc:21
CastorQIEShape::mValues
float mValues[129]
Definition: CastorQIEShape.h:29
CastorQIEShape::range
unsigned range(unsigned fAdc) const
Definition: CastorQIEShape.h:22
CastorQIEShape::setLowEdge
bool setLowEdge(float fValue, unsigned fAdc)
Definition: CastorQIEShape.cc:60
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
mps_fire.result
result
Definition: mps_fire.py:311