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>
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 double evaluate(const Likelihood< Sample, PDF, Yield > &f)
const Yield & yield() const
Likelihood(const Sample &sample, PDF &pdf, Yield &yield)
double operator()() const
static double evaluate(const PDF &pdf, const Tuple &tuple)
double operator()() const
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 absoluteLog() const
double logNFactorial() const
unsigned int sampleSize() const
Likelihood(const Sample &sample, PDF &pdf)