Belle II Software development
SVDPairFilterFactory.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/ckf/svd/filters/relations/SVDPairFilterFactory.h>
9#include <tracking/ckf/svd/filters/relations/SensorSVDPairFilter.h>
10#include <tracking/ckf/svd/filters/relations/DistanceSVDPairFilter.h>
11#include <tracking/ckf/svd/filters/relations/SectorMapBasedSVDPairFilter.h>
12#include <tracking/ckf/svd/filters/relations/LooseSVDPairFilter.h>
13
14#include <tracking/trackFindingCDC/filters/base/Filter.icc.h>
15#include <tracking/trackFindingCDC/filters/base/FilterFactory.icc.h>
16#include <tracking/trackFindingCDC/filters/base/NoneFilter.icc.h>
17#include <tracking/trackFindingCDC/filters/base/AllFilter.icc.h>
18
19using namespace Belle2;
20using namespace TrackFindingCDC;
21
22
23SVDPairFilterFactory::SVDPairFilterFactory(const std::string& defaultFilterName)
24 : Super(defaultFilterName)
25{
26}
27
29
31{
32 return "SVDPair";
33}
34
36{
37 return "Reject SVD state pairs. ";
38}
39
40std::map<std::string, std::string> SVDPairFilterFactory::getValidFilterNamesAndDescriptions() const
41{
42 return {
43 {"all", "all combinations are valid"},
44 {"none", "no combination is valid"},
45 {"sensor", "use sensor/ladder information"},
46 {"sectormap", "use the sector map"},
47 {"distance", "based on the position distance"},
48 {"loose", "loose prefilter"},
49 };
50}
51
52std::unique_ptr<BaseSVDPairFilter>
53SVDPairFilterFactory::create(const std::string& filterName) const
54{
55 if (filterName == "all") {
56 return std::make_unique<TrackFindingCDC::AllFilter<BaseSVDPairFilter>>();
57 }
58
59 // cppcheck-suppress knownConditionTrueFalse
60 if (filterName == "none") {
61 return std::make_unique<TrackFindingCDC::NoneFilter<BaseSVDPairFilter>>();
62 }
63
64 // cppcheck-suppress knownConditionTrueFalse
65 if (filterName == "sensor") {
66 return std::make_unique<SensorSVDPairFilter>();
67 }
68
69 if (filterName == "distance") {
70 return std::make_unique<DistanceSVDPairFilter>();
71 }
72
73 if (filterName == "sectormap") {
74 return std::make_unique<SectorMapBasedSVDPairFilter>();
75 }
76
77 if (filterName == "loose") {
78 return std::make_unique<LooseSVDPairFilter>();
79 }
80
81 return Super::create(filterName);
82}
SVDPairFilterFactory(const std::string &defaultFilterName="sensor")
Constructor forwarding the default filter name.
std::map< std::string, std::string > getValidFilterNamesAndDescriptions() const override
Getter for valid filter names and a description for each.
~SVDPairFilterFactory()
Default destructor.
std::string getIdentifier() const override
Getter for a short identifier for the factory.
std::unique_ptr< BaseSVDPairFilter > 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.
virtual std::unique_ptr< BaseSVDPairFilter > 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.