10 #ifndef SimpleClustering_h 11 #define SimpleClustering_h 17 struct bDistToPointLess;
19 class SimpleClustering;
39 Cluster2D(
void) : fTag(false), fDenseStart(false), fDenseEnd(false), fIsEM(false) {}
42 size_t size(
void)
const {
return fHits.size(); }
46 const std::vector<const tss::Hit2D*>&
hits(
void)
const {
return fHits; }
47 std::vector<const tss::Hit2D*>&
hits(
void) {
return fHits; }
54 return pma::Dist2(fHits.front()->Point2D(), fHits.back()->Point2D());
59 double dist2(
const TVector2& p2d)
const;
60 double dist2(
const TVector2& p2d,
size_t& hIdx)
const;
63 const Hit2D* release_at(
size_t idx);
70 if (hit) push_back(hit);
74 for (
const auto h : clu.
hits())
107 bool isEM(
void)
const {
return fIsEM; }
110 const Hit2D* closest(
const TVector2& p2d,
size_t& idx)
const;
111 const Hit2D* outermost(
size_t& idx)
const;
113 const TVector2 min(
void)
const;
114 const TVector2 max(
void)
const;
117 std::vector<const tss::Hit2D*>
fHits;
119 bool fTag, fDenseStart, fDenseEnd, fIsEM;
124 std::vector<tss::Cluster2D> run(
const std::vector<tss::Hit2D>& inp)
const;
132 void merge(std::vector<tss::Cluster2D>& clusters)
const;
bool operator()(const tss::Hit2D *h1, const tss::Hit2D *h2) const
bDistToPointLess(const TVector2 &point)
TVector2 const & Point2D() const
double Dist2(const TVector2 &v1, const TVector2 &v2)
std::vector< const tss::Hit2D * > & hits(void)
const tss::Hit2D * start(void) const
void push_back(const tss::Hit2D *hit)
bool isDenseEnd(void) const
const std::vector< const tss::Hit2D * > & hits(void) const
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
void tagDenseStart(bool b)
bool isDenseStart(void) const
std::vector< const tss::Hit2D * > fHits
void take_from(tss::Cluster2D &clu, size_t idx)
const tss::Hit2D * end(void) const
const Hit2D * release_at(size_t idx)
Hit pos in cm and original recob hit ptr.
Detector simulation of raw signals on wires.
bool isTagged(void) const
Implementation of the Projection Matching Algorithm.
void merge(tss::Cluster2D &clu)
const Hit2D & operator[](size_t index) const
double length2(void) const