Class to store integrated charge per channel.
More...
#include <TOPCalIntegratedCharge.h>
|
| TOPCalIntegratedCharge () |
| Default constructor.
|
|
void | setCharge (int moduleID, unsigned channel, double charge) |
| Sets the integrated charge for a single channel and switches status to calibrated.
|
|
void | setUnusable (int moduleID, unsigned channel) |
| Switches calibration status to unusable to flag badly calibrated constant.
|
|
double | getCharge (int moduleID, unsigned channel) const |
| Returns the integrated charge of a single channel.
|
|
bool | isCalibrated (int moduleID, unsigned channel) const |
| Returns calibration status.
|
|
bool | isDefault (int moduleID, unsigned channel) const |
| Returns calibration status.
|
|
bool | isUnusable (int moduleID, unsigned channel) const |
| Returns calibration status.
|
|
Class to store integrated charge per channel.
Definition at line 23 of file TOPCalIntegratedCharge.h.
◆ anonymous enum
Sizes.
Enumerator |
---|
c_numModules | number of modules
|
c_numChannels | number of channels per module
|
Definition at line 147 of file TOPCalIntegratedCharge.h.
147 {
148 c_numModules = 16,
149 c_numChannels = 512
150 };
◆ EStatus
Calibration status of a constant.
Enumerator |
---|
c_Default | uncalibrated default value
|
c_Calibrated | good calibrated value
|
c_Unusable | bad calibrated value
|
Definition at line 29 of file TOPCalIntegratedCharge.h.
29 {
30 c_Default = 0,
31 c_Calibrated = 1,
32 c_Unusable = 2
33 };
◆ TOPCalIntegratedCharge()
◆ getCharge()
double getCharge |
( |
int | moduleID, |
|
|
unsigned | channel ) const |
|
inline |
Returns the integrated charge of a single channel.
- Parameters
-
moduleID | module ID (1-based) |
channel | hardware channel number (0-based) |
- Returns
- integrated charge [C/cm^2]
Definition at line 86 of file TOPCalIntegratedCharge.h.
87 {
88 unsigned module = moduleID - 1;
89 if (module >= c_numModules) {
90 B2WARNING("Invalid module number, returning 0 (" << ClassName() << ")");
91 return 0;
92 }
93 if (channel >= c_numChannels) {
94 B2WARNING("Invalid channel number, returning 0 (" << ClassName() << ")");
95 return 0;
96 }
97 return m_charge[module][channel];
98 }
◆ isCalibrated()
bool isCalibrated |
( |
int | moduleID, |
|
|
unsigned | channel ) const |
|
inline |
Returns calibration status.
- Parameters
-
moduleID | module ID (1-based) |
channel | hardware channel number (0-based) |
- Returns
- true, if good calibrated
Definition at line 106 of file TOPCalIntegratedCharge.h.
107 {
108 unsigned module = moduleID - 1;
109 if (module >= c_numModules) return false;
110 if (channel >= c_numChannels) return false;
111 return m_status[module][channel] == c_Calibrated;
112 }
◆ isDefault()
bool isDefault |
( |
int | moduleID, |
|
|
unsigned | channel ) const |
|
inline |
Returns calibration status.
- Parameters
-
moduleID | module ID (1-based) |
channel | hardware channel number (0-based) |
- Returns
- true, if default (not calibrated)
Definition at line 120 of file TOPCalIntegratedCharge.h.
121 {
122 unsigned module = moduleID - 1;
123 if (module >= c_numModules) return false;
124 if (channel >= c_numChannels) return false;
125 return m_status[module][channel] == c_Default;
126 }
◆ isUnusable()
bool isUnusable |
( |
int | moduleID, |
|
|
unsigned | channel ) const |
|
inline |
Returns calibration status.
- Parameters
-
moduleID | module ID (1-based) |
channel | hardware channel number (0-based) |
- Returns
- true, if bad calibrated
Definition at line 134 of file TOPCalIntegratedCharge.h.
135 {
136 unsigned module = moduleID - 1;
137 if (module >= c_numModules) return false;
138 if (channel >= c_numChannels) return false;
139 return m_status[module][channel] == c_Unusable;
140 }
◆ setCharge()
void setCharge |
( |
int | moduleID, |
|
|
unsigned | channel, |
|
|
double | charge ) |
|
inline |
Sets the integrated charge for a single channel and switches status to calibrated.
- Parameters
-
moduleID | module ID (1-based) |
channel | hardware channel number (0-based) |
charge | integrated charge in Coulombs per cm^2 |
Definition at line 46 of file TOPCalIntegratedCharge.h.
47 {
48 unsigned module = moduleID - 1;
49 if (module >= c_numModules) {
50 B2ERROR("Invalid module number, constant not set (" << ClassName() << ")");
51 return;
52 }
53 if (channel >= c_numChannels) {
54 B2ERROR("Invalid channel number, constant not set (" << ClassName() << ")");
55 return;
56 }
57 m_charge[module][channel] =
charge;
58 m_status[module][channel] = c_Calibrated;
59 }
double charge(int pdgCode)
Returns electric charge of a particle with given pdg code.
◆ setUnusable()
void setUnusable |
( |
int | moduleID, |
|
|
unsigned | channel ) |
|
inline |
Switches calibration status to unusable to flag badly calibrated constant.
- Parameters
-
moduleID | module ID (1-based) |
channel | hardware channel number (0-based) |
Definition at line 66 of file TOPCalIntegratedCharge.h.
67 {
68 unsigned module = moduleID - 1;
69 if (module >= c_numModules) {
70 B2ERROR("Invalid module number, status not set (" << ClassName() << ")");
71 return;
72 }
73 if (channel >= c_numChannels) {
74 B2ERROR("Invalid channel number, status not set (" << ClassName() << ")");
75 return;
76 }
77 m_status[module][channel] = c_Unusable;
78 }
◆ m_charge
◆ m_status
The documentation for this class was generated from the following file: