Class AbstractSector<SuperlayerType extends Superlayer>

java.lang.Object
org.jlab.geom.abs.AbstractSector<SuperlayerType>
Type Parameters:
SuperlayerType - the specific type of Superlayer contained by the Sector
All Implemented Interfaces:
Sector<SuperlayerType>, Showable
Direct Known Subclasses:
AlertDCSector, AlertTOFSector, BSTSector, CNDSector, DCSector, ECSector, FMTSector, FTCALSector, FTOFSector, FTOFSectorMesh

public abstract class AbstractSector<SuperlayerType extends Superlayer> extends Object implements Sector<SuperlayerType>
This class provides a skeletal implementation of the Sector interface to minimize the effort required to implement a Sector.

To implement a Sector, the programmer needs only to extend this class and provide implementations for the Sector.getType() method.

Initially the Sector will contain no Superlayers, so Superlayers must be added to the Sector after AbstractSector's constructor has been invoked via the addSuperlayer(org.jlab.geom.base.Superlayer) method.

Author:
jnhankins
  • Constructor Details Link icon

    • AbstractSector Link icon

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

    • getDetectorId Link icon

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

      public final int getSectorId()
      Description copied from interface: Sector
      Returns the id of this sector.
      Specified by:
      getSectorId in interface Sector<SuperlayerType extends Superlayer>
      Returns:
      the id of this sector
    • getNumSuperlayers Link icon

      public final int getNumSuperlayers()
      Description copied from interface: Sector
      Returns the number of superlayers contained in this sector.
      Specified by:
      getNumSuperlayers in interface Sector<SuperlayerType extends Superlayer>
      Returns:
      the number of superlayers
    • addSuperlayer Link icon

      public final void addSuperlayer(SuperlayerType superlayer)
      Adds a superlayer to this sector. If a superlayer with the same id is contained in this sector then the preexisting superlayer is replaced by the given superlayer. Intended for use by detector factories.
      Parameters:
      superlayer - the superlayer to add
    • getSuperlayer Link icon

      public final SuperlayerType getSuperlayer(int superlayerId)
      Description copied from interface: Sector
      Returns the superlayer associated with the given superlayer id.
      Specified by:
      getSuperlayer in interface Sector<SuperlayerType extends Superlayer>
      Parameters:
      superlayerId - the superlayer id
      Returns:
      the superlayer with the specified id
    • getAllSuperlayers Link icon

      public final List<SuperlayerType> getAllSuperlayers()
      Description copied from interface: Sector
      Returns an unmodifiable list of all superlayers contained in this sector.
      Specified by:
      getAllSuperlayers in interface Sector<SuperlayerType extends Superlayer>
      Returns:
      an unmodifiable list of superlayers
    • getCrossSections Link icon

      public final List<List<Line3D>> getCrossSections(Transformation3D transform)
      Description copied from interface: Sector
      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 sector'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 Sector<SuperlayerType extends Superlayer>
      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: Sector
      Returns a list of DetecorHits which store information about intersections with layer surface boundaries in this sector. 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 Sector<SuperlayerType extends Superlayer>
      Parameters:
      path - the path
      Returns:
      a list of detector hits
    • getHits Link icon

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

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

      public String toString()
      Overrides:
      toString in class Object