17#include "analysis/OrcaKinFit/BaseFitter.h"
18#include "analysis/OrcaKinFit/BaseSoftConstraint.h"
19#include "analysis/OrcaKinFit/BaseHardConstraint.h"
29 namespace OrcaKinFit {
31 BaseFitter::BaseFitter()
32 : fitobjects(FitObjectContainer()),
33 constraints(ConstraintContainer()),
34 softconstraints(SoftConstraintContainer()),
35 covDim(0), cov(nullptr), covValid(false)
38 traceValues(
std::map<
std::string, double> ())
42 BaseFitter::~BaseFitter()
48 void BaseFitter::addFitObject(BaseFitObject* fitobject_)
51 fitobjects.push_back(fitobject_);
54 void BaseFitter::addFitObject(BaseFitObject& fitobject_)
57 fitobjects.push_back(&fitobject_);
60 void BaseFitter::addConstraint(BaseConstraint* constraint_)
64 if (
auto* hc =
dynamic_cast<BaseHardConstraint*
>(constraint_))
65 constraints.push_back(hc);
66 else if (
auto* sc =
dynamic_cast<BaseSoftConstraint*
>(constraint_))
67 softconstraints.push_back(sc);
74 void BaseFitter::addConstraint(BaseConstraint& constraint_)
77 if (
auto* hc =
dynamic_cast<BaseHardConstraint*
>(&constraint_))
78 constraints.push_back(hc);
79 else if (
auto* sc =
dynamic_cast<BaseSoftConstraint*
>(&constraint_))
80 softconstraints.push_back(sc);
83 void BaseFitter::addHardConstraint(BaseHardConstraint* constraint_)
86 constraints.push_back(constraint_);
89 void BaseFitter::addHardConstraint(BaseHardConstraint& constraint_)
92 constraints.push_back(&constraint_);
95 void BaseFitter::addSoftConstraint(BaseSoftConstraint* constraint_)
98 softconstraints.push_back(constraint_);
101 void BaseFitter::addSoftConstraint(BaseSoftConstraint& constraint_)
104 softconstraints.push_back(&constraint_);
107 std::vector<BaseFitObject*>* BaseFitter::getFitObjects()
112 std::vector<BaseHardConstraint*>* BaseFitter::getConstraints()
117 std::vector<BaseSoftConstraint*>* BaseFitter::getSoftConstraints()
119 return &softconstraints;
122 void BaseFitter::reset()
124 fitobjects.resize(0);
125 constraints.resize(0);
126 softconstraints.resize(0);
130 BaseTracer* BaseFitter::getTracer()
134 const BaseTracer* BaseFitter::getTracer()
const
138 void BaseFitter::setTracer(BaseTracer* newTracer)
143 void BaseFitter::setTracer(BaseTracer& newTracer)
148 const double* BaseFitter::getGlobalCovarianceMatrix(
int& idim)
const
150 if (covValid && cov) {
158 double* BaseFitter::getGlobalCovarianceMatrix(
int& idim)
160 if (covValid && cov) {
Abstract base class for different kinds of events.