Calibration constants of a singe ASIC channel: pedestals, gains and time axis.
More...
#include <TOPASICChannel.h>
Calibration constants of a singe ASIC channel: pedestals, gains and time axis.
Definition at line 25 of file TOPASICChannel.h.
◆ TOPASICChannel() [1/3]
◆ TOPASICChannel() [2/3]
Constructor with module ID, hardware channel number and number of ASIC windows.
- Parameters
-
moduleID | module ID |
channel | hardware channel number |
numWindows | number 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 }
◆ TOPASICChannel() [3/3]
Copy constructor.
Definition at line 50 of file TOPASICChannel.h.
50 : TObject()
51 {
52 *this = chan;
53 }
◆ ~TOPASICChannel()
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 }
◆ getChannel()
unsigned getChannel |
( |
| ) |
const |
|
inline |
Return hardware channel number.
- Returns
- channel number
Definition at line 145 of file TOPASICChannel.h.
◆ getGains() [1/2]
◆ getGains() [2/2]
Return gains of an ASIC window.
- Parameters
-
- 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 }
◆ getModuleID()
int getModuleID |
( |
| ) |
const |
|
inline |
◆ 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]
Returns a vector of pedestals.
- Returns
- pedestals
Definition at line 171 of file TOPASICChannel.h.
◆ getPedestals() [2/2]
Return pedestals of an ASIC window.
- Parameters
-
- 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=()
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()
Set gains of a single ASIC window.
- Parameters
-
- 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()
Set pedestals of a single ASIC window.
- Parameters
-
pedestals | ASIC 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 }
◆ m_channel
◆ m_defaultGain
◆ m_gains
◆ m_moduleID
◆ m_pedestals
The documentation for this class was generated from the following file: