CLHEP VERSION Reference Documentation
   
CLHEP Home Page     CLHEP Documentation     CLHEP Bug Reports

EfficiencyFunctional.cc
Go to the documentation of this file.
1// -*- C++ -*-
2// $Id:
6#include <iostream>
7#include <cmath> // for log()
8
9namespace Genfun {
11_aList(aList)
12{}
13
15}
16
17double EfficiencyFunctional::operator [] (const AbsFunction & function) const {
18 double logEfficiency(0);
19 for (unsigned int i=0; i<_aList.size()-1;i++) {
20 Argument a = _aList[i];
21 Argument b(a.dimension()-1);
22 for (unsigned int j=0;j<b.dimension();j++) b[j]=a[j];
23 double f = function(b);
24 if (f<0 || f>1) {
25 std::cerr
26 << "Warning.. negative likelihood arg[" << i << "]=" << a << "f=" << f << std::endl;
27 }
28 logEfficiency -= (a[a.dimension()-1]>0.5) ? log(f):log(1-f);
29 }
30 return 2.0*logEfficiency;
31}
32} // namespace Genfun
virtual double operator[](const AbsFunction &function) const
EfficiencyFunctional(const ArgumentList &aList)
void f(void g())
Definition: excDblThrow.cc:38
std::vector< Argument > ArgumentList
@ b
@ a