Class AbstractSector<SuperlayerType extends Superlayer>
- Type Parameters:
SuperlayerType
- the specific type ofSuperlayer
contained by theSector
- Direct Known Subclasses:
AlertDCSector
,AlertTOFSector
,BSTSector
,CNDSector
,DCSector
,ECSector
,FMTSector
,FTCALSector
,FTOFSector
,FTOFSectorMesh
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 Superlayer
s, so
Superlayer
s 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 Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractSector
(DetectorId detectorId, int sectorId) Initializes an empty AbstractSector with the given id. -
Method Summary
Modifier and TypeMethodDescriptionfinal void
addSuperlayer
(SuperlayerType superlayer) Adds a superlayer to this sector.final List
<SuperlayerType> Returns an unmodifiable list of all superlayers contained in this sector.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.final DetectorId
Returns the id of the detector that this sector is contained in.Returns a list of DetecorHits which store information about intersections with components in this sector.getLayerHits
(Path3D path) Returns a list of DetecorHits which store information about intersections with layer surface boundaries in this sector.final int
Returns the number of superlayers contained in this sector.final int
Returns the id of this sector.final SuperlayerType
getSuperlayer
(int superlayerId) Returns the superlayer associated with the given superlayer id.void
show()
InvokesSystem.out.println(this)
.toString()
-
Constructor Details
-
Method Details
-
getDetectorId
Description copied from interface:Sector
Returns the id of the detector that this sector is contained in.- Specified by:
getDetectorId
in interfaceSector<SuperlayerType extends Superlayer>
- Returns:
- the id of this sector's detector
-
getSectorId
public final int getSectorId()Description copied from interface:Sector
Returns the id of this sector.- Specified by:
getSectorId
in interfaceSector<SuperlayerType extends Superlayer>
- Returns:
- the id of this sector
-
getNumSuperlayers
public final int getNumSuperlayers()Description copied from interface:Sector
Returns the number of superlayers contained in this sector.- Specified by:
getNumSuperlayers
in interfaceSector<SuperlayerType extends Superlayer>
- Returns:
- the number of superlayers
-
addSuperlayer
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
Description copied from interface:Sector
Returns the superlayer associated with the given superlayer id.- Specified by:
getSuperlayer
in interfaceSector<SuperlayerType extends Superlayer>
- Parameters:
superlayerId
- the superlayer id- Returns:
- the superlayer with the specified id
-
getAllSuperlayers
Description copied from interface:Sector
Returns an unmodifiable list of all superlayers contained in this sector.- Specified by:
getAllSuperlayers
in interfaceSector<SuperlayerType extends Superlayer>
- Returns:
- an unmodifiable list of superlayers
-
getCrossSections
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 interfaceSector<SuperlayerType extends Superlayer>
- Parameters:
transform
- the transformation- Returns:
- a list of list of lines representing the cross section
- See Also:
-
getLayerHits
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 interfaceSector<SuperlayerType extends Superlayer>
- Parameters:
path
- the path- Returns:
- a list of detector hits
-
getHits
Description copied from interface:Sector
Returns a list of DetecorHits which store information about intersections with components in this sector.- Specified by:
getHits
in interfaceSector<SuperlayerType extends Superlayer>
- Parameters:
path
- the path- Returns:
- a list of detector hits
-
show
public void show()Description copied from interface:Sector
InvokesSystem.out.println(this)
.- Specified by:
show
in interfaceSector<SuperlayerType extends Superlayer>
- Specified by:
show
in interfaceShowable
-
toString
-