Belle II Software  release-08-01-10
SegmentTripleFilterFactory.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/segmentTriple/SegmentTripleFilterFactory.h>
9 
10 #include <tracking/trackFindingCDC/filters/segmentTriple/BaseSegmentTripleFilter.h>
11 #include <tracking/trackFindingCDC/filters/segmentTriple/AllSegmentTripleFilter.h>
12 #include <tracking/trackFindingCDC/filters/segmentTriple/MCSegmentTripleFilter.h>
13 #include <tracking/trackFindingCDC/filters/segmentTriple/SimpleSegmentTripleFilter.h>
14 
15 #include <tracking/trackFindingCDC/filters/base/NoneFilter.icc.h>
16 #include <tracking/trackFindingCDC/filters/base/FilterFactory.icc.h>
17 
18 
19 using namespace Belle2;
20 using namespace TrackFindingCDC;
21 
23 
24 SegmentTripleFilterFactory::SegmentTripleFilterFactory(const std::string& defaultFilterName)
25  : Super(defaultFilterName)
26 {
27 }
28 
30 {
31  return "SegmentTriple";
32 }
33 
35 {
36  return "Segment triple filter to construct of a segment triple network";
37 }
38 
39 std::map<std::string, std::string>
41 {
42  return {
43  {"none", "no segment triple is valid"},
44  {"all", "all segment triples are valid"},
45  {"truth", "monte carlo truth"},
46  {"simple", "mc free with simple criteria"},
47  };
48 }
49 
50 std::unique_ptr<Filter<CDCSegmentTriple> >
51 SegmentTripleFilterFactory::create(const std::string& filterName) const
52 {
53  if (filterName == "none") {
54  return std::make_unique<NoneFilter<BaseSegmentTripleFilter>>();
55  // cppcheck-suppress knownConditionTrueFalse
56  } else if (filterName == "all") {
57  return std::make_unique<AllSegmentTripleFilter>();
58  // cppcheck-suppress knownConditionTrueFalse
59  } else if (filterName == "truth") {
60  return std::make_unique<MCSegmentTripleFilter>();
61  // cppcheck-suppress knownConditionTrueFalse
62  } else if (filterName == "simple") {
63  return std::make_unique<SimpleSegmentTripleFilter>();
64  } else {
65  return Super::create(filterName);
66  }
67 }
virtual std::unique_ptr< BaseSegmentTripleFilter > create(const std::string &filterName) const
Create a filter with the given name, does not set filter specific parameters.
std::unique_ptr< BaseSegmentTripleFilter > 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.
std::string getFilterPurpose() const override
Getter for a descriptive purpose of the constructed filters.
SegmentTripleFilterFactory(const std::string &defaultFilterName="simple")
Constructor forwarding the default filter name.
Abstract base class for different kinds of events.