8#include <tracking/v0Finding/fitter/V0VertexFitterFactory.h>
10#include <tracking/v0Finding/fitter/KFitV0VertexFitter.h>
11#include <tracking/v0Finding/fitter/RaveV0VertexFitter.h>
13#include <framework/logging/Logger.h>
23 typedef std::function<std::unique_ptr<V0VertexFitter>()> CreatorFunction;
26 const std::map<std::string, CreatorFunction>& getRegistry()
28 static const std::map<std::string, CreatorFunction> registry = {
29 {
"KFit", []() -> std::unique_ptr<V0VertexFitter> {
return std::make_unique<KFitV0VertexFitter>();}},
30 {
"Rave", []() -> std::unique_ptr<V0VertexFitter> {
return std::make_unique<RaveV0VertexFitter>();}},
39 const auto& registry = getRegistry();
40 const auto iterator = registry.find(name);
41 if (iterator == registry.end()) {
42 B2FATAL(
"Unknown V0 vertex fitter requested."
43 <<
LogVar(
"requested fitter", name)
46 return iterator->second();
51 std::vector<std::string> names;
52 for (
const auto& entry : getRegistry()) names.push_back(entry.first);
59 for (
const auto& name :
getNames()) {
60 if (not names.empty()) names +=
", ";
static std::string getNamesAsString()
Get the names of all the registered fitters as a single string, for messages and parameter descriptio...
static std::vector< std::string > getNames()
Get the names of all the registered fitters.
static std::unique_ptr< V0VertexFitter > create(const std::string &name)
Create the fitter registered under the given name.
Class to store variables with their name which were sent to the logging service.
Abstract base class for different kinds of events.