Diana Software
MGoodWaveform.cc
Go to the documentation of this file.
1 #include "MGoodWaveform.hh"
2 #include "QEvent.hh"
3 #include "QCountPulsesData.hh"
4 #include "QBaselineData.hh"
5 #include "QPulseParameters.hh"
6 #include "QPulseInfo.hh"
7 
8 using namespace Diana;
9 
11 
12 
13 void MGoodWaveform::GetCuts(const QEvent& ev)
14 {
15  fnPeaks = GetInt("NumberOfPeaks", -1);
16  fBaselineSlope = GetDouble("MaxBaselineSlope", 0, false);
17  ev.Require<QCountPulsesData>("BCountPulses","CountPulsesData");
18  ev.Require<QBaselineData>("BaselineModule","BaselineData");
19  ev.Require<QPulseParameters>("PulseBasicParameters","Parameters");
20  ev.Require<QPulseInfo>("DAQ","PulseInfo");
21 }
22 
24 {
25  // perform selection: true if the event passes the cuts
26  bool result = true;
27  const QPulseParameters& bParams = ev.Get<QPulseParameters>("PulseBasicParameters","Parameters");
28  if(bParams.fIsSaturatedLow || bParams.fIsSaturatedHigh) return false;
29  if(fBaselineSlope)
30  {
31  double bs = ev.Get<QBaselineData>("BaselineModule","BaselineData").GetBaselineSlope();
32  if(bs > fBaselineSlope || bs < (-1*fBaselineSlope))
33  result = false;
34  }
35 
36 
37  const QPulseInfo& pi = ev.Get<QPulseInfo>("DAQ","PulseInfo");
38  int numberOfPulses = ev.Get<QCountPulsesData>("BCountPulses","CountPulsesData").GetNumberOfPulses();
39 
40  if(pi.GetIsNoise()) {
41  if(numberOfPulses > 0) result = false;
42  } else if(pi.GetIsSignal() || pi.GetIsPulser()) {
43  if(fnPeaks >= 0 && numberOfPulses != fnPeaks) result = false;
44  } else {
45  result = false;
46  }
47 
48  return result;
49 }
#define REGISTER_MODULE(clazz)
Definition: QDriver.hh:133
Filter to select good waveform.
bool Filter(const Diana::QEvent &ev)
return true if ev passes the cuts
baseline data
number of pulses and time interval beetwen peaks in the same acquired window
diana event
Definition: QEvent.hh:46
void Get(const char *owner, ReadHandle< Q > &handle) const
Get a QObject Handle in read mode.
Definition: QEvent.hh:74
Raw event: bolometer channel, trigger positions and types.
Definition: QPulseInfo.hh:18
bool GetIsSignal() const
Get IsSignal.
Definition: QPulseInfo.hh:48
bool GetIsNoise() const
Get IsNoise.
Definition: QPulseInfo.hh:54
bool GetIsPulser() const
Get IsPulser.
Definition: QPulseInfo.hh:44
basic pulse informations
bool fIsSaturatedLow
IsSaturatedLow.
bool fIsSaturatedHigh
IsSaturatedHigh.
the Diana namespace is needed because sometimes we use Qt libraries, that use same class names of our...