Belle II Software development
TOPASICChannel Class Reference

Calibration constants of a singe ASIC channel: pedestals, gains and time axis. More...

#include <TOPASICChannel.h>

Inheritance diagram for TOPASICChannel:

Public Member Functions

 TOPASICChannel ()
 Default constructor.
 
 TOPASICChannel (int moduleID, unsigned channel, int numWindows)
 Constructor with module ID, hardware channel number and number of ASIC windows.
 
 TOPASICChannel (const TOPASICChannel &chan)
 Copy constructor.
 
TOPASICChanneloperator= (const TOPASICChannel &chan)
 Assignment operator.
 
 ~TOPASICChannel ()
 Destructor.
 
bool setPedestals (const TOPASICPedestals &pedestals)
 Set pedestals of a single ASIC window.
 
bool setGains (const TOPASICGains &gains)
 Set gains of a single ASIC window.
 
int getModuleID () const
 Return module ID.
 
unsigned getChannel () const
 Return hardware channel number.
 
unsigned getNumofWindows () const
 Return number of ASIC windows.
 
const TOPASICPedestalsgetPedestals (unsigned window) const
 Return pedestals of an ASIC window.
 
const std::vector< TOPASICPedestals * > & getPedestals () const
 Returns a vector of pedestals.
 
const TOPASICGainsgetGains (unsigned window) const
 Return gains of an ASIC window.
 
const std::vector< TOPASICGains * > & getGains () const
 Returns a vector of gains.
 
unsigned getNumofGoodWindows () const
 Return number of good ASIC windows (e.g.
 

Private Member Functions

 ClassDef (TOPASICChannel, 4)
 ClassDef.
 

Private Attributes

int m_moduleID = 0
 module ID
 
unsigned m_channel = 0
 hardware channel number
 
std::vector< TOPASICPedestals * > m_pedestals
 pedestals
 
std::vector< TOPASICGains * > m_gains
 gains
 
TOPASICGains m_defaultGain
 default gain
 

Detailed Description

Calibration constants of a singe ASIC channel: pedestals, gains and time axis.

Definition at line 25 of file TOPASICChannel.h.

Constructor & Destructor Documentation

◆ TOPASICChannel() [1/3]

TOPASICChannel ( )
inline

Default constructor.

Definition at line 31 of file TOPASICChannel.h.

32 {
33 }

◆ TOPASICChannel() [2/3]

TOPASICChannel ( int  moduleID,
unsigned  channel,
int  numWindows 
)
inline

Constructor with module ID, hardware channel number and number of ASIC windows.

Parameters
moduleIDmodule ID
channelhardware channel number
numWindowsnumber of active windows per ASIC

Definition at line 41 of file TOPASICChannel.h.

41 :
42 m_moduleID(moduleID), m_channel(channel)
43 {
44 for (int i = 0; i < numWindows; i++) m_pedestals.push_back(NULL);
45 }
unsigned m_channel
hardware channel number
std::vector< TOPASICPedestals * > m_pedestals
pedestals

◆ TOPASICChannel() [3/3]

TOPASICChannel ( const TOPASICChannel chan)
inline

Copy constructor.

Definition at line 50 of file TOPASICChannel.h.

50 : TObject()
51 {
52 *this = chan;
53 }

◆ ~TOPASICChannel()

~TOPASICChannel ( )
inline

Destructor.

Definition at line 84 of file TOPASICChannel.h.

85 {
86 for (auto& window : m_pedestals) {
87 if (window) delete window;
88 }
89 for (auto& window : m_gains) {
90 if (window) delete window;
91 }
92 }
std::vector< TOPASICGains * > m_gains
gains

Member Function Documentation

◆ getChannel()

unsigned getChannel ( ) const
inline

Return hardware channel number.

Returns
channel number

Definition at line 145 of file TOPASICChannel.h.

145{return m_channel;}

◆ getGains() [1/2]

const std::vector< TOPASICGains * > & getGains ( ) const
inline

Returns a vector of gains.

Returns
gains

Definition at line 189 of file TOPASICChannel.h.

189{return m_gains;}

◆ getGains() [2/2]

const TOPASICGains * getGains ( unsigned  window) const
inline

Return gains of an ASIC window.

Parameters
windowASIC window number
Returns
pointer to gains or NULL

Definition at line 178 of file TOPASICChannel.h.

179 {
180 if (window < m_gains.size()) return m_gains[window];
181 if (window < m_pedestals.size()) return &m_defaultGain;
182 return NULL;
183 }
TOPASICGains m_defaultGain
default gain

◆ getModuleID()

int getModuleID ( ) const
inline

Return module ID.

Returns
module ID

Definition at line 139 of file TOPASICChannel.h.

139{return m_moduleID;}

◆ getNumofGoodWindows()

unsigned getNumofGoodWindows ( ) const
inline

Return number of good ASIC windows (e.g.

those with defined pedestals)

Returns
number of good windows

Definition at line 195 of file TOPASICChannel.h.

196 {
197 unsigned n = 0;
198 for (auto& pedestal : m_pedestals) if (pedestal) n++;
199 return n;
200 }

◆ getNumofWindows()

unsigned getNumofWindows ( ) const
inline

Return number of ASIC windows.

Returns
number of windows

Definition at line 151 of file TOPASICChannel.h.

152 {
153 return m_pedestals.size();
154 }

◆ getPedestals() [1/2]

const std::vector< TOPASICPedestals * > & getPedestals ( ) const
inline

Returns a vector of pedestals.

Returns
pedestals

Definition at line 171 of file TOPASICChannel.h.

171{return m_pedestals;}

◆ getPedestals() [2/2]

const TOPASICPedestals * getPedestals ( unsigned  window) const
inline

Return pedestals of an ASIC window.

Parameters
windowASIC window number
Returns
pointer to pedestals or NULL

Definition at line 161 of file TOPASICChannel.h.

162 {
163 if (window < m_pedestals.size()) return m_pedestals[window];
164 return NULL;
165 }

◆ operator=()

TOPASICChannel & operator= ( const TOPASICChannel chan)
inline

Assignment operator.

Definition at line 58 of file TOPASICChannel.h.

59 {
60 if (this != &chan) {
61 m_moduleID = chan.getModuleID();
62 m_channel = chan.getChannel();
63 for (auto& pedestals : m_pedestals) {
64 if (pedestals) delete pedestals;
65 }
66 m_pedestals = chan.getPedestals();
67 for (auto& pedestals : m_pedestals) {
68 if (pedestals) pedestals = new TOPASICPedestals(*pedestals);
69 }
70 for (auto& gains : m_gains) {
71 if (gains) delete gains;
72 }
73 m_gains = chan.getGains();
74 for (auto& gains : m_gains) {
75 if (gains) gains = new TOPASICGains(*gains);
76 }
77 }
78 return *this;
79 }

◆ setGains()

bool setGains ( const TOPASICGains gains)
inline

Set gains of a single ASIC window.

Parameters
gainsASIC window gains
Returns
true on success

Definition at line 118 of file TOPASICChannel.h.

119 {
120 if (m_gains.empty()) {
121 for (unsigned i = 0; i < m_pedestals.size(); i++) m_gains.push_back(NULL);
122 }
123 unsigned i = gains.getASICWindow();
124 if (i < m_gains.size()) {
125 if (m_gains[i]) {
126 *m_gains[i] = gains;
127 } else {
128 m_gains[i] = new TOPASICGains(gains);
129 }
130 return true;
131 }
132 return false;
133 }

◆ setPedestals()

bool setPedestals ( const TOPASICPedestals pedestals)
inline

Set pedestals of a single ASIC window.

Parameters
pedestalsASIC window pedestals
Returns
true on success

Definition at line 99 of file TOPASICChannel.h.

100 {
101 unsigned i = pedestals.getASICWindow();
102 if (i < m_pedestals.size()) {
103 if (m_pedestals[i]) {
104 *m_pedestals[i] = pedestals;
105 } else {
106 m_pedestals[i] = new TOPASICPedestals(pedestals);
107 }
108 return true;
109 }
110 return false;
111 }

Member Data Documentation

◆ m_channel

unsigned m_channel = 0
private

hardware channel number

Definition at line 206 of file TOPASICChannel.h.

◆ m_defaultGain

TOPASICGains m_defaultGain
private

default gain

Definition at line 210 of file TOPASICChannel.h.

◆ m_gains

std::vector<TOPASICGains*> m_gains
private

gains

Definition at line 208 of file TOPASICChannel.h.

◆ m_moduleID

int m_moduleID = 0
private

module ID

Definition at line 205 of file TOPASICChannel.h.

◆ m_pedestals

std::vector<TOPASICPedestals*> m_pedestals
private

pedestals

Definition at line 207 of file TOPASICChannel.h.


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