DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
WaferGridXY.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  * WaferGridXY.h
14  *
15  * Created on: April 19, 2016
16  * Author: S. Lu, DESY
17  */
18 
19 #ifndef DDSEGMENTATION_WAFERGRIDXY_H
20 #define DDSEGMENTATION_WAFERGRIDXY_H
21 
23 
24 #define MAX_GROUPS 100
25 #define MAX_WAFERS 100
26 
27 namespace dd4hep {
28  namespace DDSegmentation {
29 
31  class WaferGridXY: public CartesianGrid {
32  public:
34  WaferGridXY(const std::string& cellEncoding = "");
38  virtual ~WaferGridXY();
39 
41  virtual Vector3D position(const CellID& cellID) const;
43  virtual CellID cellID(const Vector3D& localPosition, const Vector3D& globalPosition, const VolumeID& volumeID) const;
45  double gridSizeX() const {
46  return _gridSizeX;
47  }
49  double gridSizeY() const {
50  return _gridSizeY;
51  }
53  double offsetX() const {
54  return _offsetX;
55  }
57  double offsetY() const {
58  return _offsetY;
59  }
61  double waferOffsetX(int inGroup, int inWafer) const {
62  return _waferOffsetX[inGroup][inWafer];
63  }
65  double waferOffsetY(int inGroup, int inWafer) const {
66  return _waferOffsetY[inGroup][inWafer];
67  }
68 
70  const std::string& fieldNameX() const {
71  return _xId;
72  }
74  const std::string& fieldNameY() const {
75  return _yId;
76  }
78  void setGridSizeX(double cellSize) {
79  _gridSizeX = cellSize;
80  }
82  void setGridSizeY(double cellSize) {
83  _gridSizeY = cellSize;
84  }
86  void setOffsetX(double offset) {
87  _offsetX = offset;
88  }
90  void setOffsetY(double offset) {
91  _offsetY = offset;
92  }
94  void setWaferOffsetX(int inGroup,int inWafer, double offset) {
95  _waferOffsetX[inGroup][inWafer] = offset;
96  }
98  void setWaferOffsetY(int inGroup,int inWafer, double offset) {
99  _waferOffsetY[inGroup][inWafer] = offset;
100  }
101 
103  void setFieldNameX(const std::string& fieldName) {
104  _xId = fieldName;
105  }
107  void setFieldNameY(const std::string& fieldName) {
108  _yId = fieldName;
109  }
119  virtual std::vector<double> cellDimensions(const CellID& cellID) const;
120 
121  protected:
123  double _gridSizeX;
125  double _offsetX;
127  double _gridSizeY;
129  double _offsetY;
135  std::string _xId;
137  std::string _yId;
141  std::string _identifierWafer;
142  };
143 
144  } /* namespace DDSegmentation */
145 } /* namespace dd4hep */
146 #endif // DDSEGMENTATION_WAFERGRIDXY_H
dd4hep::DDSegmentation::WaferGridXY::setFieldNameX
void setFieldNameX(const std::string &fieldName)
set the field name used for X
Definition: WaferGridXY.h:103
dd4hep::DDSegmentation::WaferGridXY::setOffsetY
void setOffsetY(double offset)
set the coordinate offset in Y
Definition: WaferGridXY.h:90
dd4hep::DDSegmentation::VolumeID
uint64_t VolumeID
Definition: BitFieldCoder.h:27
dd4hep::DDSegmentation::WaferGridXY::offsetX
double offsetX() const
access the coordinate offset in X
Definition: WaferGridXY.h:53
dd4hep::DDSegmentation::WaferGridXY::_identifierWafer
std::string _identifierWafer
encoding field used for the wafer
Definition: WaferGridXY.h:141
dd4hep::DDSegmentation::Vector3D
Simple container for a physics vector.
Definition: Segmentation.h:48
dd4hep::DDSegmentation::WaferGridXY::_waferOffsetY
double _waferOffsetY[MAX_GROUPS][MAX_WAFERS]
list of wafer y offset for each group
Definition: WaferGridXY.h:133
dd4hep::DDSegmentation::BitFieldCoder
Helper class for decoding and encoding a bit field of 64bits for convenient declaration.
Definition: BitFieldCoder.h:114
dd4hep::DDSegmentation::WaferGridXY::_yId
std::string _yId
the field name used for Y
Definition: WaferGridXY.h:137
dd4hep::DDSegmentation::WaferGridXY::setGridSizeY
void setGridSizeY(double cellSize)
set the grid size in Y
Definition: WaferGridXY.h:82
dd4hep::DDSegmentation::WaferGridXY::gridSizeX
double gridSizeX() const
access the grid size in X
Definition: WaferGridXY.h:45
dd4hep::DDSegmentation::WaferGridXY::_offsetX
double _offsetX
the coordinate offset in X
Definition: WaferGridXY.h:125
dd4hep::DDSegmentation::WaferGridXY::waferOffsetX
double waferOffsetX(int inGroup, int inWafer) const
access the coordinate waferOffset for inGroup in X
Definition: WaferGridXY.h:61
dd4hep::DDSegmentation::WaferGridXY::setOffsetX
void setOffsetX(double offset)
set the coordinate offset in X
Definition: WaferGridXY.h:86
dd4hep::DDSegmentation::WaferGridXY::fieldNameX
const std::string & fieldNameX() const
access the field name used for X
Definition: WaferGridXY.h:70
dd4hep::DDSegmentation::WaferGridXY::cellID
virtual CellID cellID(const Vector3D &localPosition, const Vector3D &globalPosition, const VolumeID &volumeID) const
determine the cell ID based on the position
Definition: WaferGridXY.cpp:98
dd4hep::DDSegmentation::WaferGridXY::setWaferOffsetX
void setWaferOffsetX(int inGroup, int inWafer, double offset)
set the coordinate waferOffset for inlayer in X
Definition: WaferGridXY.h:94
dd4hep::DDSegmentation::WaferGridXY::_offsetY
double _offsetY
the coordinate offset in Y
Definition: WaferGridXY.h:129
dd4hep::DDSegmentation::WaferGridXY::_identifierMGWaferGroup
std::string _identifierMGWaferGroup
encoding field used for the Magic Wafer group
Definition: WaferGridXY.h:139
CartesianGrid.h
dd4hep::DDSegmentation::WaferGridXY::gridSizeY
double gridSizeY() const
access the grid size in Y
Definition: WaferGridXY.h:49
dd4hep::DDSegmentation::WaferGridXY::_waferOffsetX
double _waferOffsetX[MAX_GROUPS][MAX_WAFERS]
list of wafer x offset for each group
Definition: WaferGridXY.h:131
dd4hep::DDSegmentation::WaferGridXY::~WaferGridXY
virtual ~WaferGridXY()
destructor
Definition: WaferGridXY.cpp:63
dd4hep::DDSegmentation::Segmentation::decoder
virtual const BitFieldCoder * decoder() const
Access the underlying decoder.
Definition: Segmentation.h:112
dd4hep::DDSegmentation::WaferGridXY::WaferGridXY
WaferGridXY(const std::string &cellEncoding="")
Default constructor passing the encoding string.
Definition: WaferGridXY.cpp:24
dd4hep::DDSegmentation::CellID
uint64_t CellID
Definition: BitFieldCoder.h:26
dd4hep::DDSegmentation::WaferGridXY::_gridSizeX
double _gridSizeX
the grid size in X
Definition: WaferGridXY.h:123
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::WaferGridXY::offsetY
double offsetY() const
access the coordinate offset in Y
Definition: WaferGridXY.h:57
MAX_GROUPS
#define MAX_GROUPS
Definition: WaferGridXY.h:24
MAX_WAFERS
#define MAX_WAFERS
Definition: WaferGridXY.h:25
dd4hep::DDSegmentation::WaferGridXY::setWaferOffsetY
void setWaferOffsetY(int inGroup, int inWafer, double offset)
set the coordinate waferOffset for inGroup in Y
Definition: WaferGridXY.h:98
dd4hep
Namespace for the AIDA detector description toolkit.
Definition: AlignmentsCalib.h:28
dd4hep::DDSegmentation::WaferGridXY::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: WaferGridXY.cpp:128
dd4hep::DDSegmentation::WaferGridXY::position
virtual Vector3D position(const CellID &cellID) const
determine the position based on the cell ID
Definition: WaferGridXY.cpp:68
dd4hep::DDSegmentation::WaferGridXY::_xId
std::string _xId
the field name used for X
Definition: WaferGridXY.h:135
dd4hep::DDSegmentation::WaferGridXY::fieldNameY
const std::string & fieldNameY() const
access the field name used for Y
Definition: WaferGridXY.h:74
dd4hep::DDSegmentation::WaferGridXY::waferOffsetY
double waferOffsetY(int inGroup, int inWafer) const
access the coordinate waferOffset for inGroup in Y
Definition: WaferGridXY.h:65
dd4hep::DDSegmentation::WaferGridXY::_gridSizeY
double _gridSizeY
the grid size in Y
Definition: WaferGridXY.h:127
dd4hep::DDSegmentation::WaferGridXY::setFieldNameY
void setFieldNameY(const std::string &fieldName)
set the field name used for Y
Definition: WaferGridXY.h:107
dd4hep::DDSegmentation::WaferGridXY
A segmentation class to describe wafer grids in X-Y.
Definition: WaferGridXY.h:31
dd4hep::DDSegmentation::CartesianGrid
Segmentation base class describing cartesian grid segmentation.
Definition: CartesianGrid.h:28
dd4hep::DDSegmentation::WaferGridXY::setGridSizeX
void setGridSizeX(double cellSize)
set the grid size in X
Definition: WaferGridXY.h:78