Class ATOFHit

java.lang.Object
org.jlab.rec.atof.hit.ATOFHit
Direct Known Subclasses:
BarHit

public class ATOFHit extends Object
Represents a hit in the atof. Stores info about the sector, layer, component, order, TDC, ToT. Type is wedge/bar up/bar down/ bar Spatial coordinates are computed from atof detector object using the geometry service Stores whether the hit is part of a cluster. Calculates time, energy based on TDC/ToT.
Author:
npilleux
  • Constructor Details

    • ATOFHit

      public ATOFHit(int sector, int layer, int component, int order, int tdc, int tot, org.jlab.geom.base.Detector atof)
      Constructor for a hit in the atof. Initializes the hit's sector, layer, component, order, TDC, ToT. Sets the hit's initial state regarding clustering. Set up the hit's type, time, energy, and spatial coordinates.
      Parameters:
      sector - The sector of the detector where the hit occurred.
      layer - The layer of the detector where the hit was detected.
      component - The component within the layer that registered the hit.
      order - Order of the hit.
      tdc - TDC value.
      tot - ToT value.
      atof - Detector object representing the atof, used to calculate spatial coordinates.
    • ATOFHit

      public ATOFHit()
  • Method Details

    • getSector

      public int getSector()
    • setSector

      public void setSector(int sector)
    • getLayer

      public int getLayer()
    • setLayer

      public void setLayer(int layer)
    • getOrder

      public int getOrder()
    • setOrder

      public void setOrder(int order)
    • getComponent

      public int getComponent()
    • setComponent

      public void setComponent(int component)
    • getTdc

      public int getTdc()
    • setTdc

      public void setTdc(int tdc)
    • getTot

      public int getTot()
    • setTot

      public void setTot(int tot)
    • getTime

      public double getTime()
    • setTime

      public void setTime(double time)
    • getEnergy

      public double getEnergy()
    • setEnergy

      public void setEnergy(double energy)
    • getX

      public double getX()
    • setX

      public void setX(double x)
    • getY

      public double getY()
    • setY

      public void setY(double y)
    • getZ

      public double getZ()
    • setZ

      public void setZ(double z)
    • getType

      public String getType()
    • setType

      public void setType(String type)
    • getIsInACluster

      public boolean getIsInACluster()
    • setIsInACluster

      public void setIsInACluster(boolean is_in_a_cluster)
    • getAssociatedClusterIndex

      public int getAssociatedClusterIndex()
    • setAssociatedClusterIndex

      public void setAssociatedClusterIndex(int index)
    • getIdTDC

      public int getIdTDC()
    • setIdTDC

      public void setIdTDC(int index)
    • computeModuleIndex

      public int computeModuleIndex()
      Computes the module index for the hit.
    • makeType

      public final String makeType()
      Assigns a type to the hit.
    • convertTdcToTime

      public final int convertTdcToTime()
      Converts TDC to time (ns). Sets the hit time parameter to a raw time for up/down bar hits or to the time corrected for the propagation for wedge hits.
      Returns:
      0 if the time was successfully set, or 1 if the hit type is unsupported.
    • convertTotToEnergy

      public final int convertTotToEnergy()
      Converts ToT to energy (MeV). Sets the hit energy parameter to a raw energy for up/down bar hits or to the energy corrected for the attenuation for wedge hits.
      Returns:
      0 if the energy was successfully set, or 1 if the hit type is unsupported.
    • convertSLCToXYZ

      public final int convertSLCToXYZ(org.jlab.geom.base.Detector atof)
      Calculates spatial coordinates for the hit based on associated detector component. Retrieves the midpoint of the atof component to assign the corresponding x, y, z coordinates to the hit (mm).
      Parameters:
      atof - The Detector object representing the atof.
      Returns:
      0 if the coordinates were successfully set, or 1 if the hit type is undefined or unsupported.
    • matchBar

      public boolean matchBar(ATOFHit hit2match)
      Compares two ATOFHit objects to check if they match in the bar.
      • If the sector or layer of the two hits do not match, the method returns false.
      • If either hit is not in the bar (component must be 10), the method returns false.
      • If both hits are in the same SiPM (i.e., their order is the same), or have incorrect order, the method returns false.
      If none of these conditions are violated, the method returns true, indicating the two hits match.
      Parameters:
      hit2match - The ATOFHit object to compare with the current instance.
      Returns:
      true if the hits match; false otherwise.
    • getPhi

      public double getPhi()
      Computes the azimuthal angle (phi) of the hit in rad.
      Returns:
      The azimuthal angle (phi) in radians, in the range [-π, π].
    • main

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