artdaq  v2_03_00
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
artdaq::BoardReaderCore Class Reference

BoardReaderCore implements the state machine for the BoardReader artdaq application. It contains a CommandableFragmentGenerator, which generates Fragments which are then sent to a DataSenderManager by BoardReaderCore. More...

#include <artdaq/Application/BoardReaderCore.hh>

Public Member Functions

 BoardReaderCore (Commandable &parent_application, int rank, std::string name)
 BoardReaderCore Constructor. More...
 
 BoardReaderCore (BoardReaderCore const &)=delete
 Copy Constructor is Deleted.
 
virtual ~BoardReaderCore ()
 BoardReaderCore Destructor.
 
BoardReaderCoreoperator= (BoardReaderCore const &)=delete
 Copy Assignment Operator is deleted. More...
 
bool initialize (fhicl::ParameterSet const &pset, uint64_t, uint64_t)
 Initialize the BoardReaderCore. More...
 
bool start (art::RunID id, uint64_t timeout, uint64_t timestamp)
 Start the BoardReader, and the CommandableFragmentGenerator. More...
 
bool stop (uint64_t timeout, uint64_t timestamp)
 Stop the BoardReader, and the CommandableFragmentGenerator. More...
 
bool pause (uint64_t timeout, uint64_t timestamp)
 Pause the BoardReader, and the CommandableFragmentGenerator. More...
 
bool resume (uint64_t timeout, uint64_t timestamp)
 Resume the BoardReader, and the CommandableFragmentGenerator. More...
 
bool shutdown (uint64_t)
 Shutdown the BoardReader, and the CommandableFragmentGenerator. More...
 
bool soft_initialize (fhicl::ParameterSet const &pset, uint64_t, uint64_t)
 Soft-Initialize the BoardReader. No-Op. More...
 
bool reinitialize (fhicl::ParameterSet const &pset, uint64_t, uint64_t)
 Reinitialize the BoardReader. No-Op. More...
 
size_t process_fragments ()
 Main working loop of the BoardReaderCore. More...
 
std::string report (std::string const &which) const
 Send a report on a given run-time quantity. More...
 

Static Public Member Functions

static DataSenderManagerGetDataSenderManagerPtr ()
 Gets a handle to the DataSenderManager. More...
 

Static Public Attributes

static const std::string FRAGMENTS_PROCESSED_STAT_KEY
 Key for the Fragments Processed MonitoredQuantity.
 
static const std::string INPUT_WAIT_STAT_KEY
 Key for the Input Wait MonitoredQuantity.
 
static const std::string BRSYNC_WAIT_STAT_KEY
 Key for the Sync Wait MonitoredQuantity.
 
static const std::string OUTPUT_WAIT_STAT_KEY
 Key for the Output Wait MonitoredQuantity.
 
static const std::string FRAGMENTS_PER_READ_STAT_KEY
 Key for the Fragments Per Read MonitoredQuantity.
 

Detailed Description

BoardReaderCore implements the state machine for the BoardReader artdaq application. It contains a CommandableFragmentGenerator, which generates Fragments which are then sent to a DataSenderManager by BoardReaderCore.

Definition at line 23 of file BoardReaderCore.hh.

Constructor & Destructor Documentation

artdaq::BoardReaderCore::BoardReaderCore ( Commandable parent_application,
int  rank,
std::string  name 
)

BoardReaderCore Constructor.

Parameters
parent_applicationReference to parent Commandable object, for in_run_failure notification
rankRank of the BoardReader
nameFriendly name for the BoardReader

Definition at line 27 of file BoardReaderCore.cc.

Member Function Documentation

static DataSenderManager* artdaq::BoardReaderCore::GetDataSenderManagerPtr ( )
inlinestatic

Gets a handle to the DataSenderManager.

Returns
Pointer to the DataSenderManager

Definition at line 151 of file BoardReaderCore.hh.

bool artdaq::BoardReaderCore::initialize ( fhicl::ParameterSet const &  pset,
uint64_t  ,
uint64_t   
)

Initialize the BoardReaderCore.

Parameters
psetParameterSet used to configure the BoardReaderCore
Returns
True if the initialize attempt succeeded
* BoardReaderCore accepts the following Parameters:
* "daq" (REQUIRED): FHiCL table containing DAQ configuration.
*   "fragment_receiver" (REQUIRED): FHiCL table containing Fragment Receiver configruation.
*     See CommandableFragmentGenerator for configuration options.
*     "generator" (Default: ""): The plugin name of the generator to load
*     "rt_priority" (Default: 0): The unix priority to attempt to assign to the process
*   "metrics": FHiCL table containing MetricManager configuration.
*     See MetricManager for configuration options.
* 

Definition at line 51 of file BoardReaderCore.cc.

BoardReaderCore& artdaq::BoardReaderCore::operator= ( BoardReaderCore const &  )
delete

Copy Assignment Operator is deleted.

Returns
BoardReaderCore copy
bool artdaq::BoardReaderCore::pause ( uint64_t  timeout,
uint64_t  timestamp 
)

Pause the BoardReader, and the CommandableFragmentGenerator.

Parameters
timeoutTimeout for transition
timestampTimestamp of transition
Returns
True unless exception occurred

Definition at line 214 of file BoardReaderCore.cc.

size_t artdaq::BoardReaderCore::process_fragments ( )

Main working loop of the BoardReaderCore.

Returns
Number of Fragments generated

This loop calls the CommandableFragmentGenerator::getNext method, then sends each Fragment using DataSenderManager.

Definition at line 256 of file BoardReaderCore.cc.

bool artdaq::BoardReaderCore::reinitialize ( fhicl::ParameterSet const &  pset,
uint64_t  ,
uint64_t   
)

Reinitialize the BoardReader. No-Op.

Parameters
psetParameterSet used to configure the BoardReaderCore
Returns
True unless exception occurred

Definition at line 248 of file BoardReaderCore.cc.

std::string artdaq::BoardReaderCore::report ( std::string const &  which) const

Send a report on a given run-time quantity.

Parameters
whichWhich quantity to report
Returns
A string containing the requested quantity.

If the CommandableFragmentGenerator has been initialized, CommandableFragmentGenerator::report(std::string const& which) will be called. Otherwise, the BoardReaderCore will return the current run number and an error message.

Definition at line 487 of file BoardReaderCore.cc.

bool artdaq::BoardReaderCore::resume ( uint64_t  timeout,
uint64_t  timestamp 
)

Resume the BoardReader, and the CommandableFragmentGenerator.

Parameters
timeoutTimeout for transition
timestampTimestamp of transition
Returns
True unless exception occurred

Definition at line 224 of file BoardReaderCore.cc.

bool artdaq::BoardReaderCore::shutdown ( uint64_t  )

Shutdown the BoardReader, and the CommandableFragmentGenerator.

Returns
True unless exception occurred

Definition at line 233 of file BoardReaderCore.cc.

bool artdaq::BoardReaderCore::soft_initialize ( fhicl::ParameterSet const &  pset,
uint64_t  ,
uint64_t   
)

Soft-Initialize the BoardReader. No-Op.

Parameters
psetParameterSet used to configure the BoardReaderCore
Returns
True unless exception occurred

Definition at line 240 of file BoardReaderCore.cc.

bool artdaq::BoardReaderCore::start ( art::RunID  id,
uint64_t  timeout,
uint64_t  timestamp 
)

Start the BoardReader, and the CommandableFragmentGenerator.

Parameters
idRun ID of new run
timeoutTimeout for transition
timestampTimestamp of transition
Returns
True unless exception occurred

Definition at line 186 of file BoardReaderCore.cc.

bool artdaq::BoardReaderCore::stop ( uint64_t  timeout,
uint64_t  timestamp 
)

Stop the BoardReader, and the CommandableFragmentGenerator.

Parameters
timeoutTimeout for transition
timestampTimestamp of transition
Returns
True unless exception occurred

Definition at line 204 of file BoardReaderCore.cc.


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