LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
Segmentation2D.h
Go to the documentation of this file.
1 
9 #ifndef Segmentation2D_h
10 #define Segmentation2D_h
11 
12 namespace fhicl {
13  class ParameterSet;
14 }
15 
17 
18 namespace tss {
19  class Segmentation2D;
20 }
21 
23 public:
25  : fRadiusMin(0.5)
26  , fRadiusMax(1.0)
27  , fMaxLineDist(0.2)
28  , fDenseVtxRadius(1.0)
29  , fDenseHitRadius(5.0)
30  , fDenseMinN(5)
31  , fDenseMinH(100)
32  {
33  reconfigure(p);
34  }
35 
36  void reconfigure(const fhicl::ParameterSet& p);
37 
38  std::vector<tss::Cluster2D> run(tss::Cluster2D& inp) const;
39 
40  void splitHits(const std::vector<tss::Cluster2D>& inp,
41  std::vector<const tss::Hit2D*>& trackHits,
42  std::vector<const tss::Hit2D*>& emHits) const;
43 
44  void splitHitsNaive(const tss::Cluster2D& inp,
45  std::vector<const tss::Hit2D*>& trackHits,
46  std::vector<const tss::Hit2D*>& emHits) const;
47 
48  void splitHitsNaive(const std::vector<tss::Cluster2D>& inp,
49  std::vector<const tss::Hit2D*>& trackHits,
50  std::vector<const tss::Hit2D*>& emHits) const;
51 
52  int mergeClusters(std::vector<tss::Cluster2D>& group, const std::vector<size_t>& idxs) const;
53 
54 private:
55  void run(tss::Cluster2D& inp,
56  std::vector<tss::Cluster2D>& result,
57  std::vector<TVector2>& centers) const;
58 
59  tss::Cluster2D buildSegment(tss::Cluster2D& inp, TVector2 center, TVector2 end) const;
60  tss::Cluster2D selectRing(const tss::Cluster2D& inp, TVector2 center) const;
61 
62  void tagDenseEnds(std::vector<tss::Cluster2D>& group) const;
63  void mergeDenseParts(std::vector<tss::Cluster2D>& group) const;
64 
65  bool Cl2InsideCl1(tss::Cluster2D& cl1, tss::Cluster2D& cl2) const;
66 
68 
69  double fRadiusMin, fRadiusMax;
70  double fMaxLineDist;
71 
72  double fDenseVtxRadius, fDenseHitRadius;
73  size_t fDenseMinN, fDenseMinH;
74 };
75 
76 #endif
Trivial, collect hits "touching" each other (next wire or consecutive ticks), plus Cluster2D class to...
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
Definition: StdUtils.h:77
parameter set interface
Segmentation2D(const fhicl::ParameterSet &p)
tss::SimpleClustering fSimpleClustering