Belle II Software development
ClusterFilterFactory.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/cluster/ClusterFilterFactory.h>
9
10#include <tracking/trackFindingCDC/filters/cluster/BaseClusterFilter.h>
11#include <tracking/trackFindingCDC/filters/cluster/AllClusterFilter.h>
12#include <tracking/trackFindingCDC/filters/cluster/UnionRecordingClusterFilter.h>
13#include <tracking/trackFindingCDC/filters/cluster/MVABackgroundClusterFilter.h>
14
15#include <tracking/trackFindingCDC/filters/base/FilterFactory.icc.h>
16
17
18using namespace Belle2;
19using namespace TrackFindingCDC;
20
22
23ClusterFilterFactory::ClusterFilterFactory(const std::string& defaultFilterName)
24 : Super(defaultFilterName)
25{
26}
27
29
31{
32 return "Cluster";
33}
34
36{
37 return "Cluster filter to reject background";
38}
39
40std::map<std::string, std::string> ClusterFilterFactory::getValidFilterNamesAndDescriptions() const
41{
42 return {
43 {"all", "all cluster are valid"},
44 {"unionrecording", "record many multiple choosable variable set"},
45 {"mva_bkg", "test clusters for background with a mva method"},
46 };
47}
48
49std::unique_ptr<Filter<CDCWireHitCluster> >
50ClusterFilterFactory::create(const std::string& filterName) const
51{
52 if (filterName == "all") {
53 return std::make_unique<AllClusterFilter>();
54 // cppcheck-suppress knownConditionTrueFalse
55 } else if (filterName == "unionrecording") {
56 return std::make_unique<UnionRecordingClusterFilter>();
57 // cppcheck-suppress knownConditionTrueFalse
58 } else if (filterName == "mva_bkg") {
59 return std::make_unique<MVABackgroundClusterFilter>();
60 } else {
61 return Super::create(filterName);
62 }
63}
std::map< std::string, std::string > getValidFilterNamesAndDescriptions() const override
Getter for valid filter names and a description for each.
ClusterFilterFactory(const std::string &defaultFilterName="mva_bkg")
Constructor forwarding the default filter name.
std::string getIdentifier() const override
Getter for a short identifier for the factory.
std::unique_ptr< BaseClusterFilter > create(const std::string &filterName) const override
Create a filter with the given name.
std::string getFilterPurpose() const override
Getter for a descriptive purpose of the constructed filters.
Factory that can create appropriate filter instances from a name.
virtual std::unique_ptr< BaseClusterFilter > create(const std::string &filterName) const
Create a filter with the given name, does not set filter specific parameters.
Abstract base class for different kinds of events.