MarlinTPC  1.2.0
TrackConnection.h
1 #ifndef TRACKCONNECTION_H
2 #define TRACKCONNECTION_H 1
3 
4 #include <lcio.h>
5 #include <string>
6 #include <map>
7 
8 #include <EVENT/TrackerHit.h>
9 #include <IMPL/TrackerHitImpl.h>
10 
11 namespace marlintpc
12 {
13 
15 {
16 
17  public:
18 
22 
26 
29  struct UsedFlag : lcrtrel::LCIntExtension<UsedFlag> {} ;
30 
33  void mergeTracks(IMPL::TrackImpl*& mergedTrack, std::multimap<int, IMPL::TrackImpl*> &tracksByModuleID);
34 
35  void setConeAngle(double angle);
36 
37  private:
38 
41  std::multimap<int, IMPL::TrackImpl*> *_tracksByModuleID;
42 
45  bool connectSegment(IMPL::TrackImpl* mergedTrack, std::multimap<int, IMPL::TrackImpl*>::iterator nextSegment);
46 
49  void connect(IMPL::TrackImpl* mergedTrack, std::multimap<int, IMPL::TrackImpl*>::iterator nextSegment);
50 
53 #if 0 // 2D
54  class Compare
55  {
56  public:
57  bool operator()(EVENT::TrackerHit* left, EVENT::TrackerHit* right)
58  {
59  const double* xv1 = left->getPosition();
60  const double* xv2 = right->getPosition();
61  double r12 = xv1[0] * xv1[0] + xv1[1] * xv1[1];
62  double r22 = xv2[0] * xv2[0] + xv2[1] * xv2[1];
63  return r12 < r22;
64  }
65  };
66 
67 #else // 3D
68  class Compare
69  {
70  public:
71  bool operator()(EVENT::TrackerHit* left, EVENT::TrackerHit* right)
72  {
73  const double* xv1 = left->getPosition();
74  const double* xv2 = right->getPosition();
75  double r12 = xv1[0] * xv1[0] + xv1[1] * xv1[1] + xv1[2] * xv1[2];
76  double r22 = xv2[0] * xv2[0] + xv2[1] * xv2[1] + xv2[2] * xv2[2];
77  return r12 < r22;
78  }
79  };
80 #endif
81 
84  const double* _x1;
85  const double* _x3;
86 
87  double _coneAngle;
88 
89 };
90 
91 }// namespace marlintpc
92 
93 #endif // TRACKCONNECTION_H
94 
void mergeTracks(IMPL::TrackImpl *&mergedTrack, std::multimap< int, IMPL::TrackImpl * > &tracksByModuleID)
Track merger process.
Definition: TrackConnection.cc:51
Definition: TrackConnection.h:14
TrackConnection()
Default constructor.
Definition: TrackConnection.cc:41
~TrackConnection()
Destructor.
Definition: TrackConnection.cc:46
UsedFlag.
Definition: TrackConnection.h:29