Belle II Software  release-06-01-15
TrackletFilterFactory.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/vxdHoughTracking/filters/trackletFilters/TrackletFilterFactory.h>
9 #include <tracking/trackFindingCDC/filters/base/Filter.icc.h>
10 #include <tracking/trackFindingCDC/filters/base/FilterFactory.icc.h>
11 #include <tracking/trackFindingCDC/filters/base/NoneFilter.icc.h>
12 #include <tracking/trackFindingCDC/filters/base/AllFilter.icc.h>
13 
14 using namespace Belle2;
15 using namespace TrackFindingCDC;
16 using namespace vxdHoughTracking;
17 
18 TrackletFilterFactory::TrackletFilterFactory(const std::string& defaultFilterName)
19  : Super(defaultFilterName)
20 {
21 }
22 
24 
26 {
27  return "SVD Hit Pair";
28  return "Factory for Filters for SpacePointTrackCands";
29 }
30 
32 {
33  return "Rejects SpacePointTrackCands. ";
34 }
35 
36 std::map<std::string, std::string> TrackletFilterFactory::getValidFilterNamesAndDescriptions() const
37 {
38  return {
39  {"all", "all combinations are valid"},
40  {"none", "no combination is valid"},
41  };
42 }
43 
44 std::unique_ptr<BaseTrackletFilter>
45 TrackletFilterFactory::create(const std::string& filterName) const
46 {
47  if (filterName == "all") {
48  return std::make_unique<TrackFindingCDC::AllFilter<BaseTrackletFilter>>();
49  }
50 
51  if (filterName == "none") {
52  return std::make_unique<TrackFindingCDC::NoneFilter<BaseTrackletFilter>>();
53  }
54 
55  return Super::create(filterName);
56 }
virtual std::unique_ptr< BaseTrackletFilter > 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 override
Getter for valid filter names and a description for each.
std::unique_ptr< BaseTrackletFilter > create(const std::string &filterName) const override
Create a filter with the given name.
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.
Abstract base class for different kinds of events.