Class AbstractSector<SuperlayerType extends Superlayer>
- Type Parameters:
SuperlayerType- the specific type ofSuperlayercontained 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 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 Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractSector(DetectorId detectorId, int sectorId) Initializes an empty AbstractSector with the given id. -
Method Summary
Modifier and TypeMethodDescriptionfinal voidaddSuperlayer(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 DetectorIdReturns 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 intReturns the number of superlayers contained in this sector.final intReturns the id of this sector.final SuperlayerTypegetSuperlayer(int superlayerId) Returns the superlayer associated with the given superlayer id.voidshow()InvokesSystem.out.println(this).toString()
-
Constructor Details
-
AbstractSector
Initializes an empty AbstractSector with the given id.- Parameters:
detectorId- the id of this sector's detectorsectorId- the id of this sector
-
-
Method Details
-
getDetectorId
Description copied from interface:SectorReturns the id of the detector that this sector is contained in.- Specified by:
getDetectorIdin interfaceSector<SuperlayerType extends Superlayer>- Returns:
- the id of this sector's detector
-
getSectorId
public final int getSectorId()Description copied from interface:SectorReturns the id of this sector.- Specified by:
getSectorIdin interfaceSector<SuperlayerType extends Superlayer>- Returns:
- the id of this sector
-
getNumSuperlayers
public final int getNumSuperlayers()Description copied from interface:SectorReturns the number of superlayers contained in this sector.- Specified by:
getNumSuperlayersin 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:SectorReturns the superlayer associated with the given superlayer id.- Specified by:
getSuperlayerin interfaceSector<SuperlayerType extends Superlayer>- Parameters:
superlayerId- the superlayer id- Returns:
- the superlayer with the specified id
-
getAllSuperlayers
Description copied from interface:SectorReturns an unmodifiable list of all superlayers contained in this sector.- Specified by:
getAllSuperlayersin interfaceSector<SuperlayerType extends Superlayer>- Returns:
- an unmodifiable list of superlayers
-
getCrossSections
Description copied from interface:SectorReturns 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 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:
getCrossSectionsin 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:SectorReturns 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:
getLayerHitsin interfaceSector<SuperlayerType extends Superlayer>- Parameters:
path- the path- Returns:
- a list of detector hits
-
getHits
Description copied from interface:SectorReturns a list of DetecorHits which store information about intersections with components in this sector.- Specified by:
getHitsin interfaceSector<SuperlayerType extends Superlayer>- Parameters:
path- the path- Returns:
- a list of detector hits
-
show
public void show()Description copied from interface:SectorInvokesSystem.out.println(this).- Specified by:
showin interfaceSector<SuperlayerType extends Superlayer>- Specified by:
showin interfaceShowable
-
toString
-