artdaq_demo  v3_06_00
demo::ToySimulator Class Reference

ToySimulator is a simple type of fragment generator intended to be studied by new users of artdaq as an example of how to create such a generator in the "best practices" manner. Derived from artdaq's CommandableFragmentGenerator class, it can be used in a full DAQ simulation, obtaining data from the ToyHardwareInterface class. More...

#include <artdaq-demo/Generators/ToySimulator.hh>

Inheritance diagram for demo::ToySimulator:
artdaq::CommandableFragmentGenerator artdaq::FragmentGenerator

Public Member Functions

 ToySimulator (fhicl::ParameterSet const &ps)
 ToySimulator Constructor. More...
 
virtual ~ToySimulator ()
 Shutdown the ToySimulator.
 
- Public Member Functions inherited from artdaq::CommandableFragmentGenerator
 CommandableFragmentGenerator (const fhicl::ParameterSet &ps)
 
void joinThreads ()
 
bool getNext (FragmentPtrs &output) overridefinal
 
void applyRequestsIgnoredMode (artdaq::FragmentPtrs &frags)
 
void applyRequestsSingleMode (artdaq::FragmentPtrs &frags)
 
void applyRequestsBufferMode (artdaq::FragmentPtrs &frags)
 
void applyRequestsWindowMode (artdaq::FragmentPtrs &frags)
 
bool applyRequests (FragmentPtrs &frags)
 
bool sendEmptyFragment (FragmentPtrs &frags, size_t sequenceId, Fragment::fragment_id_t fragmentId, std::string desc)
 
void sendEmptyFragments (FragmentPtrs &frags, std::map< Fragment::sequence_id_t, Fragment::timestamp_t > &requests)
 
void checkSentWindows (Fragment::sequence_id_t seq)
 
void startDataThread ()
 
void startMonitoringThread ()
 
void getDataLoop ()
 
bool waitForDataBufferReady (Fragment::fragment_id_t id)
 
bool dataBufferIsTooLarge (Fragment::fragment_id_t id)
 
void getDataBufferStats (Fragment::fragment_id_t id)
 
void checkDataBuffer (Fragment::fragment_id_t id)
 
void getMonitoringDataLoop ()
 
std::vector
< Fragment::fragment_id_t
fragmentIDs () override
 
size_t ev_counter () const
 
RequestMode request_mode () const
 
void StartCmd (int run, uint64_t timeout, uint64_t timestamp)
 
void StopCmd (uint64_t timeout, uint64_t timestamp)
 
void PauseCmd (uint64_t timeout, uint64_t timestamp)
 
void ResumeCmd (uint64_t timeout, uint64_t timestamp)
 
std::string ReportCmd (std::string const &which="")
 
virtual std::string metricsReportingInstanceName () const
 
bool exception () const
 
virtual bool metaCommand (std::string const &command, std::string const &arg)
 

Additional Inherited Members

- Public Types inherited from artdaq::CommandableFragmentGenerator
typedef fhicl::WrappedTable
< Config
Parameters
 
- Protected Member Functions inherited from artdaq::CommandableFragmentGenerator
int run_number () const
 
int subrun_number () const
 
uint64_t timeout () const
 
uint64_t timestamp () const
 
bool should_stop () const
 
bool check_stop ()
 
int board_id () const
 
size_t ev_counter_inc (size_t step=1, bool force=false)
 
void set_exception (bool exception)
 
void metricsReportingInstanceName (std::string const &name)
 
std::string printMode_ ()
 
virtual bool checkHWStatus_ ()
 
virtual void pauseNoMutex ()
 
virtual void pause ()
 
virtual void resume ()
 
virtual std::string report ()
 
virtual std::string reportSpecific (std::string const &what)
 
- Protected Attributes inherited from artdaq::CommandableFragmentGenerator
std::mutex mutex_
 

Detailed Description

ToySimulator is a simple type of fragment generator intended to be studied by new users of artdaq as an example of how to create such a generator in the "best practices" manner. Derived from artdaq's CommandableFragmentGenerator class, it can be used in a full DAQ simulation, obtaining data from the ToyHardwareInterface class.

ToySimulator is designed to simulate values coming in from one of two types of digitizer boards, one called "TOY1" and the other called "TOY2"; the only difference between the two boards is the # of bits in the ADC values they send. These values are declared as FragmentType enum's in artdaq-demo's artdaq-core-demo/Overlays/FragmentType.hh header.

Definition at line 37 of file ToySimulator.hh.

Constructor & Destructor Documentation

demo::ToySimulator::ToySimulator ( fhicl::ParameterSet const &  ps)
explicit

ToySimulator Constructor.

Parameters
psParameterSet used to configure ToySimulator

The ToySimulator FragmentGenerator accepts the following configuration paramters: "timestamp_scale_factor" (Default: 1): How much to increment the timestamp Fragment Header field for each event "distribution_type" (REQUIRED): Which type of distribution to use when generating data. See ToyHardwareInterface for more information "rollover_subrun_interval" (Default: 0): If this ToySimulator has fragment_id 0, will cause the system to rollover subruns every N events. 0 (default) disables.

Definition at line 27 of file ToySimulator_generator.cc.


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