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

a megatile is a rectangule in x-y, split into a grid along x and y, with an exactly integer number of cells in x and y. More...

#include <MegatileLayerGridXY.h>

Inheritance diagram for dd4hep::DDSegmentation::MegatileLayerGridXY:
dd4hep::DDSegmentation::CartesianGrid dd4hep::DDSegmentation::Segmentation

Classes

struct  segInfo
 Helper structure. More...
 

Public Member Functions

 MegatileLayerGridXY (const std::string &cellEncoding="")
 Default constructor passing the encoding string. More...
 
 MegatileLayerGridXY (const BitFieldCoder *decoder)
 Default constructor used by derived classes passing an existing decoder. More...
 
virtual ~MegatileLayerGridXY ()
 destructor More...
 
void setup ()
 
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...
 
void setMegaTileSizeXY (double x, double y)
 
void setMegaTileOffsetXY (double x, double y)
 set the coordinate offset in X, Y More...
 
void setMegaTileCellsXY (unsigned int layer, int ix, int iy)
 
void setSpecialMegaTile (unsigned int layer, unsigned int tile, double sizex, double sizey, double offsetx, double offsety, unsigned int ncellsx, unsigned int ncellsy)
 
const std::string & fieldNameX () const
 access the field name used for X More...
 
const std::string & fieldNameY () const
 access the field name used for Y More...
 
void setFieldNameX (const std::string &fieldName)
 set the field name used for X More...
 
void setFieldNameY (const std::string &fieldName)
 set the field name used for Y 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...
 
virtual std::vector< double > cellDimensions (const unsigned int ilayer, const unsigned int iwafer) const
 
int getUnifNCellsX ()
 
int getUnifNCellsY ()
 
- Public Member Functions inherited from dd4hep::DDSegmentation::CartesianGrid
virtual ~CartesianGrid ()
 Destructor. 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...
 

Protected Member Functions

void getSegInfo (unsigned int layerIndex, unsigned int waferIndex) const
 
- Protected Member Functions inherited from dd4hep::DDSegmentation::CartesianGrid
 CartesianGrid (const std::string &cellEncoding="")
 Default constructor used by derived classes passing the encoding string. More...
 
 CartesianGrid (const BitFieldCoder *decoder)
 Default constructor used by derived classes passing an existing decoder. More...
 
- 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...
 

Protected Attributes

segInfo _currentSegInfo
 
double _megaTileSizeX = 0
 
double _megaTileSizeY = 0
 
double _megaTileOffsetX = 0
 
double _megaTileOffsetY = 0
 
std::vector< int > _nCellsX
 
std::vector< int > _nCellsY
 
int _unif_nCellsX
 
int _unif_nCellsY
 
std::map< std::pair< unsigned int, unsigned int >, segInfospecialMegaTiles_layerWafer
 
std::string _xId
 the field name used for X More...
 
std::string _yId
 the field name used for Y More...
 
std::string _identifierLayer
 encoding field used for the layer More...
 
std::string _identifierWafer
 encoding field used for the wafer More...
 
std::string _layerConfig
 
std::string _identifierModule
 
- 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

- 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...
 

Detailed Description

a megatile is a rectangule in x-y, split into a grid along x and y, with an exactly integer number of cells in x and y.

this class assumes a mostly-common megatile size, with possibility for a number of "special" megatiles of non-standard size / segmentation

the segmentation of standard megatiles is defined layer-by-layer.

some changes wrt previous version from Kotera et al.

D. Jeans - Nov 2016

July 2017 - DJeans some changes for easier use of multi-layer segmentations

Definition at line 48 of file MegatileLayerGridXY.h.

Constructor & Destructor Documentation

◆ MegatileLayerGridXY() [1/2]

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

Default constructor passing the encoding string.

default constructor using an encoding string

Definition at line 21 of file MegatileLayerGridXY.cpp.

◆ MegatileLayerGridXY() [2/2]

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

Default constructor used by derived classes passing an existing decoder.

Definition at line 27 of file MegatileLayerGridXY.cpp.

◆ ~MegatileLayerGridXY()

dd4hep::DDSegmentation::MegatileLayerGridXY::~MegatileLayerGridXY ( )
virtual

destructor

Definition at line 33 of file MegatileLayerGridXY.cpp.

Member Function Documentation

◆ cellDimensions() [1/2]

std::vector< double > dd4hep::DDSegmentation::MegatileLayerGridXY::cellDimensions ( const CellID cellID) const
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.

Parameters
cellIDcellID of the cell for which parameters are returned
Returns
vector<double> in natural order of dimensions, e.g., dx/dy/dz, or dr/r*dPhi

Reimplemented from dd4hep::DDSegmentation::Segmentation.

Definition at line 122 of file MegatileLayerGridXY.cpp.

◆ cellDimensions() [2/2]

std::vector< double > dd4hep::DDSegmentation::MegatileLayerGridXY::cellDimensions ( const unsigned int  ilayer,
const unsigned int  iwafer 
) const
virtual

Definition at line 168 of file MegatileLayerGridXY.cpp.

◆ cellID()

CellID dd4hep::DDSegmentation::MegatileLayerGridXY::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 90 of file MegatileLayerGridXY.cpp.

◆ fieldNameX()

const std::string& dd4hep::DDSegmentation::MegatileLayerGridXY::fieldNameX ( ) const
inline

access the field name used for X

Definition at line 94 of file MegatileLayerGridXY.h.

◆ fieldNameY()

const std::string& dd4hep::DDSegmentation::MegatileLayerGridXY::fieldNameY ( ) const
inline

access the field name used for Y

Definition at line 98 of file MegatileLayerGridXY.h.

◆ getSegInfo()

void dd4hep::DDSegmentation::MegatileLayerGridXY::getSegInfo ( unsigned int  layerIndex,
unsigned int  waferIndex 
) const
protected

Definition at line 145 of file MegatileLayerGridXY.cpp.

◆ getUnifNCellsX()

int dd4hep::DDSegmentation::MegatileLayerGridXY::getUnifNCellsX ( )
inline

Definition at line 114 of file MegatileLayerGridXY.h.

◆ getUnifNCellsY()

int dd4hep::DDSegmentation::MegatileLayerGridXY::getUnifNCellsY ( )
inline

Definition at line 115 of file MegatileLayerGridXY.h.

◆ position()

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

determine the position based on the cell ID

Implements dd4hep::DDSegmentation::Segmentation.

Definition at line 63 of file MegatileLayerGridXY.cpp.

◆ setFieldNameX()

void dd4hep::DDSegmentation::MegatileLayerGridXY::setFieldNameX ( const std::string &  fieldName)
inline

set the field name used for X

Definition at line 103 of file MegatileLayerGridXY.h.

◆ setFieldNameY()

void dd4hep::DDSegmentation::MegatileLayerGridXY::setFieldNameY ( const std::string &  fieldName)
inline

set the field name used for Y

Definition at line 107 of file MegatileLayerGridXY.h.

◆ setMegaTileCellsXY()

void dd4hep::DDSegmentation::MegatileLayerGridXY::setMegaTileCellsXY ( unsigned int  layer,
int  ix,
int  iy 
)
inline

Definition at line 78 of file MegatileLayerGridXY.h.

◆ setMegaTileOffsetXY()

void dd4hep::DDSegmentation::MegatileLayerGridXY::setMegaTileOffsetXY ( double  x,
double  y 
)
inline

set the coordinate offset in X, Y

Definition at line 73 of file MegatileLayerGridXY.h.

◆ setMegaTileSizeXY()

void dd4hep::DDSegmentation::MegatileLayerGridXY::setMegaTileSizeXY ( double  x,
double  y 
)
inline

Definition at line 67 of file MegatileLayerGridXY.h.

◆ setSpecialMegaTile()

void dd4hep::DDSegmentation::MegatileLayerGridXY::setSpecialMegaTile ( unsigned int  layer,
unsigned int  tile,
double  sizex,
double  sizey,
double  offsetx,
double  offsety,
unsigned int  ncellsx,
unsigned int  ncellsy 
)

Definition at line 128 of file MegatileLayerGridXY.cpp.

◆ setup()

void dd4hep::DDSegmentation::MegatileLayerGridXY::setup ( )

Definition at line 37 of file MegatileLayerGridXY.cpp.

Member Data Documentation

◆ _currentSegInfo

segInfo dd4hep::DDSegmentation::MegatileLayerGridXY::_currentSegInfo
mutableprotected

Definition at line 131 of file MegatileLayerGridXY.h.

◆ _identifierLayer

std::string dd4hep::DDSegmentation::MegatileLayerGridXY::_identifierLayer
protected

encoding field used for the layer

Definition at line 161 of file MegatileLayerGridXY.h.

◆ _identifierModule

std::string dd4hep::DDSegmentation::MegatileLayerGridXY::_identifierModule
protected

Definition at line 167 of file MegatileLayerGridXY.h.

◆ _identifierWafer

std::string dd4hep::DDSegmentation::MegatileLayerGridXY::_identifierWafer
protected

encoding field used for the wafer

Definition at line 163 of file MegatileLayerGridXY.h.

◆ _layerConfig

std::string dd4hep::DDSegmentation::MegatileLayerGridXY::_layerConfig
protected

Definition at line 165 of file MegatileLayerGridXY.h.

◆ _megaTileOffsetX

double dd4hep::DDSegmentation::MegatileLayerGridXY::_megaTileOffsetX = 0
protected

Definition at line 143 of file MegatileLayerGridXY.h.

◆ _megaTileOffsetY

double dd4hep::DDSegmentation::MegatileLayerGridXY::_megaTileOffsetY = 0
protected

Definition at line 144 of file MegatileLayerGridXY.h.

◆ _megaTileSizeX

double dd4hep::DDSegmentation::MegatileLayerGridXY::_megaTileSizeX = 0
protected

Definition at line 140 of file MegatileLayerGridXY.h.

◆ _megaTileSizeY

double dd4hep::DDSegmentation::MegatileLayerGridXY::_megaTileSizeY = 0
protected

Definition at line 141 of file MegatileLayerGridXY.h.

◆ _nCellsX

std::vector< int > dd4hep::DDSegmentation::MegatileLayerGridXY::_nCellsX
protected

Definition at line 147 of file MegatileLayerGridXY.h.

◆ _nCellsY

std::vector< int > dd4hep::DDSegmentation::MegatileLayerGridXY::_nCellsY
protected

Definition at line 148 of file MegatileLayerGridXY.h.

◆ _unif_nCellsX

int dd4hep::DDSegmentation::MegatileLayerGridXY::_unif_nCellsX
protected

Definition at line 150 of file MegatileLayerGridXY.h.

◆ _unif_nCellsY

int dd4hep::DDSegmentation::MegatileLayerGridXY::_unif_nCellsY
protected

Definition at line 151 of file MegatileLayerGridXY.h.

◆ _xId

std::string dd4hep::DDSegmentation::MegatileLayerGridXY::_xId
protected

the field name used for X

Definition at line 157 of file MegatileLayerGridXY.h.

◆ _yId

std::string dd4hep::DDSegmentation::MegatileLayerGridXY::_yId
protected

the field name used for Y

Definition at line 159 of file MegatileLayerGridXY.h.

◆ specialMegaTiles_layerWafer

std::map< std::pair < unsigned int, unsigned int > , segInfo > dd4hep::DDSegmentation::MegatileLayerGridXY::specialMegaTiles_layerWafer
protected

Definition at line 153 of file MegatileLayerGridXY.h.


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