Package org.jlab.geom
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 SummaryFieldsModifier and TypeFieldDescriptionstatic booleanUsed for debugging, if PRINTMODE_ONELINE is true then DetectorHit's toString() method is shortened to fit on one line.
- 
Constructor SummaryConstructorsConstructorDescriptionDetectorHit(DetectorId detectorId, int sectorId, int superlayerId, int layerId, int componentId, Point3D hitPosition) Constructs a newDetectorHitat 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 SummaryModifier and TypeMethodDescriptionintReturns the component id of this hit or -1 if the specific component is not known.Returns the detector id of this hit.doubleReturns the amount of energy in this hit or 0 if the energy has not yet been set.getError()Returns the position of this hit.intReturns the layer id of this hit.Returns the position of this hit.intReturns the sector id of this hit.intReturns the superlayer id of this hit.doublegetTime()Returns the time that this hit occurred or 0 if the time has not yet been set.voidsetEnergy(double e) Sets the amount of energy deposited by this hit.voidsetTime(double t) Sets the time that this hit occurred.voidshow()InvokesSystem.out.println(this).toString()
- 
Field Details- 
PRINTMODE_ONELINEpublic static boolean PRINTMODE_ONELINEUsed for debugging, if PRINTMODE_ONELINE is true then DetectorHit's toString() method is shortened to fit on one line.
 
- 
- 
Constructor Details- 
DetectorHitpublic DetectorHit(DetectorId detectorId, int sectorId, int superlayerId, int layerId, int componentId, Point3D hitPosition) Constructs a newDetectorHitat the given position with the detector, sector, superlayer, layer, and component ids all set to 0.- Parameters:
- hitPosition- the position of the hit
- 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
 
- 
DetectorHitpublic DetectorHit(DetectorId detectorId, int sectorId, int superlayerId, int layerId, int componentId, Point3D hitPosition, Vector3D direction) 
 
- 
- 
Method Details- 
getDetectorIdReturns the detector id of this hit.- Returns:
- the detector id
 
- 
getSectorIdpublic int getSectorId()Returns the sector id of this hit.- Returns:
- the sector id
 
- 
getSuperlayerIdpublic int getSuperlayerId()Returns the superlayer id of this hit.- Returns:
- the superlayer id
 
- 
getLayerIdpublic int getLayerId()Returns the layer id of this hit.- Returns:
- the layer id
 
- 
getComponentIdpublic int getComponentId()Returns the component id of this hit or -1 if the specific component is not known.- Returns:
- the component id or -1
 
- 
getPositionReturns the position of this hit.- Returns:
- the position of this hit
 
- 
getErrorReturns the position of this hit.- Returns:
- the position of this hit
 
- 
getEnergypublic 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
 
- 
getTimepublic double getTime()Returns the time that this hit occurred or 0 if the time has not yet been set.- Returns:
- the time or 0
 
- 
setEnergypublic void setEnergy(double e) Sets the amount of energy deposited by this hit.- Parameters:
- e- the energy
 
- 
setTimepublic void setTime(double t) Sets the time that this hit occurred.- Parameters:
- t- the time
 
- 
showpublic void show()InvokesSystem.out.println(this).
- 
toString
 
-