00001 #include <errno.h>
00002 #include <sstream>
00003 #include <iomanip>
00004 #include <bitset>
00005
00006 #include <boost/tokenizer.hpp>
00007 #include <boost/filesystem.hpp>
00008 #include <boost/algorithm/string.hpp>
00009 #include "art/Framework/Art/artapp.h"
00010 #include "cetlib/BasicPluginFactory.h"
00011
00012 #define TRACE_NAME (app_name + "_DataLoggerCore").c_str() // include these 2 first -
00013 #include "artdaq/DAQdata/Globals.hh"
00014 #include "artdaq-core/Core/SimpleMemoryReader.hh"
00015 #include "artdaq-core/Utilities/ExceptionHandler.hh"
00016 #include "artdaq-core/Data/RawEvent.hh"
00017
00018 #include "artdaq/Application/DataLoggerCore.hh"
00019 #include "artdaq/DAQrate/detail/FragCounter.hh"
00020 #include "artdaq/TransferPlugins/MakeTransferPlugin.hh"
00021
00022 artdaq::DataLoggerCore::DataLoggerCore()
00023 : DataReceiverCore()
00024 {
00025 }
00026
00027 artdaq::DataLoggerCore::~DataLoggerCore()
00028 {
00029 TLOG(TLVL_DEBUG) << "Destructor" ;
00030 }
00031
00032 bool artdaq::DataLoggerCore::initialize(fhicl::ParameterSet const& pset)
00033 {
00034 TLOG(TLVL_DEBUG) << "initialize method called with DAQ " << "ParameterSet = \"" << pset.to_string() << "\"." ;
00035
00036
00037 fhicl::ParameterSet daq_pset;
00038 try
00039 {
00040 daq_pset = pset.get<fhicl::ParameterSet>("daq");
00041 }
00042 catch (...)
00043 {
00044 TLOG(TLVL_ERROR)
00045 << "Unable to find the DAQ parameters in the initialization "
00046 << "ParameterSet: \"" + pset.to_string() + "\"." ;
00047 return false;
00048 }
00049 fhicl::ParameterSet agg_pset;
00050 try
00051 {
00052 agg_pset = daq_pset.get<fhicl::ParameterSet>("datalogger", daq_pset.get<fhicl::ParameterSet>("aggregator"));
00053 }
00054 catch (...)
00055 {
00056 TLOG(TLVL_ERROR)
00057 << "Unable to find the DataLogger parameters in the DAQ "
00058 << "initialization ParameterSet: \"" + daq_pset.to_string() + "\"." ;
00059 return false;
00060 }
00061
00062
00063 fhicl::ParameterSet metric_pset;
00064
00065 try
00066 {
00067 metric_pset = daq_pset.get<fhicl::ParameterSet>("metrics");
00068 }
00069 catch (...) {}
00070
00071
00072 return initializeDataReceiver(pset, agg_pset, metric_pset);
00073 }