DABC (Data Acquisition Backbone Core)  2.9.9
Public Member Functions | Protected Member Functions | Protected Attributes
user::Input Class Reference

#include <user/Input.h>

Inheritance diagram for user::Input:
dabc::DataInput

Public Member Functions

 Input (dabc::Url &url)
 
virtual ~Input ()
 
- Public Member Functions inherited from dabc::DataInput
virtual bool Read_Stat (dabc::Command cmd)
 Provide timeout value. More...
 
Buffer ReadBuffer ()
 Reads complete buffer. More...
 
virtual ~DataInput ()
 

Protected Member Functions

double Gauss_Rnd (double mean, double sigma)
 produce random spectra for the go4 example More...
 
unsigned int GetReadLength ()
 
virtual unsigned Read_Complete (dabc::Buffer &buf)
 Complete reading of the buffer from source,. More...
 
virtual bool Read_Init (const dabc::WorkerRef &wrk, const dabc::Command &cmd)
 Initialize data input, using port and command. More...
 
virtual unsigned Read_Size ()
 Defines required buffer size for next operation. More...
 
virtual unsigned Read_Start (dabc::Buffer &buf)
 Prepare buffer for reading (if required) More...
 
virtual double Read_Timeout ()
 Provide timeout value. More...
 
virtual int User_Cleanup ()
 shut down the readout hardware properly at the end More...
 
virtual int User_Init ()
 Initialize the readout hardware on startup. More...
 
virtual int User_Readout (uint32_t *pdat, unsigned long &size)
 Fill the data at the buffer pointer. More...
 
virtual int User_ResetTrigger ()
 Used to clear any kind of external trigger information. More...
 
virtual int User_WaitForTrigger ()
 Here any kind of external trigger can be waited for. More...
 
- Protected Member Functions inherited from dabc::DataInput
virtual WorkerAddonRead_GetAddon ()
 Returns addon, provided by data input If specified, supposed that I/O object is double-deriver from DataInput and Addon. More...
 

Protected Attributes

bool fDebug
 flag for optional debug output More...
 
bool fEarlyTriggerClear
 rest the trigger before device buffer has been read out. More...
 
dabc::Ratemeter fErrorRate
 
unsigned int fNumEvents
 Event number since device init. More...
 
unsigned int fReadLength
 actual payload length of read buffer More...
 
unsigned int fSubeventControl
 For mbsformat: defines subevent control. More...
 
unsigned int fSubeventProcid
 For mbsformat: defines subevent procid. More...
 
unsigned int fSubeventSize
 subevent size for this example More...
 
unsigned int fSubeventSubcrate
 For mbsformat: defines subevent subcrate id for case fSingleSubevent=true. More...
 
dabc::Url fURL
 remember specifications of this input from port config More...
 

Detailed Description

Definition at line 26 of file Input.h.

Constructor & Destructor Documentation

◆ Input()

user::Input::Input ( dabc::Url url)

Definition at line 25 of file Input.cxx.

◆ ~Input()

user::Input::~Input ( )
virtual

Definition at line 45 of file Input.cxx.

Member Function Documentation

◆ Read_Init()

bool user::Input::Read_Init ( const dabc::WorkerRef wrk,
const dabc::Command cmd 
)
protectedvirtual

Initialize data input, using port and command.

This is generic virtual method to initialize input, using configurations from Port and (or) from the Command

Parameters
[in]wrkreference on input port
[in]cmdreference on command object
Returns
false when method fails

Reimplemented from dabc::DataInput.

Definition at line 52 of file Input.cxx.

◆ Read_Size()

unsigned user::Input::Read_Size ( )
protectedvirtual

Defines required buffer size for next operation.

Returns
  • 0..di_ValidSize - size of buffer for next read operation (di_ValidSize = 0xFFFFFFF0)
  • di_EndOfStream - this is end of stream, normal close of the input
  • di_DfltBufSize - any non-zero buffer can be provided
  • di_Repeat - nothing to read now, try again as soon as possible
  • di_RepeatTimeOut - nothing to read now, try again after timeout
  • di_CallBack - input will activate transport via callback
  • di_Error - error, close input

Reimplemented from dabc::DataInput.

Definition at line 67 of file Input.cxx.

◆ Read_Start()

unsigned user::Input::Read_Start ( dabc::Buffer buf)
protectedvirtual

Prepare buffer for reading (if required)

Returns
  • di_Ok - buffer must be filled in Read_Complete call
  • di_CallBack - input will do readout and activate transport via callback
  • di_Error (or other) - error, skip buffer

Reimplemented from dabc::DataInput.

Definition at line 72 of file Input.cxx.

◆ Read_Complete()

unsigned user::Input::Read_Complete ( dabc::Buffer buf)
protectedvirtual

Complete reading of the buffer from source,.

Returns
  • di_Ok - buffer filled and ready
  • di_EndOfStream - this is end of stream, normal close of the input
  • di_SkipBuffer - skip buffer
  • di_Error - error, skip buffer and close input
  • di_Repeat - not ready, call again as soon as possible
  • di_RepeatTimeOut - not ready, call again after timeout

Reimplemented from dabc::DataInput.

Definition at line 78 of file Input.cxx.

◆ Read_Timeout()

double user::Input::Read_Timeout ( )
protectedvirtual

Provide timeout value.

Returns
timeout in seconds

When Read_Size or Read_Complete operations returns di_RepeatTimeout argument, specified timeout will be used before next operation will be done

Reimplemented from dabc::DataInput.

Definition at line 61 of file Input.cxx.

◆ GetReadLength()

unsigned int user::Input::GetReadLength ( )
inlineprotected

Definition at line 46 of file Input.h.

◆ User_Init()

int user::Input::User_Init ( )
protectedvirtual

Initialize the readout hardware on startup.

Definition at line 147 of file Input.cxx.

◆ User_Readout()

int user::Input::User_Readout ( uint32_t *  pdat,
unsigned long &  size 
)
protectedvirtual

Fill the data at the buffer pointer.

size returns filled size in bytes

Definition at line 177 of file Input.cxx.

◆ User_WaitForTrigger()

int user::Input::User_WaitForTrigger ( )
protectedvirtual

Here any kind of external trigger can be waited for.

Definition at line 162 of file Input.cxx.

◆ User_ResetTrigger()

int user::Input::User_ResetTrigger ( )
protectedvirtual

Used to clear any kind of external trigger information.

Definition at line 171 of file Input.cxx.

◆ User_Cleanup()

int user::Input::User_Cleanup ( )
protectedvirtual

shut down the readout hardware properly at the end

Definition at line 156 of file Input.cxx.

◆ Gauss_Rnd()

double user::Input::Gauss_Rnd ( double  mean,
double  sigma 
)
protected

produce random spectra for the go4 example

Definition at line 195 of file Input.cxx.

Field Documentation

◆ fURL

dabc::Url user::Input::fURL
protected

remember specifications of this input from port config

Definition at line 74 of file Input.h.

◆ fErrorRate

dabc::Ratemeter user::Input::fErrorRate
protected

Definition at line 76 of file Input.h.

◆ fReadLength

unsigned int user::Input::fReadLength
protected

actual payload length of read buffer

Definition at line 79 of file Input.h.

◆ fNumEvents

unsigned int user::Input::fNumEvents
protected

Event number since device init.

Definition at line 83 of file Input.h.

◆ fSubeventSize

unsigned int user::Input::fSubeventSize
protected

subevent size for this example

Definition at line 86 of file Input.h.

◆ fSubeventSubcrate

unsigned int user::Input::fSubeventSubcrate
protected

For mbsformat: defines subevent subcrate id for case fSingleSubevent=true.

Definition at line 89 of file Input.h.

◆ fSubeventProcid

unsigned int user::Input::fSubeventProcid
protected

For mbsformat: defines subevent procid.

Definition at line 92 of file Input.h.

◆ fSubeventControl

unsigned int user::Input::fSubeventControl
protected

For mbsformat: defines subevent control.

Definition at line 95 of file Input.h.

◆ fEarlyTriggerClear

bool user::Input::fEarlyTriggerClear
protected

rest the trigger before device buffer has been read out.

This can speed up things if DAQ is provided with double buffering or external data queues.

Definition at line 99 of file Input.h.

◆ fDebug

bool user::Input::fDebug
protected

flag for optional debug output

Definition at line 102 of file Input.h.


The documentation for this class was generated from the following files: