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 class SimFit {
8 public:
9 SimFit() = default;
10 double getVal() {
11 double LL = 0;
12 for(auto &pdf : m_pdfs) LL += pdf();
13 return LL;
14 }
15
16 template <class PDF> void add(PDF &pdf) {
17 INFO("Adding " << &pdf << " to sim fit");
18 m_pdfs.emplace_back([&pdf]() -> double { return pdf.getVal(); });
19 }
20
21 private:
22 std::vector<std::function<double(void)>> m_pdfs;
23 };
24} // namespace AmpGen
25
26#endif
SimFit()=default
double getVal()
Definition SimPDF.h:10
void add(PDF &pdf)
Definition SimPDF.h:16
#define INFO(X)
Used for printing information messages, and will always be printed.
Definition MsgService.h:81