Loading [MathJax]/extensions/tex2jax.js
AmpGen 2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
AmpGen::SumPDF< eventListType, pdfTypes > Class Template Reference

Detailed Description

template<class eventListType, class... pdfTypes>
class AmpGen::SumPDF< eventListType, pdfTypes >

A pdf with a probability of the form

\[ P(\psi) = \sum_{j} \mathcal{P}_j (\psi), \]

where \( \mathcal{P}_j(\psi) \) are some normalised probability density functions as a function of position in the phase space \( \psi \) , and the sum is over the different terms, typically a signal term and then a number of background terms. The pdf is also equipped with a log-likelihood of the form:

\[ -2 \mathcal{L} = - 2 \sum_{i} \log \left( \sum_{j} \mathcal{P}_j \left(\psi_i\right) \right) \]

and the sum over \( i \) is over some dataset. This combined functionality is largely historical and the two roles should be separated at some point in the future. The sum is variadically unrolled at compile time, i.e. the wrapper is the same for 1..N pdfs. The unrolling should be properly inlined, hence N can be reasonably large with out afflicting either compile time or binary size. It isn't primarily used as PDF, as its primary function is as a likelihood via function getVal(). Typically constructed using either the make_pdf helper function or make_likelihood helper function.

Definition at line 43 of file SumPDF.h.

Public Member Functions

 SumPDF ()=default
 Default Constructor.
 
 SumPDF (const pdfTypes &... pdfs)
 Constructor from a set of PDF functions.
 
double getVal ()
 Returns negative twice the log-likelihood for this PDF and the given dataset.
 
void fill_likelihood (real_v *output)
 
real_v operator() (const real_v *evt, const unsigned block)
 Returns the probability for the given event.
 
double operator() (const eventValueType &evt)
 Returns the probability for the given event.
 
void setEvents (eventListType &events)
 Sets the events to be summed over in the likelihood.
 
std::size_t nPDFs () const
 Returns the number of PDFs contained by this function.
 
std::tuple< pdfTypes... > pdfs () const
 Returns the tuple of PDFs used by this function.
 
std::function< double(const eventValueType &)> evaluator (const eventListType *events) const
 
KeyedFunctors< double(eventValueType)> componentEvaluator (const eventListType *events) const
 

Constructor & Destructor Documentation

◆ SumPDF() [1/2]

template<class eventListType, class... pdfTypes>
AmpGen::SumPDF< eventListType, pdfTypes >::SumPDF ( )
default

◆ SumPDF() [2/2]

template<class eventListType, class... pdfTypes>
AmpGen::SumPDF< eventListType, pdfTypes >::SumPDF ( const pdfTypes &... pdfs)
inline

Definition at line 55 of file SumPDF.h.

Member Function Documentation

◆ componentEvaluator()

template<class eventListType, class... pdfTypes>
KeyedFunctors< double(eventValueType)> AmpGen::SumPDF< eventListType, pdfTypes >::componentEvaluator ( const eventListType * events) const
inline

Definition at line 129 of file SumPDF.h.

◆ evaluator()

template<class eventListType, class... pdfTypes>
std::function< double(const eventValueType &)> AmpGen::SumPDF< eventListType, pdfTypes >::evaluator ( const eventListType * events) const
inline

Definition at line 120 of file SumPDF.h.

◆ fill_likelihood()

template<class eventListType, class... pdfTypes>
void AmpGen::SumPDF< eventListType, pdfTypes >::fill_likelihood ( real_v * output)
inline

Definition at line 68 of file SumPDF.h.

◆ getVal()

template<class eventListType, class... pdfTypes>
double AmpGen::SumPDF< eventListType, pdfTypes >::getVal ( )
inline

Definition at line 59 of file SumPDF.h.

◆ nPDFs()

template<class eventListType, class... pdfTypes>
std::size_t AmpGen::SumPDF< eventListType, pdfTypes >::nPDFs ( ) const
inline

Definition at line 115 of file SumPDF.h.

◆ operator()() [1/2]

template<class eventListType, class... pdfTypes>
double AmpGen::SumPDF< eventListType, pdfTypes >::operator() ( const eventValueType & evt)
inline

Definition at line 100 of file SumPDF.h.

◆ operator()() [2/2]

template<class eventListType, class... pdfTypes>
real_v AmpGen::SumPDF< eventListType, pdfTypes >::operator() ( const real_v * evt,
const unsigned block )
inline

Definition at line 93 of file SumPDF.h.

◆ pdfs()

template<class eventListType, class... pdfTypes>
std::tuple< pdfTypes... > AmpGen::SumPDF< eventListType, pdfTypes >::pdfs ( ) const
inline

Definition at line 118 of file SumPDF.h.

◆ setEvents()

template<class eventListType, class... pdfTypes>
void AmpGen::SumPDF< eventListType, pdfTypes >::setEvents ( eventListType & events)
inline

Definition at line 108 of file SumPDF.h.


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