artdaq  v3_00_03
DataLoggerCore.cc
1 #include <errno.h>
2 #include <sstream>
3 #include <iomanip>
4 #include <bitset>
5 
6 #include <boost/tokenizer.hpp>
7 #include <boost/filesystem.hpp>
8 #include <boost/algorithm/string.hpp>
9 #include "art/Framework/Art/artapp.h"
10 #include "cetlib/BasicPluginFactory.h"
11 
12 #define TRACE_NAME "DataLoggerCore"
13 #include "artdaq/DAQdata/Globals.hh"
14 #include "artdaq-core/Core/SimpleMemoryReader.hh"
15 #include "artdaq-core/Utilities/ExceptionHandler.hh"
16 #include "artdaq-core/Data/RawEvent.hh"
17 
18 #include "artdaq/Application/DataLoggerCore.hh"
19 #include "artdaq/DAQrate/detail/FragCounter.hh"
20 #include "artdaq/TransferPlugins/MakeTransferPlugin.hh"
21 
24 {
25 }
26 
28 {
29  TLOG_DEBUG(app_name) << "Destructor" << TLOG_ENDL;
30 }
31 
32 bool artdaq::DataLoggerCore::initialize(fhicl::ParameterSet const& pset)
33 {
34  TLOG_DEBUG(app_name) << "initialize method called with DAQ " << "ParameterSet = \"" << pset.to_string() << "\"." << TLOG_ENDL;
35 
36  // pull out the relevant parts of the ParameterSet
37  fhicl::ParameterSet daq_pset;
38  try
39  {
40  daq_pset = pset.get<fhicl::ParameterSet>("daq");
41  }
42  catch (...)
43  {
44  TLOG_ERROR(app_name)
45  << "Unable to find the DAQ parameters in the initialization "
46  << "ParameterSet: \"" + pset.to_string() + "\"." << TLOG_ENDL;
47  return false;
48  }
49  fhicl::ParameterSet agg_pset;
50  try
51  {
52  agg_pset = daq_pset.get<fhicl::ParameterSet>("datalogger", daq_pset.get<fhicl::ParameterSet>("aggregator"));
53  }
54  catch (...)
55  {
56  TLOG_ERROR(app_name)
57  << "Unable to find the DataLogger parameters in the DAQ "
58  << "initialization ParameterSet: \"" + daq_pset.to_string() + "\"." << TLOG_ENDL;
59  return false;
60  }
61 
62  // initialize the MetricManager and the names of our metrics
63  fhicl::ParameterSet metric_pset;
64 
65  try
66  {
67  metric_pset = daq_pset.get<fhicl::ParameterSet>("metrics");
68  }
69  catch (...) {} // OK if there's no metrics table defined in the FHiCL
70 
71 
72  return initializeDataReceiver(pset, agg_pset, metric_pset);
73 }
DataReceiverCore implements the state machine for the DataReceiver artdaq application. DataReceiverCore receives Fragment objects from the DataReceiverManager, and sends them to the EventStore.
bool initialize(fhicl::ParameterSet const &pset) override
Processes the initialize request.
DataLoggerCore()
DataLoggerCore Constructor.