CMS 3D CMS Logo

TrackResiduals.h
Go to the documentation of this file.
1 #ifndef TrackReco_TrackResiduals_h
2 #define TrackReco_TrackResiduals_h
3 
4 #include <vector>
5 
6 namespace reco {
7 
8  class TrackResiduals {
9  public:
10  // In principle 8bits would suffice for histos...
11  using StorageType = unsigned short;
12 
14  void resize(unsigned int nHits) { m_storage.resize(4 * nHits); }
15  void setResidualXY(int idx, float residualX, float residualY);
16  void setPullXY(int idx, float pullX, float pullY);
18  float residualX(int i) const { return unpack_residual(m_storage[4 * i]); }
19  float residualY(int i) const { return unpack_residual(m_storage[4 * i + 1]); }
20  float pullX(int i) const { return unpack_pull(m_storage[4 * i + 2]); }
21  float pullY(int i) const { return unpack_pull(m_storage[4 * i + 3]); }
22 
23  private:
24  static float unpack_pull(StorageType);
25  static StorageType pack_pull(float);
26  static float unpack_residual(StorageType);
27  static StorageType pack_residual(float);
28 
29  private:
30  std::vector<StorageType> m_storage;
31  };
32 
33 } // namespace reco
34 
35 #endif
reco::TrackResiduals::residualY
float residualY(int i) const
Definition: TrackResiduals.h:19
reco::TrackResiduals::StorageType
unsigned short StorageType
Definition: TrackResiduals.h:11
mps_fire.i
i
Definition: mps_fire.py:355
reco::TrackResiduals::pullY
float pullY(int i) const
Definition: TrackResiduals.h:21
reco::TrackResiduals::setPullXY
void setPullXY(int idx, float pullX, float pullY)
Definition: TrackResiduals.cc:34
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
reco::TrackResiduals::TrackResiduals
TrackResiduals()
Definition: TrackResiduals.h:13
reco::TrackResiduals
Definition: TrackResiduals.h:8
training_settings.idx
idx
Definition: training_settings.py:16
reco::TrackResiduals::residualX
float residualX(int i) const
get the residual of the ith hit
Definition: TrackResiduals.h:18
reco::TrackResiduals::m_storage
std::vector< StorageType > m_storage
Definition: TrackResiduals.h:30
reco::TrackResiduals::unpack_pull
static float unpack_pull(StorageType)
Definition: TrackResiduals.cc:25
reco::TrackResiduals::setResidualXY
void setResidualXY(int idx, float residualX, float residualY)
Definition: TrackResiduals.cc:30
reco::TrackResiduals::resize
void resize(unsigned int nHits)
Definition: TrackResiduals.h:14
reco::TrackResiduals::pack_pull
static StorageType pack_pull(float)
Definition: TrackResiduals.cc:26
reco::TrackResiduals::unpack_residual
static float unpack_residual(StorageType)
Definition: TrackResiduals.cc:27
reco::TrackResiduals::pack_residual
static StorageType pack_residual(float)
Definition: TrackResiduals.cc:28
reco::TrackResiduals::pullX
float pullX(int i) const
Definition: TrackResiduals.h:20