DABC (Data Acquisition Backbone Core)  2.9.9
Input.h
Go to the documentation of this file.
1 /********************************************************************
2  * The Data Acquisition Backbone Core (DABC)
3  ********************************************************************
4  * Copyright (C) 2009-
5  * GSI Helmholtzzentrum fuer Schwerionenforschung GmbH
6  * Planckstr. 1
7  * 64291 Darmstadt
8  * Germany
9  * Contact: http://dabc.gsi.de
10  ********************************************************************
11  * This software can be used under the GPL license agreements as stated
12  * in LICENSE.txt file which is part of the distribution.
13  ********************************************************************/
14 #ifndef USER_Input
15 #define USER_Input
16 
17 #include "dabc/DataIO.h"
18 #include "dabc/statistic.h"
19 
20 #include "mbs/MbsTypeDefs.h"
21 
22 namespace user
23 {
24 
25 
26 class Input: public dabc::DataInput
27 {
28 
29 public:
30  Input (dabc::Url& url);
31  virtual ~Input ();
32 
33 protected:
34 
35 
36  virtual bool Read_Init(const dabc::WorkerRef& wrk, const dabc::Command& cmd);
37 
38  virtual unsigned Read_Size ();
39 
40  virtual unsigned Read_Start (dabc::Buffer& buf);
41 
42  virtual unsigned Read_Complete (dabc::Buffer& buf);
43 
44  virtual double Read_Timeout ();
45 
46  unsigned int GetReadLength ()
47  {
48  return fReadLength;
49  }
50 
51  // These are the actual user readout functions to implement: //
52 
53 
55  virtual int User_Init ();
56 
58  virtual int User_Readout (uint32_t* pdat, unsigned long& size);
59 
61  virtual int User_WaitForTrigger ();
62 
64  virtual int User_ResetTrigger();
65 
67  virtual int User_Cleanup();
68 
69 
71  double Gauss_Rnd(double mean, double sigma);
72 
75 
77 
79  unsigned int fReadLength;
80 
81 
83  unsigned int fNumEvents;
84 
86  unsigned int fSubeventSize;
87 
89  unsigned int fSubeventSubcrate;
90 
92  unsigned int fSubeventProcid;
93 
95  unsigned int fSubeventControl;
96 
100 
102  bool fDebug;
103 
104 
105 
106 };
107 }
108 
109 #endif
Reference on memory from memory pool.
Definition: Buffer.h:135
Represents command with its arguments.
Definition: Command.h:99
Interface for implementing any kind of data input.
Definition: DataIO.h:61
Helper class to calculate data rate.
Definition: statistic.h:79
Uniform Resource Locator interpreter.
Definition: Url.h:33
Reference on dabc::Worker
Definition: Worker.h:466
Input(dabc::Url &url)
Definition: Input.cxx:25
unsigned int fSubeventSize
subevent size for this example
Definition: Input.h:86
virtual unsigned Read_Complete(dabc::Buffer &buf)
Complete reading of the buffer from source,.
Definition: Input.cxx:78
bool fDebug
flag for optional debug output
Definition: Input.h:102
virtual int User_Readout(uint32_t *pdat, unsigned long &size)
Fill the data at the buffer pointer.
Definition: Input.cxx:177
double Gauss_Rnd(double mean, double sigma)
produce random spectra for the go4 example
Definition: Input.cxx:195
unsigned int fNumEvents
Event number since device init.
Definition: Input.h:83
unsigned int GetReadLength()
Definition: Input.h:46
unsigned int fReadLength
actual payload length of read buffer
Definition: Input.h:79
unsigned int fSubeventProcid
For mbsformat: defines subevent procid.
Definition: Input.h:92
virtual int User_ResetTrigger()
Used to clear any kind of external trigger information.
Definition: Input.cxx:171
virtual int User_Cleanup()
shut down the readout hardware properly at the end
Definition: Input.cxx:156
bool fEarlyTriggerClear
rest the trigger before device buffer has been read out.
Definition: Input.h:99
unsigned int fSubeventControl
For mbsformat: defines subevent control.
Definition: Input.h:95
virtual ~Input()
Definition: Input.cxx:45
virtual unsigned Read_Start(dabc::Buffer &buf)
Prepare buffer for reading (if required)
Definition: Input.cxx:72
dabc::Url fURL
remember specifications of this input from port config
Definition: Input.h:74
virtual int User_WaitForTrigger()
Here any kind of external trigger can be waited for.
Definition: Input.cxx:162
virtual double Read_Timeout()
Provide timeout value.
Definition: Input.cxx:61
dabc::Ratemeter fErrorRate
Definition: Input.h:76
unsigned int fSubeventSubcrate
For mbsformat: defines subevent subcrate id for case fSingleSubevent=true.
Definition: Input.h:89
virtual unsigned Read_Size()
Defines required buffer size for next operation.
Definition: Input.cxx:67
virtual bool Read_Init(const dabc::WorkerRef &wrk, const dabc::Command &cmd)
Initialize data input, using port and command.
Definition: Input.cxx:52
virtual int User_Init()
Initialize the readout hardware on startup.
Definition: Input.cxx:147
Definition: Factory.h:20