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