BOSS 8.0.0
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

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.)

Detailed Description

template<class T>
class EvtPdfPred< T >

Definition at line 132 of file EvtPdf.hh.

Member Typedef Documentation

◆ argument_type

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

Definition at line 134 of file EvtPdf.hh.

◆ result_type

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

Definition at line 135 of file EvtPdf.hh.

Constructor & Destructor Documentation

◆ EvtPdfPred() [1/3]

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

Definition at line 137 of file EvtPdf.hh.

137{}

Referenced by EvtPdfPred().

◆ EvtPdfPred() [2/3]

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

Definition at line 138 of file EvtPdf.hh.

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

◆ EvtPdfPred() [3/3]

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

Definition at line 139 of file EvtPdf.hh.

139: COPY_PTR( itsPdf ), COPY_MEM( itsPdfMax ) {}
#define COPY_PTR(X)
Definition EvtMacros.hh:15
#define COPY_MEM(X)
Definition EvtMacros.hh:16

◆ ~EvtPdfPred()

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

Definition at line 140 of file EvtPdf.hh.

140{ delete itsPdf; }

Member Function Documentation

◆ compute_max()

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

Definition at line 153 of file EvtPdf.hh.

153 {
154 T p = *it++;
155 itsPdfMax = EvtPdfMax<T>( p, itsPdf->evaluate( p ) * factor );
156
157 while ( !( it == end ) )
158 {
159 T p = *it++;
160 double val = itsPdf->evaluate( p ) * factor;
161 if ( val > itsPdfMax.value() ) itsPdfMax = EvtPdfMax<T>( p, val );
162 }
163 }

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

◆ getMax()

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

Definition at line 150 of file EvtPdf.hh.

150{ return itsPdfMax; }

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

◆ operator()()

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

Definition at line 142 of file EvtPdf.hh.

142 {
143 assert( itsPdf );
144 assert( itsPdfMax.valueKnown() );
145
146 double random = EvtRandom::Flat( 0., itsPdfMax.value() );
147 return ( random <= itsPdf->evaluate( p ) );
148 }
static double Flat()
Definition EvtRandom.cc:69

◆ setMax()

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

Definition at line 151 of file EvtPdf.hh.

151{ itsPdfMax = max; }

Referenced by EvtRelBreitWignerBarrierFact::getRandMass().


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