Class AbstractSuperlayer<LayerType extends Layer>

java.lang.Object
org.jlab.geom.abs.AbstractSuperlayer<LayerType>
Type Parameters:
LayerType - the specific type of Layer contained by the Superlayer
All Implemented Interfaces:
Superlayer<LayerType>, Showable
Direct Known Subclasses:
AlertDCSuperlayer, AlertTOFSuperlayer, BSTSuperlayer, CNDSuperlayer, DCSuperlayer, ECSuperlayer, FMTSuperlayer, FTCALSuperlayer, FTOFSuperlayer, FTOFSuperlayerMesh

public abstract class AbstractSuperlayer<LayerType extends Layer> extends Object implements Superlayer<LayerType>
This class provides a skeletal implementation of the 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 Details Link icon

    • AbstractSuperlayer Link icon

      protected AbstractSuperlayer(DetectorId detectorId, int sectorId, int superlayerId)
      Initializes an empty AbstractSuperlayer with the given id.
      Parameters:
      detectorId - the id of this superlayer's detector
      sectorId - the id of this superlayer's sector
      superlayerId - the id of this superlayer
  • Method Details Link icon

    • getDetectorId Link icon

      public DetectorId getDetectorId()
      Description copied from interface: Superlayer
      Returns the id of the detector that this superlayer is contained in.
      Specified by:
      getDetectorId in interface Superlayer<LayerType extends Layer>
      Returns:
      the id of this superlayer's detector
    • getSectorId Link icon

      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 interface Superlayer<LayerType extends Layer>
      Returns:
      the id of this superlayer's sector
    • getSuperlayerId Link icon

      public final int getSuperlayerId()
      Description copied from interface: Superlayer
      Returns the id of this superlayer.
      Specified by:
      getSuperlayerId in interface Superlayer<LayerType extends Layer>
      Returns:
      the id of this superlayer
    • getNumLayers Link icon

      public final int getNumLayers()
      Description copied from interface: Superlayer
      Returns the number of layers contained in this sector.
      Specified by:
      getNumLayers in interface Superlayer<LayerType extends Layer>
      Returns:
      the number of layers
    • addLayer Link icon

      public final void addLayer(LayerType layer)
      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 Link icon

      public final LayerType getLayer(int layerId)
      Description copied from interface: Superlayer
      Returns the layer associated with the given layer id.
      Specified by:
      getLayer in interface Superlayer<LayerType extends Layer>
      Parameters:
      layerId - the layer id
      Returns:
      the layer with the specified id
    • getAllLayers Link icon

      public final List<LayerType> getAllLayers()
      Description copied from interface: Superlayer
      Returns an unmodifiable list of all layers contained in this superlayer.
      Specified by:
      getAllLayers in interface Superlayer<LayerType extends Layer>
      Returns:
      an unmodifiable list of layers
    • getCrossSections Link icon

      public final List<List<Line3D>> getCrossSections(Transformation3D transform)
      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 interface Superlayer<LayerType extends Layer>
      Parameters:
      transform - the transformation
      Returns:
      a list of list of lines representing the cross section
      See Also:
    • getLayerHits Link icon

      public List<DetectorHit> getLayerHits(Path3D path)
      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 interface Superlayer<LayerType extends Layer>
      Parameters:
      path - the path
      Returns:
      a list of detector hits
    • getHits Link icon

      public List<DetectorHit> getHits(Path3D path)
      Description copied from interface: Superlayer
      Returns a list of DetecorHits which store information about intersections with components in this superlayer.
      Specified by:
      getHits in interface Superlayer<LayerType extends Layer>
      Parameters:
      path - the path
      Returns:
      a list of detector hits
    • setTransformation Link icon

      public final void setTransformation(Transformation3D transform)
      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 interface Superlayer<LayerType extends Layer>
      Parameters:
      transform - the new transform
      See Also:
    • show Link icon

      public void show()
      Description copied from interface: Superlayer
      Invokes System.out.println(this).
      Specified by:
      show in interface Showable
      Specified by:
      show in interface Superlayer<LayerType extends Layer>
    • toString Link icon

      public String toString()
      Overrides:
      toString in class Object