Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

EvtPdfPred< T > Class Template Reference

#include <EvtPdf.hh>

List of all members.

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

template<class T>
class EvtPdfPred< T >


Member Typedef Documentation

template<class T>
typedef T EvtPdfPred< T >::argument_type
 

template<class T>
typedef bool EvtPdfPred< T >::result_type
 


Constructor & Destructor Documentation

template<class T>
EvtPdfPred< T >::EvtPdfPred  )  [inline]
 

00141 {}

template<class T>
EvtPdfPred< T >::EvtPdfPred const EvtPdf< T > &  thePdf  )  [inline]
 

00142 : itsPdf(thePdf.clone()) {}

template<class T>
EvtPdfPred< T >::EvtPdfPred const EvtPdfPred< T > &  other  )  [inline]
 

00143 : COPY_PTR(itsPdf), COPY_MEM(itsPdfMax) {}

template<class T>
EvtPdfPred< T >::~EvtPdfPred  )  [inline]
 

00144 { delete itsPdf; }


Member Function Documentation

template<class T>
template<class InputIterator>
void EvtPdfPred< T >::compute_max InputIterator  it,
InputIterator  end,
double  factor = 1.
[inline]
 

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   }

template<class T>
EvtPdfMax<T> EvtPdfPred< T >::getMax  )  const [inline]
 

00155 { return itsPdfMax; }  

template<class T>
result_type EvtPdfPred< T >::operator() argument_type  p  )  [inline]
 

00147   {
00148     assert(itsPdf);
00149     assert(itsPdfMax.valueKnown());
00150     
00151     double random = EvtRandom::Flat(0.,itsPdfMax.value());
00152     return (random <= itsPdf->evaluate(p));     
00153   }

template<class T>
void EvtPdfPred< T >::setMax const EvtPdfMax< T > &  max  )  [inline]
 

00156 { itsPdfMax = max; }


Member Data Documentation

template<class T>
EvtPdf<T>* EvtPdfPred< T >::itsPdf [private]
 

template<class T>
EvtPdfMax<T> EvtPdfPred< T >::itsPdfMax [private]
 


The documentation for this class was generated from the following file:
Generated on Wed Feb 2 16:08:18 2011 for BOSS6.5.5 by  doxygen 1.3.9.1