Example filter which selects events with amplitude in given range, implementation file.
- Author
- Marco Vignati
See header in MTutorialAmplitudeFilter.hh.
{
fAmplitudeMinimum = GetDouble("AmplitudeMinimum",0);
fAmplitudeMaximum = GetDouble("AmplitudeMaximum",10000);
fAmplitudeLabel = GetString("AmplitudeLabel","PulseBasicParameters@MaxBaseline");
}
{
if(
amp > fAmplitudeMinimum &&
amp < fAmplitudeMaximum) {
return true;
}
return false;
}
#define REGISTER_MODULE(clazz)
bool Filter(const Diana::QEvent &ev)
return true if ev passes the cuts
void GetCuts(const Diana::QEvent &ev)
Get cuts from config file.
base types wrapped into a QObject. Currently implemented types are QInt QDouble and QFloat....
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
the Diana namespace is needed because sometimes we use Qt libraries, that use same class names of our...