#include <EvtPdf.hh>
Public Types | |
typedef T | argument_type |
typedef bool | result_type |
Public Member Functions | |
template<class InputIterator> | |
void | compute_max (InputIterator it, InputIterator end, double factor=1.) |
EvtPdfPred (const EvtPdfPred &other) | |
EvtPdfPred (const EvtPdf< T > &thePdf) | |
EvtPdfPred () | |
EvtPdfMax< T > | getMax () const |
result_type | operator() (argument_type p) |
void | setMax (const EvtPdfMax< T > &max) |
~EvtPdfPred () | |
Private Attributes | |
EvtPdf< T > * | itsPdf |
EvtPdfMax< T > | itsPdfMax |
|
|
|
|
|
00141 {}
|
|
|
|
|
|
00144 { delete itsPdf; }
|
|
00159 { 00160 T p = *it++; 00161 itsPdfMax = EvtPdfMax<T>(p,itsPdf->evaluate(p)*factor); 00162 00163 while(!(it == end)) { 00164 T p = *it++; 00165 double val = itsPdf->evaluate(p)*factor; 00166 if(val > itsPdfMax.value()) itsPdfMax = EvtPdfMax<T>(p,val); 00167 } 00168 }
|
|
00155 { return itsPdfMax; }
|
|
00147 { 00148 assert(itsPdf); 00149 assert(itsPdfMax.valueKnown()); 00150 00151 double random = EvtRandom::Flat(0.,itsPdfMax.value()); 00152 return (random <= itsPdf->evaluate(p)); 00153 }
|
|
00156 { itsPdfMax = max; }
|
|
|
|
|