Class AbstractSuperlayer<LayerType extends Layer>
- Type Parameters:
LayerType
- the specific type ofLayer
contained 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 Layer
s, so
Layer
s 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
ConstructorsModifierConstructorDescriptionprotected
AbstractSuperlayer
(DetectorId detectorId, int sectorId, int superlayerId) Initializes an empty AbstractSuperlayer with the given id. -
Method Summary
Modifier and TypeMethodDescriptionfinal void
Adds 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 LayerType
getLayer
(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 int
Returns the number of layers contained in this sector.final int
Returns the id of the sector that this superlayer is contained in.final int
Returns the id of this superlayer.final void
setTransformation
(Transformation3D transform) Sets the transformation of all layers contained in this superlayer.void
show()
InvokesSystem.out.println(this)
.toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.jlab.geom.base.Superlayer
getType
-
Constructor Details
-
Method Details
-
getDetectorId
Description copied from interface:Superlayer
Returns the id of the detector that this superlayer is contained in.- Specified by:
getDetectorId
in interfaceSuperlayer<LayerType extends Layer>
- Returns:
- the id of this superlayer's detector
-
getSectorId
public final int getSectorId()Description copied from interface:Superlayer
Returns the id of the sector that this superlayer is contained in.- Specified by:
getSectorId
in interfaceSuperlayer<LayerType extends Layer>
- Returns:
- the id of this superlayer's sector
-
getSuperlayerId
public final int getSuperlayerId()Description copied from interface:Superlayer
Returns the id of this superlayer.- Specified by:
getSuperlayerId
in interfaceSuperlayer<LayerType extends Layer>
- Returns:
- the id of this superlayer
-
getNumLayers
public final int getNumLayers()Description copied from interface:Superlayer
Returns the number of layers contained in this sector.- Specified by:
getNumLayers
in 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:Superlayer
Returns the layer associated with the given layer id.- Specified by:
getLayer
in interfaceSuperlayer<LayerType extends Layer>
- Parameters:
layerId
- the layer id- Returns:
- the layer with the specified id
-
getAllLayers
Description copied from interface:Superlayer
Returns an unmodifiable list of all layers contained in this superlayer.- Specified by:
getAllLayers
in interfaceSuperlayer<LayerType extends Layer>
- Returns:
- an unmodifiable list of layers
-
getCrossSections
Description copied from interface:Superlayer
Returns 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
Plane3D
object 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:
getCrossSections
in 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:Superlayer
Returns 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:
getLayerHits
in interfaceSuperlayer<LayerType extends Layer>
- Parameters:
path
- the path- Returns:
- a list of detector hits
-
getHits
Description copied from interface:Superlayer
Returns a list of DetecorHits which store information about intersections with components in this superlayer.- Specified by:
getHits
in interfaceSuperlayer<LayerType extends Layer>
- Parameters:
path
- the path- Returns:
- a list of detector hits
-
setTransformation
Description copied from interface:Superlayer
Sets 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:
setTransformation
in interfaceSuperlayer<LayerType extends Layer>
- Parameters:
transform
- the new transform- See Also:
-
show
-
toString
-