00001 #include "canvas/Utilities/Exception.h"
00002 #include "art/Framework/Art/artapp.h"
00003
00004 #define TRACE_NAME (app_name + "_EventBuilderCore").c_str() // include these 2 first -
00005 #include "artdaq/DAQdata/Globals.hh"
00006 #include "artdaq-core/Core/SimpleMemoryReader.hh"
00007 #include "artdaq-core/Utilities/ExceptionHandler.hh"
00008
00009 #include "artdaq/Application/EventBuilderCore.hh"
00010 #include "artdaq/TransferPlugins/TransferInterface.hh"
00011
00012 #include <iomanip>
00013
00014 artdaq::EventBuilderCore::EventBuilderCore()
00015 : DataReceiverCore()
00016 {
00017 }
00018
00019 artdaq::EventBuilderCore::~EventBuilderCore()
00020 {
00021 TLOG(TLVL_DEBUG) << "Destructor" ;
00022 }
00023
00024 bool artdaq::EventBuilderCore::initialize(fhicl::ParameterSet const& pset)
00025 {
00026 TLOG(TLVL_DEBUG) << "initialize method called with DAQ "
00027 << "ParameterSet = \"" << pset.to_string() << "\"." ;
00028
00029
00030 fhicl::ParameterSet daq_pset;
00031 try
00032 {
00033 daq_pset = pset.get<fhicl::ParameterSet>("daq");
00034 }
00035 catch (...)
00036 {
00037 TLOG(TLVL_ERROR)
00038 << "Unable to find the DAQ parameters in the initialization "
00039 << "ParameterSet: \"" + pset.to_string() + "\"." ;
00040 return false;
00041 }
00042 fhicl::ParameterSet evb_pset;
00043 try
00044 {
00045 evb_pset = daq_pset.get<fhicl::ParameterSet>("event_builder");
00046
00047
00048
00049 if (!evb_pset.has_key("send_init_fragments"))
00050 {
00051 evb_pset.put<bool>("send_init_fragments", false);
00052 }
00053 }
00054 catch (...)
00055 {
00056 TLOG(TLVL_ERROR)
00057 << "Unable to find the event_builder parameters in the DAQ "
00058 << "initialization ParameterSet: \"" + daq_pset.to_string() + "\"." ;
00059 return false;
00060 }
00061
00062 fhicl::ParameterSet metric_pset;
00063 try
00064 {
00065 metric_pset = daq_pset.get<fhicl::ParameterSet>("metrics");
00066 }
00067 catch (...) {}
00068
00069 return initializeDataReceiver(pset,evb_pset, metric_pset);
00070 }