1 #ifndef artdaq_Application_MPI2_BoardReaderCore_hh
2 #define artdaq_Application_MPI2_BoardReaderCore_hh
6 #include "artdaq/Application/CommandableFragmentGenerator.hh"
7 #include "artdaq/Application/Commandable.hh"
8 #include "fhiclcpp/ParameterSet.h"
9 #include "canvas/Persistency/Provenance/RunID.h"
10 #include "artdaq/DAQrate/DataSenderManager.hh"
11 #include "artdaq/Application/StatisticsHelper.hh"
12 #include "artdaq-utilities/Plugins/MetricManager.hh"
16 class BoardReaderCore;
72 bool initialize(fhicl::ParameterSet
const& pset, uint64_t, uint64_t);
81 bool start(art::RunID
id, uint64_t timeout, uint64_t timestamp);
89 bool stop(uint64_t timeout, uint64_t timestamp);
97 bool pause(uint64_t timeout, uint64_t timestamp);
105 bool resume(uint64_t timeout, uint64_t timestamp);
118 bool soft_initialize(fhicl::ParameterSet
const& pset, uint64_t, uint64_t);
125 bool reinitialize(fhicl::ParameterSet
const& pset, uint64_t, uint64_t);
143 std::string
report(std::string
const& which)
const;
151 bool metaCommand(std::string
const& command, std::string
const& arg);
166 std::unique_ptr<CommandableFragmentGenerator> generator_ptr_;
169 fhicl::ParameterSet data_pset_;
171 bool skip_seqId_test_;
173 static std::unique_ptr<artdaq::DataSenderManager> sender_ptr_;
175 size_t fragment_count_;
176 artdaq::Fragment::sequence_id_t prev_seq_id_;
177 std::atomic<bool> stop_requested_;
178 std::atomic<bool> pause_requested_;
183 std::string buildStatisticsString_();
185 artdaq::MetricManager metricMan_;
195 void logMessage_(std::string
const& text);
This class manages MonitoredQuantity instances for the *Core classes.
size_t GetFragmentsProcessed()
Get the number of Fragments processed this run
Commandable is the base class for all artdaq components which implement the artdaq state machine...
Sends Fragment objects using TransferInterface plugins. Uses Routing Tables if confgiured, otherwise will Round-Robin Fragments to the destinations.
static DataSenderManager * GetDataSenderManagerPtr()
Gets a handle to the DataSenderManager.
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.
bool stop(uint64_t timeout, uint64_t timestamp)
Stop the BoardReader, and the CommandableFragmentGenerator.
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.
virtual ~BoardReaderCore()
BoardReaderCore Destructor.
BoardReaderCore(Commandable &parent_application)
BoardReaderCore Constructor.
bool reinitialize(fhicl::ParameterSet const &pset, uint64_t, uint64_t)
Reinitialize the BoardReader. No-Op.
bool soft_initialize(fhicl::ParameterSet const &pset, uint64_t, uint64_t)
Soft-Initialize the BoardReader. No-Op.
static const std::string BRSYNC_WAIT_STAT_KEY
Key for the Sync Wait MonitoredQuantity.
static const std::string FRAGMENTS_PER_READ_STAT_KEY
Key for the Fragments Per Read MonitoredQuantity.
static const std::string OUTPUT_WAIT_STAT_KEY
Key for the Output Wait MonitoredQuantity.
bool initialize(fhicl::ParameterSet const &pset, uint64_t, uint64_t)
Initialize the BoardReaderCore.
std::string report(std::string const &which) const
Send a report on a given run-time quantity.
void process_fragments()
Main working loop of the BoardReaderCore.
bool start(art::RunID id, uint64_t timeout, uint64_t timestamp)
Start the BoardReader, and the CommandableFragmentGenerator.
bool resume(uint64_t timeout, uint64_t timestamp)
Resume the BoardReader, and the CommandableFragmentGenerator.
bool pause(uint64_t timeout, uint64_t timestamp)
Pause the BoardReader, and the CommandableFragmentGenerator.
bool shutdown(uint64_t)
Shutdown the BoardReader, and the CommandableFragmentGenerator.
bool metaCommand(std::string const &command, std::string const &arg)
Run a user-defined command on the CommandableFragmentGenerator.
BoardReaderCore & operator=(BoardReaderCore const &)=delete
Copy Assignment Operator is deleted.