LArSoft  v09_90_00
Liquid Argon Software toolkit - https://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  class VtxCandidate;
19 }
20 
21 #include <utility>
22 #include <vector>
23 
25 public:
26  static constexpr double kMaxDistToTrack{4.0}; // max. dist. track to center to create vtx
27  static constexpr double kMinDistToNode{2.0}; // min. dist. to node needed to split segment
28 
29  VtxCandidate(double segMinLength = 0.5)
30  : tracksJoined(false)
31  , fSegMinLength(segMinLength)
32  , fMse(0.0)
33  , fMse2D(0.0)
34  , fCenter(0., 0., 0.)
35  , fErr(0., 0., 0.)
36  {}
37 
38  bool Has(pma::Track3D* trk) const;
39 
40  bool Has(const VtxCandidate& other) const;
41 
42  bool IsAttached(pma::Track3D* trk) const;
43 
44  bool IsAttached(const VtxCandidate& other) const;
45 
46  bool HasLoops() const;
47 
48  bool Add(const pma::TrkCandidate& trk);
49 
50  double ComputeMse2D();
51 
52  double Test(const VtxCandidate& other) const;
53 
54  double MaxAngle(double minLength = 0.0) const;
55 
56  size_t Size() const { return fAssigned.size(); }
57  size_t Size(double minLength) const;
58 
59  bool MergeWith(const VtxCandidate& other);
60 
61  double Compute();
62 
63  bool JoinTracks(detinfo::DetectorPropertiesData const& detProp,
64  pma::TrkCandidateColl& tracks,
66 
67  const TVector3& Center() const { return fCenter; }
68  double Mse() const { return fMse; }
69  double Mse2D() const { return fMse2D; }
70 
71  std::pair<pma::Track3D*, size_t> Track(size_t i) const
72  {
73  return std::pair<pma::Track3D*, size_t>(fAssigned[i].first.Track(), fAssigned[i].second);
74  }
75 
76 private:
77  bool has(const std::vector<int>& v, int id) const
78  {
79  for (auto c : v)
80  if (c == id) return true;
81  return false;
82  }
83 
86  std::vector<std::pair<pma::TrkCandidate, size_t>> fAssigned;
87  TVector3 fCenter, fErr;
88 };
89 
90 #endif
bool Has(pma::Track3D *trk) const
std::pair< pma::Track3D *, size_t > Track(size_t i) const
double Test(const VtxCandidate &other) const
bool JoinTracks(detinfo::DetectorPropertiesData const &detProp, pma::TrkCandidateColl &tracks, pma::TrkCandidateColl &src)
std::vector< std::pair< pma::TrkCandidate, size_t > > fAssigned
double Mse() const
double Mse2D() const
size_t Size() const
const TVector3 & Center() const
static constexpr double kMinDistToNode
VtxCandidate(double segMinLength=0.5)
static constexpr double kMaxDistToTrack
double MaxAngle(double minLength=0.0) const
Track finding helper for the Projection Matching Algorithm.
bool MergeWith(const VtxCandidate &other)
bool Add(const pma::TrkCandidate &trk)
bool IsAttached(pma::Track3D *trk) const
bool HasLoops() const
bool has(const std::vector< int > &v, int id) const