9#include <mdst/dataobjects/Track.h>
10#include <framework/datastore/StoreArray.h>
11#include <framework/logging/Logger.h>
18 const std::string trackFitResultsName)
const
21 if (trackFitResultArrayIndex < 0) {
22 B2DEBUG(20,
"TrackFitResult for the requested hypothesis is not set. Returning a nullptr instead.");
27 return trackFitResults[trackFitResultArrayIndex];
45 std::vector<Track::ChargedStableTrackFitResultPair> result;
51 for (
auto particleIndex : validParticleIndices) {
54 trackFitResults[indexInStoreArray]));
67 std::vector <short int> resultParticleIndex;
72 resultParticleIndex.push_back(i);
77 return resultParticleIndex;
81 const std::string trackFitResultsName)
const
91 auto bestMassFit = std::min_element(allFitRes.begin(), allFitRes.end(), [requestedType](
auto & a,
auto & b) {
92 const auto massDiffA = std::abs(a.first.getMass() - requestedType.getMass());
93 const auto massDiffB = std::abs(b.first.getMass() - requestedType.getMass());
95 return massDiffA < massDiffB;
98 if (std::isnan(bestMassFit->second->getPValue())) {
101 return bestMassFit->second;
111 std::stringstream out;
118 out <<
"<br><b>-- Hypothesis " << count <<
" --</b><br>";
119 out << fitResults.second->getInfoHTML();
Provides a type-safe way to pass members of the chargedStableSet set.
int getIndex() const
This particle's index in the associated set.
static const ParticleSet chargedStableSet
set of charged stable particles
Accessor to arrays stored in the data store.
Values of the result of a track fit with a given particle hypothesis.
std::vector< ChargedStableTrackFitResultPair > getTrackFitResults() const
Deafult Access to all track fit results at the same time.
std::vector< ChargedStableTrackFitResultPair > getTrackFitResultsByName(const std::string trackFitResultsName) const
Access to all track fit results at the same time (from TrackFitResult with specified name)
const TrackFitResult * getTrackFitResultByName(const Const::ChargedStable &chargedStable, const std::string trackFitResultsName) const
Access to TrackFitResults with a specified Name.
virtual std::string getInfoHTML() const override
Return a short summary of this object's contents in HTML format.
const TrackFitResult * getTrackFitResult(const Const::ChargedStable &chargedStable) const
Default Access to TrackFitResults.
std::vector< short int > getValidIndices() const
Returns a vector of all fit hypothesis indices in m_trackFitIndices which have been set (meaning are ...
const TrackFitResult * getTrackFitResultWithClosestMassByName(const Const::ChargedStable &requestedType, const std::string trackFitResultsName) const
Return the track fit (from TrackFitResult with specified name) for a fit hypothesis with the closest ...
unsigned int getNumberOfFittedHypotheses() const
Returns the number of fitted hypothesis which are stored in this track.
const TrackFitResult * getTrackFitResultWithClosestMass(const Const::ChargedStable &requestedType) const
Return the track fit for a fit hypothesis with the closest mass.
short int m_trackFitIndices[Const::ChargedStable::c_SetSize]
Index list of the TrackFitResults associated with this Track.
Abstract base class for different kinds of events.