$treeview $search $mathjax $extrastylesheet
artdaq
v3_04_00
$projectbrief
|
$projectbrief
|
$searchbox |
00001 #ifndef artdaq_Application_MPI2_DataReceiverCore_hh 00002 #define artdaq_Application_MPI2_DataReceiverCore_hh 00003 00004 #include <string> 00005 #include <atomic> 00006 #include <map> 00007 00008 #include "fhiclcpp/ParameterSet.h" 00009 #include "canvas/Persistency/Provenance/RunID.h" 00010 00011 #include "artdaq-utilities/Plugins/MetricManager.hh" 00012 00013 #include "artdaq/DAQrate/DataReceiverManager.hh" 00014 #include "artdaq/Application/StatisticsHelper.hh" 00015 00016 namespace artdaq 00017 { 00018 class DataReceiverCore; 00019 } 00020 00025 class artdaq::DataReceiverCore 00026 { 00027 public: 00028 00032 DataReceiverCore(); 00033 00037 DataReceiverCore(DataReceiverCore const&) = delete; 00038 00042 virtual ~DataReceiverCore(); 00043 00048 DataReceiverCore& operator=(DataReceiverCore const&) = delete; 00049 00069 virtual bool initialize(fhicl::ParameterSet const& pset) = 0; 00070 00076 bool start(art::RunID id); 00077 00082 bool stop(); 00083 00088 bool pause(); 00089 00094 bool resume(); 00095 00100 bool shutdown(); 00101 00107 bool soft_initialize(fhicl::ParameterSet const& pset); 00108 00114 bool reinitialize(fhicl::ParameterSet const& pset); 00115 00122 bool rollover_subrun(uint64_t eventNum, uint32_t subrun); 00123 00135 std::string report(std::string const& which) const; 00136 00142 bool add_config_archive_entry(std::string const& key, std::string const& value) 00143 { 00144 config_archive_entries_[key] = value; 00145 return true; 00146 } 00147 00151 bool clear_config_archive() 00152 { 00153 config_archive_entries_.clear(); 00154 return config_archive_entries_.empty(); 00155 } 00156 00157 protected: 00165 bool initializeDataReceiver(fhicl::ParameterSet const& pset, fhicl::ParameterSet const& data_pset, fhicl::ParameterSet const& metric_pset); 00166 00167 std::unique_ptr<DataReceiverManager> receiver_ptr_; 00168 std::shared_ptr<SharedMemoryEventManager> event_store_ptr_; 00169 std::atomic<bool> stop_requested_; 00170 std::atomic<bool> pause_requested_; 00171 std::atomic<bool> run_is_paused_; 00172 bool verbose_; 00173 00174 fhicl::ParameterSet art_pset_; 00175 std::map<std::string, std::string> config_archive_entries_; 00176 00181 void logMessage_(std::string const& text); 00182 }; 00183 00184 #endif /* artdaq_Application_MPI2_DataReceiverCore_hh */