BOSS 7.0.9
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtPdfPred< T > Class Template Reference

#include <EvtPdf.hh>

Public Types

typedef T argument_type
 
typedef bool result_type
 
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.)
 
 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.)
 

Detailed Description

template<class T>
class EvtPdfPred< T >

Definition at line 136 of file BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtPdf.hh.

Member Typedef Documentation

◆ argument_type [1/2]

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

◆ argument_type [2/2]

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

◆ result_type [1/2]

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

◆ result_type [2/2]

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

Constructor & Destructor Documentation

◆ EvtPdfPred() [1/6]

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

◆ EvtPdfPred() [2/6]

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

Definition at line 142 of file bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtPdf.hh.

142: itsPdf(thePdf.clone()) {}
virtual EvtPdf< T > * clone() const =0

◆ EvtPdfPred() [3/6]

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

◆ ~EvtPdfPred() [1/2]

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

Definition at line 144 of file bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtPdf.hh.

144{ delete itsPdf; }

◆ EvtPdfPred() [4/6]

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

Definition at line 141 of file BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtPdf.hh.

141{}

◆ EvtPdfPred() [5/6]

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

Definition at line 142 of file BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtPdf.hh.

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

◆ EvtPdfPred() [6/6]

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

Definition at line 143 of file BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtPdf.hh.

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

◆ ~EvtPdfPred() [2/2]

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

Definition at line 144 of file BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtPdf.hh.

144{ delete itsPdf; }

Member Function Documentation

◆ compute_max() [1/2]

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 bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtPdf.hh.

159 {
160 T p = *it++;
161 itsPdfMax = EvtPdfMax<T>(p,itsPdf->evaluate(p)*factor);
162
163 while(!(it == end)) {
164 T p = *it++;
165 double val = itsPdf->evaluate(p)*factor;
166 if(val > itsPdfMax.value()) itsPdfMax = EvtPdfMax<T>(p,val);
167 }
168 }

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

◆ compute_max() [2/2]

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 BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtPdf.hh.

159 {
160 T p = *it++;
161 itsPdfMax = EvtPdfMax<T>(p,itsPdf->evaluate(p)*factor);
162
163 while(!(it == end)) {
164 T p = *it++;
165 double val = itsPdf->evaluate(p)*factor;
166 if(val > itsPdfMax.value()) itsPdfMax = EvtPdfMax<T>(p,val);
167 }
168 }

◆ getMax() [1/2]

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

Definition at line 155 of file bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtPdf.hh.

155{ return itsPdfMax; }

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

◆ getMax() [2/2]

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

Definition at line 155 of file BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtPdf.hh.

155{ return itsPdfMax; }

◆ operator()() [1/2]

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

Definition at line 146 of file bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtPdf.hh.

147 {
148 assert(itsPdf);
149 assert(itsPdfMax.valueKnown());
150
151 double random = EvtRandom::Flat(0.,itsPdfMax.value());
152 return (random <= itsPdf->evaluate(p));
153 }

◆ operator()() [2/2]

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

Definition at line 146 of file BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtPdf.hh.

147 {
148 assert(itsPdf);
149 assert(itsPdfMax.valueKnown());
150
151 double random = EvtRandom::Flat(0.,itsPdfMax.value());
152 return (random <= itsPdf->evaluate(p));
153 }

◆ setMax() [1/2]

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

◆ setMax() [2/2]

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

Definition at line 156 of file BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtPdf.hh.

156{ itsPdfMax = max; }

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