Belle II Software development
SegmentTripleRelationFilterFactory.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/segmentTripleRelation/SegmentTripleRelationFilterFactory.h>
9
10#include <tracking/trackFindingCDC/filters/segmentTripleRelation/BaseSegmentTripleRelationFilter.h>
11#include <tracking/trackFindingCDC/filters/segmentTripleRelation/AllSegmentTripleRelationFilter.h>
12#include <tracking/trackFindingCDC/filters/segmentTripleRelation/MCSegmentTripleRelationFilter.h>
13#include <tracking/trackFindingCDC/filters/segmentTripleRelation/SimpleSegmentTripleRelationFilter.h>
14
15#include <tracking/trackFindingCDC/filters/base/NoneFilter.icc.h>
16
17#include <tracking/trackFindingCDC/filters/base/FilterFactory.icc.h>
18
19
20using namespace Belle2;
21using namespace TrackFindingCDC;
22
24
26 : Super(defaultFilterName)
27{
28}
29
31{
32 return "SegmentTripleRelation";
33}
34
36{
37 return "Segment triple relation filter to construct of a segment triple network";
38}
39
40std::map<std::string, std::string>
42{
43 return {
44 {"none", "no segment triple relation is valid, stop at segment triple creation"},
45 {"all", "all segment triple relations are valid"},
46 {"truth", "segment triple relations from monte carlo truth"},
47 {"simple", "mc free with simple criteria"},
48 };
49}
50
51std::unique_ptr<BaseSegmentTripleRelationFilter>
52SegmentTripleRelationFilterFactory::create(const std::string& filterName) const
53{
54 if (filterName == "none") {
55 return std::make_unique<NoneFilter<BaseSegmentTripleRelationFilter>>();
56 // cppcheck-suppress knownConditionTrueFalse
57 } else if (filterName == "all") {
58 return std::make_unique<AllSegmentTripleRelationFilter>();
59 // cppcheck-suppress knownConditionTrueFalse
60 } else if (filterName == "truth") {
61 return std::make_unique<MCSegmentTripleRelationFilter>();
62 // cppcheck-suppress knownConditionTrueFalse
63 } else if (filterName == "simple") {
64 return std::make_unique<SimpleSegmentTripleRelationFilter>();
65 } else {
66 return Super::create(filterName);
67 }
68}
Factory that can create appropriate filter instances from a name.
virtual std::unique_ptr< BaseSegmentTripleRelationFilter > create(const std::string &filterName) const
Create a filter with the given name, does not set filter specific parameters.
std::unique_ptr< BaseSegmentTripleRelationFilter > 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.
SegmentTripleRelationFilterFactory(const std::string &defaultFilterName="simple")
Constructor forwarding the default filter name.
std::string getFilterPurpose() const override
Getter for a descriptive purpose of the constructed filters.
Abstract base class for different kinds of events.