Package org.jlab.rec.atof.cluster
Class ClusterFinder
java.lang.Object
org.jlab.rec.atof.cluster.ClusterFinder
The
ClusterFinder
class builds clusters in the atof
Uses found hits information. Creates a ATOFCluster
matching them.
- Author:
- pilleux
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor that initializes the list clusters as new empty list. -
Method Summary
Modifier and TypeMethodDescription<T extends ATOFHit>
voidclusterHits
(int i, ArrayList<T> hits, ATOFHit this_hit, double sigma_module, Number sigma_z, double sigma_t, int cluster_id, ArrayList<? super T> this_cluster_hits) Cluster hits around a given hit, based on the time and geometric proximity.int
computeDeltaModule
(ATOFHit hit, ATOFHit otherhit) Computes the module difference between twoATOFHit
.Gets the list of clusters.static void
void
makeClusters
(org.jlab.io.base.DataEvent event, HitFinder hitfinder) Builds clusters in theDateEvent
using hits found and stored in aHitFinder
.void
makeClusters
(HitFinder hitfinder, double sigma_module, double sigma_component, double sigma_z, double sigma_t, org.jlab.io.base.DataEvent event) Builds clusters in theDateEvent
using hits found and stored in aHitFinder
.void
setClusters
(ArrayList<ATOFCluster> clusters) Sets the list of clusters.
-
Constructor Details
-
ClusterFinder
public ClusterFinder()Default constructor that initializes the list clusters as new empty list.
-
-
Method Details
-
setClusters
Sets the list of clusters.- Parameters:
clusters
- aArrayList
ofATOFCluster
.
-
getClusters
Gets the list of clusters.- Returns:
- a
ArrayList
ofATOFCluster
.
-
computeDeltaModule
Computes the module difference between twoATOFHit
. -
clusterHits
public <T extends ATOFHit> void clusterHits(int i, ArrayList<T> hits, ATOFHit this_hit, double sigma_module, Number sigma_z, double sigma_t, int cluster_id, ArrayList<? super T> this_cluster_hits) Cluster hits around a given hit, based on the time and geometric proximity. Hits are compared based on their module difference, z difference, which is distance in mm or component difference for wedge hits, and time difference. If the hit satisfies all conditions, it is marked as clustered and added to the cluster hit list.- Type Parameters:
T
- The type of the hit objects, which must extendATOFHit
. This allows the method to work with different types of hits that are subclasses ofATOFHit
(e.g.,BarHit
).- Parameters:
i
- The index from which hits are read in the list to compare against the current hit.hits
- The list of hits to be clustered, can be any subclass ofATOFHit
.this_hit
- The hit currently being considered for clustering.sigma_module
- The threshold for the module difference between the hits. If the difference exceeds this value, the hits are not clustered.sigma_z
- The threshold for the z-distance [mm] (or component difference for "wedge" type hits) between the hits.sigma_t
- The threshold for the time difference [ns] between the hits.cluster_id
- The ID of the cluster being formed.this_cluster_hits
- The list that will store the clustered hits. This list can accept hits of type ATOFHit or BarHit. Clustered hits are added to this list.
-
makeClusters
public void makeClusters(HitFinder hitfinder, double sigma_module, double sigma_component, double sigma_z, double sigma_t, org.jlab.io.base.DataEvent event) Builds clusters in theDateEvent
using hits found and stored in aHitFinder
.- Parameters:
hitfinder
- theHitFinder
containing the hits that were foundsigma_module
- the tolerance for clustering between modulessigma_component
- the tolerance for clustering between componentssigma_z
- the tolerance for clustering in z [mm]sigma_t
- the tolerance for clustering in time [ns]
-
makeClusters
Builds clusters in theDateEvent
using hits found and stored in aHitFinder
.- Parameters:
event
- theDataEvent
containing the clusters to be builthitfinder
- theHitFinder
containing the hits that were found
-
main
- Parameters:
args
- the command line arguments
-