Belle II Software development
AxialSegmentPairFilterFactory.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/axialSegmentPair/AxialSegmentPairFilterFactory.h>
9
10#include <tracking/trackFindingCDC/filters/axialSegmentPair/BaseAxialSegmentPairFilter.h>
11#include <tracking/trackFindingCDC/filters/axialSegmentPair/AllAxialSegmentPairFilter.h>
12#include <tracking/trackFindingCDC/filters/axialSegmentPair/MCAxialSegmentPairFilter.h>
13#include <tracking/trackFindingCDC/filters/axialSegmentPair/SimpleAxialSegmentPairFilter.h>
14#include <tracking/trackFindingCDC/filters/axialSegmentPair/UnionRecordingAxialSegmentPairFilter.h>
15
16#include <tracking/trackFindingCDC/filters/axialSegmentPair/MVAFeasibleAxialSegmentPairFilter.h>
17#include <tracking/trackFindingCDC/filters/axialSegmentPair/MVARealisticAxialSegmentPairFilter.h>
18
19#include <tracking/trackFindingCDC/filters/base/NoneFilter.icc.h>
20
21#include <tracking/trackFindingCDC/filters/base/FilterFactory.icc.h>
22
23using namespace Belle2;
24using namespace TrackFindingCDC;
25
27
29 : Super(defaultFilterName)
30{
31}
32
34{
35 return "AxialSegmentPair";
36}
37
39{
40 return "AxialSegment pair filter to construct of a axialSegment pair network";
41}
42
43std::map<std::string, std::string>
45{
46 return {
47 {"none", "no axialSegment pair is valid"},
48 {"all", "all axialSegment pairs are valid"},
49 {"truth", "monte carlo truth"},
50 {"unionrecording", "record many multiple choosable variable set"},
51 {"feasible", "check if the segment relation is feasible"},
52 {"realistic", "check if the segment relation is a good combination"},
53 {"simple", "mc free with simple criteria"},
54 };
55}
56
57std::unique_ptr<Filter<CDCAxialSegmentPair> >
58AxialSegmentPairFilterFactory::create(const std::string& filterName) const
59{
60 if (filterName == "none") {
61 return std::make_unique<NoneFilter<BaseAxialSegmentPairFilter> >();
62 // cppcheck-suppress knownConditionTrueFalse
63 } else if (filterName == "all") {
64 return std::make_unique<AllAxialSegmentPairFilter>();
65 // cppcheck-suppress knownConditionTrueFalse
66 } else if (filterName == "truth") {
67 return std::make_unique<MCAxialSegmentPairFilter>();
68 // cppcheck-suppress knownConditionTrueFalse
69 } else if (filterName == "unionrecording") {
70 return std::make_unique<UnionRecordingAxialSegmentPairFilter>();
71 // cppcheck-suppress knownConditionTrueFalse
72 } else if (filterName == "simple") {
73 return std::make_unique<SimpleAxialSegmentPairFilter>();
74 // cppcheck-suppress knownConditionTrueFalse
75 } else if (filterName == "feasible") {
76 return std::make_unique<MVAFeasibleAxialSegmentPairFilter>();
77 // cppcheck-suppress knownConditionTrueFalse
78 } else if (filterName == "realistic") {
79 return std::make_unique<MVARealisticAxialSegmentPairFilter>();
80 } else {
81 return Super::create(filterName);
82 }
83}
std::map< std::string, std::string > getValidFilterNamesAndDescriptions() const override
Getter for valid filter names and a description for each.
AxialSegmentPairFilterFactory(const std::string &defaultFilterName="realistic")
Constructor forwarding the default filter name.
std::unique_ptr< BaseAxialSegmentPairFilter > 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.
Factory that can create appropriate filter instances from a name.
virtual std::unique_ptr< BaseAxialSegmentPairFilter > 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.