10 #ifndef SimpleClustering_h 11 #define SimpleClustering_h 18 struct bDistToPointLess;
20 class SimpleClustering;
24 public std::binary_function<const tss::Hit2D*, const tss::Hit2D*, bool>
41 Cluster2D(
void) : fTag(false), fDenseStart(false), fDenseEnd(false), fIsEM(false) { }
42 Cluster2D(
const std::vector< const tss::Hit2D* > & hits);
44 size_t size(
void)
const {
return fHits.size(); }
48 const std::vector< const tss::Hit2D* > &
hits(
void)
const {
return fHits; }
49 std::vector< const tss::Hit2D* > &
hits(
void) {
return fHits; }
55 if (
size() > 1)
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);
74 for (
const auto h : clu.
hits()) fHits.push_back(
h);
80 if (fHits.size())
return fHits.front();
85 if (fHits.size())
return fHits.back();
91 std::sort(fHits.begin() + 1, fHits.end(),
103 bool isEM(
void)
const {
return fIsEM; }
106 const Hit2D* closest(
const TVector2 & p2d,
size_t & idx)
const;
107 const Hit2D* outermost(
size_t & idx)
const;
109 const TVector2
min(
void)
const;
110 const TVector2
max(
void)
const;
114 std::vector< const tss::Hit2D* >
fHits;
116 bool fTag, fDenseStart, fDenseEnd, fIsEM;
124 std::vector< tss::Cluster2D >
run(
const std::vector< tss::Hit2D > & inp)
const;
133 void merge(std::vector< tss::Cluster2D > & clusters)
const;
bDistToPointLess(const TVector2 &point)
TVector2 const & Point2D() const
double Dist2(const TVector2 &v1, const TVector2 &v2)
const tss::Hit2D * start(void) const
void push_back(const tss::Hit2D *hit)
bool isDenseEnd(void) const
std::vector< const tss::Hit2D * > fHits
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
bool operator()(const tss::Hit2D *h1, const tss::Hit2D *h2)
void tagDenseStart(bool b)
const std::vector< const tss::Hit2D * > & hits(void) const
fInnerVessel push_back(Point(-578.400000, 0.000000, 0.000000))
std::vector< const tss::Hit2D * > & hits(void)
bool isDenseStart(void) const
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.
static int max(int a, int b)
Detector simulation of raw signals on wires.
bool isTagged(void) const
Implementation of the Projection Matching Algorithm.
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
void merge(tss::Cluster2D &clu)
double length2(void) const