8#include <tracking/ckf/pxd/filters/states/PXDStateFilterFactory.h>
10#include <tracking/trackFindingCDC/filters/base/FilterFactory.icc.h>
11#include <tracking/trackFindingCDC/filters/base/AllFilter.icc.h>
12#include <tracking/trackFindingCDC/filters/base/NoneFilter.icc.h>
13#include <tracking/trackFindingCDC/filters/base/AndFilter.icc.h>
14#include <tracking/trackFindingCDC/filters/base/NegativeFilter.icc.h>
15#include <tracking/trackFindingCDC/filters/base/ChoosableFromVarSetFilter.icc.h>
16#include <tracking/trackFindingCDC/filters/base/RecordingFilter.icc.h>
17#include <tracking/trackFindingCDC/filters/base/MVAFilter.icc.h>
18#include <tracking/trackFindingCDC/filters/base/SloppyFilter.icc.h>
19#include <tracking/trackFindingCDC/filters/base/TruthVarFilter.icc.h>
21#include <tracking/trackFindingCDC/varsets/VariadicUnionVarSet.h>
23#include <tracking/ckf/general/filters/AdvanceFilter.h>
24#include <tracking/ckf/general/filters/KalmanFilter.h>
25#include <tracking/ckf/pxd/utilities/PXDAdvancer.h>
26#include <tracking/ckf/pxd/utilities/PXDKalmanStepper.h>
28#include <tracking/ckf/pxd/filters/states/PXDStateBasicVarSet.h>
29#include <tracking/ckf/pxd/filters/states/PXDStateTruthVarSet.h>
30#include <tracking/ckf/pxd/filters/states/SimplePXDStateFilter.h>
31#include <tracking/ckf/pxd/filters/states/AllPXDStateFilter.h>
32#include <tracking/ckf/pxd/filters/states/NonIPCrossingPXDStateFilter.h>
35using namespace TrackFindingCDC;
57 class SloppyRecordingPXDStateFilter :
public RecordingPXDStateFilter {
59 explicit SloppyRecordingPXDStateFilter(
const std::string& defaultRootFileName) : RecordingPXDStateFilter(defaultRootFileName)
61 setSkimFilter(std::make_unique<SloppyMCPXDStateFilter>());
68 :
Super(defaultFilterName)
81 return "Reject PXD CKF states. ";
87 {
"none",
"no track combination is valid"},
88 {
"all",
"set all track combinations as good"},
89 {
"advance",
"extrapolate the states"},
90 {
"fit",
"update the mSoP using a Kalman Filter"},
91 {
"truth",
"monte carlo truth"},
92 {
"ordering_truth",
"monte carlo truth ordering"},
93 {
"sloppy_truth",
"sloppy monte carlo truth"},
94 {
"simple",
"simple filter to be used in pxd"},
95 {
"recording",
"record variables to a TTree"},
96 {
"recording_and_truth",
"record variables to a TTree and store truth information"},
97 {
"recording_with_direction_check",
"record variables to a TTree with direction check"},
98 {
"mva_with_direction_check",
"MVA filter with direction check"},
99 {
"mva",
"MVA filter"},
100 {
"sloppy_recording",
"record variables to a TTree"},
104std::unique_ptr<BasePXDStateFilter>
107 if (filterName ==
"none") {
108 return std::make_unique<TrackFindingCDC::NoneFilter<BasePXDStateFilter>>();
109 }
else if (filterName ==
"all") {
110 return std::make_unique<AllPXDStateFilter>();
111 }
else if (filterName ==
"advance") {
112 return std::make_unique<AdvanceFilter<CKFToPXDState, PXDAdvancer>>();
113 }
else if (filterName ==
"fit") {
114 return std::make_unique<KalmanFilter<CKFToPXDState, PXDKalmanStepper>>();
115 }
else if (filterName ==
"simple") {
116 return std::make_unique<SimplePXDStateFilter>();
117 }
else if (filterName ==
"truth") {
118 return std::make_unique<MCPXDStateFilter>();
119 }
else if (filterName ==
"ordering_truth") {
120 return std::make_unique<MCOrderingPXDStateFilter>(
"truth_inverted");
121 }
else if (filterName ==
"sloppy_truth") {
122 return std::make_unique<SloppyMCPXDStateFilter>();
123 }
else if (filterName ==
"recording") {
124 return std::make_unique<RecordingPXDStateFilter>(
"PXDStateFilter.root");
125 }
else if (filterName ==
"recording_and_truth") {
126 return std::make_unique<AndPXDStateFilter>(
127 std::make_unique<RecordingPXDStateFilter>(
"PXDStateFilter.root"),
128 std::make_unique<MCPXDStateFilter>());
129 }
else if (filterName ==
"recording_with_direction_check") {
130 return std::make_unique<AndPXDStateFilter>(
131 std::make_unique<NonIPCrossingPXDStateFilter>(),
132 std::make_unique<RecordingPXDStateFilter>(
"PXDStateFilter.root"));
133 }
else if (filterName ==
"mva_with_direction_check") {
134 return std::make_unique<AndPXDStateFilter>(
135 std::make_unique<NonIPCrossingPXDStateFilter>(),
136 std::make_unique<MVAPXDStateFilter>(
"ckf_CDCPXDStateFilter_1"));
137 }
else if (filterName ==
"mva") {
138 return std::make_unique<AndPXDStateFilter>(
139 std::make_unique<MVAPXDStateFilter>(
"ckf_CDCPXDStateFilter_1"),
140 std::make_unique<NonIPCrossingPXDStateFilter>());
141 }
else if (filterName ==
"sloppy_recording") {
142 return std::make_unique<SloppyRecordingPXDStateFilter>(
"PXDStateFilter.root");
std::map< std::string, std::string > getValidFilterNamesAndDescriptions() const override
Getter for valid filter names and a description for each.
PXDStateFilterFactory(const std::string &defaultFilterName="all")
Constructor forwarding the default filter name.
std::unique_ptr< BasePXDStateFilter > 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.
~PXDStateFilterFactory()
Default destructor.
Filter adapter type that joins two filter results in an and like fashion.
Convince template to create a filter returning on variable from a set of variables.
virtual std::unique_ptr< BasePXDStateFilter > create(const std::string &filterName) const
Create a filter with the given name, does not set filter specific parameters.
Filter adapter type that negates the acceptance criterion for cross checks.
Convenience template to create a recording filter for a set of variables.
A filter that accepts every "sloppinessFactor"th candidate on average (random selection)
MC Filter Type using a VarSet and the truth variable in it.
Abstract base class for different kinds of events.