Diana Software
MSelectPulserByDelay.cc
Go to the documentation of this file.
2 #include "QEvent.hh"
3 #include "QEventList.hh"
4 #include "QPulseInfo.hh"
5 
7 
8 using namespace Diana;
9 
10 
12 {
13  ev.Require<QPulseInfo>("DAQ","PulseInfo");
14 
15  fPulserDelayThresholdDown= GetInt("PulserDelayLow",0);
16  fPulserDelayThresholdUp= GetInt("PulserDelayHigh",45000);
17 
18 }
19 
20 //bool MSelectPulserByDelay::Filter(const QEvent& ev, const QEventList& neighbours)
22 {
23  const QPulseInfo& pi = ev.Get<QPulseInfo>("DAQ","PulseInfo");
24 
25  //Get pulser events
26  if(!pi.GetIsPulser()) return false;
27 
28  //Check pulser delay
29  const int chan = pi.GetChannelId();
30  const int pulserDelay = pi.GetMasterSample().GetPulserDelay();
31  Debug("Chan %d: Pulser Delay %d",chan,pulserDelay);
32 
33  if(pulserDelay < fPulserDelayThresholdDown || pulserDelay > fPulserDelayThresholdUp) return false;
34 
35  return true;
36 }
#define REGISTER_MODULE(clazz)
Definition: QDriver.hh:133
one-line description of your filter
void GetCuts(const Diana::QEvent &ev)
Get cuts from config file.
bool Filter(const Diana::QEvent &ev)
return true if ev passes the cuts
diana event
Definition: QEvent.hh:46
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
Definition: QEvent.hh:232
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
const QSampleInfo & GetMasterSample() const
Get MasterSample.
Definition: QPulseInfo.hh:26
bool GetIsPulser() const
Get IsPulser.
Definition: QPulseInfo.hh:44
const int & GetChannelId() const
Get ChannelId.
Definition: QPulseInfo.hh:22
Int_t GetPulserDelay() const
Get pulser delay. Valid for IsPulser.
Definition: QSampleInfo.hh:49
the Diana namespace is needed because sometimes we use Qt libraries, that use same class names of our...