8#include <tracking/trackFindingCDC/filters/track/TrackFilterFactory.h>
10#include <tracking/trackFindingCDC/filters/track/TruthTrackVarSet.h>
11#include <tracking/trackFindingCDC/filters/track/BasicTrackVarSet.h>
13#include <tracking/trackFindingCDC/filters/base/MVAFilter.icc.h>
15#include <tracking/trackFindingCDC/filters/base/RecordingFilter.icc.h>
16#include <tracking/trackFindingCDC/filters/base/TruthVarFilter.icc.h>
17#include <tracking/trackFindingCDC/filters/base/AllFilter.icc.h>
18#include <tracking/trackFindingCDC/filters/base/NoneFilter.icc.h>
20#include <tracking/trackFindingCDC/filters/base/FilterFactory.icc.h>
21#include <tracking/trackFindingCDC/filters/base/FilterVarSet.icc.h>
23#include <tracking/trackFindingCDC/varsets/VariadicUnionVarSet.h>
26using namespace TrackFindingCDC;
40 :
Super(defaultFilterName)
51 return "Track filter to reject fakes";
54std::map<std::string, std::string>
58 {
"none",
"no track is valid"},
59 {
"all",
"set all tracks as good"},
60 {
"truth",
"monte carlo truth"},
61 {
"recording",
"record variables to a TTree"},
62 {
"recording_data",
"record reco-variables to a TTree (no truth information)"},
63 {
"eval",
"record truth and the mva response for insitu comparison"},
64 {
"mva",
"test with a mva method"}
68std::unique_ptr<BaseTrackFilter>
71 if (filterName ==
"none") {
72 return std::make_unique<NoneTrackFilter>();
73 }
else if (filterName ==
"all") {
74 return std::make_unique<AllTrackFilter>();
75 }
else if (filterName ==
"truth") {
76 return std::make_unique<MCTrackFilter>();
77 }
else if (filterName ==
"recording") {
78 return std::make_unique<RecordingTrackFilter>(
"TrackFilter.root");
79 }
else if (filterName ==
"recording_data") {
80 return std::make_unique<RecordingDataTrackFilter>(
"TrackFilter.root");
81 }
else if (filterName ==
"eval") {
82 auto recordedVarSets = std::make_unique<UnionVarSet<CDCTrack>>();
84 recordedVarSets->push_back(std::make_unique<TrackFilterVarSet>(
"mva",
create(
"mva")));
85 recordedVarSets->push_back(std::make_unique<TrackFilterVarSet>(
"truth",
create(
"truth")));
86 return std::make_unique<Recording<BaseTrackFilter>>(std::move(recordedVarSets),
"TrackFilter_eval.root");
87 }
else if (filterName ==
"mva") {
88 return std::make_unique<MVATrackFilter>(
"trackfindingcdc_TrackFilter", 0.10);
Filter adapter type that accepts all items (just for reference).
Factory that can create appropriate filter instances from a name.
virtual std::unique_ptr< BaseTrackFilter > create(const std::string &filterName) const
Create a filter with the given name, does not set filter specific parameters.
Class to compute floating point variables from a filter response which can be recorded as a flat TNtu...
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.
std::unique_ptr< BaseTrackFilter > 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.
TrackFilterFactory(const std::string &defaultFilterName="mva")
Constructor forwarding the default filter name.
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.