Belle II Software  release-08-01-10
SegmentPairFilterFactory.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/segmentPair/SegmentPairFilterFactory.h>
9 
10 #include <tracking/trackFindingCDC/filters/segmentPair/BaseSegmentPairFilter.h>
11 #include <tracking/trackFindingCDC/filters/segmentPair/AllSegmentPairFilter.h>
12 #include <tracking/trackFindingCDC/filters/segmentPair/MCSegmentPairFilter.h>
13 #include <tracking/trackFindingCDC/filters/segmentPair/FitlessSegmentPairFilter.h>
14 #include <tracking/trackFindingCDC/filters/segmentPair/SimpleSegmentPairFilter.h>
15 #include <tracking/trackFindingCDC/filters/segmentPair/UnionRecordingSegmentPairFilter.h>
16 #include <tracking/trackFindingCDC/filters/segmentPair/MVAFeasibleSegmentPairFilter.h>
17 #include <tracking/trackFindingCDC/filters/segmentPair/MVARealisticSegmentPairFilter.h>
18 
19 #include <tracking/trackFindingCDC/filters/base/NoneFilter.icc.h>
20 #include <tracking/trackFindingCDC/filters/base/FilterFactory.icc.h>
21 
22 
23 using namespace Belle2;
24 using namespace TrackFindingCDC;
25 
27 
28 SegmentPairFilterFactory::SegmentPairFilterFactory(const std::string& defaultFilterName)
29  : Super(defaultFilterName)
30 {
31 }
32 
34 {
35  return "SegmentPair";
36 }
37 
39 {
40  return "Segment pair filter to construct of a segment pair network";
41 }
42 
43 std::map<std::string, std::string>
45 {
46  return {
47  {"none", "no segment pair is valid"},
48  {"all", "all segment pairs are valid"},
49  {"truth", "monte carlo truth"},
50  {"fitless", "mc free with simple criteria without the common fit"},
51  {"simple", "mc free with simple criteria"},
52  {"unionrecording", "record many multiple choosable variable set"},
53  {"feasible", "multivariat method based on variables of the first and last hit in each segment meant as precut"},
54  {"realistic", "realistic filter using a common fit and combination of all information with an mva"},
55  };
56 }
57 
58 std::unique_ptr<Filter<CDCSegmentPair> >
59 SegmentPairFilterFactory::create(const std::string& filterName) const
60 {
61  if (filterName == "none") {
62  return std::make_unique<NoneFilter<BaseSegmentPairFilter>>();
63  // cppcheck-suppress knownConditionTrueFalse
64  } else if (filterName == "all") {
65  return std::make_unique<AllSegmentPairFilter>();
66  // cppcheck-suppress knownConditionTrueFalse
67  } else if (filterName == "truth") {
68  return std::make_unique<MCSegmentPairFilter>();
69  // cppcheck-suppress knownConditionTrueFalse
70  } else if (filterName == "fitless") {
71  return std::make_unique<FitlessSegmentPairFilter>();
72  // cppcheck-suppress knownConditionTrueFalse
73  } else if (filterName == "simple") {
74  return std::make_unique<SimpleSegmentPairFilter>();
75  // cppcheck-suppress knownConditionTrueFalse
76  } else if (filterName == "unionrecording") {
77  return std::make_unique<UnionRecordingSegmentPairFilter>();
78  // cppcheck-suppress knownConditionTrueFalse
79  } else if (filterName == "feasible") {
80  return std::make_unique<MVAFeasibleSegmentPairFilter>();
81  // cppcheck-suppress knownConditionTrueFalse
82  } else if (filterName == "realistic") {
83  return std::make_unique<MVARealisticSegmentPairFilter>();
84  } else {
85  return Super::create(filterName);
86  }
87 }
virtual std::unique_ptr< BaseSegmentPairFilter > create(const std::string &filterName) const
Create a filter with the given name, does not set filter specific parameters.
std::unique_ptr< BaseSegmentPairFilter > create(const std::string &filterName) const final
Create a filter with the given name.
std::map< std::string, std::string > getValidFilterNamesAndDescriptions() const final
Getter for valid filter names and a description for each.
std::string getFilterPurpose() const final
Getter for a descriptive purpose of the constructed filters.
SegmentPairFilterFactory(const std::string &defaultFilterName="realistic")
Constructor forwarding the default filter name.
std::string getIdentifier() const final
Getter for a short identifier for the factory.
Abstract base class for different kinds of events.