Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TrackStateInfo_v1.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file TrackStateInfo_v1.cc
1 #include "TrackStateInfo_v1.h"
2 #include <trackbase/TrkrDefs.h>
3 
4 #include <cmath>
5 #include <cstddef> // for size_t
6 #include <iostream>
7 #include <map>
8 #include <utility> // for pair
9 
10 namespace
11 {
12  // get unique index in cov. matrix array from i and j
13  inline unsigned int covar_index(unsigned int i, unsigned int j)
14  {
15  if (i > j)
16  {
17  std::swap(i, j);
18  }
19  return i + 1 + (j + 1) * (j) / 2 - 1;
20  }
21 } // namespace
22 float TrackStateInfo_v1::get_covariance(int i, int j) const
23 {
24  return m_Covariance[covar_index(i, j)];
25 }
27 {
28  m_Covariance[covar_index(i, j)] = value;
29 }