Package org.jlab.service.recoil.tof
Class RTOFRawHit
java.lang.Object
org.jlab.service.recoil.tof.RTOFRawHit
- Direct Known Subclasses:
RTOFHit
Represents a hit in the recoil tof. Stores info about the sector, row, column,
order, TDC, ToT. Type is bar up/bar down/ bar. Stores whether
the hit is part of a cluster. Calculates time, energy based on TDC/ToT.
- Author:
- npilleux, Nilanga Wickramaarachchi
-
Constructor Summary
ConstructorsConstructorDescriptionRTOFRawHit(int sector, int row, int column, int order, int tdc, int tot) Constructor for a hit in the recoil tof. -
Method Summary
Modifier and TypeMethodDescriptionfinal intCalculates spatial coordinates (cm) for the hit based on row and column number of the bar within a sector.final intConverts TDC to time (ns).final intConverts ToT to energy (MeV).intintdoubleintgetIdTDC()booleandoubleintgetOrder()doublegetPhi()Computes the azimuthal angle (phi) of the hit in rad.intgetRow()intintgetTdc()doublegetTime()intgetTot()getType()doublegetX()doublegetY()doublegetZ()final StringmakeType()Assigns a type to the hit.booleanmatchBar(RTOFRawHit hit2match) Compares two RTOFRawHit objects to check if they match in the bar.voidsetAssociatedClusterIndex(int index) voidsetColumn(int column) voidsetEnergy(double energy) voidsetIdTDC(int index) voidsetIsInACluster(boolean is_in_a_cluster) voidsetLocalY(double local_y) voidsetOrder(int order) voidsetRow(int row) voidsetSector(int sector) voidsetTdc(int tdc) voidsetTime(double time) voidsetTot(int tot) voidvoidsetX(double x) voidsetY(double y) voidsetZ(double z)
-
Constructor Details
-
RTOFRawHit
public RTOFRawHit(int sector, int row, int column, int order, int tdc, int tot) Constructor for a hit in the recoil tof. Initializes the hit's sector, row, column, 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.row- The row of the detector where the hit was detected.column- The column within the row that registered the hit.order- Order of the hit.tdc- TDC value.tot- ToT value.
-
RTOFRawHit
public RTOFRawHit()
-
-
Method Details
-
getSector
public int getSector() -
setSector
public void setSector(int sector) -
getRow
public int getRow() -
setRow
public void setRow(int row) -
getOrder
public int getOrder() -
setOrder
public void setOrder(int order) -
getColumn
public int getColumn() -
setColumn
public void setColumn(int column) -
getTdc
public int getTdc() -
setTdc
public void setTdc(int tdc) -
getTot
public int getTot() -
setTot
public void setTot(int tot) -
getTime
public double getTime() -
setTime
public void setTime(double time) -
getEnergy
public double getEnergy() -
setEnergy
public void setEnergy(double energy) -
getX
public double getX() -
setX
public void setX(double x) -
getY
public double getY() -
setY
public void setY(double y) -
getLocalY
public double getLocalY() -
setLocalY
public void setLocalY(double local_y) -
getZ
public double getZ() -
setZ
public void setZ(double z) -
getType
-
setType
-
getIsInACluster
public boolean getIsInACluster() -
setIsInACluster
public void setIsInACluster(boolean is_in_a_cluster) -
getAssociatedClusterIndex
public int getAssociatedClusterIndex() -
setAssociatedClusterIndex
public void setAssociatedClusterIndex(int index) -
getIdTDC
public int getIdTDC() -
setIdTDC
public void setIdTDC(int index) -
makeType
Assigns a type to the hit. -
convertTdcToTime
public final int convertTdcToTime()Converts TDC to time (ns). Sets the hit time parameter to a raw time for up/down bar hits.- Returns:
- 0 if the time was successfully set, or 1 if the hit type is unsupported.
-
convertTotToEnergy
public final int convertTotToEnergy()Converts ToT to energy (MeV). Sets the hit energy parameter to a raw energy for up/down bar hits.- Returns:
- 0 if the energy was successfully set, or 1 if the hit type is unsupported.
-
calculateXYZ
public final int calculateXYZ()Calculates spatial coordinates (cm) for the hit based on row and column number of the bar within a sector. The row and column variables are obtained from the bank information.- Returns:
- 0 if the coordinates were successfully set, or 1 if the hit type is undefined or unsupported.
-
matchBar
Compares two RTOFRawHit objects to check if they match in the bar.- If the sector or row or column of the two hits do not match, 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 RTOFRawHit object to compare with the current instance.- Returns:
trueif the hits match;falseotherwise.
- If the sector or row or column of the two hits do not match, the method
returns
-
getPhi
public double getPhi()Computes the azimuthal angle (phi) of the hit in rad.- Returns:
- The azimuthal angle (phi) in radians, in the range [-π, π].
-