public abstract class AbstractCartesianGrid extends SegmentationBase
Modifier and Type | Field and Description |
---|---|
(package private) List<Integer> |
geomFields |
(package private) double[] |
globalPosition |
(package private) double |
gridSizeX |
(package private) double |
gridSizeY |
(package private) double |
gridSizeZ |
(package private) double[] |
localPosition |
(package private) boolean |
needsCompute |
(package private) List[] |
sensitiveSlices |
protected int |
sliceIndex |
cellSizes
decoder, descriptor, detector, layerIndex, valid, values
INVALID_INDEX
Modifier | Constructor and Description |
---|---|
protected |
AbstractCartesianGrid(org.jdom.Element segmentation)
This constructor accepts an XML element corresponding to the segmentation
but does nothing with it.
|
Modifier and Type | Method and Description |
---|---|
abstract boolean |
boundsCheck(long rawId)
Check if the id is valid, e.g.
|
double |
computeCoordinate(int binValue,
double gridSize)
Compute the coordinate given a bin value.
|
protected void |
computeGlobalPosition()
Generic computation of hit's global position.
|
protected abstract void |
computeLocalPosition()
Using the current ID, compute the local position in the readout volume
and set the internal
localPosition array. |
protected void |
computePosition()
Compute and cache the cell's global position.
|
long |
findCellContainingXYZ(double x,
double y,
double z)
Find the readout cell given a global position.
|
int |
getBin(double u,
double gridSize)
Compute the integer bin value given a coordinate and a grid size.
|
double |
getGridSizeX() |
double |
getGridSizeY() |
double |
getGridSizeZ() |
protected long[] |
getNeighbourIDs(int layerRange,
int uRange,
int vRange,
int uIndex,
int vIndex)
Utility method for finding neighbors in a 2D readout grid with layers.
|
double[] |
getPosition()
Get the position from the current cell ID.
|
double |
getX()
Get the X coordinate.
|
double |
getY()
Get the Y coordinate.
|
double |
getZ()
Get the Z coordinate.
|
protected void |
initSensitiveSlices() |
protected IIdentifier |
makeGeometryIdentifier(long id)
Create an id with geometry fields only given an id including geometry and
segmentation fields.
|
void |
setID(long id)
This method is overridden in order to flag the decoder as dirty so that
internal position data can be recomputed the next time a position is
retrieved by the user.
|
void |
setIDDescription(IDDescriptor id)
We override this method to cache the geometry field information.
|
protected abstract void |
setSegmentationValues(IExpandedIdentifier geomId,
Hep3Vector localPositionVec)
Set the segmentation field values on the given
IExpandedIdentifier given a local hit position. |
protected abstract void |
setupGeomFields(IDDescriptor id)
Make a list of fields that are geometric by stripping out this
segmentation's fields from the given
IDDescriptor . |
boolean |
supportsNeighbours()
All implementations must support neighbor finding.
|
findCellContainingXYZ, findCellContainingXYZ, getDistanceToSensitive, getID, getLayering, getNumberOfLayers, getRMax, getRMin, getSegmentationFieldNames, getZMax, getZMin, transformLocalToGlobal
getCellSizeU, getCellSizeV, useForHitPosition
getBarrelEndcapFlag, getDecoder, getFieldCount, getFieldIndex, getFieldName, getIDDescription, getLayer, getNeighbourIDs, getNeighbourIDs, getPhi, getPositionVector, getSubdetector, getSystemID, getSystemNumber, getTheta, getValue, getValue, getValues, getVLayer, isValid, setSubdetector, toString
double[] localPosition
double[] globalPosition
boolean needsCompute
double gridSizeX
double gridSizeY
double gridSizeZ
List[] sensitiveSlices
protected int sliceIndex
protected AbstractCartesianGrid(org.jdom.Element segmentation)
segmentation
- The XML element for the segmentation.protected abstract void computeLocalPosition()
localPosition
array.protected abstract void setupGeomFields(IDDescriptor id)
IDDescriptor
.id
- The description of the Id.public abstract boolean boundsCheck(long rawId)
rawId
- protected abstract void setSegmentationValues(IExpandedIdentifier geomId, Hep3Vector localPositionVec)
IExpandedIdentifier
given a local hit position.geomId
- The expanded id.localPositionVec
- The local position of the hit.public final int getBin(double u, double gridSize)
u
- The coordinate value.gridSize
- The grid size.public final double computeCoordinate(int binValue, double gridSize)
binValue
- The bin value.gridSize
- The grid size.protected void computeGlobalPosition()
globalPosition
array.public long findCellContainingXYZ(double x, double y, double z)
findCellContainingXYZ
in class SegmentationBase
x
- Cartesian X coordinate.y
- Cartesian Y coordinate.z
- Cartesian Z coordinate.public final double[] getPosition()
getPosition
in interface IDDecoder
getPosition
in class BaseIDDecoder
protected void computePosition()
protected final IIdentifier makeGeometryIdentifier(long id)
id
- The cell id.public final void setID(long id)
setID
in interface IDDecoder
setID
in class BaseIDDecoder
public void setIDDescription(IDDescriptor id)
setIDDescription
in interface IDDecoder
setIDDescription
in class BaseIDDecoder
id
- The ID description.public final boolean supportsNeighbours()
supportsNeighbours
in interface IDDecoder
supportsNeighbours
in class SegmentationBase
public final double getX()
getX
in interface IDDecoder
getX
in class BaseIDDecoder
public final double getY()
getY
in interface IDDecoder
getY
in class BaseIDDecoder
public final double getZ()
getZ
in interface IDDecoder
getZ
in class BaseIDDecoder
protected final long[] getNeighbourIDs(int layerRange, int uRange, int vRange, int uIndex, int vIndex)
layerRange
- The layer range.uRange
- The u range.vRange
- The v range.uIndex
- The u field index.vIndex
- The v field index.public double getGridSizeX()
public double getGridSizeY()
public double getGridSizeZ()
protected void initSensitiveSlices()
Copyright © 2016 Linear Collider Detector (LCD). All rights reserved.