10 #include <reconstruction/modules/MdstPID/MdstPIDModule.h>
13 #include <framework/gearbox/Const.h>
14 #include <framework/logging/Logger.h>
15 #include <klm/muid/MuidElementNumbers.h>
33 setDescription(
"Create MDST PID format (PIDLikelihood objects) from subdetector PID info.");
34 setPropertyFlags(c_ParallelProcessingCertified);
37 MdstPIDModule::~MdstPIDModule()
41 void MdstPIDModule::initialize()
46 m_tracks.isRequired();
47 m_pidLikelihoods.registerInDataStore();
48 m_tracks.registerRelationTo(m_pidLikelihoods);
51 m_topLikelihoods.isOptional();
52 m_arichLikelihoods.isOptional();
53 m_cdcDedxLikelihoods.isOptional();
54 m_vxdDedxLikelihoods.isOptional();
55 m_eclLikelihoods.isOptional();
60 void MdstPIDModule::beginRun()
64 void MdstPIDModule::endRun()
68 void MdstPIDModule::terminate()
72 void MdstPIDModule::event()
75 for (
int itra = 0; itra < m_tracks.getEntries(); ++itra) {
78 const Track* track = m_tracks[itra];
81 m_pid = m_pidLikelihoods.appendNew();
82 track->addRelationTo(m_pid);
86 if (top) setLikelihoods(top);
90 if (arich) setLikelihoods(arich);
94 if (cdcdedx) setLikelihoods(cdcdedx);
98 if (vxddedx) setLikelihoods(vxddedx);
102 if (ecl) setLikelihoods(ecl);
106 if (muid) setLikelihoods(muid);
115 if (logl->
getFlag() != 1)
return;
117 for (
const auto& chargedStable : Const::chargedStableSet) {
118 m_pid->setLogLikelihood(Const::TOP, chargedStable, logl->
getLogL(chargedStable));
126 if (logl->
getFlag() != 1)
return;
128 for (
const auto& chargedStable : Const::chargedStableSet) {
129 m_pid->setLogLikelihood(Const::ARICH, chargedStable, logl->
getLogL(chargedStable));
138 for (
const auto& chargedStable : Const::chargedStableSet) {
139 m_pid->setLogLikelihood(Const::CDC, chargedStable, logl->
getLogL(chargedStable));
148 for (
const auto& chargedStable : Const::chargedStableSet) {
149 m_pid->setLogLikelihood(Const::SVD, chargedStable, logl->
getLogL(chargedStable));
158 for (
const auto& chargedStable : Const::chargedStableSet) {
159 m_pid->setLogLikelihood(Const::ECL, chargedStable, logl->
getLogLikelihood(chargedStable));
167 if (abs(muid->getPDGCode()) != abs(Const::muon.getPDGCode())) {
168 B2WARNING(
"MdstPID, KLMMuidLikelihood: extrapolation with other than muon hypothesis ignored");
172 if (muid->getOutcome() == MuidElementNumbers::c_NotReached)
175 if (muid->getJunkPDFValue())
178 for (
const auto& chargedStable : Const::chargedStableSet) {
179 m_pid->setLogLikelihood(Const::KLM, chargedStable, muid->getLogL(chargedStable.getPDGCode()));
This is a class to store ARICH likelihoods in the datastore.
int getFlag() const
Get reconstruction flag.
float getLogL(const Const::ChargedStable &part) const
Return log likelihood for a given particle.
Container for likelihoods obtained by the CDC dE/dx PID (CDCDedxPIDModule).
double getLogL(const Const::ChargedStable &type) const
returns unnormalised log-likelihood value for a particle hypothesis using CDC information.
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 informations related to the extrapolation.
a module to fill PIDLikelihoods
Class to store TOP log likelihoods (output of TOPReconstructor).
int getFlag() const
Return reconstruction flag.
float getLogL(const Const::ChargedStable &part) const
Return log likelihood for a given particle.
Class that bundles various TrackFitResults.
Container for likelihoods obtained by the VXD dE/dx PID (VXDDedxPIDModule).
double getLogL(const Const::ChargedStable &type) const
returns unnormalised log-likelihood value for a particle hypothesis using SVD (and/or PXD) informatio...
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.