artdaq  v3_10_02
DataLoggerCore.cc
1 #include <bitset>
2 #include <cerrno>
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/Data/RawEvent.hh"
15 #include "artdaq-core/Utilities/ExceptionHandler.hh"
16 
17 #include "artdaq/Application/DataLoggerCore.hh"
18 #include "artdaq/DAQrate/detail/FragCounter.hh"
19 #include "artdaq/TransferPlugins/MakeTransferPlugin.hh"
20 
21 bool artdaq::DataLoggerCore::initialize(fhicl::ParameterSet const& pset)
22 {
23  TLOG(TLVL_DEBUG) << "initialize method called with DAQ "
24  << "ParameterSet = \"" << pset.to_string() << "\".";
25 
26  // pull out the relevant parts of the ParameterSet
27  fhicl::ParameterSet daq_pset;
28  try
29  {
30  daq_pset = pset.get<fhicl::ParameterSet>("daq");
31  }
32  catch (...)
33  {
34  TLOG(TLVL_ERROR)
35  << "Unable to find the DAQ parameters in the initialization "
36  << "ParameterSet: \"" + pset.to_string() + "\".";
37  return false;
38  }
39  fhicl::ParameterSet agg_pset;
40  try
41  {
42  agg_pset = daq_pset.get<fhicl::ParameterSet>("datalogger", daq_pset.get<fhicl::ParameterSet>("aggregator"));
43  }
44  catch (...)
45  {
46  TLOG(TLVL_ERROR)
47  << "Unable to find the DataLogger parameters in the DAQ "
48  << "initialization ParameterSet: \"" + daq_pset.to_string() + "\".";
49  return false;
50  }
51 
52  // initialize the MetricManager and the names of our metrics
53  fhicl::ParameterSet metric_pset;
54 
55  try
56  {
57  metric_pset = daq_pset.get<fhicl::ParameterSet>("metrics");
58  }
59  catch (...)
60  {} // OK if there's no metrics table defined in the FHiCL
61 
62  return initializeDataReceiver(pset, agg_pset, metric_pset);
63 }
bool initialize(fhicl::ParameterSet const &pset) override
Processes the initialize request.
bool initializeDataReceiver(fhicl::ParameterSet const &pset, fhicl::ParameterSet const &data_pset, fhicl::ParameterSet const &metric_pset)
Initialize the DataReceiverCore (should be called from initialize() overrides.