11#ifndef KF_CORE_KfTrajectory_h
12#define KF_CORE_KfTrajectory_h 1
21template<cbm::algo::kf::DoFitTime>
48 template<
typename T =
double>
52 template<cbm::algo::kf::DoFitTime>
53 friend class ::CbmKfTrackFitter;
55 friend class ::CbmBbaAlignTask;
56 friend class ::CbmBbaAlignmentMcbmTask;
62 struct alignas(VcMemAlign)
Node {
90 std::array<int, 10>
userReferences{{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}};
199 for (
const auto& n : nodes) {
208 if (index >=
fNodes.size()) {
209 LOG(fatal) <<
"KfTrajectory::DisableMeasurementAtNode: index " << index <<
" is out of range!";
211 fNodes[index].isXySet =
false;
212 fNodes[index].isTimeSet =
false;
216 for (
size_t i = index + 1; i <
fNodes.size(); ++i) {
225 for (
int i =
static_cast<int>(index) - 1; i >= 0; --i) {
243 void MakeConsistent();
Common constant definitions for the Kalman Filter library.
Definition of the KfMeasurementXy class.
Setup representation for the Kalman-filter framework (header)
Implementation selection for the SIMD utilities (VS or pseudo)
an example of alignment using BBA package
The class describes a time measurement.
The class describes a 2D - measurement (x, y) in XY coordinate system.
KF-framework representation of the detector setup.
TrackParam classes of different types.
Trajectory(std::shared_ptr< const Setup< T > > kfSetup)
void Clear()
Clear the trajectory.
T fQaChi2Downstream
chi2 from the downstream fit iteration, needed for QA
bool fIsFitted
true if the trajectory at all the nodes between the first and the last measurements are fitted
std::shared_ptr< const Setup< T > > fKfSetup
Kalman Filter setup.
bool IsFullyExtrapolated() const
Check if the trajectory is extrapolated beyond the first and last measurements.
int fFirstMeasurementNodeId
index of the first node with measurement
std::array< int, 10 > & GetNodeUserReferences(const size_t index)
Get reference to the user references of the node by its index.
int GetNofMeasurements() const
Get number of nodes with measurements.
const Node & GetLastMeasurementNode() const
Get reference to the last node with measurement.
void MakeConsistent()
sort the nodes in Z, add missing material layers and set fFirstMeasureNode and fLastMeasureNode
void AddNode(const Node &node)
Add a node to the trajectory.
void AddNodes(const std::vector< Node > &nodes)
Add multiple nodes to the trajectory.
Trajectory(Trajectory &&other) noexcept=default
Move constructor.
double GetQaChi2Downstream() const
Get chi2 from the downstream fit iteration, needed for QA.
Trajectory & operator=(const Trajectory &other)=default
Assignment operator.
void ModifyNode(const size_t index, const Node &node)
Modify node at the given index.
size_t GetNofNodes() const
Get number of nodes on the trajectory.
bool IsFitted() const
Check if the trajectory is fitted.
void SetKfSetup(std::shared_ptr< const Setup< T > > kfSetup)
Set Kalman Filter setup.
const std::array< int, 10 > & GetNodeUserReferences(const size_t index) const
Get user reference of the node by its index.
std::vector< Node > fNodes
nodes on the trajectory
Node & GetNodeReference(const size_t index)
Get reference to the node by its index.
const std::vector< Node > & GetNodes() const
Get reference to the vector of nodes.
void DisableMeasurementAtNode(const size_t index)
Disable measurement at the given node.
const Node & GetNode(const size_t index) const
Get const reference to the node by its index.
int GetLastMeasurementNodeId() const
Get index of the last node with measurement.
Trajectory(const Trajectory &other)=default
Copy constructor.
bool fIsFullyExtrapolated
true if the trajectory is successfully extrapolated beyond the first and last measurements
~Trajectory()=default
Destructor.
const Node & GetFirstMeasurementNode() const
Get reference to the first node with measurement.
int fLastMeasurementNodeId
index of the last node with measurement
int fNmeasurements
number of nodes with measurements
int GetFirstMeasurementNodeId() const
Get index of the first node with measurement.
Trajectory & operator=(Trajectory &&other) noexcept=default
Move assignment operator.
Trajectory()=default
Default constructor.
The class represent a node on the trajectory.
MeasurementXy< T > measurementXY
== Measurement information ( if present )
T z
Z coordinate of the node.
TrackParam< T > paramDn
fitted track parameters downstream the node
int materialLayer
== Material information (if present)
bool isTimeSet
true if the time measurement is set
TrackParam< T > paramUp
fitted track parameters upstream the node
bool operator<(const Node &other) const
Comparison operator for sorting nodes in Z.
MeasurementTime< T > measurementTime
time measurement at z
bool isFitted
true if the track parameters at the node are fitted and radThick is set
std::array< int, 10 > userReferences
user references (to store e.g. hit index or index of the node description in some external array)