stream  0.10.0
stream analysis framework
SysCoreProc.h
1 #ifndef BASE_SYSCOREPROC_H
2 #define BASE_SYSCOREPROC_H
3 
4 #include "base/StreamProc.h"
5 
6 namespace base {
7 
8  class OpticSplitter;
9 
17  class SysCoreProc : public base::StreamProc {
18 
19  friend class OpticSplitter;
20 
21  protected:
22  unsigned fSyncSource;
23  unsigned fTriggerSignal;
24 
26  double fPrintLeft;
27  double fPrintRight;
28  bool fAnyPrinted;
29 
30  base::H1handle fMsgPerBrd;
31  base::H1handle fALLt;
32  base::H1handle fHITt;
33  base::H1handle fAUXt[4];
34  base::H1handle fSYNCt[2];
35 
36  static unsigned fMaxBrdId;
37 
38  // this part is dedicated for OpticSplitter and should not be touched
40  uint64_t* fSplitPtr;
41 
42 
45  virtual bool doTriggerSelection() const { return (fTriggerSignal < 4) || (fTriggerSignal==10) || (fTriggerSignal==11); }
46 
47  void CreateBasicHistograms();
48 
50  void FillMsgPerBrdHist(unsigned cnt) { FillH1(fMsgPerBrd, GetID(), cnt); }
51 
52  bool CheckPrint(double msgtm, double safetymargin = 1e-6);
53 
54  public:
55 
56  SysCoreProc(const char* name, unsigned brdid, OpticSplitter* spl = 0);
57  virtual ~SysCoreProc();
58 
62  void SetSyncSource(unsigned id)
63  {
64  fSyncSource = id;
66  }
67 
71  void SetNoSyncSource() { SetSyncSource(0xff); }
72 
77  void SetTriggerSignal(unsigned id) { fTriggerSignal = id; }
78 
81 
82 
86  void SetPrint(int nummsg, double left = -1., double right = -1.)
87  {
88  fNumPrintMessages = nummsg;
89  fPrintLeft = left;
90  fPrintRight = right;
91  fAnyPrinted = false;
92  }
93 
95  static void SetMaxBrdId(unsigned max) { fMaxBrdId = max; }
96 
97  };
98 }
99 
100 #endif
Memory management class.
Definition: Buffer.h:49
This is splitter of raw data, recorded by the optic readout Current ABB firmware mix data from all RO...
Definition: OpticSplitter.h:16
unsigned GetID() const
Get processor ID.
Definition: base/Processor.h:222
void FillH1(H1handle h1, double x, double weight=1.)
Fill 1-D histogram.
Definition: base/Processor.h:103
Abstract processor of data streams.
Definition: StreamProc.h:21
@ sync_Inter
use time interpolation between two markers
Definition: StreamProc.h:29
@ sync_None
no synchronization
Definition: StreamProc.h:28
void SetSynchronisationKind(SyncKind kind=sync_Inter)
Method indicate if any kind of time-synchronization technique should be applied for the processor.
Definition: StreamProc.h:83
SysCoreProc is base class for many processors of data, provided by SysCore2/3 boards.
Definition: SysCoreProc.h:17
unsigned fSyncSource
0,1: SYNC0,1 used for synchronization, >=2: local time used for time stamp
Definition: SysCoreProc.h:22
double fPrintLeft
! left border to start printing
Definition: SysCoreProc.h:26
void SetTriggerSignal(unsigned id)
Set signal kind which should be used for data selection Values 0..3 are for AUX0 - AUX3 Values 10,...
Definition: SysCoreProc.h:77
virtual bool doTriggerSelection() const
Returns true when processor used to select trigger signal In subclass one could have alternative ways...
Definition: SysCoreProc.h:45
void SetNoSyncSource()
This declares that local time stamp will be used.
Definition: SysCoreProc.h:71
void SetSyncSource(unsigned id)
Set signal id, used for time synchronization One could use SYNC0 (id=0) or SYNC1 (id=1) for synchroni...
Definition: SysCoreProc.h:62
base::H1handle fAUXt[4]
! histogram for AUX times
Definition: SysCoreProc.h:33
bool fAnyPrinted
! true when any message was printed
Definition: SysCoreProc.h:28
virtual ~SysCoreProc()
destructor
Definition: SysCoreProc.cxx:37
Buffer fSplitBuf
! temporary buffer for splitting
Definition: SysCoreProc.h:39
SysCoreProc(const char *name, unsigned brdid, OpticSplitter *spl=0)
constructor
Definition: SysCoreProc.cxx:14
double fPrintRight
! right border to stop printing
Definition: SysCoreProc.h:27
base::H1handle fSYNCt[2]
! histogram for SYNC times
Definition: SysCoreProc.h:34
void SetPrint(int nummsg, double left=-1., double right=-1.)
Set number of messages to be printed Optionally, one could specify time window where messages should ...
Definition: SysCoreProc.h:86
void CreateBasicHistograms()
create basic histograms
Definition: SysCoreProc.cxx:44
bool CheckPrint(double msgtm, double safetymargin=1e-6)
check print
Definition: SysCoreProc.cxx:62
static void SetMaxBrdId(unsigned max)
Set maximum board number, used for histograming.
Definition: SysCoreProc.h:95
uint64_t * fSplitPtr
! current position for split data
Definition: SysCoreProc.h:40
static unsigned fMaxBrdId
! maximum allowed board id, used for histogramming
Definition: SysCoreProc.h:36
base::H1handle fHITt
! histogram for hit messages only
Definition: SysCoreProc.h:32
void SetNoTriggerSignal()
Disable any trigger generation.
Definition: SysCoreProc.h:80
int fNumPrintMessages
! number of messages to be printed
Definition: SysCoreProc.h:25
void FillMsgPerBrdHist(unsigned cnt)
fill histogram
Definition: SysCoreProc.h:50
unsigned fTriggerSignal
0 .. 3 is AUXs, 10-11 is SYNCs
Definition: SysCoreProc.h:23
base::H1handle fMsgPerBrd
! common histogram for all boards with similar prefix
Definition: SysCoreProc.h:30
base::H1handle fALLt
! histogram for all messages times
Definition: SysCoreProc.h:31