11#include <framework/datastore/RelationsObject.h>
12#include <framework/gearbox/Const.h>
134 const double* fractions =
nullptr,
148 const double* fractions =
nullptr,
176 const double preOfficialLikelihood);
194 const double* fractions,
Provides a type-safe way to pass members of the chargedStableSet set.
static const unsigned int c_SetSize
Number of elements (for use in array bounds etc.)
The DetectorSet class for sets of detector IDs in the form of EDetector values.
static const size_t c_size
Number of PID detectors, temporary workaround.
RestrictedDetectorSet< PIDDetectors > PIDDetectorSet
Typedef for set of PID detectors.
EDetector
Enum for identifying the detector components (detector and subdetector).
PIDLikelihood()
Default constructor: log likelihoods and flags set to 0.
Const::ChargedStable getMostLikely(const double *fractions=nullptr, Const::PIDDetectorSet set=Const::PIDDetectorSet::set()) const
Return most likely particle among chargedStableSet; if prior fractions not given equal prior probabil...
void subtractMaximum()
Subtract the maximum of log likelihoods of each detector component in order to reduce the range of va...
std::map< std::string, double > m_preOfficialLikelihoods
Internal storage of pre-official likelihood.
double getLogarithmicProbability(const Const::ChargedStable &part, const double *fractions=nullptr, Const::PIDDetectorSet set=Const::PIDDetectorSet::set()) const
Return logarithmic equivalent of likelihood probability defined as log(p/(1-p)), where p is the combi...
bool isAvailable(Const::PIDDetectorSet set=Const::PIDDetectorSet::set()) const
Check whether PID information is available for at least one of the detectors in a given set.
std::string getInfoHTML() const override
Return HTML Info of PID Likelihoods.
float m_logl[Const::PIDDetectors::c_size][Const::ChargedStable::c_SetSize]
log likelihoods
void printArray() const
Prints the content of a private array of log likelihoods.
float getLogL(const Const::ChargedStable &part, Const::PIDDetectorSet set=Const::PIDDetectorSet::set()) const
Return log likelihood for a given detector set and particle.
void setLogLikelihood(Const::EDetector det, const Const::ChargedStable &part, float logl)
Set log likelihood for a given detector and particle.
void addPreOfficialLikelihood(const std::string &preOfficialIdentifier, const double preOfficialLikelihood)
Add the pre-official likelihood.
bool areAllAvailable(Const::PIDDetectorSet set=Const::PIDDetectorSet::set()) const
Check whether PID information is available for all detectors in a given set.
ClassDefOverride(PIDLikelihood, 5)
Collect log likelihoods from TOP, ARICH, dEdx, ECL and KLM.
void probability(double probabilities[], const double *fractions, Const::PIDDetectorSet detSet) const
Calculate likelihood probabilities.
double getProbability(const Const::ChargedStable &p1, const Const::ChargedStable &p2, Const::PIDDetectorSet set=Const::PIDDetectorSet::set()) const
Return combined likelihood probability for a particle being p1 and not p2, assuming equal prior proba...
Const::DetectorSet m_detectors
set of detectors with PID information
float getDeltaLogL(const Const::ChargedStable &p1, const Const::ChargedStable &p2, Const::PIDDetectorSet set=Const::PIDDetectorSet::set()) const
Return log likelihood difference between two particles for a given detector set.
double getPreOfficialLikelihood(const std::string &preOfficialIdentifier) const
Get the pre-official likelihood.
RelationsInterface< TObject > RelationsObject
Provides interface for getting/adding relations to objects in StoreArrays.
Abstract base class for different kinds of events.