artdaq  v2_03_02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
Public Types | Public Member Functions | List of all members
artdaq::GenericFragmentSimulator Class Reference

GenericFragmentSimulator creates simulated Generic events, with data distributed according to a "histogram" provided in the configuration data. More...

#include <artdaq/DAQdata/GenericFragmentSimulator.hh>

+ Inheritance diagram for artdaq::GenericFragmentSimulator:

Public Types

enum  content_selector_t : uint8_t { content_selector_t::EMPTY = 0, content_selector_t::FRAG_ID = 1, content_selector_t::RANDOM = 2, content_selector_t::DEAD_BEEF }
 What type of content should the GenericFragmentSimulator put in Fragment objects? More...
 

Public Member Functions

 GenericFragmentSimulator (fhicl::ParameterSet const &ps)
 GenericFragmentSimulator Constructor. More...
 
bool getNext (Fragment::sequence_id_t sequence_id, Fragment::fragment_id_t fragment_id, FragmentPtr &frag_ptr)
 Generate a Fragment according to the value of the content_selectior_t enum. More...
 
bool getNext (FragmentPtrs &output) override
 Get the next Fragment from the generator. More...
 
std::vector
< Fragment::fragment_id_t > 
fragmentIDs () override
 Get the Fragment IDs generated by this instance. More...
 

Detailed Description

GenericFragmentSimulator creates simulated Generic events, with data distributed according to a "histogram" provided in the configuration data.

With this implementation, a single call to getNext(frags) will return a complete event (event ids are incremented automatically); fragment ids are sequential. Event size and content are both configurable; see the implementation for details.

Definition at line 26 of file GenericFragmentSimulator.hh.

Member Enumeration Documentation

What type of content should the GenericFragmentSimulator put in Fragment objects?

Enumerator
EMPTY 

Nothing (Default-initialized Fragment)

FRAG_ID 

Fill the payload with the Fragment ID.

RANDOM 

Use a random distribution to fill the payload.

DEAD_BEEF 

Fill the payload with 0xDEADBEEFDEADBEEF.

Definition at line 53 of file GenericFragmentSimulator.hh.

Constructor & Destructor Documentation

artdaq::GenericFragmentSimulator::GenericFragmentSimulator ( fhicl::ParameterSet const &  ps)
explicit

GenericFragmentSimulator Constructor.

Parameters
psParameterSet used to configure the GenericFragmentSimulator
* GenericFragmentSimulator accepts the following Parameters:
* "content_selection" (Default: 0): What type of data to fill in generated Fragment payloads
*   0: Use uninitialized memory
*   1: Use the Fragment ID
*   2: Use random data
*   3: Use the word 0xDEADBEEFDEADBEEF
* "payload_size" (Default: 10240): The size (in words) of the Fragment payload
* "want_random_payload_size" (Default: false): Whether payload size should be sampled from a random distribution
* "random_seed" (Default: 314159): Random seed for random number distributions
* "fragments_per_event" (Default: 5): The number of Fragment objects to generate for each sequence ID
* "starting_fragment_id" (Default: 0): The first Fragment ID handled by this GenericFragmentSimulator. 
*   Fragment IDs will be starting_fragment_id to starting_fragment_id + fragments_per_event.
* 

Definition at line 10 of file GenericFragmentSimulator_generator.cc.

Member Function Documentation

std::vector<Fragment::fragment_id_t> artdaq::GenericFragmentSimulator::fragmentIDs ( )
inlineoverride

Get the Fragment IDs generated by this instance.

Returns
The Fragment IDs generated by this instance

Definition at line 89 of file GenericFragmentSimulator.hh.

bool artdaq::GenericFragmentSimulator::getNext ( Fragment::sequence_id_t  sequence_id,
Fragment::fragment_id_t  fragment_id,
FragmentPtr &  frag_ptr 
)

Generate a Fragment according to the value of the content_selectior_t enum.

Parameters
sequence_idSequence ID of generated Fragment
fragment_idFragment ID of generated Fragment
[out]frag_ptrGenerated Fragment
Returns
True if no exception or assertion failure

Definition at line 45 of file GenericFragmentSimulator_generator.cc.

bool artdaq::GenericFragmentSimulator::getNext ( FragmentPtrs &  output)
inlineoverride

Get the next Fragment from the generator.

Parameters
[out]outputList of FragmentPtr objects to add the new Fragment to
Returns
Whether data taking should continue

Definition at line 80 of file GenericFragmentSimulator.hh.


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