Belle II Software development
PXDPairFilterFactory.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/pxd/filters/relations/PXDPairFilterFactory.h>
9#include <tracking/ckf/pxd/filters/relations/SensorPXDPairFilter.h>
10#include <tracking/ckf/pxd/filters/relations/AngularDistancePXDPairFilter.h>
11#include <tracking/ckf/pxd/filters/relations/LoosePXDPairFilter.h>
12#include <tracking/ckf/pxd/filters/relations/InterceptDistancePXDPairFilter.h>
13#include <tracking/ckf/pxd/filters/relations/CylinderDistancePXDPairFilter.h>
14
15#include <tracking/trackFindingCDC/filters/base/Filter.icc.h>
16#include <tracking/trackFindingCDC/filters/base/FilterFactory.icc.h>
17#include <tracking/trackFindingCDC/filters/base/NoneFilter.icc.h>
18#include <tracking/trackFindingCDC/filters/base/AllFilter.icc.h>
19
20using namespace Belle2;
21using namespace TrackFindingCDC;
22
23
24PXDPairFilterFactory::PXDPairFilterFactory(const std::string& defaultFilterName)
25 : Super(defaultFilterName)
26{
27}
28
30
32{
33 return "PXDPair";
34}
35
37{
38 return "Reject PXD state pairs. ";
39}
40
41std::map<std::string, std::string> PXDPairFilterFactory::getValidFilterNamesAndDescriptions() const
42{
43 return {
44 {"all", "all combinations are valid"},
45 {"none", "no combination is valid"},
46 {"sensor", "use sensor/ladder information"},
47 {"angulardistance", "based on the angular distance of the hit positions"},
48 {"loose", "loose prefilter"},
49 {"intercept", "intercept filter"},
50 {"cylinderextrapolation", "filter based selection using an extrapolation to a cylinder with radius of the ToState"},
51 };
52}
53
54std::unique_ptr<BasePXDPairFilter>
55PXDPairFilterFactory::create(const std::string& filterName) const
56{
57 if (filterName == "all") {
58 return std::make_unique<TrackFindingCDC::AllFilter<BasePXDPairFilter>>();
59 }
60
61 // cppcheck-suppress knownConditionTrueFalse
62 if (filterName == "none") {
63 return std::make_unique<TrackFindingCDC::NoneFilter<BasePXDPairFilter>>();
64 }
65
66 // cppcheck-suppress knownConditionTrueFalse
67 if (filterName == "sensor") {
68 return std::make_unique<SensorPXDPairFilter>();
69 }
70
71 if (filterName == "angulardistance") {
72 return std::make_unique<AngularDistancePXDPairFilter>();
73 }
74
75 if (filterName == "loose") {
76 return std::make_unique<LoosePXDPairFilter>();
77 }
78
79 if (filterName == "intercept") {
80 return std::make_unique<InterceptDistancePXDPairFilter>();
81 }
82
83 if (filterName == "cylinderextrapolation") {
84 return std::make_unique<CylinderDistancePXDPairFilter>();
85 }
86
87 return Super::create(filterName);
88}
PXDPairFilterFactory(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.
~PXDPairFilterFactory()
Default destructor.
std::string getIdentifier() const override
Getter for a short identifier for the factory.
std::unique_ptr< BasePXDPairFilter > 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< BasePXDPairFilter > 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.