Interface Layer<ComponentType extends Component>
- Type Parameters:
- ComponentType- the specific type of- Componentcontained by the- Layer
- All Superinterfaces:
- Showable
- All Known Implementing Classes:
- AbstractLayer,- AlertDCLayer,- AlertTOFLayer,- BSTLayer,- CNDLayer,- DCLayer,- ECLayer,- FMTLayer,- FTCALLayer,- FTOFLayer,- FTOFLayerMesh
 The primary purpose of a Layer object is to provide convenient
 methods for accessing to the Component objects it contains.
 
 Factory: Factory
 Hierarchy: 
 
 
 Detector → 
 Sector → 
 Superlayer → 
 Layer → 
 Component
 
 Layer contains a Plane3D called plane on
 its up-beam surface such that in the local coordinate system the reference
 point is at x=0 y=0, the z-coordinate is equal to the the minimum of the
 z-coordinates of the points in the surface boundary, and the normal is
 pointing down-beam.
 
 Layer also contains a Shape3D called 
 boundary that approximately defines the target-side 
 surface using a set of triangular faces.
 
 Layer handles coordinate systems and alignment calibration for
 detectors using the methods getTransformation() and 
 setTransformation(org.jlab.geom.prim.Transformation3D).
 
 To learn how to create a Layer and find much more information see
 Factory.
- Author:
- jnhankins
- 
Method SummaryModifier and TypeMethodDescriptionReturns an unmodifiable list of all components contained in this layer.Returns a Shape3D object that approximately defines the target-side surface of this layer using a set of triangular faces.getComponent(int componentId) Returns the component associated with the given component id.getCrossSections(Transformation3D transformation) Returns a list of lists of lines such that each of the inner lists contains the cross section lines for a single component.Returns the id of the detector that this layer is contained in.Returns a list of DetecorHits which store information about intersections with components in this superlayer.getLayerHits(Path3D path) Returns a list of DetecorHits which store information about intersections with layer surface boundaries in this layer.intReturns the id of this layer.intReturns the number of components contained in in this layer.getPlane()Returns a plane on the up-beam surface of this layer such that in the local coordinate system the reference point is at x = 0 y = 0, the z-coordinate is equal to the the minimum of the z-coordinates of the points in the surface boundary, and the normal is pointing down-beam.intReturns the id of the sector that this layer is contained in.intReturns the id of the superlayer that this layer is contained in.Returns a copy of the transformation that was used to rotate and translate this layer from its initial position in local coordinates to its current position and orientation.getType()Returns a string that identifies the specific subtype of this layer.voidsetTransformation(Transformation3D transform) Sets the transformation for this layer.voidshow()InvokesSystem.out.println(this).
- 
Method Details- 
getDetectorIdDetectorId getDetectorId()Returns the id of the detector that this layer is contained in.- Returns:
- the id of this layer's detector
 
- 
getSectorIdint getSectorId()Returns the id of the sector that this layer is contained in.- Returns:
- the id of this layer's sector
 
- 
getSuperlayerIdint getSuperlayerId()Returns the id of the superlayer that this layer is contained in.- Returns:
- the id of this layer's superlayer
 
- 
getLayerIdint getLayerId()Returns the id of this layer.- Returns:
- the id of this layer.
 
- 
getNumComponentsint getNumComponents()Returns the number of components contained in in this layer.- Returns:
- the number of components
 
- 
getComponentReturns the component associated with the given component id.- Parameters:
- componentId- the component id
- Returns:
- the component with the specified id
 
- 
getAllComponentsList<ComponentType> getAllComponents()Returns an unmodifiable list of all components contained in this layer.- Returns:
- an unmodifiable list of components
 
- 
getBoundaryShape3D getBoundary()Returns a Shape3D object that approximately defines the target-side surface of this layer using a set of triangular faces.- Returns:
- the shape of boundary of the beam-side surface
 
- 
getPlanePlane3D getPlane()Returns a plane on the up-beam surface of this layer such that in the local coordinate system the reference point is at x = 0 y = 0, the z-coordinate is equal to the the minimum of the z-coordinates of the points in the surface boundary, and the normal is pointing down-beam.- Returns:
- the up-beam surface plane
 
- 
getCrossSectionsReturns 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 layer'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- Parameters:
- transformation- the transformation
- Returns:
- a list of list of lines representing the cross section
- See Also:
 
- 
getLayerHitsReturns a list of DetecorHits which store information about intersections with layer surface boundaries in this layer. 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.- Parameters:
- path- the path
- Returns:
- a list of detector hits
 
- 
getHitsReturns a list of DetecorHits which store information about intersections with components in this superlayer.- Parameters:
- path- the path
- Returns:
- a list of detector hits
 
- 
getTransformationTransformation3D getTransformation()Returns a copy of the transformation that was used to rotate and translate this layer from its initial position in local coordinates to its current position and orientation.Note: The following paragraph uses the term "coordinate system" loosely. The layer's current "coordinate system" is ment to mean the true coordinate system (i.e. local, tilted, sector, or CLAS) with, optionally, additional translations and rotations applied to account for misalignments, etc. Applying the returned translation to a point will transform that point from the local coordinate system to this layer's coordinate system. To translate a point from this layer's current coordinate system. Example: Translating a point back to local coordinates 
 Layer layer = ...Example: Applying alignment calibrations
 Transformation3D inverse = layer.getTransformation().inverse();
 Point3D point = layer.getComponent(0).getMidpoint();
 Point3D local = new Point3D(point);
 inverse.apply(local);
 System.out.println("Current Coords:"+point+" Local Coords: "+local);
 Transformation3D nominal = layer.getTransformation(); Transformation3D calibrated = new Transformation3D(nominal); ... // add rotations and translations to calibrate the alighnment layer.setTransformation(calibrated);
 - Returns:
- a copy of the current transformation
 
- 
setTransformationSets the transformation for this layer.Internally, to apply the new transformation, this method will use the inverse of its current transformation to move itself back into local coordinates, it will then move itself to its new coordinates by applying the new the transformation before storing it. For much more information and example codesee getTransformation().- Parameters:
- transform- the new transform
- See Also:
 
- 
getTypeString getType()Returns a string that identifies the specific subtype of this layer.- Returns:
- a string naming this layer's type
 
- 
showvoid show()InvokesSystem.out.println(this).
 
-