1 #ifndef PhysicsTools_Utilities_Likelihood_h
2 #define PhysicsTools_Utilities_Likelihood_h
9 template <
typename PDF,
typename Tuple>
11 static double evaluate(
const PDF& pdf,
const Tuple& tuple) {
return pdf(tuple); }
15 template <
typename PDF>
17 static double evaluate(
const PDF& pdf,
const double val) {
return pdf(val); }
22 template <
typename Sample,
typename PDF,
typename Yield = NoExtendedLikelihood>
29 double l = -(*yield_)();
30 for (
typename Sample::const_iterator
i =
sample_.begin();
i !=
sample_.end(); ++
i) {
53 template <
typename Sample,
typename PDF>
61 for (
typename Sample::const_iterator
i =
sample_.begin();
i !=
sample_.end(); ++
i) {
75 template <
typename Sample,
typename PDF,
typename Yield>
78 std::cout <<
"-2 log(maximum-likelihood) = " << amin <<
", free parameters = " << numberOfFreeParameters
83 template <
typename Sample,
typename PDF,
typename Yield>
LikelihoodEvaluator< PDF, typename Sample::value_type > Evaluator
static std::vector< std::string > checklist log
static double evaluate(const Likelihood< Sample, PDF, Yield > &f)
double logNFactorial() const
Likelihood(const Sample &sample, PDF &pdf, Yield &yield)
static double evaluate(const PDF &pdf, const Tuple &tuple)
static void print(double amin, unsigned int numberOfFreeParameters, const Likelihood< Sample, PDF, Yield > &f)
LikelihoodEvaluator< PDF, typename Sample::value_type > Evaluator
static double evaluate(const PDF &pdf, const double val)
double operator()() const
double absoluteLog() const
const Yield & yield() const
double operator()() const
unsigned int sampleSize() const
Likelihood(const Sample &sample, PDF &pdf)