1 #ifndef artdaq_ArtModules_ArtdaqFragmentNamingService_h
2 #define artdaq_ArtModules_ArtdaqFragmentNamingService_h
4 #include "art/Framework/Services/Registry/ServiceMacros.h"
5 #include "artdaq-core/Data/FragmentNameHelper.hh"
6 #include "fhiclcpp/types/Atom.h"
28 : nameHelper_(nullptr)
30 auto unidentified_instance_name = ps.get<std::string>(
"unidentified_instance_name",
"unidentified");
31 auto extraTypes = ps.get<std::vector<std::pair<artdaq::Fragment::type_t, std::string>>>(
"fragment_type_map", std::vector<std::pair<artdaq::Fragment::type_t, std::string>>());
32 auto fragmentNameHelperPluginType = ps.get<std::string>(
"helper_plugin",
"Artdaq");
34 nameHelper_ = artdaq::makeNameHelper(fragmentNameHelperPluginType, unidentified_instance_name, extraTypes);
40 std::string
GetInstanceNameForType(artdaq::Fragment::type_t type_id)
const {
return nameHelper_->GetInstanceNameForType(type_id); }
57 std::pair<bool, std::string>
60 std::string GetUnidentifiedInstanceName()
const {
return nameHelper_->GetUnidentifiedInstanceName(); }
63 std::shared_ptr<artdaq::FragmentNameHelper> nameHelper_;
ArtdaqFragmentNamingServiceInterface(fhicl::ParameterSet const &ps)
ArtdaqFragmentNamingServiceInterface constructor.
virtual ~ArtdaqFragmentNamingServiceInterface()=default
Default virtual destructor.
std::pair< bool, std::string > GetInstanceNameForFragment(artdaq::Fragment const &fragment) const
Returns the product instance name for the specified fragment, based on the types that have been speci...
std::set< std::string > GetAllProductInstanceNames() const
Returns the full set of product instance names which may be present in the data, based on the types t...
ArtdaqFragmentNamingService extends ArtdaqFragmentNamingServiceInterface. This implementation uses th...
std::string GetInstanceNameForType(artdaq::Fragment::type_t type_id) const
Returns the basic translation for the specified type. Must be implemented by derived classes...
Interface for ArtdaqFragmentNamingService. This interface is declared to art as part of the required ...