artdaq  v3_06_00
EventBuilderCore.cc
1 #include "canvas/Utilities/Exception.h"
2 #include "art/Framework/Art/artapp.h"
3 
4 #include "artdaq/DAQdata/Globals.hh" // include these 2 first -
5 #define TRACE_NAME (app_name + "_EventBuilderCore").c_str()
6 #include "artdaq-core/Core/SimpleMemoryReader.hh"
7 #include "artdaq-core/Utilities/ExceptionHandler.hh"
8 
9 #include "artdaq/Application/EventBuilderCore.hh"
10 #include "artdaq/TransferPlugins/TransferInterface.hh"
11 
12 #include <iomanip>
13 
16 {
17 }
18 
20 {
21  TLOG(TLVL_DEBUG) << "Destructor" ;
22 }
23 
24 bool artdaq::EventBuilderCore::initialize(fhicl::ParameterSet const& pset)
25 {
26  TLOG(TLVL_DEBUG) << "initialize method called with DAQ "
27  << "ParameterSet = \"" << pset.to_string() << "\"." ;
28 
29  // pull out the relevant parts of the ParameterSet
30  fhicl::ParameterSet daq_pset;
31  try
32  {
33  daq_pset = pset.get<fhicl::ParameterSet>("daq");
34  }
35  catch (...)
36  {
37  TLOG(TLVL_ERROR)
38  << "Unable to find the DAQ parameters in the initialization "
39  << "ParameterSet: \"" + pset.to_string() + "\"." ;
40  return false;
41  }
42  fhicl::ParameterSet evb_pset;
43  try
44  {
45  evb_pset = daq_pset.get<fhicl::ParameterSet>("event_builder");
46 
47  // We are going to change the default from true to false for the "send_init_fragments" parameter
48  // EventBuilders almost always do NOT receive init Fragments from upstream to send to art
49  if (!evb_pset.has_key("send_init_fragments"))
50  {
51  evb_pset.put<bool>("send_init_fragments", false);
52  }
53  }
54  catch (...)
55  {
56  TLOG(TLVL_ERROR)
57  << "Unable to find the event_builder parameters in the DAQ "
58  << "initialization ParameterSet: \"" + daq_pset.to_string() + "\"." ;
59  return false;
60  }
61 
62  fhicl::ParameterSet metric_pset;
63  try
64  {
65  metric_pset = daq_pset.get<fhicl::ParameterSet>("metrics");
66  }
67  catch (...) {} // OK if there's no metrics table defined in the FHiCL
68 
69  return initializeDataReceiver(pset,evb_pset, metric_pset);
70 }
bool initialize(fhicl::ParameterSet const &pset) override
Processes the initialize request.
DataReceiverCore implements the state machine for the DataReceiver artdaq application. DataReceiverCore receives Fragment objects from the DataReceiverManager, and sends them to the EventStore.
EventBuilderCore()
EventBuilderCore Constructor.