DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
triggeralgs::dbscan::Hit Struct Reference

#include <Hit.hpp>

Collaboration diagram for triggeralgs::dbscan::Hit:
[legend]

Public Member Functions

 Hit (float _time, int _chan, const triggeralgs::TriggerPrimitive *_prim=nullptr)
void reset (float _time, int _chan, const triggeralgs::TriggerPrimitive *_prim=nullptr)
bool add_potential_neighbour (Hit *other, float eps, int minPts)

Public Attributes

float time
int chan
int cluster
Connectedness connectedness
HitSet neighbours
triggeralgs::TriggerPrimitive primitive

Detailed Description

Definition at line 73 of file Hit.hpp.

Constructor & Destructor Documentation

◆ Hit()

triggeralgs::dbscan::Hit::Hit ( float _time,
int _chan,
const triggeralgs::TriggerPrimitive * _prim = nullptr )

Definition at line 36 of file Hit.cpp.

37{
38 reset(_time, _chan, _prim);
39}
void reset(float _time, int _chan, const triggeralgs::TriggerPrimitive *_prim=nullptr)
Definition Hit.cpp:44

Member Function Documentation

◆ add_potential_neighbour()

bool triggeralgs::dbscan::Hit::add_potential_neighbour ( Hit * other,
float eps,
int minPts )

Definition at line 60 of file Hit.cpp.

61{
62 if (other != this && euclidean_distance_sqr(*this, *other) < eps*eps) {
63 neighbours.insert(other);
64 if (neighbours.size() + 1 >= minPts) {
66 }
67 // Neighbourliness is symmetric
68 other->neighbours.insert(this);
69 if (other->neighbours.size() + 1 >= minPts) {
70 other->connectedness = Connectedness::kCore;
71 }
72 return true;
73 }
74 return false;
75}
float euclidean_distance_sqr(const Hit &p, const Hit &q)
Definition Hit.hpp:113
Connectedness connectedness
Definition Hit.hpp:84

◆ reset()

void triggeralgs::dbscan::Hit::reset ( float _time,
int _chan,
const triggeralgs::TriggerPrimitive * _prim = nullptr )

Definition at line 44 of file Hit.cpp.

45{
46 time=_time;
47 chan=_chan;
50 neighbours.clear();
51 if(_prim){
52 primitive=*_prim;
53 }
54}
const int kUndefined
Definition Hit.hpp:15
triggeralgs::TriggerPrimitive primitive
Definition Hit.hpp:86

Member Data Documentation

◆ chan

int triggeralgs::dbscan::Hit::chan

Definition at line 83 of file Hit.hpp.

◆ cluster

int triggeralgs::dbscan::Hit::cluster

Definition at line 83 of file Hit.hpp.

◆ connectedness

Connectedness triggeralgs::dbscan::Hit::connectedness

Definition at line 84 of file Hit.hpp.

◆ neighbours

HitSet triggeralgs::dbscan::Hit::neighbours

Definition at line 85 of file Hit.hpp.

◆ primitive

triggeralgs::TriggerPrimitive triggeralgs::dbscan::Hit::primitive

Definition at line 86 of file Hit.hpp.

◆ time

float triggeralgs::dbscan::Hit::time

Definition at line 82 of file Hit.hpp.


The documentation for this struct was generated from the following files: