11 #include <reconstruction/modules/CombinedPIDPerformance/CombinedPIDPerformanceModule.h>
13 #include <root/TObject.h>
24 setDescription(
"This module evaluates the combined PID performance");
26 addParam(
"outputFileName", m_rootFileName,
"Name of output root file.",
27 std::string(
"CombinedPIDPerformance_output.root"));
28 addParam(
"mdstType", m_mdstType,
"Type of mdst file (Belle/BelleII).",
29 std::string(
"BelleII"));
31 addParam(
"numberOfBins", m_nbins,
"Number of momentum bins.",
int(100));
32 addParam(
"pLow", m_pLow,
"Lower bound of momentum range.",
double(0.0));
33 addParam(
"pHigh", m_pHigh,
"Upper bound of momentum range.",
double(5.0));
41 B2INFO(
"Making PID Performance plots...");
79 const int npbins = 18;
80 const int npidbins = 101;
81 const float pidlow = 0.;
82 const float pidhigh = 1.01;
83 const char* names[] = {
"pi",
"k",
"e",
"mu",
"p" };
87 for (
int Hypo = 0; Hypo < 5; Hypo++) {
88 for (
int k = 0; k < 10; k++) {
89 h_ROC[Hypo][k] =
new TH3F(Form(
"ROC_%s_%d", names[Hypo], k), Form(
";PID(%s);N;p (GeV)", names[Hypo]), 5, 0, 5, npidbins, pidlow,
136 for (
unsigned int i = 0; i <
muonSet.
size(); ++i) {
170 for (
const auto& track :
m_tracks) {
174 B2WARNING(
"No track fit result... Skipping.");
180 B2WARNING(
"No PID information... Skipping.");
185 if (!mcParticle)
continue;
186 int pdg = mcParticle->
getPDG();
189 if (trackFit->
getPValue() < 0.001)
continue;
207 while ((obj = nextH()))
228 if (
m_mdstType ==
"BelleII") det += Const::SVD;
232 if (
m_mdstType ==
"BelleII") det += Const::SVD;
237 if (
m_mdstType ==
"BelleII") det += Const::SVD;
244 double logl_pi = 0, logl_k = 0, logl_p = 0;
252 if (
pidavail(pid, det) and abs(pdg) == 211) {
276 if (
pidavail(pid, det) and abs(pdg) == 321) {
297 if (
pidavail(pid, det) and abs(pdg) == 2212) {
304 pidval =
pidvalue(logl_p, logl_pi + logl_k);
309 if (
pidavail(pid, det) and abs(pdg) == 1000010020) {
323 if (
m_mdstType ==
"BelleII") det += Const::SVD;
330 double logl_e = 0, logl_pi_e = 0;
337 if (
pidavail(pid, det) and abs(pdg) == 11) {
341 pidval =
pidvalue(logl_e, logl_pi_e);
346 if (
pidavail(pid, det) and abs(pdg) == 211) {
350 pidval =
pidvalue(logl_pi_e, logl_e);
356 for (
unsigned int i = 0; i <
muonSet.
size(); ++i) {
361 double logl_mu = 0, logl_pi_mu = 0;
368 if (
pidavail(pid, det) and abs(pdg) == 13) {
372 pidval =
pidvalue(logl_mu, logl_pi_mu);
377 if (
pidavail(pid, det) and abs(pdg) == 211) {
381 pidval =
pidvalue(logl_pi_mu, logl_mu);
388 Int_t nbins, Double_t min, Double_t max, TList* histoList)
391 TEfficiency* h =
new TEfficiency(name, title, nbins, min, max);
405 float dl = logl_b - logl_a;
408 val = 1 / (1 + exp(dl));
410 val = exp(-1 * dl) / (1 + exp(-1 * dl));
421 for (
unsigned int i = 0; i < dets.
size(); ++i) {