Class DetectorHit

java.lang.Object
org.jlab.geom.DetectorHit
All Implemented Interfaces:
Showable

public class DetectorHit extends Object implements Showable
Representation of an intersection between a particle's path and a sensing component. When this intersection corresponds to corresponds to an event which would cause the sensor the produce a signal that triggers the sensors discriminator mechanism, this intersection is referred to as a "hit". Though DetectorHit can be used to store a hits, DetectorHit is can be used more generally to associate any intersection point with detector, sector, superlayer, layer, and, optionally, component id. For example, DetectorHit may be used to store outgoing intersections which would not trigger a discriminator.

Additionally, DetectorHit can, optionally, associate a hit with an error measurement (getError()), energy (getEnergy(), setEnergy(double)), and time (getTime(), setTime(double)).

The detector, superlayer, layer, and component id's are immutable, however the hit position and error can be retrieved and modified via getPosition() and getError().

Author:
jnhankins
See Also:
  • Field Summary Link icon

    Fields
    Modifier and Type
    Field
    Description
    static boolean
    Used for debugging, if PRINTMODE_ONELINE is true then DetectorHit's toString() method is shortened to fit on one line.
  • Constructor Summary Link icon

    Constructors
    Constructor
    Description
    DetectorHit(DetectorId detectorId, int sectorId, int superlayerId, int layerId, int componentId, Point3D hitPosition)
    Constructs a new DetectorHit at the given position with the detector, sector, superlayer, layer, and component ids all set to 0.
    DetectorHit(DetectorId detectorId, int sectorId, int superlayerId, int layerId, int componentId, Point3D hitPosition, Vector3D direction)
     
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    int
    Returns the component id of this hit or -1 if the specific component is not known.
    Returns the detector id of this hit.
    double
    Returns the amount of energy in this hit or 0 if the energy has not yet been set.
    Returns the position of this hit.
    int
    Returns the layer id of this hit.
    Returns the position of this hit.
    int
    Returns the sector id of this hit.
    int
    Returns the superlayer id of this hit.
    double
    Returns the time that this hit occurred or 0 if the time has not yet been set.
    void
    setEnergy(double e)
    Sets the amount of energy deposited by this hit.
    void
    setTime(double t)
    Sets the time that this hit occurred.
    void
    Invokes System.out.println(this).
     

    Methods inherited from class java.lang.Object Link icon

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details Link icon

    • PRINTMODE_ONELINE Link icon

      public static boolean PRINTMODE_ONELINE
      Used for debugging, if PRINTMODE_ONELINE is true then DetectorHit's toString() method is shortened to fit on one line.
  • Constructor Details Link icon

    • DetectorHit Link icon

      public DetectorHit(DetectorId detectorId, int sectorId, int superlayerId, int layerId, int componentId, Point3D hitPosition)
      Constructs a new DetectorHit at the given position with the detector, sector, superlayer, layer, and component ids all set to 0.
      Parameters:
      detectorId - the id of the detector containing this hit
      sectorId - the id of the sector containing this hit
      superlayerId - the id of the superlayer containing this hit
      layerId - the id of the layer containing this hit
      componentId - the id of the component closest to this hit
      hitPosition - the position of the hit
    • DetectorHit Link icon

      public DetectorHit(DetectorId detectorId, int sectorId, int superlayerId, int layerId, int componentId, Point3D hitPosition, Vector3D direction)
  • Method Details Link icon

    • getDetectorId Link icon

      public DetectorId getDetectorId()
      Returns the detector id of this hit.
      Returns:
      the detector id
    • getSectorId Link icon

      public int getSectorId()
      Returns the sector id of this hit.
      Returns:
      the sector id
    • getSuperlayerId Link icon

      public int getSuperlayerId()
      Returns the superlayer id of this hit.
      Returns:
      the superlayer id
    • getLayerId Link icon

      public int getLayerId()
      Returns the layer id of this hit.
      Returns:
      the layer id
    • getComponentId Link icon

      public int getComponentId()
      Returns the component id of this hit or -1 if the specific component is not known.
      Returns:
      the component id or -1
    • getPosition Link icon

      public Point3D getPosition()
      Returns the position of this hit.
      Returns:
      the position of this hit
    • getError Link icon

      public Vector3D getError()
      Returns the position of this hit.
      Returns:
      the position of this hit
    • getEnergy Link icon

      public double getEnergy()
      Returns the amount of energy in this hit or 0 if the energy has not yet been set.
      Returns:
      the energy or 0
    • getTime Link icon

      public double getTime()
      Returns the time that this hit occurred or 0 if the time has not yet been set.
      Returns:
      the time or 0
    • setEnergy Link icon

      public void setEnergy(double e)
      Sets the amount of energy deposited by this hit.
      Parameters:
      e - the energy
    • setTime Link icon

      public void setTime(double t)
      Sets the time that this hit occurred.
      Parameters:
      t - the time
    • show Link icon

      public void show()
      Invokes System.out.println(this).
      Specified by:
      show in interface Showable
    • toString Link icon

      public String toString()
      Overrides:
      toString in class Object