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 catch (...)
00048 {
00049 TLOG(TLVL_ERROR)
00050 << "Unable to find the event_builder parameters in the DAQ "
00051 << "initialization ParameterSet: \"" + daq_pset.to_string() + "\"." ;
00052 return false;
00053 }
00054
00055 fhicl::ParameterSet metric_pset;
00056 try
00057 {
00058 metric_pset = daq_pset.get<fhicl::ParameterSet>("metrics");
00059 }
00060 catch (...) {}
00061
00062 return initializeDataReceiver(pset,evb_pset, metric_pset);
00063 }