Diana Software
MEarlierEventsFilter.cc
Go to the documentation of this file.
2 #include "QEvent.hh"
3 #include "QRawEvent.hh"
4 #include "QRunDataHandle.hh"
5 
6 using namespace Diana;
7 
9 
10 
11 
12 void MEarlierEventsFilter::GetCuts(const QEvent& ev)
13 {
14  // Get parameters from cfg
15 }
16 
18 {
19  // perform selection: true if the event passes the cuts
20 
21  const QHeader& hdr = ev.Get<QHeader>("DAQ","Header");
22  const QPulse& pulse = ev.Get<QPulse>("DAQ","Pulse");
23  const QPulseInfo& pulseInfo = ev.Get<QPulseInfo>("DAQ","PulseInfo");
24 
26  GlobalData().Get("",&rHandle,"");
27  const QChannelRunData& crData = rHandle.Get().GetChannelRunData(pulseInfo.GetChannelId());
28 
29  const unsigned long long time = hdr.GetTime().GetFromStartRunNs();
30  const double samplFreq = crData.fSamplingFrequency;
31  const size_t N = pulse.GetSamples().Size();
32  const unsigned long long duration = (unsigned long long)(double(N)*1.e09/samplFreq);
33 
34  if(time < duration) return false;
35 
36  return true;
37 }
int N
Definition: CheckOF.C:24
QRunDataHandle rHandle(753)
#define REGISTER_MODULE(clazz)
Definition: QDriver.hh:133
bool Filter(const Diana::QEvent &ev)
return true if ev passes the cuts
basic channel and run based info. Used in the QRunData object.
double fSamplingFrequency
sampling frequency in Hz
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: basic information like run number and time.
Definition: QHeader.hh:16
const Diana::QTime & GetTime() const
get time
Definition: QHeader.hh:28
int GetRun() const
destructor
Definition: QHeader.hh:22
Raw event: bolometer channel, trigger positions and types.
Definition: QPulseInfo.hh:18
Raw event: sampled waveform.
Definition: QPulse.hh:22
global handle for QRunData
the Diana namespace is needed because sometimes we use Qt libraries, that use same class names of our...