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

A segmentation for arbitrary sizes in R and R-dependent sizes in Phi. More...

#include <PolarGridRPhi2.h>

Inheritance diagram for dd4hep::DDSegmentation::PolarGridRPhi2:
dd4hep::DDSegmentation::PolarGrid dd4hep::DDSegmentation::Segmentation

Public Member Functions

 PolarGridRPhi2 (const std::string &cellEncoding="")
 Default constructor passing the encoding string. More...
 
 PolarGridRPhi2 (const BitFieldCoder *decoder)
 Default constructor used by derived classes passing an existing decoder. More...
 
virtual ~PolarGridRPhi2 ()
 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...
 
std::vector< double > gridRValues () const
 access the grid size in R More...
 
std::vector< double > gridPhiValues () const
 access the grid size in Phi More...
 
double offsetR () const
 access the coordinate offset in R More...
 
double offsetPhi () const
 access the coordinate offset in Phi More...
 
const std::string & fieldNameR () const
 access the field name used for R More...
 
const std::string & fieldNamePhi () const
 access the field name used for Phi More...
 
void setGridRValues (double cellSize, int rID)
 set the grid Boundaries in R More...
 
void setGridSizePhi (double cellSize, int phiID)
 set the grid size in Phi More...
 
void setGridRValues (std::vector< double > const &rValues)
 
void setGridPhiValues (std::vector< double > const &phiValues)
 
void setOffsetR (double offset)
 set the coordinate offset in R More...
 
void setOffsetPhi (double offset)
 set the coordinate offset in Phi More...
 
void setFieldNameR (const std::string &fieldName)
 set the field name used for X More...
 
void setFieldNamePhi (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: dr, r*dPhi. More...
 
- Public Member Functions inherited from dd4hep::DDSegmentation::PolarGrid
virtual ~PolarGrid ()
 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 Attributes

std::vector< double > _gridRValues
 the grid boundaries in R More...
 
double _offsetR
 the coordinate offset in R More...
 
std::vector< double > _gridPhiValues
 the grid sizes in Phi More...
 
double _offsetPhi
 the coordinate offset in Phi More...
 
std::string _rId
 the field name used for R More...
 
std::string _phiId
 the field name used for Phi 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::PolarGrid
 PolarGrid (const std::string &cellEncoding="")
 Default constructor used by derived classes passing the encoding string. More...
 
 PolarGrid (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...
 
- 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 segmentation for arbitrary sizes in R and R-dependent sizes in Phi.

Note: Counting of phi-ids starts at the offset. There are no negative phi-IDs
The grid_r_values give the boundaries of the bin, the grid_phi_values give the size of the bin for each radial bin see also PolarGridRPhi2::setGridRValues and PolarGridRPhi2::setGridPhiValues
Example:

<segmentation type="PolarGridRPhi2"
grid_r_values="3.2*cm 3.7*cm 4.9*cm 5.5*cm<br/>
6.*cm 7.*cm 7.5*cm 8.7*cm<br/>
9.5*cm 10.*cm 11.*cm 11.8*cm<br/>
12.*cm 13.*cm 14.*cm 15.0*cm"
grid_phi_values="360/(4*8)*degree 360/(5*8)*degree
360/(6*8)*degree 360/(6*8)*degree
360/(7*8)*degree 360/(8*8)*degree
360/(9*8)*degree 360/(9*8)*degree
360/(10*8)*degree 360/(11*8)*degree
360/(12*8)*degree 360/(12*8)*degree
360/(13*8)*degree 360/(14*8)*degree
360/(15*8)*degree"
offset_phi="-180.0*degree"
/>
<id>system:8,barrel:3,layer:8,slice:5,r:32:16,phi:16</id>
Version
$Id$
Date
2015-03

Definition at line 57 of file PolarGridRPhi2.h.

Constructor & Destructor Documentation

◆ PolarGridRPhi2() [1/2]

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

Default constructor passing the encoding string.

default constructor using an encoding string

Definition at line 24 of file PolarGridRPhi2.cpp.

◆ PolarGridRPhi2() [2/2]

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

Default constructor used by derived classes passing an existing decoder.

Definition at line 40 of file PolarGridRPhi2.cpp.

◆ ~PolarGridRPhi2()

dd4hep::DDSegmentation::PolarGridRPhi2::~PolarGridRPhi2 ( )
virtual

destructor

Definition at line 56 of file PolarGridRPhi2.cpp.

Member Function Documentation

◆ cellDimensions()

std::vector< double > dd4hep::DDSegmentation::PolarGridRPhi2::cellDimensions ( const CellID cellID) const
virtual

Returns a vector<double> of the cellDimensions of the given cell ID in natural order of dimensions: dr, r*dPhi.

Returns a vector of the cellDimensions of the given cell ID

Parameters
cellIDis ignored as all cells have the same dimension
Returns
std::vector<double> size 2:
  1. size in r
  2. size of r*dPhi at the radial centre of the pad

Reimplemented from dd4hep::DDSegmentation::Segmentation.

Definition at line 98 of file PolarGridRPhi2.cpp.

◆ cellID()

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

◆ fieldNamePhi()

const std::string& dd4hep::DDSegmentation::PolarGridRPhi2::fieldNamePhi ( ) const
inline

access the field name used for Phi

Definition at line 91 of file PolarGridRPhi2.h.

◆ fieldNameR()

const std::string& dd4hep::DDSegmentation::PolarGridRPhi2::fieldNameR ( ) const
inline

access the field name used for R

Definition at line 87 of file PolarGridRPhi2.h.

◆ gridPhiValues()

std::vector<double> dd4hep::DDSegmentation::PolarGridRPhi2::gridPhiValues ( ) const
inline

access the grid size in Phi

Definition at line 75 of file PolarGridRPhi2.h.

◆ gridRValues()

std::vector<double> dd4hep::DDSegmentation::PolarGridRPhi2::gridRValues ( ) const
inline

access the grid size in R

Definition at line 71 of file PolarGridRPhi2.h.

◆ offsetPhi()

double dd4hep::DDSegmentation::PolarGridRPhi2::offsetPhi ( ) const
inline

access the coordinate offset in Phi

Definition at line 83 of file PolarGridRPhi2.h.

◆ offsetR()

double dd4hep::DDSegmentation::PolarGridRPhi2::offsetR ( ) const
inline

access the coordinate offset in R

Definition at line 79 of file PolarGridRPhi2.h.

◆ position()

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

determine the position based on the cell ID

Implements dd4hep::DDSegmentation::Segmentation.

Definition at line 61 of file PolarGridRPhi2.cpp.

◆ setFieldNamePhi()

void dd4hep::DDSegmentation::PolarGridRPhi2::setFieldNamePhi ( const std::string &  fieldName)
inline

set the field name used for Y

Definition at line 129 of file PolarGridRPhi2.h.

◆ setFieldNameR()

void dd4hep::DDSegmentation::PolarGridRPhi2::setFieldNameR ( const std::string &  fieldName)
inline

set the field name used for X

Definition at line 125 of file PolarGridRPhi2.h.

◆ setGridPhiValues()

void dd4hep::DDSegmentation::PolarGridRPhi2::setGridPhiValues ( std::vector< double > const &  phiValues)
inline

set the grid size in Phi for each bin in R

Parameters
phiValuesThe size in phi for each bin in R, this vector is one smaller than the vector for PolarGridRPhi2::setGridRValues

Definition at line 111 of file PolarGridRPhi2.h.

◆ setGridRValues() [1/2]

void dd4hep::DDSegmentation::PolarGridRPhi2::setGridRValues ( double  cellSize,
int  rID 
)
inline

set the grid Boundaries in R

Definition at line 95 of file PolarGridRPhi2.h.

◆ setGridRValues() [2/2]

void dd4hep::DDSegmentation::PolarGridRPhi2::setGridRValues ( std::vector< double > const &  rValues)
inline

set the grid boundaries for R

Parameters
rValuesThe boundaries of the segments in radius, the first value is the lower boundary of the first bin, the highest value is the upper boundary of the last bin

Definition at line 105 of file PolarGridRPhi2.h.

◆ setGridSizePhi()

void dd4hep::DDSegmentation::PolarGridRPhi2::setGridSizePhi ( double  cellSize,
int  phiID 
)
inline

set the grid size in Phi

Definition at line 99 of file PolarGridRPhi2.h.

◆ setOffsetPhi()

void dd4hep::DDSegmentation::PolarGridRPhi2::setOffsetPhi ( double  offset)
inline

set the coordinate offset in Phi

Definition at line 121 of file PolarGridRPhi2.h.

◆ setOffsetR()

void dd4hep::DDSegmentation::PolarGridRPhi2::setOffsetR ( double  offset)
inline

set the coordinate offset in R

Definition at line 117 of file PolarGridRPhi2.h.

Member Data Documentation

◆ _gridPhiValues

std::vector<double> dd4hep::DDSegmentation::PolarGridRPhi2::_gridPhiValues
protected

the grid sizes in Phi

Definition at line 149 of file PolarGridRPhi2.h.

◆ _gridRValues

std::vector<double> dd4hep::DDSegmentation::PolarGridRPhi2::_gridRValues
protected

the grid boundaries in R

Definition at line 145 of file PolarGridRPhi2.h.

◆ _offsetPhi

double dd4hep::DDSegmentation::PolarGridRPhi2::_offsetPhi
protected

the coordinate offset in Phi

Definition at line 151 of file PolarGridRPhi2.h.

◆ _offsetR

double dd4hep::DDSegmentation::PolarGridRPhi2::_offsetR
protected

the coordinate offset in R

Definition at line 147 of file PolarGridRPhi2.h.

◆ _phiId

std::string dd4hep::DDSegmentation::PolarGridRPhi2::_phiId
protected

the field name used for Phi

Definition at line 155 of file PolarGridRPhi2.h.

◆ _rId

std::string dd4hep::DDSegmentation::PolarGridRPhi2::_rId
protected

the field name used for R

Definition at line 153 of file PolarGridRPhi2.h.


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