Line data Source code
1 : #include "TRACE/tracemf.h"
2 : #include "artdaq/DAQdata/Globals.hh" // include these 2 first -
3 : #define TRACE_NAME (app_name + "_EventBuilderCore").c_str()
4 :
5 : #include "artdaq/Application/EventBuilderCore.hh"
6 :
7 : #include "fhiclcpp/ParameterSet.h"
8 :
9 : #include <iomanip>
10 :
11 0 : bool artdaq::EventBuilderCore::initialize(fhicl::ParameterSet const& pset)
12 : {
13 0 : TLOG(TLVL_DEBUG + 32) << "initialize method called with DAQ "
14 0 : << "ParameterSet = \"" << pset.to_string() << "\".";
15 :
16 : // pull out the relevant parts of the ParameterSet
17 0 : fhicl::ParameterSet daq_pset;
18 : try
19 : {
20 0 : daq_pset = pset.get<fhicl::ParameterSet>("daq");
21 : }
22 0 : catch (...)
23 : {
24 0 : TLOG(TLVL_ERROR)
25 0 : << "Unable to find the DAQ parameters in the initialization "
26 0 : << "ParameterSet: \"" + pset.to_string() + "\".";
27 0 : return false;
28 0 : }
29 0 : fhicl::ParameterSet evb_pset;
30 : try
31 : {
32 0 : evb_pset = daq_pset.get<fhicl::ParameterSet>("event_builder");
33 :
34 : // We are going to change the default from true to false for the "send_init_fragments" parameter
35 : // EventBuilders almost always do NOT receive init Fragments from upstream to send to art
36 0 : if (!evb_pset.has_key("send_init_fragments"))
37 : {
38 0 : evb_pset.put<bool>("send_init_fragments", false);
39 : }
40 : }
41 0 : catch (...)
42 : {
43 0 : TLOG(TLVL_ERROR)
44 0 : << "Unable to find the event_builder parameters in the DAQ "
45 0 : << "initialization ParameterSet: \"" + daq_pset.to_string() + "\".";
46 0 : return false;
47 0 : }
48 :
49 0 : fhicl::ParameterSet metric_pset = daq_pset.get<fhicl::ParameterSet>("metrics", fhicl::ParameterSet());
50 :
51 0 : return initializeDataReceiver(pset, evb_pset, metric_pset);
52 0 : }
|