DD4hep  1.28.0
Detector Description Toolkit for High Energy Physics
Classes | Public Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
dd4hep::DDSegmentation::TiledLayerSegmentation Class Reference

A segmentation class to describe tiled layers. More...

#include <TiledLayerSegmentation.h>

Inheritance diagram for dd4hep::DDSegmentation::TiledLayerSegmentation:
dd4hep::DDSegmentation::Segmentation

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 BitFieldCoderdecoder () const
 Access the underlying decoder. More...
 
virtual void setDecoder (const BitFieldCoder *decoder)
 Set the underlying decoder. More...
 
virtual Parameter parameter (const std::string &parameterName) const
 Access to parameter by name. More...
 
virtual Parameters parameters () const
 Access to all parameters. More...
 
virtual void setParameters (const Parameters &parameters)
 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 &param, 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...
 

Detailed Description

A segmentation class to describe tiled layers.

Definition at line 32 of file TiledLayerSegmentation.h.

Constructor & Destructor Documentation

◆ TiledLayerSegmentation() [1/2]

dd4hep::DDSegmentation::TiledLayerSegmentation::TiledLayerSegmentation ( const std::string &  cellEncoding = "")

Default constructor passing the encoding string.

Definition at line 23 of file TiledLayerSegmentation.cpp.

◆ TiledLayerSegmentation() [2/2]

dd4hep::DDSegmentation::TiledLayerSegmentation::TiledLayerSegmentation ( const BitFieldCoder decoder)

Default constructor used by derived classes passing an existing decoder.

Definition at line 45 of file TiledLayerSegmentation.cpp.

◆ ~TiledLayerSegmentation()

dd4hep::DDSegmentation::TiledLayerSegmentation::~TiledLayerSegmentation ( )
virtual

destructor

Definition at line 65 of file TiledLayerSegmentation.cpp.

Member Function Documentation

◆ calculateOffset()

double dd4hep::DDSegmentation::TiledLayerSegmentation::calculateOffset ( double  cellSize,
double  totalSize 
)
staticprotected

helper method to calculate offset of bin 0 based on the total size

Definition at line 151 of file TiledLayerSegmentation.cpp.

◆ calculateOptimalCellSize()

double dd4hep::DDSegmentation::TiledLayerSegmentation::calculateOptimalCellSize ( double  nominalCellSize,
double  totalSize 
)
staticprotected

list of layer y dimensions

helper method to calculate optimal cell size based on total size

Definition at line 145 of file TiledLayerSegmentation.cpp.

◆ cellID()

CellID dd4hep::DDSegmentation::TiledLayerSegmentation::cellID ( const Vector3D localPosition,
const Vector3D globalPosition,
const VolumeID volumeID 
) const
virtual

determine the cell ID based on the position

Implements dd4hep::DDSegmentation::Segmentation.

Definition at line 130 of file TiledLayerSegmentation.cpp.

◆ gridSizeX()

double dd4hep::DDSegmentation::TiledLayerSegmentation::gridSizeX ( ) const
inline

access the default grid size in X

Definition at line 55 of file TiledLayerSegmentation.h.

◆ gridSizeY()

double dd4hep::DDSegmentation::TiledLayerSegmentation::gridSizeY ( ) const
inline

access the default grid size in Y

Definition at line 59 of file TiledLayerSegmentation.h.

◆ identifierLayer()

const std::string& dd4hep::DDSegmentation::TiledLayerSegmentation::identifierLayer ( ) const
inline

access the encoding field name used for Y

Definition at line 77 of file TiledLayerSegmentation.h.

◆ identifierX()

const std::string& dd4hep::DDSegmentation::TiledLayerSegmentation::identifierX ( ) const
inline

access the encoding field name used for X

Definition at line 69 of file TiledLayerSegmentation.h.

◆ identifierY()

const std::string& dd4hep::DDSegmentation::TiledLayerSegmentation::identifierY ( ) const
inline

access the encoding field name used for Y

Definition at line 73 of file TiledLayerSegmentation.h.

◆ layerDimensions()

TiledLayerSegmentation::LayerDimensions dd4hep::DDSegmentation::TiledLayerSegmentation::layerDimensions ( int  layerIndex) const

access to the dimensions of the given layer

Definition at line 100 of file TiledLayerSegmentation.cpp.

◆ layerGridSizeX()

double dd4hep::DDSegmentation::TiledLayerSegmentation::layerGridSizeX ( int  layerIndex) const

access the actual grid size in X for a given layer

Definition at line 69 of file TiledLayerSegmentation.cpp.

◆ layerGridSizeY()

double dd4hep::DDSegmentation::TiledLayerSegmentation::layerGridSizeY ( int  layerIndex) const

access the actual grid size in Y for a given layer

Definition at line 75 of file TiledLayerSegmentation.cpp.

◆ position()

Vector3D dd4hep::DDSegmentation::TiledLayerSegmentation::position ( const CellID cellID) const
virtual

determine the position based on the cell ID

Implements dd4hep::DDSegmentation::Segmentation.

Definition at line 118 of file TiledLayerSegmentation.cpp.

◆ setGridSizeX()

void dd4hep::DDSegmentation::TiledLayerSegmentation::setGridSizeX ( double  cellSize)
inline

set the default grid size in X

Definition at line 85 of file TiledLayerSegmentation.h.

◆ setGridSizeY()

void dd4hep::DDSegmentation::TiledLayerSegmentation::setGridSizeY ( double  cellSize)
inline

set the default grid size in Y

Definition at line 89 of file TiledLayerSegmentation.h.

◆ setIdentifierLayer()

void dd4hep::DDSegmentation::TiledLayerSegmentation::setIdentifierLayer ( const std::string &  fieldName)
inline

set the encoding field name used for layer

Definition at line 102 of file TiledLayerSegmentation.h.

◆ setIdentifierX()

void dd4hep::DDSegmentation::TiledLayerSegmentation::setIdentifierX ( const std::string &  fieldName)
inline

set the encoding field name used for X

Definition at line 94 of file TiledLayerSegmentation.h.

◆ setIdentifierY()

void dd4hep::DDSegmentation::TiledLayerSegmentation::setIdentifierY ( const std::string &  fieldName)
inline

set the encoding field name used for Y

Definition at line 98 of file TiledLayerSegmentation.h.

◆ setLayerDimensions()

void dd4hep::DDSegmentation::TiledLayerSegmentation::setLayerDimensions ( int  layerIndex,
double  x,
double  y 
)

set the dimensions of the given layer

Definition at line 81 of file TiledLayerSegmentation.cpp.

Member Data Documentation

◆ _gridSizeX

double dd4hep::DDSegmentation::TiledLayerSegmentation::_gridSizeX
protected

Definition at line 112 of file TiledLayerSegmentation.h.

◆ _gridSizeY

double dd4hep::DDSegmentation::TiledLayerSegmentation::_gridSizeY
protected

default grid size in X

Definition at line 113 of file TiledLayerSegmentation.h.

◆ _identifierLayer

std::string dd4hep::DDSegmentation::TiledLayerSegmentation::_identifierLayer
protected

encoding field used for Y

Definition at line 116 of file TiledLayerSegmentation.h.

◆ _identifierX

std::string dd4hep::DDSegmentation::TiledLayerSegmentation::_identifierX
protected

default grid size in Y

Definition at line 114 of file TiledLayerSegmentation.h.

◆ _identifierY

std::string dd4hep::DDSegmentation::TiledLayerSegmentation::_identifierY
protected

encoding field used for X

Definition at line 115 of file TiledLayerSegmentation.h.

◆ _layerDimensionsX

std::vector<double> dd4hep::DDSegmentation::TiledLayerSegmentation::_layerDimensionsX
protected

list of valid layer identifiers

Definition at line 118 of file TiledLayerSegmentation.h.

◆ _layerDimensionsY

std::vector<double> dd4hep::DDSegmentation::TiledLayerSegmentation::_layerDimensionsY
protected

list of layer x dimensions

Definition at line 119 of file TiledLayerSegmentation.h.

◆ _layerIndices

std::vector<int> dd4hep::DDSegmentation::TiledLayerSegmentation::_layerIndices
protected

encoding field used for the layer

Definition at line 117 of file TiledLayerSegmentation.h.


The documentation for this class was generated from the following files: