CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions | Variables
TrackResiduals.cc File Reference
#include <math.h>
#include "DataFormats/TrackReco/interface/HitPattern.h"
#include "DataFormats/TrackReco/interface/TrackResiduals.h"
#include <cstdio>
#include <cstring>
#include "FWCore/MessageLogger/interface/MessageLogger.h"

Go to the source code of this file.

Functions

static int index_to_hitpattern (int i_hitpattern, const HitPattern &h)
 

Variables

static const double pull_char_to_double [8][2]
 

Function Documentation

static int index_to_hitpattern ( int  i_hitpattern,
const HitPattern h 
)
static

Definition at line 64 of file TrackResiduals.cc.

References assert(), reco::HitPattern::getHitPattern(), i, reco::HitPattern::numberOfHits(), reco::HitPattern::TRACK_HITS, and reco::HitPattern::validHitFilter().

Referenced by reco::TrackResiduals::residualX(), and reco::TrackResiduals::residualY().

65 {
66  int i_residuals = 0;
67  assert(i_hitpattern < h.numberOfHits(HitPattern::TRACK_HITS));
68  if (!h.validHitFilter(h.getHitPattern(HitPattern::TRACK_HITS, i_hitpattern))) {
69  // asking for residual of invalid hit...
70  return -999;
71  }
72 
73  for (int i = 0; i <= i_hitpattern; i++) {
74  if (h.validHitFilter(h.getHitPattern(HitPattern::TRACK_HITS, i))) {
75  i_residuals++;
76  }
77  }
78 
79  assert(i_residuals > 0);
80  return i_residuals - 1;
81 }
int i
Definition: DBlmapReader.cc:9
assert(m_qm.get())
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:698
uint16_t getHitPattern(HitCategory category, int position) const
Definition: HitPattern.h:456
int numberOfHits(HitCategory category) const
Definition: HitPattern.h:718

Variable Documentation

const double pull_char_to_double[8][2]
static
Initial value:
= {
{ 0, 0.5 },
{ 0.5, 1 },
{ 1, 1.5 },
{ 1.5, 2 },
{ 2, 2.5 },
{ 2.5, 3.5 },
{ 3.5, 4.5 },
{ 4.5, 5.5 },
}

Definition at line 114 of file TrackResiduals.cc.

Referenced by reco::TrackResiduals::pack_pull(), reco::TrackResiduals::pack_residual(), reco::TrackResiduals::unpack_pull(), and reco::TrackResiduals::unpack_residual().