Class AbstractDetector<SectorType extends Sector>
- Type Parameters:
SectorType
- the specific type ofSector
contained by theDetector
- Direct Known Subclasses:
AlertDCDetector
,AlertTOFDetector
,BSTDetector
,BSTRing
,CNDDetector
,DCDetector
,ECDetector
,FMTDetector
,FTCALDetector
,FTOFDetector
,FTOFDetectorMesh
Detector
interface to minimize the effort
required to implement a Detector
.
To implement a Detector
, the programmer needs only to extend this
class and provide implementations for the
Detector.getType()
method.
Initially the Detector
will contain no Sector
s, so
Sector
s must be added to the Detector
after
AbstractDetector
's constructor has been invoked via the
addSector(org.jlab.geom.base.Sector)
method.
- Author:
- jnhankins
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractDetector
(DetectorId detectorId) Initializes an empty AbstractDetector with the given id. -
Method Summary
Modifier and TypeMethodDescriptionfinal void
addSector
(SectorType sector) Adds a sector to this detector.final List
<SectorType> Returns an unmodifiable list of all of the sectors contained in this detector.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 this detector.Returns a list of DetecorHits which store information about intersections with components in this detector.getLayerHits
(Path3D path) Returns a list of DetecorHits which store information about intersections with layer surface boundaries in this detector.final int
Returns the number of sectors contained in this detector.final SectorType
getSector
(int sectorId) Returns the sector associated with the given sector id.void
show()
InvokesSystem.out.println(this)
.toString()
-
Constructor Details
-
Method Details
-
getDetectorId
Description copied from interface:Detector
Returns the id of this detector. This id is a DetectorID which is an enumeration type that uniquely identifies this detector. To find an integer id associated with this detector, call getDetectorId.getIdNumber().- Specified by:
getDetectorId
in interfaceDetector<SectorType extends Sector>
- Returns:
- the id of this detector
-
getNumSectors
public final int getNumSectors()Description copied from interface:Detector
Returns the number of sectors contained in this detector.- Specified by:
getNumSectors
in interfaceDetector<SectorType extends Sector>
- Returns:
- the number of sectors
-
addSector
Adds a sector to this detector. If a sector with the same id is contained in this detector then the preexisting sector is replaced by the given sector. Intended for use by detector factories.- Parameters:
sector
- the sector to add
-
getSector
Description copied from interface:Detector
Returns the sector associated with the given sector id.- Specified by:
getSector
in interfaceDetector<SectorType extends Sector>
- Parameters:
sectorId
- the sector id- Returns:
- the sector with the specified id
-
getAllSectors
Description copied from interface:Detector
Returns an unmodifiable list of all of the sectors contained in this detector.- Specified by:
getAllSectors
in interfaceDetector<SectorType extends Sector>
- Returns:
- an unmodifiable list of all sectors
-
getCrossSections
Description copied from interface:Detector
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 new
Plane3D
object in the xy-plane and applies the transformation to the plane. The intersection of the detector'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 interfaceDetector<SectorType extends Sector>
- Parameters:
transform
- the transformation- Returns:
- a list of list of lines representing the cross section
- See Also:
-
getLayerHits
Description copied from interface:Detector
Returns a list of DetecorHits which store information about intersections with layer surface boundaries in this detector. 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 interfaceDetector<SectorType extends Sector>
- Parameters:
path
- the path- Returns:
- a list of detector hits
-
getHits
Description copied from interface:Detector
Returns a list of DetecorHits which store information about intersections with components in this detector.- Specified by:
getHits
in interfaceDetector<SectorType extends Sector>
- Parameters:
path
- the path- Returns:
- a list of detector hits
-
show
-
toString
-