Belle II Software development
TOPASICGains Class Reference

Calibration constants of a single ASIC window: gains. More...

#include <TOPASICGains.h>

Inheritance diagram for TOPASICGains:

Public Types

enum  {
  c_WindowSize = 64 ,
  c_Unit = 0x1000
}
 Various constants. More...
 

Public Member Functions

 TOPASICGains ()
 Default constructor.
 
 TOPASICGains (unsigned short asicWindow)
 Constructor with ASIC window.
 
bool setGains (const std::vector< float > &gains, float error=0)
 Set gains.
 
unsigned getASICWindow () const
 Return ASIC window number.
 
unsigned getSize () const
 Return window size (number of pedestal samples)
 
float getValue (unsigned i) const
 Return relative gain for i-th sample.
 
float getError () const
 Return gain uncertainly.
 

Private Member Functions

 ClassDef (TOPASICGains, 1)
 ClassDef.
 

Private Attributes

unsigned short m_asicWindow
 ASIC window number.
 
unsigned short m_unit
 unit of fixed point number
 
unsigned short m_gainError
 gain error (fixed point format)
 
unsigned short m_gains [c_WindowSize]
 gains (in fixed point format)
 

Detailed Description

Calibration constants of a single ASIC window: gains.

Definition at line 22 of file TOPASICGains.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Various constants.

Enumerator
c_WindowSize 

number of samples

c_Unit 

unit of fixed point number

Definition at line 28 of file TOPASICGains.h.

28 {c_WindowSize = 64,
29 c_Unit = 0x1000
30 };
@ c_Unit
unit of fixed point number
Definition: TOPASICGains.h:29
@ c_WindowSize
number of samples
Definition: TOPASICGains.h:28

Constructor & Destructor Documentation

◆ TOPASICGains() [1/2]

TOPASICGains ( )
inline

Default constructor.

Definition at line 35 of file TOPASICGains.h.

36 {
37 for (unsigned i = 0; i < c_WindowSize; i++) m_gains[i] = c_Unit;
38 }
unsigned short m_gains[c_WindowSize]
gains (in fixed point format)
Definition: TOPASICGains.h:98
unsigned short m_asicWindow
ASIC window number.
Definition: TOPASICGains.h:95
unsigned short m_gainError
gain error (fixed point format)
Definition: TOPASICGains.h:97
unsigned short m_unit
unit of fixed point number
Definition: TOPASICGains.h:96

◆ TOPASICGains() [2/2]

TOPASICGains ( unsigned short  asicWindow)
inlineexplicit

Constructor with ASIC window.

Parameters
asicWindowASIC window number

Definition at line 44 of file TOPASICGains.h.

44 :
45 m_asicWindow(asicWindow), m_unit(c_Unit), m_gainError(0)
46 {
47 for (unsigned i = 0; i < c_WindowSize; i++) m_gains[i] = c_Unit;
48 }

Member Function Documentation

◆ getASICWindow()

unsigned getASICWindow ( ) const
inline

Return ASIC window number.

Returns
window number

Definition at line 62 of file TOPASICGains.h.

62{return m_asicWindow;}

◆ getError()

float getError ( ) const
inline

Return gain uncertainly.

Returns
gain uncertainty

Definition at line 87 of file TOPASICGains.h.

88 {
89 return float(m_gainError) / float(m_unit);
90 }

◆ getSize()

unsigned getSize ( ) const
inline

Return window size (number of pedestal samples)

Returns
window size

Definition at line 68 of file TOPASICGains.h.

68{return c_WindowSize;}

◆ getValue()

float getValue ( unsigned  i) const
inline

Return relative gain for i-th sample.

Parameters
isample number
Returns
relative gain

Definition at line 75 of file TOPASICGains.h.

76 {
77 if (i < c_WindowSize) {
78 return float(m_gains[i]) / float(m_unit);
79 }
80 return 0;
81 }

Member Data Documentation

◆ m_asicWindow

unsigned short m_asicWindow
private

ASIC window number.

Definition at line 95 of file TOPASICGains.h.

◆ m_gainError

unsigned short m_gainError
private

gain error (fixed point format)

Definition at line 97 of file TOPASICGains.h.

◆ m_gains

unsigned short m_gains[c_WindowSize]
private

gains (in fixed point format)

Definition at line 98 of file TOPASICGains.h.

◆ m_unit

unsigned short m_unit
private

unit of fixed point number

Definition at line 96 of file TOPASICGains.h.


The documentation for this class was generated from the following files: