Contents
Class DetectorHit
java.lang.Object
org.jlab.geom.DetectorHit
- All Implemented Interfaces:
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
FieldsModifier and TypeFieldDescriptionstatic boolean
Used for debugging, if PRINTMODE_ONELINE is true then DetectorHit's toString() method is shortened to fit on one line. -
Constructor Summary
ConstructorsConstructorDescriptionDetectorHit
(DetectorId detectorId, int sectorId, int superlayerId, int layerId, int componentId, Point3D hitPosition) Constructs a newDetectorHit
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
Modifier and TypeMethodDescriptionint
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.getError()
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
getTime()
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
show()
InvokesSystem.out.println(this)
.toString()
-
Field Details
-
Constructor Details
-
DetectorHit
public DetectorHit(DetectorId detectorId, int sectorId, int superlayerId, int layerId, int componentId, Point3D hitPosition) Constructs a newDetectorHit
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 hitsectorId
- the id of the sector containing this hitsuperlayerId
- the id of the superlayer containing this hitlayerId
- the id of the layer containing this hitcomponentId
- the id of the component closest to this hithitPosition
- the position of the hit
-
DetectorHit
public DetectorHit(DetectorId detectorId, int sectorId, int superlayerId, int layerId, int componentId, Point3D hitPosition, Vector3D direction)
-
-
Method Details
-
getDetectorId
-
getSectorId
public int getSectorId()Returns the sector id of this hit.- Returns:
- the sector id
-
getSuperlayerId
public int getSuperlayerId()Returns the superlayer id of this hit.- Returns:
- the superlayer id
-
getLayerId
public int getLayerId()Returns the layer id of this hit.- Returns:
- the layer id
-
getComponentId
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
-
getError
-
getEnergy
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
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
public void setEnergy(double e) Sets the amount of energy deposited by this hit.- Parameters:
e
- the energy
-
setTime
public void setTime(double t) Sets the time that this hit occurred.- Parameters:
t
- the time
-
show
-
toString
-