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
132 std::vector<ChargedStableTrackFitResultPair> getTrackFitResultsByName(const std::string trackFitResultsName) const;
133
139 std::vector<ChargedStableTrackFitResultPair> getTrackFitResults() const;
140
144 void addStatusBits(unsigned short int bitmask) { m_statusBitmap |= bitmask; }
145
149 void setFlippedAndRefitted() { addStatusBits(c_isFlippedAndRefitted); }
150
155 bool getStatusBit(unsigned short int bitmask) const { return (m_statusBitmap & bitmask) == bitmask; }
156
160 bool isFlippedAndRefitted() const { return getStatusBit(c_isFlippedAndRefitted); }
161
165 bool wasRefined() { return m_statusBitmap > 0; }
166
174 void setTrackFitResultIndex(const Const::ChargedStable& chargedStable, short index)
175 {
176 m_trackFitIndices[chargedStable.getIndex()] = index;
177 }
178
180 unsigned int getNumberOfFittedHypotheses() const;
181
199 {
200 return m_qualityIndicator;
201 }
202
209 void setTrackTime(float track_time)
210 {
211 m_trackTime = track_time;
212 }
213
215 float getTrackTime() const
216 {
217 return m_trackTime;
218 }
219
221 virtual std::string getInfoHTML() const override;
222
223 private:
224
227 unsigned short int m_statusBitmap = 0;
228
231
236 std::vector < short int > getValidIndices() const;
237
244
246 float m_trackTime = std::numeric_limits<float>::quiet_NaN();
247
250 friend class FixMergedObjectsModule;
251 friend class PostMergeUpdaterModule;
252 };
254}
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
Deafult 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
void setFlippedAndRefitted()
Set the Track status bit when the track has been flipped and refitted in the refining step.
Definition: Track.h:149
float getTrackTime() const
Returns track time computed as the difference between the average of SVD clusters time and the SVD Ev...
Definition: Track.h:215
bool getStatusBit(unsigned short int bitmask) const
Get Track Status after Refining.
Definition: Track.h:155
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:209
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:109
unsigned short int m_statusBitmap
Bitmap of the track status, contains informations on the refining stage.
Definition: Track.h:227
const TrackFitResult * getTrackFitResult(const Const::ChargedStable &chargedStable) const
Default Access to TrackFitResults.
Definition: Track.cc:30
ClassDefOverride(Track, 6)
Class that bundles various TrackFitResults.
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:198
bool wasRefined()
Check whether Track was modified in the Refining step.
Definition: Track.h:165
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:174
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 * 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 ...
Definition: Track.cc:80
unsigned int getNumberOfFittedHypotheses() const
Returns the number of fitted hypothesis which are stored in this track.
Definition: Track.cc:36
const TrackFitResult * getTrackFitResultWithClosestMass(const Const::ChargedStable &requestedType) const
Return the track fit for a 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:246
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:144
short int m_trackFitIndices[Const::ChargedStable::c_SetSize]
Index list of the TrackFitResults associated with this Track.
Definition: Track.h:230
bool isFlippedAndRefitted() const
Check the Track status after the Refining step.
Definition: Track.h:160
float const m_qualityIndicator
Quality indicator for classification of fake vs.
Definition: Track.h:243
Abstract base class for different kinds of events.