Example module which produces a raw average pulse for each channel, implementation file.
{
fOutput = GetString("Output","avg/averagepulses.root");
}
{
if(fAveragePulses.find(chan) == fAveragePulses.end()) {
fAveragePulses[chan].fNumberOfEvents = 0;
fAveragePulses[chan].fSamples.Resize(samples.Size());
fAveragePulses[chan].fSamples.Initialize(0.);
}
fAveragePulses[chan].fSamples += samples;
fAveragePulses[chan].fNumberOfEvents++;
}
{
std::map<int,ChannelInfo>::const_iterator iter = fAveragePulses.begin();
while(iter != fAveragePulses.end()) {
const int chan = iter->first;
int nev = iter->second.fNumberOfEvents;
apHandle.SetChannel(chan);
GlobalData().Set(&apHandle,fOutput);
iter++;
}
}
#define REGISTER_MODULE(clazz)
template class to handle diana global QObject with QGlobalDataManager
void Do(Diana::QEvent &ev)
Do method. Declare and implement only one of the two versions.
void Init(Diana::QEvent &ev)
Init method.
void Get(const char *owner, ReadHandle< Q > &handle) const
Get a QObject Handle in read mode.
Raw event: bolometer channel, trigger positions and types.
const int & GetChannelId() const
Get ChannelId.
Raw event: sampled waveform.
const Diana::QVector & GetSamples() const
Get Samples casted to double (QVector instead of QVectorI). Use this method in place of GetSamplesADC...
Interface for vectors in Diana analysis.
the Diana namespace is needed because sometimes we use Qt libraries, that use same class names of our...