Belle II Software development
TOPCalIntegratedCharge Class Reference

Class to store integrated charge per channel. More...

#include <TOPCalIntegratedCharge.h>

Inheritance diagram for TOPCalIntegratedCharge:

Public Types

enum  EStatus {
  c_Default = 0 ,
  c_Calibrated = 1 ,
  c_Unusable = 2
}
 Calibration status of a constant. More...
 

Public Member Functions

 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.
 

Private Types

enum  {
  c_numModules = 16 ,
  c_numChannels = 512
}
 Sizes. More...
 

Private Member Functions

 ClassDef (TOPCalIntegratedCharge, 1)
 ClassDef.
 

Private Attributes

float m_charge [c_numModules][c_numChannels] = {{0}}
 integrated charge [C/cm^2]
 
EStatus m_status [c_numModules][c_numChannels] = {{c_Default}}
 calibration status
 

Detailed Description

Class to store integrated charge per channel.

Definition at line 23 of file TOPCalIntegratedCharge.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private

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 };
@ c_numChannels
number of channels per module

◆ EStatus

enum 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 };
@ c_Default
uncalibrated default value

Constructor & Destructor Documentation

◆ TOPCalIntegratedCharge()

Default constructor.

Definition at line 38 of file TOPCalIntegratedCharge.h.

38{}

Member Function Documentation

◆ getCharge()

double getCharge ( int  moduleID,
unsigned  channel 
) const
inline

Returns the integrated charge of a single channel.

Parameters
moduleIDmodule ID (1-based)
channelhardware 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 }
float m_charge[c_numModules][c_numChannels]
integrated charge [C/cm^2]

◆ isCalibrated()

bool isCalibrated ( int  moduleID,
unsigned  channel 
) const
inline

Returns calibration status.

Parameters
moduleIDmodule ID (1-based)
channelhardware 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 }
EStatus m_status[c_numModules][c_numChannels]
calibration status

◆ isDefault()

bool isDefault ( int  moduleID,
unsigned  channel 
) const
inline

Returns calibration status.

Parameters
moduleIDmodule ID (1-based)
channelhardware 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
moduleIDmodule ID (1-based)
channelhardware 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
moduleIDmodule ID (1-based)
channelhardware channel number (0-based)
chargeintegrated 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.
Definition: EvtPDLUtil.cc:44

◆ setUnusable()

void setUnusable ( int  moduleID,
unsigned  channel 
)
inline

Switches calibration status to unusable to flag badly calibrated constant.

Parameters
moduleIDmodule ID (1-based)
channelhardware 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 }

Member Data Documentation

◆ m_charge

float m_charge[c_numModules][c_numChannels] = {{0}}
private

integrated charge [C/cm^2]

Definition at line 152 of file TOPCalIntegratedCharge.h.

◆ m_status

EStatus m_status[c_numModules][c_numChannels] = {{c_Default}}
private

calibration status

Definition at line 153 of file TOPCalIntegratedCharge.h.


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