Diana Software
MCoincidenceSimple.cc
Go to the documentation of this file.
1 #include "MCoincidenceSimple.hh"
2 #include "QEvent.hh"
3 #include "QEventList.hh"
4 #include "QRawEvent.hh"
5 
6 
8 
9 using namespace Diana;
10 
12 {
13 }
14 
15 void MCoincidenceSimple::Do(QEvent& ev, const QEventList& neighbours)
16 {
17  const QPulseInfo& pi = ev.Get<QPulseInfo>("DAQ","PulseInfo");
18  const int chan = pi.GetChannelId();
19  const bool isSignal = pi.GetIsSignal();
20  const int evnum = ev.GetReadNumber();
21  const double time = ev.Get<QHeader>("DAQ","Header").GetTime().GetFromStartRunNs()/1e09;
22 
23  Info("************************************************************");
24  Info("Event: %d, chan %d, isSignal %d, time %f",evnum,chan,isSignal,time);
25  for(size_t i = 0; i < neighbours.Size(); i++) {
26 
27  const double n_time = neighbours[i].Get<QHeader>("DAQ","Header").GetTime().GetFromStartRunNs()/1e09;
28  const QPulseInfo& n_pi = neighbours[i].Get<QPulseInfo>("DAQ","PulseInfo");
29  const int n_chan = n_pi.GetChannelId();
30  const bool n_isSignal = n_pi.GetIsSignal();
31  const int n_evnum = neighbours[i].GetReadNumber();
32  Info("Neighbour event: %d, chan %d, isSignal %d, time %f",n_evnum,n_chan,n_isSignal,n_time);
33 
34  }
35 }
36 
38 {
39 }
40 
#define REGISTER_MODULE(clazz)
Definition: QDriver.hh:133
one-line description of your module
void Done()
Done method.
void Init(Diana::QEvent &ev)
Init method.
void Do(Diana::QEvent &ev, const Diana::QEventList &neighbours)
Do method. Declare and implement only one of the two versions.
list of references to const QEvent (s)
Definition: QEventList.hh:21
size_t Size() const
number of QEvent (s)
Definition: QEventList.hh:36
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
unsigned int GetReadNumber() const
return the event number as read by the current reader.
Definition: QEvent.hh:60
Raw event: basic information like run number and time.
Definition: QHeader.hh:16
Raw event: bolometer channel, trigger positions and types.
Definition: QPulseInfo.hh:18
bool GetIsSignal() const
Get IsSignal.
Definition: QPulseInfo.hh:48
const int & GetChannelId() const
Get ChannelId.
Definition: QPulseInfo.hh:22
the Diana namespace is needed because sometimes we use Qt libraries, that use same class names of our...