Class SNRCluster
java.lang.Object
cnuphys.snr.SNRCluster
- Author:
- heddle A cluster candidate is a list of wires with the requirement that there are no more than two wires in a given layer
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal intThe number of layers, probably 6final intThe number of wires, probably 112final SegmentStartLista list for the segment starting points.final WireList[]one wirelist for each layer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(int layer, int wire) Add a wire to the wire list for a given layer.voidaddSegmentStart(int wire) Add a segment (candidate) start wirevoidclean()This removes wires from the wire list if there are more than two in a given layer.voidclear()Clear the wire lists.voidThis computes slope and intercept a line using the layer as the X value and the average wire number as the Y so a slope of 0 looks "vertical".doublegetSlope()Get the slope of the linear fitdoublegetWirePosition(int layer) Used to draw a linear fit to the clusterbooleanThe given cluster is a subset of this cluster if all wirelists are subsetsvoidpackData(NoiseReductionParameters params) toString()String representation
-
Field Details
-
numLayers
public final int numLayersThe number of layers, probably 6 -
numWires
public final int numWiresThe number of wires, probably 112 -
segmentStartList
a list for the segment starting points. -
wireLists
one wirelist for each layer
-
-
Constructor Details
-
SNRCluster
public SNRCluster(int numLayers, int numWires) - Parameters:
numLayers- the number of layers, for CLAS12 6numWires- the number of wires, for CLAS12 112
-
-
Method Details
-
add
public void add(int layer, int wire) Add a wire to the wire list for a given layer. The wireList will enforce no duplicates, but will keep repeat count- Parameters:
layer- the zero-based layer, for CLAS12 [0..5]wire- the zero-based wire, for CLAS12 [0..111]
-
addSegmentStart
public void addSegmentStart(int wire) Add a segment (candidate) start wire- Parameters:
wire- the zero-based wire, for CLAS12 [0..111]numMissing- the number of missing layers required
-
clear
public void clear()Clear the wire lists. So the object can be reused, but only for the same sector, superlayer, and numLayers -
toString
-
packData
-
getSlope
public double getSlope()Get the slope of the linear fit- Returns:
-
clean
public void clean()This removes wires from the wire list if there are more than two in a given layer. -
computeLine
public void computeLine()This computes slope and intercept a line using the layer as the X value and the average wire number as the Y so a slope of 0 looks "vertical". We do it this way to avoid the possibility of an infinite slope. -
getWirePosition
public double getWirePosition(int layer) Used to draw a linear fit to the cluster- Parameters:
layer- the layer- Returns:
- the wire position as a real (with fractional part)
-
hasSubset
The given cluster is a subset of this cluster if all wirelists are subsets- Parameters:
c- the given cluster- Returns:
trueif the given cluster is a subset of this cluster
-