LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
PmaVtxCandidate.h
Go to the documentation of this file.
1 
12 #ifndef VtxCandidate_h
13 #define VtxCandidate_h
14 
16 
17 namespace pma
18 {
19  class VtxCandidate;
20 }
21 
23 {
24 public:
25  static const double kMaxDistToTrack;
26  static const double kMinDistToNode;
27 
28  VtxCandidate(double segMinLength = 0.5) :
29  tracksJoined(false),
30  fSegMinLength(segMinLength),
31  fMse(0.0), fMse2D(0.0),
32  fCenter(0., 0., 0.),
33  fErr(0., 0., 0.)
34  {}
35 
36  bool Has(pma::Track3D* trk) const;
37 
38  bool Has(const VtxCandidate& other) const;
39 
40  bool IsAttached(pma::Track3D* trk) const;
41 
42  bool IsAttached(const VtxCandidate& other) const;
43 
44  bool HasLoops(void) const;
45 
46  bool Add(const pma::TrkCandidate & trk);
47 
48  double ComputeMse2D(void);
49 
50  double Test(const VtxCandidate& other) const;
51 
52  double MaxAngle(double minLength = 0.0) const;
53 
54  size_t Size(void) const { return fAssigned.size(); }
55  size_t Size(double minLength) const;
56 
57  bool MergeWith(const VtxCandidate& other);
58 
59  double Compute(void);
60 
62 
63  const TVector3& Center(void) const { return fCenter; }
64  double Mse(void) const { return fMse; }
65  double Mse2D(void) const { return fMse2D; }
66 
67  std::pair< pma::Track3D*, size_t > Track(size_t i) const
68  {
69  return std::pair< pma::Track3D*, size_t >(fAssigned[i].first.Track(), fAssigned[i].second);
70  }
71 
72 private:
73  bool has(const std::vector<int>& v, int id) const
74  {
75  for (auto c : v) if (c == id) return true;
76  return false;
77  }
78 
81  std::vector< std::pair< pma::TrkCandidate, size_t > > fAssigned;
82  TVector3 fCenter, fErr;
83 };
84 
85 #endif
86 
const TVector3 & Center(void) const
double ComputeMse2D(void)
bool Has(pma::Track3D *trk) const
double Test(const VtxCandidate &other) const
bool JoinTracks(pma::TrkCandidateColl &tracks, pma::TrkCandidateColl &src)
bool HasLoops(void) const
double Mse2D(void) const
double Mse(void) const
std::pair< pma::Track3D *, size_t > Track(size_t i) const
static const double kMinDistToNode
VtxCandidate(double segMinLength=0.5)
std::vector< std::pair< pma::TrkCandidate, size_t > > fAssigned
double MaxAngle(double minLength=0.0) const
Track finding helper for the Projection Matching Algorithm.
bool MergeWith(const VtxCandidate &other)
static const double kMaxDistToTrack
bool Add(const pma::TrkCandidate &trk)
bool IsAttached(pma::Track3D *trk) const
size_t Size(void) const
bool has(const std::vector< int > &v, int id) const