artdaq
v2_03_00
|
AggregatorCore implements the state machine for the Aggregator artdaq application. AggregatorCore processes incoming events in one of three roles: Data Logger, Online Monitor, or Dispatcher. More...
#include <artdaq/Application/AggregatorCore.hh>
Public Member Functions | |
AggregatorCore (int rank, std::string name) | |
AggregatorCore Constructor. More... | |
AggregatorCore (AggregatorCore const &)=delete | |
Copy Constructor is deleted. | |
~AggregatorCore () | |
AggregatorCore & | operator= (AggregatorCore const &)=delete |
Copy Assignment operator is deleted. More... | |
bool | initialize (fhicl::ParameterSet const &pset) |
Processes the initialize request. More... | |
bool | start (art::RunID id) |
Start the AggregatorCore. More... | |
bool | stop () |
Stops the AggregatorCore. More... | |
bool | pause () |
Pauses the AggregatorCore. More... | |
bool | resume () |
Resumes the AggregatorCore. More... | |
bool | shutdown () |
Shuts Down the AggregatorCore. More... | |
bool | soft_initialize (fhicl::ParameterSet const &pset) |
Soft-Initializes the AggregatorCore. No-Op. More... | |
bool | reinitialize (fhicl::ParameterSet const &pset) |
Reinitializes the AggregatorCore. No-Op. More... | |
size_t | process_fragments () |
The main working loop of the AggregatorCore. Receives events from DataReceiverManager and processes them according to the Aggreagtor's configuration. More... | |
std::string | report (std::string const &which) const |
Send a report on a given run-time quantity. More... | |
std::string | register_monitor (fhicl::ParameterSet const &pset) |
Create a new TransferInterface instance using the given configuration. More... | |
std::string | unregister_monitor (std::string const &label) |
Delete the TransferInterface having the given unique label. More... | |
Static Public Attributes | |
static const std::string | INPUT_EVENTS_STAT_KEY |
Key for the Input Events MonitoredQuantity. | |
static const std::string | INPUT_WAIT_STAT_KEY |
Key for the Input Wait MonitoredQuantity. | |
static const std::string | STORE_EVENT_WAIT_STAT_KEY |
Key for the EventStore Event Wait MonitoredQuantity. | |
static const std::string | SHM_COPY_TIME_STAT_KEY |
Key for the Shared Memory Copy Time MonitoredQuantity. | |
static const std::string | FILE_CHECK_TIME_STAT_KEY |
Key for the File Check Time MonitoredQuantity. | |
AggregatorCore implements the state machine for the Aggregator artdaq application. AggregatorCore processes incoming events in one of three roles: Data Logger, Online Monitor, or Dispatcher.
Definition at line 31 of file AggregatorCore.hh.
artdaq::AggregatorCore::AggregatorCore | ( | int | rank, |
std::string | name | ||
) |
AggregatorCore Constructor.
rank | Rank of the Aggregator |
name | Friendly name for the Aggregator |
Definition at line 63 of file AggregatorCore.cc.
artdaq::AggregatorCore::~AggregatorCore | ( | ) |
Destructor.
Definition at line 84 of file AggregatorCore.cc.
bool artdaq::AggregatorCore::initialize | ( | fhicl::ParameterSet const & | pset | ) |
Processes the initialize request.
pset | ParameterSet used to configure the AggregatorCore |
* AggregatorCore accepts the following Parameters: * "daq" (REQUIRED): FHiCL table containing DAQ configuration * "aggregator" (REQUIRED): FHiCL table containing Aggregator paramters * "expected_events_per_bunch" (REQUIRED): Number of events to collect before sending them to art * "enq_timeout" (Default: 5.0): Maximum amount of time to wait while enqueueing events to the ConcurrentQueue * "is_data_logger": True if the Aggregator is a Data Logger * "is_online_monitor": True if the Aggregator is an Online Monitor. is_data_logger takes precedence * "is_dispatcher": True if the Aggregator is a Dispatcher. is_data_logger and is_online_monitor take precedence * NOTE: At least ONE of these three parameters must be specified. * "xmlrpc_client_list" (Default: ""): List of XMLRPC addresses of other applications in the artdaq system * "subrun_size_MB" (Default: 0): Maximum size for Aggregator-based subrun rollover * "subrun_duration" (Dfeault: 0): Maximum time for Aggregator-based subrun rollover * "subrun_event_count" (Default: 0): Maximum event count for Aggregator-based subrun rollover * "inrun_recv_timeout_usec" (Default: 100000): Amount of time to wait for new events while running * "endrun_recv_timeout_usec" (Default: 20000000): Amount of time to wait for additional events at EndOfRun * "pause_recv_timeout_usec" (Default: 3000000): Amount of time to wait for additional events at PauseRun * "onmon_event_prescale" (Default: 1): Only send 1/N events to art for online monitoring (requires is_data_logger: true) * "filesize_check_interval_seconds" (Default: 20): Interval to check the file size when using Aggregator-based subrun rollover * "filesize_check_interval_events" (Default: 20): Interval to check the file size when using Aggregator-based subrun rollover * "metrics": FHiCL table containing configuration for MetricManager * "outputs" (REQUIRED): FHiCL table containing output parameters * "normalOutput" (REQUIRED): FHiCL table containing default output parameters * "fileName" (Default: ""): Name template of the output file. Used to determine output directory *
Note that the "aggregator" ParameterSet is also used to configure the EventStore. See that class' documentation for more information.
Definition at line 89 of file AggregatorCore.cc.
|
delete |
Copy Assignment operator is deleted.
bool artdaq::AggregatorCore::pause | ( | ) |
Pauses the AggregatorCore.
Definition at line 371 of file AggregatorCore.cc.
size_t artdaq::AggregatorCore::process_fragments | ( | ) |
The main working loop of the AggregatorCore. Receives events from DataReceiverManager and processes them according to the Aggreagtor's configuration.
process_fragments first receives an event from DataReceiverManager, and checks the validity of the sender rank. If the Aggregator is a Data Logger, it checks the onmon presale and if the event passes, it sends it to any online monitors or dispatchers. If the Aggregator is a dispatcher, it saves the event if it is the init event, for later re-sending. It will dispatch the event to any connected monitors. The event is then sent to the EventStore for art processing. If the Aggregator is a Data Logger, it will check for configured Aggregator-based subrun rollover.
Definition at line 429 of file AggregatorCore.cc.
std::string artdaq::AggregatorCore::register_monitor | ( | fhicl::ParameterSet const & | pset | ) |
Create a new TransferInterface instance using the given configuration.
pset | ParameterSet used to configure the TransferInterface |
See TransferInterface for details on the expected configuration
Definition at line 1033 of file AggregatorCore.cc.
bool artdaq::AggregatorCore::reinitialize | ( | fhicl::ParameterSet const & | pset | ) |
Reinitializes the AggregatorCore. No-Op.
pset | ParameterSet for configuring AggregatorCore |
Definition at line 421 of file AggregatorCore.cc.
std::string artdaq::AggregatorCore::report | ( | std::string const & | which | ) | const |
Send a report on a given run-time quantity.
which | Which quantity to report |
report accepts the following values of "which": "event_count": The number of events received, or -1 if not initialized "run_duration": The time that the current run has been running for, or the previous if not running "file_size": The size of the latest file written, or being written "subrun_number": The current subrun number, or -1 if not initialized "incomplete_event_count": The number of incomplete event bunches in the EventStore, or -1 if not initalized
Anything else will return the run number and an error message.
Definition at line 957 of file AggregatorCore.cc.
bool artdaq::AggregatorCore::resume | ( | ) |
Resumes the AggregatorCore.
Definition at line 384 of file AggregatorCore.cc.
bool artdaq::AggregatorCore::shutdown | ( | ) |
Shuts Down the AggregatorCore.
Definition at line 396 of file AggregatorCore.cc.
bool artdaq::AggregatorCore::soft_initialize | ( | fhicl::ParameterSet const & | pset | ) |
Soft-Initializes the AggregatorCore. No-Op.
pset | ParameterSet for configuring AggregatorCore |
Definition at line 413 of file AggregatorCore.cc.
bool artdaq::AggregatorCore::start | ( | art::RunID | id | ) |
Start the AggregatorCore.
id | Run ID of the current run |
Definition at line 340 of file AggregatorCore.cc.
bool artdaq::AggregatorCore::stop | ( | ) |
Stops the AggregatorCore.
Definition at line 358 of file AggregatorCore.cc.
std::string artdaq::AggregatorCore::unregister_monitor | ( | std::string const & | label | ) |
Delete the TransferInterface having the given unique label.
label | Label of the TransferInterface to delete |
Definition at line 1069 of file AggregatorCore.cc.