17 for (
auto hit_it = hits.rbegin(); hit_it != hits.rend(); ++hit_it) {
18 if ((*hit_it)->time > q.
time + eps)
20 if ((*hit_it)->time < q.
time - eps)
39 auto begin_it = std::lower_bound(
42 for (
auto it = begin_it; it !=
hits.
end(); ++it) {
85 for (
auto h : other.
hits) {
101 while (!seedSet.empty()) {
102 Hit* q = seedSet.back();
129 new_hit.
reset(time, channel);
132 add_hit(&new_hit, completed_clusters);
148 add_hit(&new_hit, completed_clusters);
157 static int next_cluster_index = 0;
159 m_hits.push_back(new_hit);
165 std::set<int> clusters_neighbouring_hit;
172 neighbour->neighbours.size() + 1 >=
m_minPts) {
175 clusters_neighbouring_hit.insert(neighbour->cluster);
179 if (clusters_neighbouring_hit.empty()) {
187 m_clusters.end(), next_cluster_index, next_cluster_index);
188 Cluster& new_cluster = new_it->second;
191 next_cluster_index++;
202 auto index_it = clusters_neighbouring_hit.begin();
222 if(q->neighbours.size() + 1 ==
m_minPts){
223 for (
auto r : q->neighbours) {
232 for (; index_it != clusters_neighbouring_hit.end(); ++index_it) {
236 Cluster& other_cluster = other_it->second;
245 if(neighbour->neighbours.size() + 1 >=
m_minPts){
250 m_clusters.end(), next_cluster_index, next_cluster_index);
251 Cluster& new_cluster = new_it->second;
253 new_cluster.
add_hit(neighbour);
254 next_cluster_index++;
269 Cluster& cluster = clust_it->second;
276 if(completed_clusters){
283 completed_clusters->push_back(cluster);
299 float earliest_time = std::numeric_limits<float>::max();
303 std::min(earliest_time, (*cluster.second.hits.begin())->time);
311 auto last_it = std::lower_bound(
m_hits.begin(),
313 earliest_time - 10 *
m_eps,
std::vector< Hit * >::iterator begin()
std::vector< Hit * >::iterator end()
std::vector< Hit * > m_hits
void add_primitive(const triggeralgs::TriggerPrimitive &prim, std::vector< Cluster > *completed_clusters=nullptr)
std::vector< Hit > m_hit_pool
uint64_t m_first_prim_time
void add_point(float time, float channel, std::vector< Cluster > *completed_clusters=nullptr)
void cluster_reachable(Hit *seed_hit, Cluster &cluster)
void add_hit(Hit *new_hit, std::vector< Cluster > *completed_clusters=nullptr)
std::map< int, Cluster > m_clusters
bool time_comp_lower(const Hit *hit, const float t)
int neighbours_sorted(const std::vector< Hit * > &hits, Hit &q, float eps, int minPts)
Completeness completeness
bool maybe_add_new_hit(Hit *new_hit, float eps, int minPts)
void steal_hits(Cluster &other)
bool add_potential_neighbour(Hit *other, float eps, int minPts)
void reset(float _time, int _chan, const triggeralgs::TriggerPrimitive *_prim=nullptr)
Connectedness connectedness