DD4hep
1.30.0
Detector Description Toolkit for High Energy Physics
|
A segmentation class to describe tiled layers. More...
#include <TiledLayerSegmentation.h>
Classes | |
struct | LayerDimensions |
Helper class to store x and y dimensions of a layer. More... | |
Public Member Functions | |
TiledLayerSegmentation (const std::string &cellEncoding="") | |
Default constructor passing the encoding string. More... | |
TiledLayerSegmentation (const BitFieldCoder *decoder) | |
Default constructor used by derived classes passing an existing decoder. More... | |
virtual | ~TiledLayerSegmentation () |
destructor More... | |
virtual Vector3D | position (const CellID &cellID) const |
determine the position based on the cell ID More... | |
virtual CellID | cellID (const Vector3D &localPosition, const Vector3D &globalPosition, const VolumeID &volumeID) const |
determine the cell ID based on the position More... | |
double | gridSizeX () const |
access the default grid size in X More... | |
double | gridSizeY () const |
access the default grid size in Y More... | |
double | layerGridSizeX (int layerIndex) const |
access the actual grid size in X for a given layer More... | |
double | layerGridSizeY (int layerIndex) const |
access the actual grid size in Y for a given layer More... | |
const std::string & | identifierX () const |
access the encoding field name used for X More... | |
const std::string & | identifierY () const |
access the encoding field name used for Y More... | |
const std::string & | identifierLayer () const |
access the encoding field name used for Y More... | |
LayerDimensions | layerDimensions (int layerIndex) const |
access to the dimensions of the given layer More... | |
void | setGridSizeX (double cellSize) |
set the default grid size in X More... | |
void | setGridSizeY (double cellSize) |
set the default grid size in Y More... | |
void | setIdentifierX (const std::string &fieldName) |
set the encoding field name used for X More... | |
void | setIdentifierY (const std::string &fieldName) |
set the encoding field name used for Y More... | |
void | setIdentifierLayer (const std::string &fieldName) |
set the encoding field name used for layer More... | |
void | setLayerDimensions (int layerIndex, double x, double y) |
set the dimensions of the given layer More... | |
Public Member Functions inherited from dd4hep::DDSegmentation::Segmentation | |
virtual | ~Segmentation () |
Destructor. More... | |
virtual void | addSubsegmentation (long key_min, long key_max, Segmentation *entry) |
Add subsegmentation. Call only valid for Multi-segmentations. Default implementation throws an exception. More... | |
virtual VolumeID | volumeID (const CellID &cellID) const |
Determine the volume ID from the full cell ID by removing all local fields. More... | |
virtual void | neighbours (const CellID &cellID, std::set< CellID > &neighbours) const |
Calculates the neighbours of the given cell ID and adds them to the list of neighbours. More... | |
virtual std::string | fieldDescription () const |
Access the encoding string. More... | |
virtual const std::string & | name () const |
Access the segmentation name. More... | |
virtual void | setName (const std::string &value) |
Set the segmentation name. More... | |
virtual const std::string & | type () const |
Access the segmentation type. More... | |
virtual const std::string & | description () const |
Access the description of the segmentation. More... | |
virtual const BitFieldCoder * | decoder () const |
Access the underlying decoder. More... | |
virtual void | setDecoder (const BitFieldCoder *decoder) |
Set the underlying decoder. More... | |
virtual Parameter | parameter (const std::string ¶meterName) const |
Access to parameter by name. More... | |
virtual Parameters | parameters () const |
Access to all parameters. More... | |
virtual void | setParameters (const Parameters ¶meters) |
Set all parameters from an existing set of parameters. More... | |
virtual std::vector< double > | cellDimensions (const CellID &cellID) const |
Returns a vector<double> of the cellDimensions of the given cell ID in natural order of dimensions, e.g., dx/dy/dz, or dr/r*dPhi. More... | |
Static Protected Member Functions | |
static double | calculateOptimalCellSize (double nominalCellSize, double totalSize) |
list of layer y dimensions More... | |
static double | calculateOffset (double cellSize, double totalSize) |
helper method to calculate offset of bin 0 based on the total size More... | |
Static Protected Member Functions inherited from dd4hep::DDSegmentation::Segmentation | |
static double | binToPosition (FieldID bin, double cellSize, double offset=0.) |
Helper method to convert a bin number to a 1D position. More... | |
static int | positionToBin (double position, double cellSize, double offset=0.) |
Helper method to convert a 1D position to a cell ID. More... | |
static double | binToPosition (FieldID bin, std::vector< double > const &cellBoundaries, double offset=0.) |
Helper method to convert a bin number to a 1D position given a vector of binBoundaries. More... | |
static int | positionToBin (double position, std::vector< double > const &cellBoundaries, double offset=0.) |
Helper method to convert a 1D position to a cell ID given a vector of binBoundaries. More... | |
Protected Attributes | |
double | _gridSizeX |
double | _gridSizeY |
default grid size in X More... | |
std::string | _identifierX |
default grid size in Y More... | |
std::string | _identifierY |
encoding field used for X More... | |
std::string | _identifierLayer |
encoding field used for Y More... | |
std::vector< int > | _layerIndices |
encoding field used for the layer More... | |
std::vector< double > | _layerDimensionsX |
list of valid layer identifiers More... | |
std::vector< double > | _layerDimensionsY |
list of layer x dimensions More... | |
Protected Attributes inherited from dd4hep::DDSegmentation::Segmentation | |
std::string | _name |
The segmentation name. More... | |
std::string | _type |
The segmentation type. More... | |
std::string | _description |
The description of the segmentation. More... | |
std::map< std::string, Parameter > | _parameters |
The parameters for this segmentation. More... | |
std::map< std::string, StringParameter > | _indexIdentifiers |
The indices used for the encoding. More... | |
const BitFieldCoder * | _decoder = 0 |
The cell ID encoder and decoder. More... | |
bool | _ownsDecoder = false |
Keeps track of the decoder ownership. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from dd4hep::DDSegmentation::Segmentation | |
Segmentation (const std::string &cellEncoding="") | |
Default constructor used by derived classes passing the encoding string. More... | |
Segmentation (const BitFieldCoder *decoder) | |
Default constructor used by derived classes passing an existing decoder. More... | |
template<typename TYPE > | |
void | registerParameter (const std::string &nam, const std::string &desc, TYPE ¶m, const TYPE &defaultVal, UnitType unitTyp=SegmentationParameter::NoUnit, bool isOpt=false) |
Add a parameter to this segmentation. Used by derived classes to define their parameters. More... | |
void | registerIdentifier (const std::string &nam, const std::string &desc, std::string &ident, const std::string &defaultVal) |
Add a cell identifier to this segmentation. Used by derived classes to define their required identifiers. More... | |
A segmentation class to describe tiled layers.
Definition at line 32 of file TiledLayerSegmentation.h.
dd4hep::DDSegmentation::TiledLayerSegmentation::TiledLayerSegmentation | ( | const std::string & | cellEncoding = "" | ) |
Default constructor passing the encoding string.
Definition at line 33 of file TiledLayerSegmentation.cpp.
dd4hep::DDSegmentation::TiledLayerSegmentation::TiledLayerSegmentation | ( | const BitFieldCoder * | decoder | ) |
Default constructor used by derived classes passing an existing decoder.
Definition at line 55 of file TiledLayerSegmentation.cpp.
|
virtual |
destructor
Definition at line 75 of file TiledLayerSegmentation.cpp.
|
staticprotected |
helper method to calculate offset of bin 0 based on the total size
Definition at line 161 of file TiledLayerSegmentation.cpp.
|
staticprotected |
list of layer y dimensions
helper method to calculate optimal cell size based on total size
Definition at line 155 of file TiledLayerSegmentation.cpp.
|
virtual |
determine the cell ID based on the position
Implements dd4hep::DDSegmentation::Segmentation.
Definition at line 140 of file TiledLayerSegmentation.cpp.
|
inline |
access the default grid size in X
Definition at line 55 of file TiledLayerSegmentation.h.
|
inline |
access the default grid size in Y
Definition at line 59 of file TiledLayerSegmentation.h.
|
inline |
access the encoding field name used for Y
Definition at line 77 of file TiledLayerSegmentation.h.
|
inline |
access the encoding field name used for X
Definition at line 69 of file TiledLayerSegmentation.h.
|
inline |
access the encoding field name used for Y
Definition at line 73 of file TiledLayerSegmentation.h.
TiledLayerSegmentation::LayerDimensions dd4hep::DDSegmentation::TiledLayerSegmentation::layerDimensions | ( | int | layerIndex | ) | const |
access to the dimensions of the given layer
Definition at line 110 of file TiledLayerSegmentation.cpp.
double dd4hep::DDSegmentation::TiledLayerSegmentation::layerGridSizeX | ( | int | layerIndex | ) | const |
access the actual grid size in X for a given layer
Definition at line 79 of file TiledLayerSegmentation.cpp.
double dd4hep::DDSegmentation::TiledLayerSegmentation::layerGridSizeY | ( | int | layerIndex | ) | const |
access the actual grid size in Y for a given layer
Definition at line 85 of file TiledLayerSegmentation.cpp.
|
virtual |
determine the position based on the cell ID
Implements dd4hep::DDSegmentation::Segmentation.
Definition at line 128 of file TiledLayerSegmentation.cpp.
|
inline |
set the default grid size in X
Definition at line 85 of file TiledLayerSegmentation.h.
|
inline |
set the default grid size in Y
Definition at line 89 of file TiledLayerSegmentation.h.
|
inline |
set the encoding field name used for layer
Definition at line 102 of file TiledLayerSegmentation.h.
|
inline |
set the encoding field name used for X
Definition at line 94 of file TiledLayerSegmentation.h.
|
inline |
set the encoding field name used for Y
Definition at line 98 of file TiledLayerSegmentation.h.
void dd4hep::DDSegmentation::TiledLayerSegmentation::setLayerDimensions | ( | int | layerIndex, |
double | x, | ||
double | y | ||
) |
set the dimensions of the given layer
Definition at line 91 of file TiledLayerSegmentation.cpp.
|
protected |
Definition at line 112 of file TiledLayerSegmentation.h.
|
protected |
default grid size in X
Definition at line 113 of file TiledLayerSegmentation.h.
|
protected |
encoding field used for Y
Definition at line 116 of file TiledLayerSegmentation.h.
|
protected |
default grid size in Y
Definition at line 114 of file TiledLayerSegmentation.h.
|
protected |
encoding field used for X
Definition at line 115 of file TiledLayerSegmentation.h.
|
protected |
list of valid layer identifiers
Definition at line 118 of file TiledLayerSegmentation.h.
|
protected |
list of layer x dimensions
Definition at line 119 of file TiledLayerSegmentation.h.
|
protected |
encoding field used for the layer
Definition at line 117 of file TiledLayerSegmentation.h.