Belle II Software  release-08-01-10
SegmentPairRelationFilterFactory.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/segmentPairRelation/SegmentPairRelationFilterFactory.h>
9 
10 #include <tracking/trackFindingCDC/filters/segmentPairRelation/BaseSegmentPairRelationFilter.h>
11 #include <tracking/trackFindingCDC/filters/segmentPairRelation/AllSegmentPairRelationFilter.h>
12 #include <tracking/trackFindingCDC/filters/segmentPairRelation/MCSegmentPairRelationFilter.h>
13 #include <tracking/trackFindingCDC/filters/segmentPairRelation/SimpleSegmentPairRelationFilter.h>
14 #include <tracking/trackFindingCDC/filters/segmentPairRelation/UnionRecordingSegmentPairRelationFilter.h>
15 #include <tracking/trackFindingCDC/filters/segmentPairRelation/MVARealisticSegmentPairRelationFilter.h>
16 
17 #include <tracking/trackFindingCDC/filters/base/NoneFilter.icc.h>
18 
19 #include <tracking/trackFindingCDC/filters/base/FilterFactory.icc.h>
20 
21 
22 using namespace Belle2;
23 using namespace TrackFindingCDC;
24 
26 
28  : Super(defaultFilterName)
29 {
30 }
31 
33 {
34  return "SegmentPairRelation";
35 }
36 
38 {
39  return "Segment pair relation filter to construct of a segment pair network";
40 }
41 
42 std::map<std::string, std::string>
44 {
45  return {
46  {"none", "no segment pair relation is valid, stop at segment pair creation"},
47  {"all", "all segment pair relations are valid"},
48  {"truth", "segment pair relations from monte carlo truth"},
49  {"simple", "mc free with simple criteria"},
50  {"unionrecording", "record multiple choosable variable set"},
51  {"realistic", "mc free using a mva method"},
52  };
53 }
54 
55 std::unique_ptr<BaseSegmentPairRelationFilter>
56 SegmentPairRelationFilterFactory::create(const std::string& filterName) const
57 {
58  if (filterName == "none") {
59  return std::make_unique<NoneFilter<BaseSegmentPairRelationFilter>>();
60  // cppcheck-suppress knownConditionTrueFalse
61  } else if (filterName == "all") {
62  return std::make_unique<AllSegmentPairRelationFilter>();
63  // cppcheck-suppress knownConditionTrueFalse
64  } else if (filterName == "truth") {
65  return std::make_unique<MCSegmentPairRelationFilter>();
66  // cppcheck-suppress knownConditionTrueFalse
67  } else if (filterName == "simple") {
68  return std::make_unique<SimpleSegmentPairRelationFilter>();
69  // cppcheck-suppress knownConditionTrueFalse
70  } else if (filterName == "unionrecording") {
71  return std::make_unique<UnionRecordingSegmentPairRelationFilter>();
72  // cppcheck-suppress knownConditionTrueFalse
73  } else if (filterName == "realistic") {
74  return std::make_unique<MVARealisticSegmentPairRelationFilter>();
75  } else {
76  return Super::create(filterName);
77  }
78 }
virtual std::unique_ptr< BaseSegmentPairRelationFilter > create(const std::string &filterName) const
Create a filter with the given name, does not set filter specific parameters.
std::map< std::string, std::string > getValidFilterNamesAndDescriptions() const final
Getter for valid filter names and a description for each.
std::unique_ptr< BaseSegmentPairRelationFilter > 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.
std::string getIdentifier() const final
Getter for a short identifier for the factory.
SegmentPairRelationFilterFactory(const std::string &defaultFilterName="realistic")
Constructor forwarding the default filter name.
Abstract base class for different kinds of events.