11#include <framework/core/Module.h>
12#include <framework/datastore/StoreArray.h>
13#include <framework/logging/Logger.h>
14#include <framework/gearbox/Const.h>
16#include <mdst/dataobjects/Track.h>
17#include <mdst/dataobjects/PIDLikelihood.h>
19#include <top/dataobjects/TOPLikelihood.h>
20#include <arich/dataobjects/ARICHLikelihood.h>
21#include <reconstruction/dataobjects/CDCDedxLikelihood.h>
22#include <reconstruction/dataobjects/VXDDedxLikelihood.h>
23#include <ecl/dataobjects/ECLPidLikelihood.h>
24#include <klm/dataobjects/KLMMuidLikelihood.h>
59 virtual void event()
override;
108 return logl->getLogL(chargedStable);
141 std::vector<float> values;
143 auto value =
getLogL(logl, chargedStable);
144 values.push_back(value);
145 if (std::isnan(value) or value == INFINITY) {
146 B2ERROR(
"MdstPID::setLikelihoods: invalid " << logl->ClassName() <<
" for " <<
m_chargedNames[chargedStable]
148 <<
". Likelihoods ignored.");
153 for (
auto value : values) {
154 if (value != values.back())
return true;
This is a class to store ARICH likelihoods in the datastore.
Container for likelihoods obtained by the CDC dE/dx PID (CDCDedxPIDModule).
Provides a type-safe way to pass members of the chargedStableSet set.
int getPDGCode() const
PDG code.
static const ParticleSet chargedStableSet
set of charged stable particles
Container for likelihoods with ECL PID (ECLChargedPIDModule)
float getLogLikelihood(const Const::ChargedStable &type) const
returns log-likelihood value for a particle hypothesis.
Class to store the likelihoods from KLM with additional information related to the extrapolation.
double getLogL(int pdg) const
Get the log-likelihood.
a module to fill PIDLikelihoods
StoreArray< KLMMuidLikelihood > m_muid
Optional collection of KLMMuidLikelihood.
bool areLikelihoodsValid(const T *logl)
Check for validity of log likelihood values (NaN and +Inf are not allowed).
float getLogL(const ECLPidLikelihood *logl, const Const::ChargedStable &chargedStable) const
Get log likelihood for a given particle (ECL specialization)
StoreArray< VXDDedxLikelihood > m_vxdDedxLikelihoods
Optional collection of VXDDedxLikelihoods.
bool m_subtractMaximum
if true subtract the maximum of log likelihoods
virtual void initialize() override
Initialize the module.
virtual void event() override
Called for each event.
StoreArray< TOPLikelihood > m_topLikelihoods
Optional collection of TOPLikelihoods.
MdstPIDModule()
Constructor.
StoreArray< ECLPidLikelihood > m_eclLikelihoods
Optional collection of ECLPidLikelihoods.
PIDLikelihood * m_pid
pointer to the object to be filled
std::map< Const::ChargedStable, std::string > m_chargedNames
names of charged particles (used in error messages)
StoreArray< Track > m_tracks
Required collection of Tracks.
StoreArray< ARICHLikelihood > m_arichLikelihoods
Optional collection of ARICHLikelihoods.
void setLikelihoods(const TOPLikelihood *logl)
Set TOP log likelihoods and corresponding reconstruction flag.
StoreArray< CDCDedxLikelihood > m_cdcDedxLikelihoods
Optional collection of CDCDedxLikelihoods.
float getLogL(const T *logl, const Const::ChargedStable &chargedStable) const
Get log likelihood for a given particle.
StoreArray< PIDLikelihood > m_pidLikelihoods
collection of PIDLikelihoods
float getLogL(const KLMMuidLikelihood *logl, const Const::ChargedStable &chargedStable) const
Get log likelihood for a given particle (KLM specialization)
Class to collect log likelihoods from TOP, ARICH, dEdx, ECL and KLM aimed for output to mdst includes...
Accessor to arrays stored in the data store.
Class to store TOP log likelihoods (output of TOPReconstructor).
Container for likelihoods obtained by the VXD dE/dx PID (VXDDedxPIDModule).
Abstract base class for different kinds of events.