Belle II Software  release-05-01-25
SegmentPairRelationFilterFactory.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2015 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Oliver Frost *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #include <tracking/trackFindingCDC/filters/segmentPairRelation/SegmentPairRelationFilterFactory.h>
11 
12 #include <tracking/trackFindingCDC/filters/segmentPairRelation/BaseSegmentPairRelationFilter.h>
13 #include <tracking/trackFindingCDC/filters/segmentPairRelation/AllSegmentPairRelationFilter.h>
14 #include <tracking/trackFindingCDC/filters/segmentPairRelation/MCSegmentPairRelationFilter.h>
15 #include <tracking/trackFindingCDC/filters/segmentPairRelation/SimpleSegmentPairRelationFilter.h>
16 #include <tracking/trackFindingCDC/filters/segmentPairRelation/UnionRecordingSegmentPairRelationFilter.h>
17 #include <tracking/trackFindingCDC/filters/segmentPairRelation/MVARealisticSegmentPairRelationFilter.h>
18 
19 #include <tracking/trackFindingCDC/filters/base/NoneFilter.icc.h>
20 
21 #include <tracking/trackFindingCDC/filters/base/FilterFactory.icc.h>
22 
23 
24 using namespace Belle2;
25 using namespace TrackFindingCDC;
26 
28 
30  : Super(defaultFilterName)
31 {
32 }
33 
35 {
36  return "SegmentPairRelation";
37 }
38 
40 {
41  return "Segment pair relation filter to construct of a segment pair network";
42 }
43 
44 std::map<std::string, std::string>
46 {
47  return {
48  {"none", "no segment pair relation is valid, stop at segment pair creation"},
49  {"all", "all segment pair relations are valid"},
50  {"truth", "segment pair relations from monte carlo truth"},
51  {"simple", "mc free with simple criteria"},
52  {"unionrecording", "record multiple choosable variable set"},
53  {"realistic", "mc free using a mva method"},
54  };
55 }
56 
57 std::unique_ptr<BaseSegmentPairRelationFilter>
58 SegmentPairRelationFilterFactory::create(const std::string& filterName) const
59 {
60  if (filterName == "none") {
61  return std::make_unique<NoneFilter<BaseSegmentPairRelationFilter>>();
62  } else if (filterName == "all") {
63  return std::make_unique<AllSegmentPairRelationFilter>();
64  } else if (filterName == "truth") {
65  return std::make_unique<MCSegmentPairRelationFilter>();
66  } else if (filterName == "simple") {
67  return std::make_unique<SimpleSegmentPairRelationFilter>();
68  } else if (filterName == "unionrecording") {
69  return std::make_unique<UnionRecordingSegmentPairRelationFilter>();
70  } else if (filterName == "realistic") {
71  return std::make_unique<MVARealisticSegmentPairRelationFilter>();
72  } else {
73  return Super::create(filterName);
74  }
75 }
Belle2::TrackFindingCDC::FilterFactory< BaseSegmentPairRelationFilter >
Belle2::TrackFindingCDC::SegmentPairRelationFilterFactory::getValidFilterNamesAndDescriptions
std::map< std::string, std::string > getValidFilterNamesAndDescriptions() const final
Getter for valid filter names and a description for each.
Definition: SegmentPairRelationFilterFactory.cc:45
Belle2::TrackFindingCDC::SegmentPairRelationFilterFactory::getFilterPurpose
std::string getFilterPurpose() const final
Getter for a descriptive purpose of the constructed filters.
Definition: SegmentPairRelationFilterFactory.cc:39
Belle2::TrackFindingCDC::SegmentPairRelationFilterFactory::getIdentifier
std::string getIdentifier() const final
Getter for a short identifier for the factory.
Definition: SegmentPairRelationFilterFactory.cc:34
Belle2::TrackFindingCDC::FilterFactory< BaseSegmentPairRelationFilter >::create
virtual std::unique_ptr< BaseSegmentPairRelationFilter > create(const std::string &filterName) const
Create a filter with the given name, does not set filter specific parameters.
Definition: FilterFactory.icc.h:54
Belle2::TrackFindingCDC::SegmentPairRelationFilterFactory::SegmentPairRelationFilterFactory
SegmentPairRelationFilterFactory(const std::string &defaultFilterName="realistic")
Constructor forwarding the default filter name.
Definition: SegmentPairRelationFilterFactory.cc:29
Belle2::TrackFindingCDC::SegmentPairRelationFilterFactory::create
std::unique_ptr< BaseSegmentPairRelationFilter > create(const std::string &filterName) const final
Create a filter with the given name.
Definition: SegmentPairRelationFilterFactory.cc:58
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19