DD4hep
1.30.0
Detector Description Toolkit for High Energy Physics
|
Base class for all segmentations. More...
#include <Segmentation.h>
Public Member Functions | |
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 Vector3D | position (const CellID &cellID) const =0 |
Determine the local position based on the cell ID. More... | |
virtual CellID | cellID (const Vector3D &localPosition, const Vector3D &globalPosition, const VolumeID &volumeID) const =0 |
Determine the cell ID based on the position. 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... | |
Protected Member Functions | |
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... | |
Static Protected Member Functions | |
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 | |
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... | |
Private Member Functions | |
Segmentation (const Segmentation &) | |
No copy constructor allowed. More... | |
Base class for all segmentations.
Definition at line 75 of file Segmentation.h.
|
virtual |
Destructor.
Definition at line 50 of file Segmentation.cpp.
|
protected |
Default constructor used by derived classes passing the encoding string.
Definition at line 39 of file Segmentation.cpp.
|
protected |
Default constructor used by derived classes passing an existing decoder.
Definition at line 45 of file Segmentation.cpp.
|
private |
No copy constructor allowed.
|
virtual |
Add subsegmentation. Call only valid for Multi-segmentations. Default implementation throws an exception.
Reimplemented in dd4hep::DDSegmentation::MultiSegmentation.
Definition at line 61 of file Segmentation.cpp.
|
staticprotected |
Helper method to convert a bin number to a 1D position.
Definition at line 145 of file Segmentation.cpp.
|
staticprotected |
Helper method to convert a bin number to a 1D position given a vector of binBoundaries.
Definition at line 158 of file Segmentation.cpp.
|
virtual |
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.
cellID | cellID of the cell for which parameters are returned |
Reimplemented in dd4hep::DDSegmentation::PolarGridRPhi, dd4hep::DDSegmentation::TiledLayerGridXY, dd4hep::DDSegmentation::PolarGridRPhi2, dd4hep::DDSegmentation::CartesianGridXYStaggered, dd4hep::DDSegmentation::WaferGridXY, dd4hep::DDSegmentation::MegatileLayerGridXY, dd4hep::DDSegmentation::HexGrid, dd4hep::DDSegmentation::CylindricalGridPhiZ, dd4hep::DDSegmentation::CartesianGridYZ, dd4hep::DDSegmentation::CartesianGridXY, dd4hep::DDSegmentation::CartesianGridXZ, dd4hep::DDSegmentation::MultiSegmentation, dd4hep::DDSegmentation::CartesianGridXYZ, dd4hep::DDSegmentation::CartesianStripX, dd4hep::DDSegmentation::CartesianStripZ, and dd4hep::DDSegmentation::CartesianStripY.
Definition at line 195 of file Segmentation.cpp.
|
pure virtual |
Determine the cell ID based on the position.
Implemented in dd4hep::DDSegmentation::MultiSegmentation, dd4hep::DDSegmentation::PolarGridRPhi2, dd4hep::DDSegmentation::MegatileLayerGridXY, dd4hep::DDSegmentation::TiledLayerSegmentation, dd4hep::DDSegmentation::TiledLayerGridXY, dd4hep::DDSegmentation::WaferGridXY, dd4hep::DDSegmentation::CartesianGridYZ, dd4hep::DDSegmentation::CartesianStripX, dd4hep::DDSegmentation::CartesianStripZ, dd4hep::DDSegmentation::HexGrid, dd4hep::DDSegmentation::PolarGridRPhi, dd4hep::DDSegmentation::CartesianStripY, dd4hep::DDSegmentation::ProjectiveCylinder, dd4hep::DDSegmentation::CartesianGridXY, dd4hep::DDSegmentation::CartesianGridXYStaggered, dd4hep::DDSegmentation::CartesianGridXYZ, dd4hep::DDSegmentation::CartesianGridXZ, dd4hep::DDSegmentation::CylindricalGridPhiZ, dd4hep::DDSegmentation::NoSegmentation, dd4hep::DDSegmentation::GridRPhiEta, and dd4hep::DDSegmentation::GridPhiEta.
|
inlinevirtual |
Access the underlying decoder.
Definition at line 112 of file Segmentation.h.
|
inlinevirtual |
Access the description of the segmentation.
Definition at line 108 of file Segmentation.h.
|
inlinevirtual |
Access the encoding string.
Definition at line 92 of file Segmentation.h.
|
inlinevirtual |
Access the segmentation name.
Definition at line 96 of file Segmentation.h.
|
virtual |
Calculates the neighbours of the given cell ID and adds them to the list of neighbours.
Definition at line 77 of file Segmentation.cpp.
|
virtual |
Access to parameter by name.
Definition at line 110 of file Segmentation.cpp.
|
virtual |
Access to all parameters.
Definition at line 121 of file Segmentation.cpp.
|
pure virtual |
Determine the local position based on the cell ID.
Implemented in dd4hep::DDSegmentation::MultiSegmentation, dd4hep::DDSegmentation::PolarGridRPhi2, dd4hep::DDSegmentation::MegatileLayerGridXY, dd4hep::DDSegmentation::TiledLayerSegmentation, dd4hep::DDSegmentation::TiledLayerGridXY, dd4hep::DDSegmentation::WaferGridXY, dd4hep::DDSegmentation::CartesianGridYZ, dd4hep::DDSegmentation::CartesianStripX, dd4hep::DDSegmentation::CartesianStripZ, dd4hep::DDSegmentation::HexGrid, dd4hep::DDSegmentation::PolarGridRPhi, dd4hep::DDSegmentation::CartesianStripY, dd4hep::DDSegmentation::ProjectiveCylinder, dd4hep::DDSegmentation::CartesianGridXY, dd4hep::DDSegmentation::CartesianGridXYStaggered, dd4hep::DDSegmentation::CartesianGridXYZ, dd4hep::DDSegmentation::CartesianGridXZ, dd4hep::DDSegmentation::CylindricalGridPhiZ, dd4hep::DDSegmentation::NoSegmentation, dd4hep::DDSegmentation::GridRPhiEta, and dd4hep::DDSegmentation::GridPhiEta.
|
staticprotected |
Helper method to convert a 1D position to a cell ID.
Definition at line 150 of file Segmentation.cpp.
|
staticprotected |
Helper method to convert a 1D position to a cell ID given a vector of binBoundaries.
Definition at line 162 of file Segmentation.cpp.
|
protected |
Add a cell identifier to this segmentation. Used by derived classes to define their required identifiers.
Definition at line 135 of file Segmentation.cpp.
|
inlineprotected |
Add a parameter to this segmentation. Used by derived classes to define their parameters.
Definition at line 138 of file Segmentation.h.
|
virtual |
Set the underlying decoder.
Reimplemented in dd4hep::DDSegmentation::MultiSegmentation.
Definition at line 100 of file Segmentation.cpp.
|
inlinevirtual |
Set the segmentation name.
Definition at line 100 of file Segmentation.h.
|
virtual |
Set all parameters from an existing set of parameters.
Definition at line 129 of file Segmentation.cpp.
|
inlinevirtual |
Access the segmentation type.
Definition at line 104 of file Segmentation.h.
Determine the volume ID from the full cell ID by removing all local fields.
Definition at line 66 of file Segmentation.cpp.
|
protected |
|
protected |
The description of the segmentation.
Definition at line 162 of file Segmentation.h.
|
protected |
The indices used for the encoding.
No ROOT persistency
Definition at line 166 of file Segmentation.h.
|
protected |
The segmentation name.
Definition at line 158 of file Segmentation.h.
|
protected |
Keeps track of the decoder ownership.
Definition at line 170 of file Segmentation.h.
|
protected |
The parameters for this segmentation.
Definition at line 164 of file Segmentation.h.
|
protected |
The segmentation type.
Definition at line 160 of file Segmentation.h.