CGEM BOSS 6.6.5.f
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 136 of file EvtPdf.hh.

Member Typedef Documentation

◆ argument_type

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

Definition at line 138 of file EvtPdf.hh.

◆ result_type

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

Definition at line 139 of file EvtPdf.hh.

Constructor & Destructor Documentation

◆ EvtPdfPred() [1/3]

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

Definition at line 141 of file EvtPdf.hh.

141{}

◆ EvtPdfPred() [2/3]

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

Definition at line 142 of file EvtPdf.hh.

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

◆ EvtPdfPred() [3/3]

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

Definition at line 143 of file EvtPdf.hh.

143: 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 144 of file EvtPdf.hh.

144{ 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 157 of file 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 }
double value() const
Definition: EvtPdfMax.hh:39

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

◆ getMax()

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

Definition at line 155 of file EvtPdf.hh.

155{ return itsPdfMax; }

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

◆ operator()()

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

Definition at line 146 of file 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 }
bool valueKnown() const
Definition: EvtPdfMax.hh:38
static double Flat()
Definition: EvtRandom.cc:73

◆ setMax()

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

Definition at line 156 of file EvtPdf.hh.

156{ itsPdfMax = max; }

Referenced by EvtRelBreitWignerBarrierFact::getRandMass().


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