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) {
17 template<
typename PDF>
26 template<
typename Sample,
typename PDF,
typename Yield = NoExtendedLikelihood>
35 double l = - (*yield_)();
36 for(
typename Sample::const_iterator
i =
sample_.begin();
i !=
sample_.end(); ++
i) {
50 const PDF &
pdf()
const {
return *
pdf_; }
62 template<
typename Sample,
typename PDF>
72 for(
typename Sample::const_iterator
i =
sample_.begin();
i !=
sample_.end(); ++
i) {
78 const PDF &
pdf()
const {
return *
pdf_; }
85 template<
typename Sample,
typename PDF,
typename Yield>
88 std::cout <<
"-2 log(maximum-likelihood) = " << amin <<
", free parameters = " << numberOfFreeParameters
93 template<
typename Sample,
typename PDF,
typename Yield>
LikelihoodEvaluator< PDF, typename Sample::value_type > Evaluator
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)