8#include <tracking/trackFindingCDC/filters/segment/SegmentFilterFactory.h>
10#include <tracking/trackFindingCDC/filters/segment/BkgTruthSegmentVarSet.h>
12#include <tracking/trackFindingCDC/filters/segment/AdvancedSegmentVarSet.h>
14#include <tracking/trackFindingCDC/filters/base/MVAFilter.icc.h>
16#include <tracking/trackFindingCDC/filters/base/RecordingFilter.icc.h>
17#include <tracking/trackFindingCDC/filters/base/TruthVarFilter.icc.h>
18#include <tracking/trackFindingCDC/filters/base/AllFilter.icc.h>
19#include <tracking/trackFindingCDC/filters/base/NoneFilter.icc.h>
21#include <tracking/trackFindingCDC/filters/base/FilterFactory.icc.h>
23#include <tracking/trackFindingCDC/varsets/VariadicUnionVarSet.h>
26using namespace TrackFindingCDC;
32 using BkgRecordingSegmentFilter =
40 :
Super(defaultFilterName)
51 return "Segment filter to reject fakes";
54std::map<std::string, std::string>
58 {
"none",
"no segment track combination is valid"},
59 {
"all",
"filter out all segments as background"},
60 {
"bkg_truth",
"monte carlo truth"},
61 {
"bkg_recording",
"record variables to a TTree"},
62 {
"bkg_mva",
"test with a mva method"}
66std::unique_ptr<BaseSegmentFilter>
69 if (filterName ==
"none") {
70 return std::make_unique<NoneSegmentFilter>();
72 }
else if (filterName ==
"all") {
73 return std::make_unique<AllSegmentFilter>();
75 }
else if (filterName ==
"bkg_truth") {
76 return std::make_unique<BkgMCSegmentFilter>();
78 }
else if (filterName ==
"bkg_recording") {
79 return std::make_unique<BkgRecordingSegmentFilter>(
"BackgroundSegmentFilter.root");
81 }
else if (filterName ==
"bkg_mva") {
82 return std::make_unique<BkgMVASegmentFilter>(
"trackfindingcdc_BackgroundSegmentFilter");
Filter adapter type that accepts all items (just for reference).
Factory that can create appropriate filter instances from a name.
virtual std::unique_ptr< BaseSegmentFilter > create(const std::string &filterName) const
Create a filter with the given name, does not set filter specific parameters.
Convenience template to create a mva filter for a set of variables.
Filter adapter type that rejects all items.
Convenience template to create a recording filter for a set of variables.
SegmentFilterFactory(const std::string &defaultFilterName="all")
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.
std::unique_ptr< BaseSegmentFilter > 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.
MC Filter Type using a VarSet and the truth variable in it.
Abstract base class for different kinds of events.