Class ClusterFinder

java.lang.Object
org.jlab.rec.atof.cluster.ClusterFinder

public class ClusterFinder extends Object
The ClusterFinder class builds clusters in the atof

Uses found hits information. Creates a ATOFCluster matching them.

Author:
pilleux
  • Constructor Details

    • ClusterFinder

      public ClusterFinder()
      Default constructor that initializes the list clusters as new empty list.
  • Method Details

    • setClusters

      public void setClusters(ArrayList<ATOFCluster> clusters)
      Sets the list of clusters.
      Parameters:
      clusters - a ArrayList of ATOFCluster.
    • getClusters

      public ArrayList<ATOFCluster> getClusters()
      Gets the list of clusters.
      Returns:
      a ArrayList of ATOFCluster.
    • computeDeltaModule

      public int computeDeltaModule(ATOFHit hit, ATOFHit otherhit)
      Computes the module difference between two ATOFHit.
      Parameters:
      hit - the first ATOFHit.
      otherhit - the second ATOFHit.
    • 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 extend ATOFHit. This allows the method to work with different types of hits that are subclasses of ATOFHit (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 of ATOFHit.
      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 the DateEvent using hits found and stored in a HitFinder.
      Parameters:
      hitfinder - the HitFinder containing the hits that were found
      sigma_module - the tolerance for clustering between modules
      sigma_component - the tolerance for clustering between components
      sigma_z - the tolerance for clustering in z [mm]
      sigma_t - the tolerance for clustering in time [ns]
    • makeClusters

      public void makeClusters(org.jlab.io.base.DataEvent event, HitFinder hitfinder)
      Builds clusters in the DateEvent using hits found and stored in a HitFinder.
      Parameters:
      event - the DataEvent containing the clusters to be built
      hitfinder - the HitFinder containing the hits that were found
    • main

      public static void main(String[] args)
      Parameters:
      args - the command line arguments