DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
CreateGenericReceiver.hpp
Go to the documentation of this file.
1
8#ifndef ASIOLIBS_SRC_CREATEGENERICRECEIVER_HPP_
9#define ASIOLIBS_SRC_CREATEGENERICRECEIVER_HPP_
10
13
16
18
19#include <memory>
20#include <string>
21
23DUNE_DAQ_TYPESTRING(dunedaq::fddetdataformats::CRTGrenobleFrame, "CRTGrenobleFrame")
24
25namespace dunedaq::asiolibs {
26
27std::shared_ptr<GenericReceiverConcept>
28createGenericReceiver(const std::string& receiver_connection_name)
29{
30 const auto datatypes = dunedaq::iomanager::IOManager::get()->get_datatypes(receiver_connection_name);
31 if (datatypes.size() != 1) {
32 ers::error(datahandlinglibs::GenericConfigurationError(ERS_HERE,
33 "Multiple input data types specified! Expected only a single type!"));
34 }
35 const std::string dt = *datatypes.begin();
36 TLOG() << "Choosing specializations for GenericReceiverConcept for input connection "
37 << " [uid:" << receiver_connection_name << " , data_type:" << dt << ']';
38
39 if (dt.find("CRTBernFrame") != std::string::npos) {
40 return std::make_shared<GenericReceiverModel<fddetdataformats::CRTBernFrame>>(receiver_connection_name);
41 } else if (dt.find("CRTGrenobleFrame") != std::string::npos) {
42 return std::make_shared<GenericReceiverModel<fddetdataformats::CRTGrenobleFrame>>(receiver_connection_name);
43 }
44
45 return nullptr;
46}
47
48} // namespace dunedaq::asiolibs
49
50#endif // ASIOLIBS_SRC_CREATEGENERICRECEIVER_HPP_
#define ERS_HERE
#define DUNE_DAQ_TYPESTRING(Type, typestring)
Declare the datatype_to_string method for the given type.
static std::shared_ptr< IOManager > get()
Definition IOManager.hpp:40
#define TLOG(...)
Definition macro.hpp:22
std::shared_ptr< GenericReceiverConcept > createGenericReceiver(const std::string &receiver_connection_name)
Including Qt Headers.
Definition module.cpp:16
void error(const Issue &issue)
Definition ers.hpp:92
Struct for accessing/holding raw CRT data from the 'Bern' panels ProtoDUNE-II VD.