9 #include <reconstruction/modules/CombinedPIDPerformance/CombinedPIDPerformanceModule.h>
11 #include <root/TObject.h>
22 setDescription(
"This module evaluates the combined PID performance");
24 addParam(
"outputFileName", m_rootFileName,
"Name of output root file.",
25 std::string(
"CombinedPIDPerformance_output.root"));
26 addParam(
"mdstType", m_mdstType,
"Type of mdst file (Belle/BelleII).",
27 std::string(
"BelleII"));
29 addParam(
"numberOfBins", m_nbins,
"Number of momentum bins.",
int(100));
30 addParam(
"pLow", m_pLow,
"Lower bound of momentum range.",
double(0.0));
31 addParam(
"pHigh", m_pHigh,
"Upper bound of momentum range.",
double(5.0));
39 B2INFO(
"Making PID Performance plots...");
77 const int npbins = 18;
78 const int npidbins = 101;
79 const float pidlow = 0.;
80 const float pidhigh = 1.01;
81 const char* names[] = {
"pi",
"k",
"e",
"mu",
"p" };
85 for (
int Hypo = 0; Hypo < 5; Hypo++) {
86 for (
int k = 0; k < 10; k++) {
87 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,
134 for (
unsigned int i = 0; i <
muonSet.
size(); ++i) {
168 for (
const auto& track :
m_tracks) {
172 B2WARNING(
"No track fit result... Skipping.");
178 B2WARNING(
"No PID information... Skipping.");
183 if (!mcParticle)
continue;
184 int pdg = mcParticle->
getPDG();
187 if (trackFit->
getPValue() < 0.001)
continue;
205 while ((obj = nextH()))
226 if (
m_mdstType ==
"BelleII") det += Const::SVD;
230 if (
m_mdstType ==
"BelleII") det += Const::SVD;
235 if (
m_mdstType ==
"BelleII") det += Const::SVD;
242 double logl_pi = 0, logl_k = 0, logl_p = 0;
302 pidval =
pidvalue(logl_p, logl_pi + logl_k);
321 if (
m_mdstType ==
"BelleII") det += Const::SVD;
328 double logl_e = 0, logl_pi_e = 0;
339 pidval =
pidvalue(logl_e, logl_pi_e);
348 pidval =
pidvalue(logl_pi_e, logl_e);
354 for (
unsigned int i = 0; i <
muonSet.
size(); ++i) {
359 double logl_mu = 0, logl_pi_mu = 0;
370 pidval =
pidvalue(logl_mu, logl_pi_mu);
379 pidval =
pidvalue(logl_pi_mu, logl_mu);
386 Int_t nbins, Double_t min, Double_t max, TList* histoList)
389 TEfficiency* h =
new TEfficiency(name, title, nbins, min, max);
403 float dl = logl_b - logl_a;
406 val = 1 / (1 + exp(dl));
408 val = exp(-1 * dl) / (1 + exp(-1 * dl));
419 for (
unsigned int i = 0; i < dets.
size(); ++i) {
The DetectorSet class for sets of detector IDs in the form of EDetector values.
size_t size() const
Getter for number of detector IDs in this set.
int getPDGCode() const
PDG code.
static const ChargedStable muon
muon particle
EDetector
Enum for identifying the detector components (detector and subdetector).
static const ChargedStable pion
charged pion particle
static const ChargedStable proton
proton particle
static const ChargedStable kaon
charged kaon particle
static const ChargedStable electron
electron particle
static const ChargedStable deuteron
deuteron particle
A Class to store the Monte Carlo particle information.
@ c_PrimaryParticle
bit 0: Particle is primary particle.
unsigned int getStatus(unsigned short int bitmask=USHRT_MAX) const
Return status code of particle.
int getPDG() const
Return PDG code of particle.
TVector3 getProductionVertex() const
Return production vertex position.
Class to collect log likelihoods from TOP, ARICH, dEdx, ECL and KLM aimed for output to mdst includes...
bool isAvailable(Const::PIDDetectorSet set) const
Check whether PID information from a given set of detectors is available.
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
Values of the result of a track fit with a given particle hypothesis.
double getPValue() const
Getter for Chi2 Probability of the track fit.
TVector3 getMomentum() const
Getter for vector of momentum at closest approach of track in r/phi projection.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.