CMS 3D CMS Logo

TrackResiduals.cc
Go to the documentation of this file.
1 #include <cmath>
2 #include <limits>
4 
5 namespace reco {
6 
7  namespace {
8 
9  inline TrackResiduals::StorageType pack(float x, float min, float fact) {
11  return std::min(std::round(fact * (x - min)), amax);
12  }
13 
14  inline float unpack(TrackResiduals::StorageType x, float min, float fact) { return fact * x + min; }
15 
16  constexpr float pmin = -32; // overkill
17  constexpr float pmult = 1000; // overkill
18  constexpr float pdiv = 1. / pmult;
19  constexpr float rmin = -3.2; // (in cm)
20  constexpr float rmult = 10000; // micron
21  constexpr float rdiv = 1. / rmult;
22 
23  } // namespace
24 
25  float TrackResiduals::unpack_pull(StorageType x) { return unpack(x, pmin, pdiv); }
27  float TrackResiduals::unpack_residual(StorageType x) { return unpack(x, rmin, rdiv); }
29 
30  void TrackResiduals::setResidualXY(int idx, float residualX, float residualY) {
33  }
34  void TrackResiduals::setPullXY(int idx, float pullX, float pullY) {
35  m_storage[4 * idx + 2] = pack_pull(pullX);
36  m_storage[4 * idx + 3] = pack_pull(pullY);
37  }
38 
39 } // namespace reco
def pack(high, low)
std::vector< StorageType > m_storage
static StorageType pack_pull(float)
void setResidualXY(int idx, float residualX, float residualY)
static float unpack_residual(StorageType)
static float unpack_pull(StorageType)
float residualY(int i) const
float pullX(int i) const
std::pair< unsigned int, unsigned int > unpack(cond::Time_t since)
static StorageType pack_residual(float)
unsigned short StorageType
const double fact
float pullY(int i) const
fixed size matrix
float residualX(int i) const
get the residual of the ith hit
void setPullXY(int idx, float pullX, float pullY)
float x