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 Link icon

    • ATOFHit Link icon

      public ATOFHit(int sector, int layer, int component, int order, int tdc, int tot, 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 Link icon

      public ATOFHit()
  • Method Details Link icon

    • getSector Link icon

      public int getSector()
    • setSector Link icon

      public void setSector(int sector)
    • getLayer Link icon

      public int getLayer()
    • setLayer Link icon

      public void setLayer(int layer)
    • getOrder Link icon

      public int getOrder()
    • setOrder Link icon

      public void setOrder(int order)
    • getComponent Link icon

      public int getComponent()
    • setComponent Link icon

      public void setComponent(int component)
    • getTdc Link icon

      public int getTdc()
    • setTdc Link icon

      public void setTdc(int tdc)
    • getTot Link icon

      public int getTot()
    • setTot Link icon

      public void setTot(int tot)
    • getTime Link icon

      public double getTime()
    • setTime Link icon

      public void setTime(double time)
    • getEnergy Link icon

      public double getEnergy()
    • setEnergy Link icon

      public void setEnergy(double energy)
    • getX Link icon

      public double getX()
    • setX Link icon

      public void setX(double x)
    • getY Link icon

      public double getY()
    • setY Link icon

      public void setY(double y)
    • getZ Link icon

      public double getZ()
    • setZ Link icon

      public void setZ(double z)
    • getType Link icon

      public String getType()
    • setType Link icon

      public void setType(String type)
    • getIsInACluster Link icon

      public boolean getIsInACluster()
    • setIsInACluster Link icon

      public void setIsInACluster(boolean is_in_a_cluster)
    • getAssociatedClusterIndex Link icon

      public int getAssociatedClusterIndex()
    • setAssociatedClusterIndex Link icon

      public void setAssociatedClusterIndex(int index)
    • getIdTDC Link icon

      public int getIdTDC()
    • setIdTDC Link icon

      public void setIdTDC(int index)
    • computeModuleIndex Link icon

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

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

      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 Link icon

      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 Link icon

      public final int convertSLCToXYZ(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 Link icon

      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 Link icon

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

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