9 #include <mdst/dataobjects/Track.h>
10 #include <framework/datastore/StoreArray.h>
11 #include <framework/logging/Logger.h>
20 if (trackFitResultArrayIndex < 0) {
21 B2DEBUG(20,
"TrackFitResult for the requested hypothesis is not set. Returning a nullptr instead.");
26 return trackFitResults[trackFitResultArrayIndex];
38 std::vector<Track::ChargedStableTrackFitResultPair> result;
44 for (
auto particleIndex : validParticleIndices) {
47 trackFitResults[indexInStoreArray]));
55 std::vector <short int> resultParticleIndex;
60 resultParticleIndex.push_back(i);
65 return resultParticleIndex;
78 auto bestMassFit = std::min_element(allFitRes.begin(), allFitRes.end(), [requestedType](
auto & a,
auto & b) {
79 const auto massDiffA = std::abs(a.first.getMass() - requestedType.getMass());
80 const auto massDiffB = std::abs(b.first.getMass() - requestedType.getMass());
82 return massDiffA < massDiffB;
85 return bestMassFit->second;
90 std::stringstream out;
97 out <<
"<br><b>-- Hypothesis " << count <<
" --</b><br>";
98 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
Access to all track fit results at the same time.
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
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 ...
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.