CLHEP 2.4.6.4
C++ Class Library for High Energy Physics
Loading...
Searching...
No Matches
Genfun::LikelihoodFunctional Class Reference

#include <LikelihoodFunctional.hh>

+ Inheritance diagram for Genfun::LikelihoodFunctional:

Public Member Functions

 LikelihoodFunctional (const ArgumentList &aList)
 
 ~LikelihoodFunctional ()
 
virtual double operator[] (const AbsFunction &function) const
 
- Public Member Functions inherited from Genfun::AbsFunctional
 AbsFunctional ()
 
virtual ~AbsFunctional ()
 
virtual double operator[] (const AbsFunction &function) const =0
 

Detailed Description

Author

Definition at line 20 of file LikelihoodFunctional.hh.

Constructor & Destructor Documentation

◆ LikelihoodFunctional()

Genfun::LikelihoodFunctional::LikelihoodFunctional ( const ArgumentList aList)

Definition at line 13 of file LikelihoodFunctional.cc.

13 :
14_aList(aList)
15{}

◆ ~LikelihoodFunctional()

Genfun::LikelihoodFunctional::~LikelihoodFunctional ( )

Definition at line 17 of file LikelihoodFunctional.cc.

17 {
18}

Member Function Documentation

◆ operator[]()

double Genfun::LikelihoodFunctional::operator[] ( const AbsFunction function) const
virtual

Implements Genfun::AbsFunctional.

Definition at line 20 of file LikelihoodFunctional.cc.

20 {
21 double logLikelihood(0);
22 for (unsigned int i=0; i<_aList.size();i++) {
23 Argument a = _aList[i];
24 double f = function(a);
25 if (f<=0.0) {
26 std::ostringstream stream;
27 stream << "Negative likelihood arg[" << i << "]=" << a;
28 throw std::runtime_error(stream.str());
29 }
30 logLikelihood -= log(f);
31 }
32 return 2.0*logLikelihood;
33}
void f(void g())
Definition: excDblThrow.cc:38

The documentation for this class was generated from the following files: