8#include <tracking/trackFindingCDC/filters/segmentRelation/SegmentRelationFilterFactory.h>
10#include <tracking/trackFindingCDC/filters/segmentRelation/BaseSegmentRelationFilter.h>
11#include <tracking/trackFindingCDC/filters/segmentRelation/MCSegmentRelationFilter.h>
12#include <tracking/trackFindingCDC/filters/segmentRelation/UnionRecordingSegmentRelationFilter.h>
13#include <tracking/trackFindingCDC/filters/segmentRelation/MVAFeasibleSegmentRelationFilter.h>
14#include <tracking/trackFindingCDC/filters/segmentRelation/MVARealisticSegmentRelationFilter.h>
16#include <tracking/trackFindingCDC/filters/base/NoneFilter.icc.h>
18#include <tracking/trackFindingCDC/filters/base/AndFilter.icc.h>
19#include <tracking/trackFindingCDC/filters/base/NotFilter.icc.h>
21#include <tracking/trackFindingCDC/filters/base/FilterFactory.icc.h>
25using namespace TrackFindingCDC;
30 :
Super(defaultFilterName)
36 return "SegmentRelation";
41 return "Segment relation filter to construct a segment network for in super cluster merging";
44std::map<std::string, std::string>
48 {
"none",
"no segment relation is valid, stop at segment creation."},
49 {
"truth",
"segment relations from 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 {
"false_positive",
"accepts the instances that are really false but are accepted by the default filter"},
54 {
"false_negative",
"accepts the instances that are really true but are rejected by the default filter"},
58std::unique_ptr<BaseSegmentRelationFilter >
61 if (filterName ==
"none") {
62 return std::make_unique<NoneFilter<BaseSegmentRelationFilter>>();
63 }
else if (filterName ==
"truth") {
64 return std::make_unique<MCSegmentRelationFilter>();
65 }
else if (filterName ==
"unionrecording") {
66 return std::make_unique<UnionRecordingSegmentRelationFilter>();
67 }
else if (filterName ==
"feasible") {
68 return std::make_unique<MVAFeasibleSegmentRelationFilter>();
69 }
else if (filterName ==
"realistic") {
70 return std::make_unique<MVARealisticSegmentRelationFilter>();
71 }
else if (filterName ==
"false_positive") {
73 auto defaultFilter = this->
create(defaultFilterName);
74 std::string truthFilterName =
"truth";
75 auto truthFilter = this->
create(truthFilterName);
76 auto notTruthFilter = std::make_unique<NotFilter<BaseSegmentRelationFilter>>(std::move(truthFilter));
77 return std::make_unique<AndFilter<BaseSegmentRelationFilter>>(std::move(notTruthFilter),
78 std::move(defaultFilter));
79 }
else if (filterName ==
"false_negative") {
81 auto defaultFilter = this->
create(defaultFilterName);
82 std::string truthFilterName =
"truth";
83 auto truthFilter = this->
create(truthFilterName);
84 auto notDefaultFilter = std::make_unique<NotFilter<BaseSegmentRelationFilter>>(std::move(defaultFilter));
85 return std::make_unique<AndFilter<BaseSegmentRelationFilter>>(std::move(notDefaultFilter),
86 std::move(truthFilter));
Factory that can create appropriate filter instances from a name.
virtual std::unique_ptr< BaseSegmentRelationFilter > create(const std::string &filterName) const
Create a filter with the given name, does not set filter specific parameters.
const std::string & getDefaultFilterName() const
Legacy - Return the default filter suggested by the factory.
std::unique_ptr< BaseSegmentRelationFilter > create(const std::string &filterName) const override
Create a filter with the given name.
std::map< std::string, std::string > getValidFilterNamesAndDescriptions() const override
Getter for valid filter names and a description for each.
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.
SegmentRelationFilterFactory(const std::string &defaultFilterName="realistic")
Constructor forwarding the default filter name.
Abstract base class for different kinds of events.