Diana Software
QSameTimeNeighbour.cc
Go to the documentation of this file.
1 #include "QSameTimeNeighbour.hh"
2 #include "QReader.hh"
3 #include "QEvent.hh"
4 #include "QRawEvent.hh"
5 
6 
8 
9 void QSameTimeNeighbour::Init(const QReader& reader){}
10 
12 {
13 
15  const QHeader& thisHeader = thisEvent.Get<QHeader>("DAQ","Header");
16  const QHeader& otherHeader = otherEvent.Get<QHeader>("DAQ","Header");
17 
18 
19  long long time = thisHeader.GetTime().GetFromStartRunNs();
20  long long othertime = otherHeader.GetTime().GetFromStartRunNs();
21  unsigned long long stime = thisHeader.GetTime().GetStartRunUnix();
22  unsigned long long sothertime = otherHeader.GetTime().GetStartRunUnix();
23 
24  if(stime != sothertime) {
25  info.fIsInWindow = false;
26  info.fIsNeighbour = false;
27  return info;
28  }
29 
30  if(time == othertime) {
31  info.fIsInWindow = true;
32  info.fIsNeighbour = true;
33  return info;
34  }
35 
36  info.fIsInWindow = false;
37  info.fIsNeighbour = false;
38  return info;
39 
40 
41 }
43 
#define Q_END_NAMESPACE
Definition: QDiana.hh:22
#define Q_BEGIN_NAMESPACE
Definition: QDiana.hh:20
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
Base class for diana event readers.
Definition: QReader.hh:50
void Init(const QReader &reader)
Initialization (empty)
QReaderNeighbour::NeighbourInfo GetNeighbourInfo(const QEvent &thisEvent, const QEvent &otherEvent)
Gett the neighbour info for two events.