SourceXtractorPlusPlus  0.12
Please provide a description of the project.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LogChiSquareComparator.h
Go to the documentation of this file.
1 
23 #ifndef MODELFITTING_LOGCHISQUARECOMPARATOR_H
24 #define MODELFITTING_LOGCHISQUARECOMPARATOR_H
25 
26 #include <cmath>
27 
28 namespace ModelFitting {
29 
53 
54 public:
55 
57  LogChiSquareComparator(double u0=10.) : m_u0{u0} { }
58 
60  double operator()(double real, double model, double weight) const {
61  double val = weight * (real - model) / m_u0;
62  return val>0. ? m_u0 * std::log(1. + val) : -1. * m_u0 * std::log(1. - val);
63  }
64 
65 private:
66 
67  double m_u0;
68 
69 }; // end of class LogChiSquareComparator
70 
71 } // end of namespace ModelFitting
72 
73 
74 
75 #endif /* MODELFITTING_LOGCHISQUARECOMPARATOR_H */
76 
T log(T...args)
double operator()(double real, double model, double weight) const
Returns the modified residual.
LogChiSquareComparator(double u0=10.)
Creates a new LogChiSquareComparator instance with the given .
Data vs model comparator which computes a modified residual.