Class AbstractDetector<SectorType extends Sector>
- Type Parameters:
- SectorType- the specific type of- Sectorcontained by the- Detector
- 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 Sectors, so
 Sectors 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 SummaryConstructorsModifierConstructorDescriptionprotectedAbstractDetector(DetectorId detectorId) Initializes an empty AbstractDetector with the given id.
- 
Method SummaryModifier and TypeMethodDescriptionfinal voidaddSector(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 DetectorIdReturns 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 intReturns the number of sectors contained in this detector.final SectorTypegetSector(int sectorId) Returns the sector associated with the given sector id.voidshow()InvokesSystem.out.println(this).toString()
- 
Constructor Details- 
AbstractDetectorInitializes an empty AbstractDetector with the given id.- Parameters:
- detectorId- the id of this detector
 
 
- 
- 
Method Details- 
getDetectorIdDescription copied from interface:DetectorReturns 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:
- getDetectorIdin interface- Detector<SectorType extends Sector>
- Returns:
- the id of this detector
 
- 
getNumSectorspublic final int getNumSectors()Description copied from interface:DetectorReturns the number of sectors contained in this detector.- Specified by:
- getNumSectorsin interface- Detector<SectorType extends Sector>
- Returns:
- the number of sectors
 
- 
addSectorAdds 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
 
- 
getSectorDescription copied from interface:DetectorReturns the sector associated with the given sector id.- Specified by:
- getSectorin interface- Detector<SectorType extends Sector>
- Parameters:
- sectorId- the sector id
- Returns:
- the sector with the specified id
 
- 
getAllSectorsDescription copied from interface:DetectorReturns an unmodifiable list of all of the sectors contained in this detector.- Specified by:
- getAllSectorsin interface- Detector<SectorType extends Sector>
- Returns:
- an unmodifiable list of all sectors
 
- 
getCrossSectionsDescription copied from interface:DetectorReturns 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 Plane3Dobject 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:
- getCrossSectionsin interface- Detector<SectorType extends Sector>
- Parameters:
- transform- the transformation
- Returns:
- a list of list of lines representing the cross section
- See Also:
 
- 
getLayerHitsDescription copied from interface:DetectorReturns 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:
- getLayerHitsin interface- Detector<SectorType extends Sector>
- Parameters:
- path- the path
- Returns:
- a list of detector hits
 
- 
getHitsDescription copied from interface:DetectorReturns a list of DetecorHits which store information about intersections with components in this detector.- Specified by:
- getHitsin interface- Detector<SectorType extends Sector>
- Parameters:
- path- the path
- Returns:
- a list of detector hits
 
- 
showpublic void show()Description copied from interface:DetectorInvokesSystem.out.println(this).
- 
toString
 
-