12 #include <tracking/trackFindingCDC/filters/base/MVAFilter.dcl.h>
14 #include <tracking/trackFindingCDC/mva/MVAExpert.h>
16 #include <tracking/trackFindingCDC/filters/base/FilterOnVarSet.icc.h>
18 #include <framework/core/ModuleParamList.templateDetails.h>
19 #include <tracking/trackFindingCDC/utilities/StringManipulation.h>
21 #include <tracking/trackFindingCDC/utilities/Named.h>
23 #include <RtypesCore.h>
36 namespace TrackFindingCDC {
38 template <
class AFilter>
40 const std::string& identifier,
42 : Super(std::move(varSet))
43 , m_param_cut(defaultCut)
44 , m_param_identifier(identifier)
48 template <
class AFilter>
51 template <
class AFilter>
54 Super::exposeParameters(moduleParamList, prefix);
57 "The cut value of the mva output below which the object is rejected",
62 "Database identfier of the expert of weight file name",
66 template <
class AFilter>
70 std::vector<Named<Float_t*>> namedVariables = Super::getVarSet().getNamedVariables();
71 m_mvaExpert = std::make_unique<MVAExpert>(m_param_identifier, std::move(namedVariables));
72 m_mvaExpert->initialize();
75 template <
class AFilter>
79 m_mvaExpert->beginRun();
82 template <
class AFilter>
85 double prediction = predict(obj);
86 return prediction < m_param_cut ? NAN : prediction;
89 template <
class AFilter>
92 Weight extracted = Super::operator()(obj);
93 if (std::isnan(extracted)) {
96 return m_mvaExpert->predict();
100 template <
class AVarSet>
103 : Super(std::make_unique<AVarSet>(), defaultTrainingName, defaultCut)
107 template <
class AVarSet>
108 MVAFilter<AVarSet>::~MVAFilter() =
default;