AmpGen 2.1
Loading...
Searching...
No Matches
SimPDF.h
Go to the documentation of this file.
1#ifndef AMPGEN_SIMPDF_H
2#define AMPGEN_SIMPDF_H
3
4#include <tuple>
5
6namespace AmpGen
7{
8 class SimFit
9 {
10 public:
11 SimFit() = default;
12 double getVal()
13 {
14 double LL = 0;
15 for ( auto& pdf : m_pdfs ) LL += pdf();
16 return LL;
17 }
18
19 template <class PDF>
20 void add( PDF& pdf )
21 {
22 INFO( "Adding " << &pdf << " to sim fit" );
23 m_pdfs.emplace_back( [&pdf]() -> double { return pdf.getVal(); } );
24 }
25
26 private:
27 std::vector<std::function<double( void )>> m_pdfs;
28
29 };
30} // namespace AmpGen
31
32#endif
SimFit()=default
double getVal()
Definition SimPDF.h:12
void add(PDF &pdf)
Definition SimPDF.h:20
#define INFO(X)
Used for printing information messages, and will always be printed.
Definition MsgService.h:75