stream  0.10.0
stream analysis framework
StartProcessor.h
1 #ifndef HADAQ_STARTPROCESSOR_H
2 #define HADAQ_STARTPROCESSOR_H
3 
4 #include "base/StreamProc.h"
5 
6 namespace hadaq {
7 
11 
12 protected:
13  base::H1handle fEvType;
14  base::H1handle fEvSize;
15  base::H1handle fSubevSize;
16 
17  base::H1handle fEpochDiff;
18 
19  unsigned fStartId;
20 
21  unsigned fTdcMin;
22  unsigned fTdcMax;
23 
25  inline int EpochDiff(unsigned ep1, unsigned ep2)
26  {
27  unsigned res = ep1 <= ep2 ? ep2 - ep1 : ep2 + 0x10000000 - ep1;
28 
29  return res < 0x8000000 ? res : (int) res - 0x10000000;
30  }
31 
33  double EpochTmDiff(unsigned ep1, unsigned ep2);
34 
35 public:
37  virtual ~StartProcessor();
38 
39  virtual bool FirstBufferScan(const base::Buffer &buf);
40 
42  void SetStartId(unsigned id)
43  {
44  fStartId = id;
45  }
46 
48  void SetTdcRange(unsigned min, unsigned max)
49  {
50  fTdcMin = min;
51  fTdcMax = max;
52  }
53 };
54 }
55 
56 #endif
Memory management class.
Definition: Buffer.h:49
Abstract processor of data streams.
Definition: StreamProc.h:21
This is specialized process for spill structures
Definition: StartProcessor.h:10
StartProcessor()
constructor
Definition: StartProcessor.cxx:12
void SetTdcRange(unsigned min, unsigned max)
set tdc range
Definition: StartProcessor.h:48
base::H1handle fEvSize
HADAQ event size.
Definition: StartProcessor.h:14
unsigned fTdcMax
maximal TDC id
Definition: StartProcessor.h:22
unsigned fTdcMin
minimal TDC id
Definition: StartProcessor.h:21
virtual bool FirstBufferScan(const base::Buffer &buf)
Scan all messages, find reference signals.
Definition: StartProcessor.cxx:47
base::H1handle fSubevSize
HADAQ sub-event size.
Definition: StartProcessor.h:15
unsigned fStartId
HUB with start detector.
Definition: StartProcessor.h:19
double EpochTmDiff(unsigned ep1, unsigned ep2)
Return time difference between epochs in seconds.
Definition: StartProcessor.cxx:39
base::H1handle fEpochDiff
epoch differences
Definition: StartProcessor.h:17
virtual ~StartProcessor()
destructor
Definition: StartProcessor.cxx:32
base::H1handle fEvType
HADAQ event type.
Definition: StartProcessor.h:13
void SetStartId(unsigned id)
set start id
Definition: StartProcessor.h:42
int EpochDiff(unsigned ep1, unsigned ep2)
Calculates most realistic difference between epochs.
Definition: StartProcessor.h:25