Belle II Software  release-08-01-10
FacetFilterFactory.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/facet/FacetFilterFactory.h>
9 
10 #include <tracking/trackFindingCDC/filters/facet/BaseFacetFilter.h>
11 #include <tracking/trackFindingCDC/filters/facet/AllFacetFilter.h>
12 #include <tracking/trackFindingCDC/filters/facet/MCFacetFilter.h>
13 #include <tracking/trackFindingCDC/filters/facet/FeasibleRLFacetFilter.h>
14 #include <tracking/trackFindingCDC/filters/facet/SimpleFacetFilter.h>
15 #include <tracking/trackFindingCDC/filters/facet/RealisticFacetFilter.h>
16 #include <tracking/trackFindingCDC/filters/facet/Chi2FacetFilter.h>
17 #include <tracking/trackFindingCDC/filters/facet/UnionRecordingFacetFilter.h>
18 #include <tracking/trackFindingCDC/filters/facet/MVAFacetFilter.h>
19 
20 #include <tracking/trackFindingCDC/filters/base/NoneFilter.icc.h>
21 
22 #include <tracking/trackFindingCDC/filters/base/FilterFactory.icc.h>
23 
24 
25 using namespace Belle2;
26 using namespace TrackFindingCDC;
27 
29 
30 FacetFilterFactory::FacetFilterFactory(const std::string& defaultFilterName)
31  : Super(defaultFilterName)
32 {
33 }
34 
36 {
37  return "Facet";
38 }
39 
41 {
42  return "Facet filter to construct of a facet network";
43 }
44 
45 std::map<std::string, std::string> FacetFilterFactory::getValidFilterNamesAndDescriptions() const
46 {
47  return {
48  {"none", "no facet is valid, stop at cluster generation."},
49  {"all", "all facets are valid"},
50  {"truth", "monte carlo truth"},
51  {"feasible", "only checking the feasability of right left passage information"},
52  {"simple", "mc free with simple criteria"},
53  {"realistic", "mc free with realistic criteria"},
54  {"realistic_loss", "mc with realistice criteria but losser cut"},
55  {"chi2", "mc free based on chi2 fitting"},
56  {"chi2_old", "old based on chi2 fitting with single cut regardless of superlayer"},
57  {"unionrecording", "record many multiple choosable variable set"},
58  {"mva", "filter facets with a mva method"},
59  };
60 }
61 
62 std::unique_ptr<BaseFacetFilter> FacetFilterFactory::create(const std::string& filterName) const
63 {
64  if (filterName == "none") {
65  return std::make_unique<NoneFilter<BaseFacetFilter>>();
66  // cppcheck-suppress knownConditionTrueFalse
67  } else if (filterName == "all") {
68  return std::make_unique<AllFacetFilter>();
69  // cppcheck-suppress knownConditionTrueFalse
70  } else if (filterName == "truth") {
71  return std::make_unique<MCFacetFilter>();
72  // cppcheck-suppress knownConditionTrueFalse
73  } else if (filterName == "feasible") {
74  return std::make_unique<FeasibleRLFacetFilter>();
75  // cppcheck-suppress knownConditionTrueFalse
76  } else if (filterName == "simple") {
77  return std::make_unique<SimpleFacetFilter>();
78  // cppcheck-suppress knownConditionTrueFalse
79  } else if (filterName == "realistic") {
80  return std::make_unique<RealisticFacetFilter>();
81  // cppcheck-suppress knownConditionTrueFalse
82  } else if (filterName == "realistic_loss") {
83  return std::make_unique<RealisticFacetFilter>(25);
84  // cppcheck-suppress knownConditionTrueFalse
85  } else if (filterName == "chi2") {
86  return std::make_unique<Chi2FacetFilter>();
87  // cppcheck-suppress knownConditionTrueFalse
88  } else if (filterName == "chi2_old") {
89  return std::make_unique<Chi2FacetFilter>(75.0, 120.0);
90  // cppcheck-suppress knownConditionTrueFalse
91  } else if (filterName == "unionrecording") {
92  return std::make_unique<UnionRecordingFacetFilter>();
93  // cppcheck-suppress knownConditionTrueFalse
94  } else if (filterName == "mva") {
95  return std::make_unique<MVAFacetFilter>();
96  } else {
97  return Super::create(filterName);
98  }
99 }
std::map< std::string, std::string > getValidFilterNamesAndDescriptions() const final
Getter for valid filter names and a description for each.
std::unique_ptr< BaseFacetFilter > create(const std::string &filterName) const final
Create a filter with the given name.
std::string getFilterPurpose() const final
Getter for a descriptive purpose of the constructed filters.
FacetFilterFactory(const std::string &defaultFilterName="chi2")
Constructor forwarding the default filter name.
std::string getIdentifier() const final
Getter for a short identifier for the factory.
virtual std::unique_ptr< BaseFacetFilter > 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.