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

 EvtPdfPred ()
 EvtPdfPred (const EvtPdf< T > &thePdf)
 EvtPdfPred (const EvtPdfPred &other)
 ~EvtPdfPred ()
result_type operator() (argument_type p)
EvtPdfMax< T > getMax () const
void setMax (const EvtPdfMax< T > &max)
template<class InputIterator>
void compute_max (InputIterator it, InputIterator end, double factor=1.)

Private Attributes

EvtPdf< T > * itsPdf
EvtPdfMax< T > itsPdfMax


Detailed Description

template<class T>
class EvtPdfPred< T >

Definition at line 136 of file EvtPdf.hh.


Member Typedef Documentation

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

Definition at line 138 of file EvtPdf.hh.

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

Definition at line 139 of file EvtPdf.hh.


Constructor & Destructor Documentation

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

Definition at line 141 of file EvtPdf.hh.

00141 {}

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

Definition at line 142 of file EvtPdf.hh.

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

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

Definition at line 143 of file EvtPdf.hh.

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

Definition at line 144 of file EvtPdf.hh.

References EvtPdfPred< T >::itsPdf.

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]

Definition at line 157 of file EvtPdf.hh.

References EvtPdfPred< T >::itsPdf, EvtPdfPred< T >::itsPdfMax, T, and EvtPdfMax< Point >::value().

Referenced by EvtPdf< T >::accRejGen(), and EvtPdf< T >::findMax().

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]

Definition at line 155 of file EvtPdf.hh.

References EvtPdfPred< T >::itsPdfMax.

Referenced by EvtPdf< T >::findMax().

00155 { return itsPdfMax; }  

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

Definition at line 146 of file EvtPdf.hh.

References EvtRandom::Flat(), EvtPdfPred< T >::itsPdf, EvtPdfPred< T >::itsPdfMax, EvtPdfMax< Point >::value(), and EvtPdfMax< Point >::valueKnown().

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]

Definition at line 156 of file EvtPdf.hh.

References EvtPdfPred< T >::itsPdfMax, and max.

00156 { itsPdfMax = max; }


Member Data Documentation

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

Definition at line 172 of file EvtPdf.hh.

Referenced by EvtPdfPred< T >::compute_max(), EvtPdfPred< T >::operator()(), and EvtPdfPred< T >::~EvtPdfPred().

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

Definition at line 173 of file EvtPdf.hh.

Referenced by EvtPdfPred< T >::compute_max(), EvtPdfPred< T >::getMax(), EvtPdfPred< T >::operator()(), and EvtPdfPred< T >::setMax().


Generated on Tue Nov 29 23:19:10 2016 for BOSS_7.0.2 by  doxygen 1.4.7