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 
9 #include <iostream>
12 
13 class Trajectory;
14 
15 namespace reco {
16  class HitPattern;
18  friend class Trajectory;
19  public:
21 
22  protected:
24  enum { numResiduals = 0x40 };
25 
26  public:
27  TrackResiduals ();
29 
30  public:
31  void setResidualXY (int idx, double residualX, double residualY);
32  void setPullXY (int idx, double pullX, double pullY);
33  void setResidualType (enum ResidualType);
34  void print (std::ostream &stream = std::cout) const;
35  void print (const HitPattern &, std::ostream &stream = std::cout) const;
36  /* Example usage:
37  *
38  * HitPattern p;
39  * TrackResiduals r;
40  * int numHits = p.numberOfValidHits() +
41  * p.numberOfLostHits() +
42  * p.numberOfValidMuonHits() +
43  * p.numberOfLostMuonHits() +
44  * p.numberOfValidTrackerHits() +
45  * p.numberOfLostTrackerHits() +
46  * p.numberOfValidPixelHits() +
47  * p.numberOfLostPixelHits();
48  * for (int i = 0; i < numHits; ++i) {
49  * printf("hit %d: pattern 0x%x, residual (local x) %f\n", i
50  * p.getHitPattern(i), r.residualX(p, i));
51  * }
52  */
55  double residualX (int i, const HitPattern &) const;
56  double residualY (int i, const HitPattern &) const;
59  double residualX (int i) const;
60  double residualY (int i) const;
61 
62  protected:
63  static double unpack_pull (unsigned char);
64  static unsigned char pack_pull (double);
65  static double unpack_residual (unsigned char);
66  static unsigned char pack_residual (double);
67 
68  private:
70  unsigned char residuals_[numResiduals];
72  };
73 }
74 
75 #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
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
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)