CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ClosestApproachInRPhi.h
Go to the documentation of this file.
1 #ifndef _ClosestApproachInRPhi_H_
2 #define _ClosestApproachInRPhi_H_
3 
7 
19 // Function for testing ClosestApproachInRPhi
20 namespace test {
21  namespace ClosestApproachInRPhi_t {
22  int test();
23  }
24 } // namespace test
25 
28 
29 public:
31  ~ClosestApproachInRPhi() override {}
32 
33  bool calculate(const TrajectoryStateOnSurface& sta, const TrajectoryStateOnSurface& stb) override;
34 
35  bool calculate(const FreeTrajectoryState& sta, const FreeTrajectoryState& stb) override;
36 
37  bool status() const override { return status_; }
38 
42  std::pair<GlobalPoint, GlobalPoint> points() const override;
43 
46  std::pair<GlobalTrajectoryParameters, GlobalTrajectoryParameters> trajectoryParameters() const;
47 
49  GlobalPoint crossingPoint() const override;
50 
52  float distance() const override;
53 
57  ClosestApproachInRPhi* clone() const override { return new ClosestApproachInRPhi(*this); }
58 
59 private:
60  bool compute(const TrackCharge& chargeA,
61  const GlobalVector& momentumA,
62  const GlobalPoint& positionA,
63  const TrackCharge& chargeB,
64  const GlobalVector& momentumB,
65  const GlobalPoint& positionB) dso_internal;
66 
67  // given the old Parameters, and a new GlobalPoint,
68  // we return the full new GlobalTrajectoryParameters at the
69  // Point.
71  const GlobalTrajectoryParameters& oldpar,
72  double bz) dso_internal;
73 
74  // Computes center coordinates and unsigned radius of circle;
75  static void circleParameters(const TrackCharge& charge,
76  const GlobalVector& momemtum,
77  const GlobalPoint& position,
78  double& xc,
79  double& yc,
80  double& r,
81  double bz) dso_internal;
82 
83  // Computes crossing points of 2 circles with centres (cx_i, cy_i)
84  // and unsigned radii r_i.
85  // Two cases: - circles have one or two intersection points;
86  // return value = 1;
87  // - circles do not cross; computes point of closest approach
88  // on each circle; return value = 2;
89  // if the calculation fails (e.g. concentric circles), return value = 0;
90 
91  static int transverseCoord(double cxa,
92  double cya,
93  double ra,
94  double cxb,
95  double cyb,
96  double rb,
97  double& xg1,
98  double& yg1,
99  double& xg2,
100  double& yg2) dso_internal;
101 
102  // Computes z-coordinate on helix at given transverse coordinates
103  static double zCoord(const GlobalVector& mom,
104  const GlobalPoint& pos,
105  double r,
106  double xc,
107  double yc,
108  double xg,
109  double yg) dso_internal;
110 
111 private:
114  double bz;
115  bool status_;
116 };
117 
118 #endif
std::pair< GlobalTrajectoryParameters, GlobalTrajectoryParameters > trajectoryParameters() const
static int transverseCoord(double cxa, double cya, double ra, double cxb, double cyb, double rb, double &xg1, double &yg1, double &xg2, double &yg2)
static void circleParameters(const TrackCharge &charge, const GlobalVector &momemtum, const GlobalPoint &position, double &xc, double &yc, double &r, double bz)
float distance() const override
GlobalTrajectoryParameters paramB
GlobalTrajectoryParameters paramA
bool compute(const TrackCharge &chargeA, const GlobalVector &momentumA, const GlobalPoint &positionA, const TrackCharge &chargeB, const GlobalVector &momentumB, const GlobalPoint &positionB)
int TrackCharge
Definition: TrackCharge.h:4
GlobalPoint crossingPoint() const override
bool calculate(const TrajectoryStateOnSurface &sta, const TrajectoryStateOnSurface &stb) override
#define dso_internal
Definition: Visibility.h:13
static double zCoord(const GlobalVector &mom, const GlobalPoint &pos, double r, double xc, double yc, double xg, double yg)
ClosestApproachInRPhi * clone() const override
std::pair< GlobalPoint, GlobalPoint > points() const override
static GlobalTrajectoryParameters newTrajectory(const GlobalPoint &newpt, const GlobalTrajectoryParameters &oldpar, double bz)
static int position[264][3]
Definition: ReadPGInfo.cc:289
bool status() const override