DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
TiledLayerGridXY.h
Go to the documentation of this file.
1 //==========================================================================
2 // AIDA Detector description implementation
3 //--------------------------------------------------------------------------
4 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
5 // All rights reserved.
6 //
7 // For the licensing terms see $DD4hepINSTALL/LICENSE.
8 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
9 //
10 //==========================================================================
11 
12 /*
13  * TiledLayerGridXY.h
14  *
15  * Created on: November 12, 2015
16  * Author: Shaojun Lu, DESY
17  */
18 
19 #ifndef DDSEGMENTATION_TILEDLAYERGRIDXY_H
20 #define DDSEGMENTATION_TILEDLAYERGRIDXY_H
21 
23 
24 // C/C++ includes
25 #include <string>
26 #include <vector>
27 
28 namespace dd4hep {
29  namespace DDSegmentation {
30 
33  public:
35  TiledLayerGridXY(const std::string& cellEncoding = "");
39  virtual ~TiledLayerGridXY();
40 
42  virtual Vector3D position(const CellID& cellID) const;
44  virtual CellID cellID(const Vector3D& localPosition, const Vector3D& globalPosition, const VolumeID& volumeID) const;
46  double gridSizeX() const {
47  return _gridSizeX;
48  }
50  double gridSizeY() const {
51  return _gridSizeY;
52  }
54  double offsetX() const {
55  return _offsetX;
56  }
58  double offsetY() const {
59  return _offsetY;
60  }
62  std::vector<double> layerOffsetX() const {
63  return _layerOffsetX;
64  }
66  std::vector<double> layerOffsetY() const {
67  return _layerOffsetY;
68  }
70  std::vector<double> boundaryLayerX() const {
71  return _layerDimX;
72  }
74  std::vector<double> FractCellSizeXPerLayer() const {
76  }
78  const std::string& fieldNameX() const {
79  return _xId;
80  }
82  const std::string& fieldNameY() const {
83  return _yId;
84  }
86  const std::string& fieldNameLayer() const {
87  return _identifierLayer;
88  }
90  void setGridSizeX(double cellSize) {
91  _gridSizeX = cellSize;
92  }
94  void setGridSizeY(double cellSize) {
95  _gridSizeY = cellSize;
96  }
98  void setOffsetX(double offset) {
99  _offsetX = offset;
100  }
102  void setOffsetY(double offset) {
103  _offsetY = offset;
104  }
106  void setLayerOffsetX(double offset) {
107  _layerOffsetX.emplace_back(offset);
108  }
110  void setLayerOffsetY(double offset) {
111  _layerOffsetY.emplace_back(offset);
112  }
114  void setFieldNameX(const std::string& fieldName) {
115  _xId = fieldName;
116  }
118  void setFieldNameY(const std::string& fieldName) {
119  _yId = fieldName;
120  }
122  void setFieldNameLayer(const std::string& fieldName) {
123  _identifierLayer= fieldName;
124  }
126  void setBoundaryLayerX(double halfX)
127  {
128  _layerDimX.emplace_back(halfX);
129  };
131  void setFractCellSizeXPerLayer(double newFractCellSizeX)
132  {
133  _fractCellSizeXPerLayer.emplace_back(newFractCellSizeX);
134  }
144  virtual std::vector<double> cellDimensions(const CellID& cellID) const;
145 
146  protected:
148  double _gridSizeX;
150  double _offsetX;
152  double _gridSizeY;
154  double _offsetY;
156  std::string _xId;
158  std::string _yId;
160  std::string _identifierLayer;
162  std::vector<double> _layerOffsetX;
164  std::vector<double> _layerOffsetY;
166  std::vector<double> _layerDimX;
168  std::vector<double> _fractCellSizeXPerLayer;
169  };
170 
171  } /* namespace DDSegmentation */
172 } /* namespace dd4hep */
173 #endif // DDSEGMENTATION_TILEDLAYERGRIDXY_H
dd4hep::DDSegmentation::TiledLayerGridXY::setGridSizeX
void setGridSizeX(double cellSize)
set the grid size in X
Definition: TiledLayerGridXY.h:90
dd4hep::DDSegmentation::VolumeID
uint64_t VolumeID
Definition: BitFieldCoder.h:27
dd4hep::DDSegmentation::TiledLayerGridXY::_yId
std::string _yId
the field name used for Y
Definition: TiledLayerGridXY.h:158
dd4hep::DDSegmentation::TiledLayerGridXY::setFieldNameLayer
void setFieldNameLayer(const std::string &fieldName)
set the field name used for Y
Definition: TiledLayerGridXY.h:122
dd4hep::DDSegmentation::TiledLayerGridXY::setFieldNameX
void setFieldNameX(const std::string &fieldName)
set the field name used for X
Definition: TiledLayerGridXY.h:114
dd4hep::DDSegmentation::TiledLayerGridXY::gridSizeY
double gridSizeY() const
access the grid size in Y
Definition: TiledLayerGridXY.h:50
dd4hep::DDSegmentation::Vector3D
Simple container for a physics vector.
Definition: Segmentation.h:48
dd4hep::DDSegmentation::TiledLayerGridXY::gridSizeX
double gridSizeX() const
access the grid size in X
Definition: TiledLayerGridXY.h:46
dd4hep::DDSegmentation::TiledLayerGridXY::layerOffsetX
std::vector< double > layerOffsetX() const
access the coordinate layerOffset in X
Definition: TiledLayerGridXY.h:62
dd4hep::DDSegmentation::TiledLayerGridXY::_offsetX
double _offsetX
the coordinate offset in X
Definition: TiledLayerGridXY.h:150
dd4hep::DDSegmentation::BitFieldCoder
Helper class for decoding and encoding a bit field of 64bits for convenient declaration.
Definition: BitFieldCoder.h:114
dd4hep::DDSegmentation::TiledLayerGridXY::fieldNameLayer
const std::string & fieldNameLayer() const
access the field name used for Layer
Definition: TiledLayerGridXY.h:86
dd4hep::DDSegmentation::TiledLayerGridXY::position
virtual Vector3D position(const CellID &cellID) const
determine the position based on the cell ID
Definition: TiledLayerGridXY.cpp:81
dd4hep::DDSegmentation::TiledLayerGridXY::setLayerOffsetY
void setLayerOffsetY(double offset)
set the coordinate layerOffset in Y
Definition: TiledLayerGridXY.h:110
dd4hep::DDSegmentation::TiledLayerGridXY::cellID
virtual CellID cellID(const Vector3D &localPosition, const Vector3D &globalPosition, const VolumeID &volumeID) const
determine the cell ID based on the position
Definition: TiledLayerGridXY.cpp:108
dd4hep::DDSegmentation::TiledLayerGridXY::setOffsetX
void setOffsetX(double offset)
set the coordinate offset in X
Definition: TiledLayerGridXY.h:98
dd4hep::DDSegmentation::TiledLayerGridXY::fieldNameX
const std::string & fieldNameX() const
access the field name used for X
Definition: TiledLayerGridXY.h:78
dd4hep::DDSegmentation::TiledLayerGridXY::_gridSizeX
double _gridSizeX
the grid size in X
Definition: TiledLayerGridXY.h:148
dd4hep::DDSegmentation::TiledLayerGridXY::offsetX
double offsetX() const
access the coordinate offset in X
Definition: TiledLayerGridXY.h:54
dd4hep::DDSegmentation::TiledLayerGridXY::FractCellSizeXPerLayer
std::vector< double > FractCellSizeXPerLayer() const
access the fraction cell size in X
Definition: TiledLayerGridXY.h:74
dd4hep::DDSegmentation::TiledLayerGridXY::setBoundaryLayerX
void setBoundaryLayerX(double halfX)
set the layer boundary dimension for X
Definition: TiledLayerGridXY.h:126
dd4hep::DDSegmentation::TiledLayerGridXY::layerOffsetY
std::vector< double > layerOffsetY() const
access the coordinate layerOffset in Y
Definition: TiledLayerGridXY.h:66
dd4hep::DDSegmentation::TiledLayerGridXY::fieldNameY
const std::string & fieldNameY() const
access the field name used for Y
Definition: TiledLayerGridXY.h:82
dd4hep::DDSegmentation::TiledLayerGridXY::_xId
std::string _xId
the field name used for X
Definition: TiledLayerGridXY.h:156
CartesianGrid.h
dd4hep::DDSegmentation::TiledLayerGridXY::TiledLayerGridXY
TiledLayerGridXY(const std::string &cellEncoding="")
Default constructor passing the encoding string.
Definition: TiledLayerGridXY.cpp:31
dd4hep::DDSegmentation::TiledLayerGridXY::_layerOffsetX
std::vector< double > _layerOffsetX
list of layer x offset
Definition: TiledLayerGridXY.h:162
dd4hep::DDSegmentation::TiledLayerGridXY::~TiledLayerGridXY
virtual ~TiledLayerGridXY()
destructor
Definition: TiledLayerGridXY.cpp:76
dd4hep::DDSegmentation::TiledLayerGridXY::_layerOffsetY
std::vector< double > _layerOffsetY
list of layer y offset
Definition: TiledLayerGridXY.h:164
dd4hep::DDSegmentation::Segmentation::decoder
virtual const BitFieldCoder * decoder() const
Access the underlying decoder.
Definition: Segmentation.h:112
dd4hep::DDSegmentation::TiledLayerGridXY::_identifierLayer
std::string _identifierLayer
encoding field used for the layer
Definition: TiledLayerGridXY.h:160
dd4hep::DDSegmentation::TiledLayerGridXY::setFieldNameY
void setFieldNameY(const std::string &fieldName)
set the field name used for Y
Definition: TiledLayerGridXY.h:118
dd4hep::DDSegmentation::CellID
uint64_t CellID
Definition: BitFieldCoder.h:26
dd4hep::DDSegmentation::TiledLayerGridXY::boundaryLayerX
std::vector< double > boundaryLayerX() const
access the boundary dimension in X
Definition: TiledLayerGridXY.h:70
dd4hep::DDSegmentation::Segmentation::volumeID
virtual VolumeID volumeID(const CellID &cellID) const
Determine the volume ID from the full cell ID by removing all local fields.
Definition: Segmentation.cpp:66
dd4hep::DDSegmentation::TiledLayerGridXY::cellDimensions
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,...
Definition: TiledLayerGridXY.cpp:124
dd4hep::DDSegmentation::TiledLayerGridXY::setGridSizeY
void setGridSizeY(double cellSize)
set the grid size in Y
Definition: TiledLayerGridXY.h:94
dd4hep::DDSegmentation::TiledLayerGridXY::setLayerOffsetX
void setLayerOffsetX(double offset)
set the coordinate layerOffset in X
Definition: TiledLayerGridXY.h:106
dd4hep
Namespace for the AIDA detector description toolkit.
Definition: AlignmentsCalib.h:28
dd4hep::DDSegmentation::TiledLayerGridXY::_offsetY
double _offsetY
the coordinate offset in Y
Definition: TiledLayerGridXY.h:154
dd4hep::DDSegmentation::TiledLayerGridXY::setOffsetY
void setOffsetY(double offset)
set the coordinate offset in Y
Definition: TiledLayerGridXY.h:102
dd4hep::DDSegmentation::TiledLayerGridXY
A segmentation class to describe tiled layers.
Definition: TiledLayerGridXY.h:32
dd4hep::DDSegmentation::TiledLayerGridXY::_fractCellSizeXPerLayer
std::vector< double > _fractCellSizeXPerLayer
list of the layer fraction cell size for X
Definition: TiledLayerGridXY.h:168
dd4hep::DDSegmentation::TiledLayerGridXY::offsetY
double offsetY() const
access the coordinate offset in Y
Definition: TiledLayerGridXY.h:58
dd4hep::DDSegmentation::TiledLayerGridXY::setFractCellSizeXPerLayer
void setFractCellSizeXPerLayer(double newFractCellSizeX)
set the layer fraction cell size for X
Definition: TiledLayerGridXY.h:131
dd4hep::DDSegmentation::TiledLayerGridXY::_layerDimX
std::vector< double > _layerDimX
list of layer boundary dimension for X
Definition: TiledLayerGridXY.h:166
dd4hep::DDSegmentation::TiledLayerGridXY::_gridSizeY
double _gridSizeY
the grid size in Y
Definition: TiledLayerGridXY.h:152
dd4hep::DDSegmentation::CartesianGrid
Segmentation base class describing cartesian grid segmentation.
Definition: CartesianGrid.h:28