Package org.jlab.rec.atof.hit
Class ATOFHit
java.lang.Object
org.jlab.rec.atof.hit.ATOFHit
- Direct Known Subclasses:
- BarHit
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 SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionintComputes the module index for the hit.final intconvertSLCToXYZ(Detector atof) Calculates spatial coordinates for the hit based on associated detector component.final intConverts TDC to time (ns).final intConverts ToT to energy (MeV).intintdoubleintgetIdTDC()booleanintgetLayer()intgetOrder()doublegetPhi()Computes the azimuthal angle (phi) of the hit in rad.intintgetTdc()doublegetTime()intgetTot()getType()doublegetX()doublegetY()doublegetZ()static voidfinal StringmakeType()Assigns a type to the hit.booleanCompares two ATOFHit objects to check if they match in the bar.voidsetAssociatedClusterIndex(int index) voidsetComponent(int component) voidsetEnergy(double energy) voidsetIdTDC(int index) voidsetIsInACluster(boolean is_in_a_cluster) voidsetLayer(int layer) voidsetOrder(int order) voidsetSector(int sector) voidsetTdc(int tdc) voidsetTime(double time) voidsetTot(int tot) voidvoidsetX(double x) voidsetY(double y) voidsetZ(double z) 
- 
Constructor Details- 
ATOFHitConstructor 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.
 
- 
ATOFHitpublic ATOFHit()
 
- 
- 
Method Details- 
getSectorpublic int getSector()
- 
setSectorpublic void setSector(int sector) 
- 
getLayerpublic int getLayer()
- 
setLayerpublic void setLayer(int layer) 
- 
getOrderpublic int getOrder()
- 
setOrderpublic void setOrder(int order) 
- 
getComponentpublic int getComponent()
- 
setComponentpublic void setComponent(int component) 
- 
getTdcpublic int getTdc()
- 
setTdcpublic void setTdc(int tdc) 
- 
getTotpublic int getTot()
- 
setTotpublic void setTot(int tot) 
- 
getTimepublic double getTime()
- 
setTimepublic void setTime(double time) 
- 
getEnergypublic double getEnergy()
- 
setEnergypublic void setEnergy(double energy) 
- 
getXpublic double getX()
- 
setXpublic void setX(double x) 
- 
getYpublic double getY()
- 
setYpublic void setY(double y) 
- 
getZpublic double getZ()
- 
setZpublic void setZ(double z) 
- 
getType
- 
setType
- 
getIsInAClusterpublic boolean getIsInACluster()
- 
setIsInAClusterpublic void setIsInACluster(boolean is_in_a_cluster) 
- 
getAssociatedClusterIndexpublic int getAssociatedClusterIndex()
- 
setAssociatedClusterIndexpublic void setAssociatedClusterIndex(int index) 
- 
getIdTDCpublic int getIdTDC()
- 
setIdTDCpublic void setIdTDC(int index) 
- 
computeModuleIndexpublic int computeModuleIndex()Computes the module index for the hit.
- 
makeTypeAssigns a type to the hit.
- 
convertTdcToTimepublic 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.
 
- 
convertTotToEnergypublic 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.
 
- 
convertSLCToXYZCalculates 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.
 
- 
matchBarCompares 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.
 true, indicating the two hits match.- Parameters:
- hit2match- The ATOFHit object to compare with the current instance.
- Returns:
- trueif the hits match;- falseotherwise.
 
- If the sector or layer of the two hits do not match, the method
 returns 
- 
getPhipublic double getPhi()Computes the azimuthal angle (phi) of the hit in rad.- Returns:
- The azimuthal angle (phi) in radians, in the range [-π, π].
 
- 
main- Parameters:
- args- the command line arguments
 
 
-