artdaq  v3_07_01
DataLoggerCore.cc
1 #include <errno.h>
2 #include <bitset>
3 #include <iomanip>
4 #include <sstream>
5 
6 #include <boost/algorithm/string.hpp>
7 #include <boost/filesystem.hpp>
8 #include <boost/tokenizer.hpp>
9 #include "art/Framework/Art/artapp.h"
10 #include "cetlib/BasicPluginFactory.h"
11 
12 #include "artdaq/DAQdata/Globals.hh" // include these 2 first -
13 #define TRACE_NAME (app_name + "_DataLoggerCore").c_str()
14 #include "artdaq-core/Core/SimpleMemoryReader.hh"
15 #include "artdaq-core/Data/RawEvent.hh"
16 #include "artdaq-core/Utilities/ExceptionHandler.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(TLVL_DEBUG) << "Destructor";
30 }
31 
32 bool artdaq::DataLoggerCore::initialize(fhicl::ParameterSet const& pset)
33 {
34  TLOG(TLVL_DEBUG) << "initialize method called with DAQ "
35  << "ParameterSet = \"" << pset.to_string() << "\".";
36 
37  // pull out the relevant parts of the ParameterSet
38  fhicl::ParameterSet daq_pset;
39  try
40  {
41  daq_pset = pset.get<fhicl::ParameterSet>("daq");
42  }
43  catch (...)
44  {
45  TLOG(TLVL_ERROR)
46  << "Unable to find the DAQ parameters in the initialization "
47  << "ParameterSet: \"" + pset.to_string() + "\".";
48  return false;
49  }
50  fhicl::ParameterSet agg_pset;
51  try
52  {
53  agg_pset = daq_pset.get<fhicl::ParameterSet>("datalogger", daq_pset.get<fhicl::ParameterSet>("aggregator"));
54  }
55  catch (...)
56  {
57  TLOG(TLVL_ERROR)
58  << "Unable to find the DataLogger parameters in the DAQ "
59  << "initialization ParameterSet: \"" + daq_pset.to_string() + "\".";
60  return false;
61  }
62 
63  // initialize the MetricManager and the names of our metrics
64  fhicl::ParameterSet metric_pset;
65 
66  try
67  {
68  metric_pset = daq_pset.get<fhicl::ParameterSet>("metrics");
69  }
70  catch (...)
71  {} // OK if there's no metrics table defined in the FHiCL
72 
73  return initializeDataReceiver(pset, agg_pset, metric_pset);
74 }
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.