14 using namespace Diana;
18 fPulseLabel = GetString(
"PulseLabel",
"DAQ@Pulse",
false);
19 fBaselineOwner = GetString(
"BaselineOwner",
"BaselineModule",
false);
27 fNormalizeAmplitude = GetBool(
"NormalizeAmplitude",
false,
false);
28 if(fNormalizeAmplitude) {
34 fTomV = GetBool(
"ConvertTomV",
true,
false);
43 GlobalData().Get(
"",&
rHandle,
"");
51 const QVector& samples = ev.
GetByLabel<
QPulse>(fPulseLabel).GetSamples()*ADC2mV;
52 const double baseline = ev.
Get<
QBaselineData>(fBaselineOwner.c_str(),
"BaselineData").GetBaseline();
53 const size_t N = samples.Size();
54 double integral = samples.Sum(
N,0)-baseline*
N;
55 integral /= samplingFreq;
58 if(fNormalizeAmplitude) {
QRunDataHandle rHandle(753)
QChannelRunData chanRunData
#define REGISTER_MODULE(clazz)
Compute the pulse integral.
void Init(Diana::QEvent &ev)
Init method.
void Do(Diana::QEvent &ev)
Do method. Declare and implement only one of the two versions.
base types wrapped into a QObject. Currently implemented types are QInt QDouble and QFloat....
basic channel and run based info. Used in the QRunData object.
double fSamplingFrequency
sampling frequency in Hz
double fADC2mV
conversion: mV = ADC * fADC2mV
const Q & GetByLabel(const QEventLabel &label) const
Get a QObject in read mode by label.
void RequireByLabel(const QEventLabel &label) const
notify the QEvent that we need a QObject, if not found an exception is thrown
void Require(const std::string &owner, const std::string &name) const
notify the QEvent that we need a QObject, if not found an exception is thrown
void Get(const char *owner, ReadHandle< Q > &handle) const
Get a QObject Handle in read mode.
void Add(WriteHandle< Q > &handle)
Add a QObject to the event.
Raw event: bolometer channel, trigger positions and types.
Raw event: sampled waveform.
global handle for QRunData
const QChannelRunData & GetChannelRunData(const int channel) const
get channel based run data quantities
the Diana namespace is needed because sometimes we use Qt libraries, that use same class names of our...