12#include <framework/logging/Logger.h>
13#include <top/dbobjects/TOPPulseHeightPar.h>
52 void setParameters(
int moduleID,
unsigned channel,
double x0,
double p1,
double p2)
54 unsigned module = moduleID - 1;
56 B2ERROR(
"Invalid module number, constant not set (" << ClassName() <<
")");
60 B2ERROR(
"Invalid channel number, constant not set (" << ClassName() <<
")");
64 B2ERROR(
"Invalid parameter value x0, constant not set (" << ClassName() <<
")."
66 <<
LogVar(
"slot", moduleID)
67 <<
LogVar(
"channel", channel));
71 B2ERROR(
"Invalid parameter value p1, constant not set (" << ClassName() <<
")."
73 <<
LogVar(
"slot", moduleID)
74 <<
LogVar(
"channel", channel));
78 B2ERROR(
"Invalid parameter value p2, constant not set (" << ClassName() <<
")."
80 <<
LogVar(
"slot", moduleID)
81 <<
LogVar(
"channel", channel));
97 unsigned module = moduleID - 1;
99 B2ERROR(
"Invalid module number, status not set (" << ClassName() <<
")");
103 B2ERROR(
"Invalid channel number, status not set (" << ClassName() <<
")");
117 unsigned module = moduleID - 1;
119 B2WARNING(
"Invalid slot number, "
120 "returning parameters of slot 1 channel 0 (" << ClassName() <<
")"
121 <<
LogVar(
"slot", moduleID));
125 B2WARNING(
"Invalid channel, "
126 "returning parameters of channel 0 (" << ClassName() <<
")"
127 <<
LogVar(
"channel", channel));
128 return m_par[module][0];
130 return m_par[module][channel];
141 unsigned module = moduleID - 1;
155 unsigned module = moduleID - 1;
169 unsigned module = moduleID - 1;
Pulse height parameterizations for all 512 channels of 16 modules.
bool isCalibrated(int moduleID, unsigned channel) const
Returns calibration status.
const TOPPulseHeightPar & getParameters(int moduleID, unsigned channel) const
Returns pulse height parameters for a given slot and channel.
TOPPulseHeightPar m_par[c_numModules][c_numChannels]
calibration constants
ClassDef(TOPCalChannelPulseHeight, 3)
ClassDef.
TOPCalChannelPulseHeight()
Default constructor.
void setParameters(int moduleID, unsigned channel, double x0, double p1, double p2)
Sets calibration for a single channel and switches status to calibrated.
EStatus m_status[c_numModules][c_numChannels]
calibration status
@ c_numChannels
number of channels per module
@ c_numModules
number of modules
void setUnusable(int moduleID, unsigned channel)
Switches calibration status to unusable to flag badly calibrated constant.
EStatus
Calibration status of a constant.
@ c_Calibrated
good calibrated value
@ c_Unusable
bad calibrated value
@ c_Default
uncalibrated default value
bool isDefault(int moduleID, unsigned channel) const
Returns calibration status.
bool isUnusable(int moduleID, unsigned channel) const
Returns calibration status.
Class to store variables with their name which were sent to the logging service.
Abstract base class for different kinds of events.
Struct holding the pulse height parameterizations for the TOP counter.
float p1
distribution parameter p1
float x0
distribution parameter x0 [ADC counts]
float p2
distribution parameter p2