Belle II Software development
FacetRelationFilterFactory.cc
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8#include <tracking/trackFindingCDC/filters/facetRelation/FacetRelationFilterFactory.h>
9
10#include <tracking/trackFindingCDC/filters/facetRelation/BaseFacetRelationFilter.h>
11#include <tracking/trackFindingCDC/filters/facetRelation/AllFacetRelationFilter.h>
12#include <tracking/trackFindingCDC/filters/facetRelation/MCFacetRelationFilter.h>
13#include <tracking/trackFindingCDC/filters/facetRelation/SimpleFacetRelationFilter.h>
14#include <tracking/trackFindingCDC/filters/facetRelation/Chi2FacetRelationFilter.h>
15#include <tracking/trackFindingCDC/filters/facetRelation/UnionRecordingFacetRelationFilter.h>
16#include <tracking/trackFindingCDC/filters/facetRelation/MVAFacetRelationFilter.h>
17
18#include <tracking/trackFindingCDC/filters/base/NoneFilter.icc.h>
19
20#include <tracking/trackFindingCDC/filters/base/FilterFactory.icc.h>
21
22
23using namespace Belle2;
24using namespace TrackFindingCDC;
25
27
28FacetRelationFilterFactory::FacetRelationFilterFactory(const std::string& defaultFilterName)
29 : Super(defaultFilterName)
30{
31}
32
34{
35 return "FacetRelation";
36}
37
39{
40 return "Facet relation filter to construct of a facet network";
41}
42
43std::map<std::string, std::string>
45{
46 return {
47 {"none", "no facet relation is valid, stop at facet creation."},
48 {"all", "all facet relations are valid"},
49 {"truth", "facet relations from monte carlo truth"},
50 {"simple", "mc free with simple criteria"},
51 {"chi2", "mc free based on chi2 fitting"},
52 {"chi2_old", "old based on chi2 fitting with single cut regardless of superlayer"},
53 {"unionrecording", "record multiple choosable variable sets"},
54 {"mva", "filter facets with a mva method"},
55 };
56}
57
58std::unique_ptr<BaseFacetRelationFilter >
59FacetRelationFilterFactory::create(const std::string& filterName) const
60{
61 if (filterName == "none") {
62 return std::make_unique<NoneFilter<BaseFacetRelationFilter>>();
63 // cppcheck-suppress knownConditionTrueFalse
64 } else if (filterName == "all") {
65 return std::make_unique<AllFacetRelationFilter>();
66 // cppcheck-suppress knownConditionTrueFalse
67 } else if (filterName == "truth") {
68 return std::make_unique<MCFacetRelationFilter>();
69 // cppcheck-suppress knownConditionTrueFalse
70 } else if (filterName == "simple") {
71 return std::make_unique<SimpleFacetRelationFilter>();
72 // cppcheck-suppress knownConditionTrueFalse
73 } else if (filterName == "chi2") {
74 return std::make_unique<Chi2FacetRelationFilter>();
75 // cppcheck-suppress knownConditionTrueFalse
76 } else if (filterName == "chi2_old") {
77 return std::make_unique<Chi2FacetRelationFilter>(130.0, 200.0);
78 // cppcheck-suppress knownConditionTrueFalse
79 } else if (filterName == "unionrecording") {
80 return std::make_unique<UnionRecordingFacetRelationFilter>();
81 // cppcheck-suppress knownConditionTrueFalse
82 } else if (filterName == "mva") {
83 return std::make_unique<MVAFacetRelationFilter>();
84 } else {
85 return Super::create(filterName);
86 }
87}
std::unique_ptr< BaseFacetRelationFilter > create(const std::string &filterName) const override
Create a filter with the given name.
std::map< std::string, std::string > getValidFilterNamesAndDescriptions() const override
Getter for valid filter names and a description for each.
std::string getIdentifier() const override
Getter for a short identifier for the factory.
FacetRelationFilterFactory(const std::string &defaultFilterName="chi2")
Constructor forwarding the default filter name.
std::string getFilterPurpose() const override
Getter for a descriptive purpose of the constructed filters.
Factory that can create appropriate filter instances from a name.
virtual std::unique_ptr< BaseFacetRelationFilter > create(const std::string &filterName) const
Create a filter with the given name, does not set filter specific parameters.
Abstract base class for different kinds of events.