Class AbstractSuperlayer<LayerType extends Layer>
- Type Parameters:
LayerType- the specific type ofLayercontained by theSuperlayer
- All Implemented Interfaces:
Superlayer<LayerType>, Showable
- Direct Known Subclasses:
AlertDCSuperlayer, AlertTOFSuperlayer, BSTSuperlayer, CNDSuperlayer, DCSuperlayer, ECSuperlayer, FMTSuperlayer, FTCALSuperlayer, FTOFSuperlayer, FTOFSuperlayerMesh
Superlayer interface to minimize the effort
required to implement a Superlayer.
To implement a Superlayer, the programmer needs only to extend this
class and provide implementations for the
Superlayer.getType() method.
Initially the Superlayer will contain no Layers, so
Layers must be added to the Superlayer after
AbstractSuperlayer's constructor has been invoked via the
addLayer(org.jlab.geom.base.Layer) method.
- Author:
- jnhankins
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractSuperlayer(DetectorId detectorId, int sectorId, int superlayerId) Initializes an empty AbstractSuperlayer with the given id. -
Method Summary
Modifier and TypeMethodDescriptionfinal voidAdds a layer to this superlayer.Returns an unmodifiable list of all layers contained in this superlayer.getCrossSections(Transformation3D transform) Returns a list of lists of lines such that each of the inner lists contains the cross section lines for a single component.Returns the id of the detector that this superlayer is contained in.Returns a list of DetecorHits which store information about intersections with components in this superlayer.final LayerTypegetLayer(int layerId) Returns the layer associated with the given layer id.getLayerHits(Path3D path) Returns a list of DetecorHits which store information about intersections with layer surface boundaries in this superlayer.final intReturns the number of layers contained in this sector.final intReturns the id of the sector that this superlayer is contained in.final intReturns the id of this superlayer.final voidsetTransformation(Transformation3D transform) Sets the transformation of all layers contained in this superlayer.voidshow()InvokesSystem.out.println(this).toString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Superlayer
getType
-
Constructor Details
-
AbstractSuperlayer
Initializes an empty AbstractSuperlayer with the given id.- Parameters:
detectorId- the id of this superlayer's detectorsectorId- the id of this superlayer's sectorsuperlayerId- the id of this superlayer
-
-
Method Details
-
getDetectorId
Description copied from interface:SuperlayerReturns the id of the detector that this superlayer is contained in.- Specified by:
getDetectorIdin interfaceSuperlayer<LayerType extends Layer>- Returns:
- the id of this superlayer's detector
-
getSectorId
public final int getSectorId()Description copied from interface:SuperlayerReturns the id of the sector that this superlayer is contained in.- Specified by:
getSectorIdin interfaceSuperlayer<LayerType extends Layer>- Returns:
- the id of this superlayer's sector
-
getSuperlayerId
public final int getSuperlayerId()Description copied from interface:SuperlayerReturns the id of this superlayer.- Specified by:
getSuperlayerIdin interfaceSuperlayer<LayerType extends Layer>- Returns:
- the id of this superlayer
-
getNumLayers
public final int getNumLayers()Description copied from interface:SuperlayerReturns the number of layers contained in this sector.- Specified by:
getNumLayersin interfaceSuperlayer<LayerType extends Layer>- Returns:
- the number of layers
-
addLayer
Adds a layer to this superlayer. If a layer with the same id is contained in this superlayer then the preexisting layer is replaced by the given layer. Intended for use by detector factories.- Parameters:
layer- the layer to add
-
getLayer
Description copied from interface:SuperlayerReturns the layer associated with the given layer id.- Specified by:
getLayerin interfaceSuperlayer<LayerType extends Layer>- Parameters:
layerId- the layer id- Returns:
- the layer with the specified id
-
getAllLayers
Description copied from interface:SuperlayerReturns an unmodifiable list of all layers contained in this superlayer.- Specified by:
getAllLayersin interfaceSuperlayer<LayerType extends Layer>- Returns:
- an unmodifiable list of layers
-
getCrossSections
Description copied from interface:SuperlayerReturns a list of lists of lines such that each of the inner lists contains the cross section lines for a single component.This method takes a Transformation3D object as an argument, then constructs a
Plane3Dobject in the xy-plane and applies the transformation to the plane. The intersection of the superlayer's component's shapes with the transformed plane is then calculated and stored in a list of lists of lines of lines. The inverse of the transformation is then applied to each line ensuring that each returned line is in the xy-plane- Specified by:
getCrossSectionsin interfaceSuperlayer<LayerType extends Layer>- Parameters:
transform- the transformation- Returns:
- a list of list of lines representing the cross section
- See Also:
-
getLayerHits
Description copied from interface:SuperlayerReturns a list of DetecorHits which store information about intersections with layer surface boundaries in this superlayer. The component ids stored in the detector hits will all be set to -1 to indicate that detector hit does not specify a specific component.- Specified by:
getLayerHitsin interfaceSuperlayer<LayerType extends Layer>- Parameters:
path- the path- Returns:
- a list of detector hits
-
getHits
Description copied from interface:SuperlayerReturns a list of DetecorHits which store information about intersections with components in this superlayer.- Specified by:
getHitsin interfaceSuperlayer<LayerType extends Layer>- Parameters:
path- the path- Returns:
- a list of detector hits
-
setTransformation
Description copied from interface:SuperlayerSets the transformation of all layers contained in this superlayer. In most cases layers within a superlayer are "bolted" together and cannot move independently of one another, so this method is intended to provide a mechanism for moving groups of layers together.- Specified by:
setTransformationin interfaceSuperlayer<LayerType extends Layer>- Parameters:
transform- the new transform- See Also:
-
show
-
toString
-