Belle II Software  release-08-01-10
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 "Factory for Filters for SpacePointTrackCands";
28 }
29 
31 {
32  return "Rejects SpacePointTrackCands. ";
33 }
34 
35 std::map<std::string, std::string> TrackletFilterFactory::getValidFilterNamesAndDescriptions() const
36 {
37  return {
38  {"all", "all combinations are valid"},
39  {"none", "no combination is valid"},
40  };
41 }
42 
43 std::unique_ptr<BaseTrackletFilter>
44 TrackletFilterFactory::create(const std::string& filterName) const
45 {
46  if (filterName == "all") {
47  return std::make_unique<TrackFindingCDC::AllFilter<BaseTrackletFilter>>();
48  }
49 
50  // cppcheck-suppress knownConditionTrueFalse
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.