CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TrackResiduals.h
Go to the documentation of this file.
1 #ifndef TrackReco_TrackResiduals_h
2 #define TrackReco_TrackResiduals_h
3 
10 #include <iostream>
13 
14 class Trajectory;
15 
16 namespace reco {
17  class HitPattern;
19  friend class Trajectory;
20  public:
22 
23  protected:
25  enum { numResiduals = 0x40 };
26 
27  public:
28  TrackResiduals ();
30 
31  public:
32  void setResidualXY (int idx, double residualX, double residualY);
33  void setPullXY (int idx, double pullX, double pullY);
34  void setResidualType (enum ResidualType);
35  void print (std::ostream &stream = std::cout) const;
36  void print (const HitPattern &, std::ostream &stream = std::cout) const;
37  /* Example usage:
38  *
39  * HitPattern p;
40  * TrackResiduals r;
41  * int numHits = p.numberOfValidHits() +
42  * p.numberOfLostHits() +
43  * p.numberOfValidMuonHits() +
44  * p.numberOfLostMuonHits() +
45  * p.numberOfValidTrackerHits() +
46  * p.numberOfLostTrackerHits() +
47  * p.numberOfValidPixelHits() +
48  * p.numberOfLostPixelHits();
49  * for (int i = 0; i < numHits; ++i) {
50  * printf("hit %d: pattern 0x%x, residual (local x) %f\n", i
51  * p.getHitPattern(i), r.residualX(p, i));
52  * }
53  */
56  double residualX (int i, const HitPattern &) const;
57  double residualY (int i, const HitPattern &) const;
60  double residualX (int i) const;
61  double residualY (int i) const;
62 
63  protected:
64  static double unpack_pull (unsigned char);
65  static unsigned char pack_pull (double);
66  static double unpack_residual (unsigned char);
67  static unsigned char pack_residual (double);
68 
69  private:
71  unsigned char residuals_[numResiduals];
73  };
74 }
75 
76 #endif
int i
Definition: DBlmapReader.cc:9
double residualY(int i, const HitPattern &) const
void setPullXY(int idx, double pullX, double pullY)
static double unpack_residual(unsigned char)
void setResidualType(enum ResidualType)
unsigned char residuals_[numResiduals]
residuals, bitpacked two hits to a char
double residualX(int i, const HitPattern &) const
static unsigned char pack_residual(double)
void print(std::ostream &stream=std::cout) const
void setResidualXY(int idx, double residualX, double residualY)
tuple cout
Definition: gather_cfg.py:121
static double unpack_pull(unsigned char)
static unsigned char pack_pull(double)