83 float pmin_vals[] = {0.2, 0.6, 1.0, 100.0};
84 float thetamin_vals[] = {0.21, 0.56, 2.24, 2.70};
86 TH2F histgrid(
"binsgrid",
88 sizeof(thetamin_vals) /
sizeof(
float) - 1,
90 sizeof(pmin_vals) /
sizeof(
float) - 1,
101 typedef std::pair<int, TF1> pdfSet;
103 pdfSet pdf_el = std::make_pair(-1, TF1(
"pdf_el",
"TMath::Gaus(x, 1.0, 0.2, true)", 0.0, 1.3));
104 pdfSet pdf_elanti = std::make_pair(1, TF1(
"pdf_elanti",
"TMath::Gaus(x, 0.9, 0.2, true)", 0.0, 1.2));
106 pdfSet pdf_mu = std::make_pair(-1, TF1(
"pdf_mu",
"TMath::Gaus(x, 0.3, 0.2, true)", 0.0, 1.0));
107 pdfSet pdf_muanti = std::make_pair(1, TF1(
"pdf_muanti",
"TMath::Gaus(x, 0.35, 0.22, true)", 0.0, 1.0));
109 pdfSet pdf_pi = std::make_pair(1, TF1(
"pdf_pi",
"TMath::Gaus(x, 0.4, 0.1, true)", 0.0, 1.0));
110 pdfSet pdf_pianti = std::make_pair(-1, TF1(
"pdf_pianti",
"TMath::Gaus(x, 0.38, 0.15, true)", 0.0, 1.0));
112 pdfSet pdf_k = std::make_pair(1, TF1(
"pdf_k",
"TMath::Gaus(x, 0.38, 0.2, true)", 0.0, 1.0));
113 pdfSet pdf_kanti = std::make_pair(-1, TF1(
"pdf_kanti",
"TMath::Gaus(x, 0.5, 0.22, true)", 0.0, 1.0));
115 pdfSet pdf_p = std::make_pair(1, TF1(
"pdf_p",
"TMath::Gaus(x, 1.0, 0.4, true)", 0.0, 1.6));
116 pdfSet pdf_panti = std::make_pair(-1, TF1(
"pdf_panti",
"TMath::Gaus(x, 1.3, 0.5, true)", 0.0, 2.0));
118 pdfSet pdf_d = std::make_pair(1, TF1(
"pdf_d",
"TMath::Gaus(x, 1.1, 0.45, true)", 0.0, 1.6));
119 pdfSet pdf_danti = std::make_pair(-1, TF1(
"pdf_danti",
"TMath::Gaus(x, 1.2, 0.6, true)", 0.0, 2.0));
121 std::map<unsigned int, std::vector<pdfSet>> pdfs = {
122 {
Const::electron.getPDGCode(), std::vector<pdfSet>{pdf_el, pdf_elanti}},
123 {
Const::muon.getPDGCode(), std::vector<pdfSet>{pdf_mu, pdf_muanti}},
124 {
Const::pion.getPDGCode(), std::vector<pdfSet>{pdf_pi, pdf_pianti}},
125 {
Const::kaon.getPDGCode(), std::vector<pdfSet>{pdf_k, pdf_kanti}},
126 {
Const::proton.getPDGCode(), std::vector<pdfSet>{pdf_p, pdf_panti}},
135 for (
auto& [pdg, pdf_setlist] : pdfs) {
136 for (
auto& pdf_set : pdf_setlist) {
137 for (
int ip(1); ip <= histgrid.GetNbinsY(); ++ip) {
138 for (
int jth(1); jth <= histgrid.GetNbinsX(); ++jth) {
139 for (
const auto& varid : varids) {
140 eclPdfs.
add(pdg, pdf_set.first, ip, jth, varid, &pdf_set.second);
152 double clusterTheta = 1.047;
157 for (
const auto& [pdg, pdf_setlist] : pdfs) {
158 for (
const auto& pdf_set : pdf_setlist) {
159 float pdfval = eclPdfs.
getPdf(pdg, pdf_set.first, p, clusterTheta, varids.at(0))->Eval(eop);
160 EXPECT_NEAR(pdf_set.second.Eval(eop), pdfval, 0.001);
161 if (pdf_set.first < 0) {
171 const auto* lk_minus = ecl_likelihoods_minus.
appendNew(likelihoods_minus);
173 const auto* lk_plus = ecl_likelihoods_plus.
appendNew(likelihoods_plus);
175 for (
const auto& [pdg, pdf_setlist] : pdfs) {
176 for (
const auto& pdf_set : pdf_setlist) {
178 float logl_expect = log(pdf_set.second.Eval(eop));
179 if (pdf_set.first < 0) {
184 EXPECT_NEAR(logl_expect, logl, 0.01);