Belle II Software development
Track.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8#pragma once
9#include <framework/gearbox/Const.h>
10#include <framework/datastore/RelationsObject.h>
11#include <mdst/dataobjects/TrackFitResult.h>
12#include <algorithm>
13
14namespace Belle2 {
25 class Track : public RelationsObject {
26 public:
27
29 enum StatusBit {
30
31 c_isFlippedAndRefitted = 1 << 0
32
33 };
34
39 typedef std::pair< Const::ChargedStable, TrackFitResult*> ChargedStableTrackFitResultPair;
40
48 explicit Track(float qualityIndicator = 0.) : m_qualityIndicator(qualityIndicator)
49 {
51 }
52
67 const std::string trackFitResultsName) const;
68
81 const TrackFitResult* getTrackFitResult(const Const::ChargedStable& chargedStable) const;
82
83
104 const std::string trackFitResultsName) const;
105
125
138 const TrackFitResult* getTrackFitResultWithBestPValue(const std::string& trackFitResultsName = "") const;
139
146 std::vector<ChargedStableTrackFitResultPair> getTrackFitResultsByName(const std::string trackFitResultsName) const;
147
153 std::vector<ChargedStableTrackFitResultPair> getTrackFitResults() const;
154
158 void addStatusBits(unsigned short int bitmask) { m_statusBitmap |= bitmask; }
159
163 void setFlippedAndRefitted() { addStatusBits(c_isFlippedAndRefitted); }
164
169 bool getStatusBit(unsigned short int bitmask) const { return (m_statusBitmap & bitmask) == bitmask; }
170
174 bool isFlippedAndRefitted() const { return getStatusBit(c_isFlippedAndRefitted); }
175
179 bool wasRefined() { return m_statusBitmap > 0; }
180
188 void setTrackFitResultIndex(const Const::ChargedStable& chargedStable, short index)
189 {
190 m_trackFitIndices[chargedStable.getIndex()] = index;
191 }
192
194 unsigned int getNumberOfFittedHypotheses() const;
195
213 {
214 return m_qualityIndicator;
215 }
216
223 void setTrackTime(float track_time)
224 {
225 m_trackTime = track_time;
226 }
227
229 float getTrackTime() const
230 {
231 return m_trackTime;
232 }
233
235 virtual std::string getInfoHTML() const override;
236
237 private:
238
241
246 std::vector < short int > getValidIndices() const;
247
254
256 float m_trackTime = std::numeric_limits<float>::quiet_NaN();
257
260 unsigned short int m_statusBitmap = 0;
261
263 // version 7: reorder class members to improve memory layout
264
265 friend class FixMergedObjectsModule;
266 friend class PostMergeUpdaterModule;
267 };
269}
Provides a type-safe way to pass members of the chargedStableSet set.
Definition: Const.h:589
static const unsigned int c_SetSize
Number of elements (for use in array bounds etc.)
Definition: Const.h:615
int getIndex() const
This particle's index in the associated set.
Definition: Const.h:461
static const ParticleSet chargedStableSet
set of charged stable particles
Definition: Const.h:618
If the content of two DataStores are merged using the 'MergeDataStoreModule', then Relations of the o...
If the content of two DataStores are merged using the 'MergeDataStoreModule', several kinematic prope...
Defines interface for accessing relations of objects in StoreArray.
Values of the result of a track fit with a given particle hypothesis.
Class that bundles various TrackFitResults.
Definition: Track.h:25
std::vector< ChargedStableTrackFitResultPair > getTrackFitResults() const
Default Access to all track fit results at the same time.
Definition: Track.cc:60
std::vector< ChargedStableTrackFitResultPair > getTrackFitResultsByName(const std::string trackFitResultsName) const
Access to all track fit results at the same time (from TrackFitResult with specified name)
Definition: Track.cc:42
StatusBit
status enumerator
Definition: Track.h:29
ClassDefOverride(Track, 7)
Class that bundles various TrackFitResults.
void setFlippedAndRefitted()
Set the Track status bit when the track has been flipped and refitted in the refining step.
Definition: Track.h:163
float getTrackTime() const
Returns track time computed as the difference between the average of SVD clusters time and the SVD Ev...
Definition: Track.h:229
bool getStatusBit(unsigned short int bitmask) const
Get Track Status after Refining.
Definition: Track.h:169
void setTrackTime(float track_time)
Set track time computed as the difference between the outgoing/ingoing arm time (computed with SVD hi...
Definition: Track.h:223
const TrackFitResult * getTrackFitResultByName(const Const::ChargedStable &chargedStable, const std::string trackFitResultsName) const
Access to TrackFitResults with a specified Name.
Definition: Track.cc:17
virtual std::string getInfoHTML() const override
Return a short summary of this object's contents in HTML format.
Definition: Track.cc:124
unsigned short int m_statusBitmap
Bitmap of the track status, contains information on the refining stage.
Definition: Track.h:260
const TrackFitResult * getTrackFitResult(const Const::ChargedStable &chargedStable) const
Default Access to TrackFitResults.
Definition: Track.cc:30
std::vector< short int > getValidIndices() const
Returns a vector of all fit hypothesis indices in m_trackFitIndices which have been set (meaning are ...
Definition: Track.cc:65
float getQualityIndicator() const
Getter for quality indicator for classification of fake vs.
Definition: Track.h:212
bool wasRefined()
Check whether Track was modified in the Refining step.
Definition: Track.h:179
void setTrackFitResultIndex(const Const::ChargedStable &chargedStable, short index)
Set an index (for positive values) or unavailability-code (index = -1) for a specific mass hypothesis...
Definition: Track.h:188
std::pair< Const::ChargedStable, TrackFitResult * > ChargedStableTrackFitResultPair
Pair to hold the particle hypothesis used for the fit as first entry and the result of the track fit ...
Definition: Track.h:39
const TrackFitResult * getTrackFitResultWithBestPValue(const std::string &trackFitResultsName="") const
Return the track fit (from TrackFitResult with specified name) for the fit hypothesis with the best p...
Definition: Track.cc:109
const TrackFitResult * getTrackFitResultWithClosestMassByName(const Const::ChargedStable &requestedType, const std::string trackFitResultsName) const
Return the track fit (from TrackFitResult with specified name) for the fit hypothesis with the closes...
Definition: Track.cc:80
unsigned int getNumberOfFittedHypotheses() const
Returns the number of fitted hypotheses which are stored in this track.
Definition: Track.cc:36
const TrackFitResult * getTrackFitResultWithClosestMass(const Const::ChargedStable &requestedType) const
Return the track fit for the fit hypothesis with the closest mass.
Definition: Track.cc:104
float m_trackTime
Track time, computed as the difference between outgoing/ingoing arm time and the SVDEvent T0.
Definition: Track.h:256
Track(float qualityIndicator=0.)
Constructor of Track without any attached TrackFitResults.
Definition: Track.h:48
void addStatusBits(unsigned short int bitmask)
Add Track Refining Status Bit.
Definition: Track.h:158
short int m_trackFitIndices[Const::ChargedStable::c_SetSize]
Index list of the TrackFitResults associated with this Track.
Definition: Track.h:240
bool isFlippedAndRefitted() const
Check the Track status after the Refining step.
Definition: Track.h:174
float const m_qualityIndicator
Quality indicator for classification of fake vs.
Definition: Track.h:253
Abstract base class for different kinds of events.