Belle II Software development
SegmentPairRelationFilterFactory.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/segmentPairRelation/SegmentPairRelationFilterFactory.h>
9
10#include <tracking/trackFindingCDC/filters/segmentPairRelation/BaseSegmentPairRelationFilter.h>
11#include <tracking/trackFindingCDC/filters/segmentPairRelation/AllSegmentPairRelationFilter.h>
12#include <tracking/trackFindingCDC/filters/segmentPairRelation/MCSegmentPairRelationFilter.h>
13#include <tracking/trackFindingCDC/filters/segmentPairRelation/SimpleSegmentPairRelationFilter.h>
14#include <tracking/trackFindingCDC/filters/segmentPairRelation/UnionRecordingSegmentPairRelationFilter.h>
15#include <tracking/trackFindingCDC/filters/segmentPairRelation/MVARealisticSegmentPairRelationFilter.h>
16
17#include <tracking/trackingUtilities/filters/base/NoneFilter.icc.h>
18
19#include <tracking/trackingUtilities/filters/base/FilterFactory.icc.h>
20
21
22using namespace Belle2;
23using namespace TrackFindingCDC;
24using namespace TrackingUtilities;
25
27
29 : Super(defaultFilterName)
30{
31}
32
34{
35 return "SegmentPairRelation";
36}
37
39{
40 return "Segment pair relation filter to construct of a segment pair network";
41}
42
43std::map<std::string, std::string>
45{
46 return {
47 {"none", "no segment pair relation is valid, stop at segment pair creation"},
48 {"all", "all segment pair relations are valid"},
49 {"truth", "segment pair relations from monte carlo truth"},
50 {"simple", "mc free with simple criteria"},
51 {"unionrecording", "record multiple choosable variable set"},
52 {"realistic", "mc free using a mva method"},
53 };
54}
55
56std::unique_ptr<BaseSegmentPairRelationFilter>
57SegmentPairRelationFilterFactory::create(const std::string& filterName) const
58{
59 if (filterName == "none") {
60 return std::make_unique<NoneFilter<BaseSegmentPairRelationFilter>>();
61 // cppcheck-suppress knownConditionTrueFalse
62 } else if (filterName == "all") {
63 return std::make_unique<AllSegmentPairRelationFilter>();
64 // cppcheck-suppress knownConditionTrueFalse
65 } else if (filterName == "truth") {
66 return std::make_unique<MCSegmentPairRelationFilter>();
67 // cppcheck-suppress knownConditionTrueFalse
68 } else if (filterName == "simple") {
69 return std::make_unique<SimpleSegmentPairRelationFilter>();
70 // cppcheck-suppress knownConditionTrueFalse
71 } else if (filterName == "unionrecording") {
72 return std::make_unique<UnionRecordingSegmentPairRelationFilter>();
73 // cppcheck-suppress knownConditionTrueFalse
74 } else if (filterName == "realistic") {
75 return std::make_unique<MVARealisticSegmentPairRelationFilter>();
76 } else {
77 return Super::create(filterName);
78 }
79}
std::map< std::string, std::string > getValidFilterNamesAndDescriptions() const final
Getter for valid filter names and a description for each.
std::unique_ptr< BaseSegmentPairRelationFilter > create(const std::string &filterName) const final
Create a filter with the given name.
std::string getFilterPurpose() const final
Getter for a descriptive purpose of the constructed filters.
std::string getIdentifier() const final
Getter for a short identifier for the factory.
TrackingUtilities::FilterFactory< BaseSegmentPairRelationFilter > Super
Type of the base class.
SegmentPairRelationFilterFactory(const std::string &defaultFilterName="realistic")
Constructor forwarding the default filter name.
Factory that can create appropriate filter instances from a name.
virtual std::unique_ptr< BaseSegmentPairRelationFilter > create(const std::string &filterName) const
Abstract base class for different kinds of events.