public abstract class RegionSegmenter extends AbstractSegmenter
Segmenter
s that describe virtual segmentation
of a certain part of the detector.
Within that part, each Sensor is identified by a unique integer postfix. Each RegionSegmenter can be assigned an integer prefix. After that, SensorID values returned by getSensorID(SimTrackerHit) method and assigned to Sensor objects created by this segmenter will be composed of bits containing the prefix and bits containing the postfix.
Objects of this class are intended to be used either as top level segmenters
describing segmentation of the whole detector and provided directly to
SegmentationManager
in its constructor, or as bottom level segmenters
in a tree of AbstractSegmenters. In the latter case, they should be added as
daughters to ForwardingSegmenters, and their prefixes will be set automatically.
See AbstractSegmenter
for details on how to chain Segmenters.
Subclasses should implement makePostfix(SimTrackerHit)
, makeSensor(int)
,
getMaxPostfix()
, and isPostfixValid(int)
methods. In addition,
detectorChanged(Detector)
method can be overridden if any detector
dependent initialization is required.
_postfixLength, _postfixMask, _prefix, _prefixTemplate
Modifier | Constructor and Description |
---|---|
protected |
RegionSegmenter()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
detectorChanged(Detector detector)
Called by the framework whenever detector geometry changes.
|
protected abstract int |
getMaxPostfix()
Subclasses should implement this method to return maximum postfix value that can be
returned by
makePostfix(SimTrackerHit) method of this Segmenter object. |
int |
getNativePostfixLength()
Returns minimum number of bits required to hold any postfix that can be returned by
makePostfix(SimTrackerHit) method of this Segmenter. |
Sensor |
getSensor(int sensorID)
Creates a new
Sensor object given full SensorID. |
Sensor |
getSensor(SimTrackerHit hit)
Creates a new
Sensor object given simulated hit. |
int |
getSensorID(SimTrackerHit hit)
Returns integer SensorID uniquely identifying a
Sensor object
within the whole detector, given the simulated hit. |
List<Integer> |
getSensorIDs()
Returns a collection of Sensors corresponding to all virtual segments
in the part of the detector handled by this Segmenter.
|
List<Integer> |
getStereoPartners(int sensorID)
Returns a list of Sensors that might contain hits that should be combined
with hits in the Sensor whose sensorID is supplied as an argument
to form stereo pairs.
|
protected boolean |
isPostfixValid(int postfix)
Subclasses should override this method to return true if the given
postfix corresponds to a valid Sensor object that can be created
by this RegionSegmenter.
|
protected abstract int |
makePostfix(SimTrackerHit hit)
Subclasses should implement this method to return postfix corresponding
to the position of the given simulated hit.
|
protected abstract Sensor |
makeSensor(int postfix)
Subclasses should implement this method to create a new
Sensor object given
the postfix. |
void |
setPrefix(int prefix,
int postfixLength)
Set pretfix value and postfix length for this Segmenter.
|
getIdSize, getLeaves, getPrefix, idToPostfix, postfixToID, setPrefix
protected abstract int makePostfix(SimTrackerHit hit)
protected abstract Sensor makeSensor(int postfix)
Sensor
object given
the postfix. If the postfix is invalid, null should be returned.protected abstract int getMaxPostfix()
makePostfix(SimTrackerHit)
method of this Segmenter object.protected boolean isPostfixValid(int postfix)
getMaxPostfix()
.public List<Integer> getSensorIDs()
public int getSensorID(SimTrackerHit hit)
Sensor
object
within the whole detector, given the simulated hit.public Sensor getSensor(int sensorID)
Sensor
object given full SensorID.
For the sake of speed, no checking is done to verify that the supplied
SensorID belongs to the part of the detector that should be handled
by this OldSegmenter - be careful.public Sensor getSensor(SimTrackerHit hit)
Sensor
object given simulated hit.public void detectorChanged(Detector detector)
public List<Integer> getStereoPartners(int sensorID)
public void setPrefix(int prefix, int postfixLength)
setPrefix
in class AbstractSegmenter
public int getNativePostfixLength()
makePostfix(SimTrackerHit)
method of this Segmenter.getNativePostfixLength
in class AbstractSegmenter
Copyright © 2016 Linear Collider Detector (LCD). All rights reserved.