DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
CartesianGridXYStaggered.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  * CartesianGridXYStaggered.h
13  *
14  * Created on: September 15, 2023
15  * Author: Sebouh J. Paul, UCR
16  */
17 
18 #ifndef DDSEGMENTATION_CARTESIANGRIDXYSTAGGERED_H
19 #define DDSEGMENTATION_CARTESIANGRIDXYSTAGGERED_H
20 
22 
23 namespace dd4hep {
24  namespace DDSegmentation {
25 
28  public:
30  CartesianGridXYStaggered(const std::string& cellEncoding = "");
34  virtual ~CartesianGridXYStaggered();
35 
37  virtual Vector3D position(const CellID& cellID) const;
39  virtual CellID cellID(const Vector3D& localPosition, const Vector3D& globalPosition, const VolumeID& volumeID) const;
41  double gridSizeX() const {
42  return _gridSizeX;
43  }
45  double gridSizeY() const {
46  return _gridSizeY;
47  }
49  double offsetX() const {
50  return _offsetX;
51  }
53  double offsetY() const {
54  return _offsetY;
55  }
57  const std::string& fieldNameX() const {
58  return _xId;
59  }
61  const std::string& fieldNameY() const {
62  return _yId;
63  }
65  int staggerX() const {
66  return _staggerX;
67  }
69  int staggerY() const {
70  return _staggerY;
71  }
73  const std::string& staggerKeyword() const {
74  return _staggerKeyword;
75  }
77  void setGridSizeX(double cellSize) {
78  _gridSizeX = cellSize;
79  }
81  void setGridSizeY(double cellSize) {
82  _gridSizeY = cellSize;
83  }
85  void setOffsetX(double offset) {
86  _offsetX = offset;
87  }
89  void setOffsetY(double offset) {
90  _offsetY = offset;
91  }
93  void setFieldNameX(const std::string& fieldName) {
94  _xId = fieldName;
95  }
97  void setFieldNameY(const std::string& fieldName) {
98  _yId = fieldName;
99  }
101  void setStaggerX(int staggerX) {
103  }
105  void setStaggerY(int staggerY) {
107  }
109  void setStaggerKeyword(const std::string& staggerKeyword) {
111  }
121  virtual std::vector<double> cellDimensions(const CellID& cellID) const;
122 
123  protected:
125  double _gridSizeX;
127  double _offsetX;
131  double _gridSizeY;
133  double _offsetY;
137  std::string _xId;
139  std::string _yId;
141  std::string _staggerKeyword;
142  };
143 
144  } /* namespace DDSegmentation */
145 } /* namespace dd4hep */
146 #endif // DDSEGMENTATION_CARTESIANGRIDXYSTAGGERED_H
dd4hep::DDSegmentation::CartesianGridXYStaggered::staggerKeyword
const std::string & staggerKeyword() const
access the keyword used to determine which volumes to stagger
Definition: CartesianGridXYStaggered.h:73
dd4hep::DDSegmentation::VolumeID
uint64_t VolumeID
Definition: BitFieldCoder.h:27
dd4hep::DDSegmentation::CartesianGridXYStaggered::setFieldNameY
void setFieldNameY(const std::string &fieldName)
set the field name used for Y
Definition: CartesianGridXYStaggered.h:97
dd4hep::DDSegmentation::CartesianGridXYStaggered::_gridSizeY
double _gridSizeY
the grid size in Y
Definition: CartesianGridXYStaggered.h:131
dd4hep::DDSegmentation::CartesianGridXYStaggered::setFieldNameX
void setFieldNameX(const std::string &fieldName)
set the field name used for X
Definition: CartesianGridXYStaggered.h:93
dd4hep::DDSegmentation::Vector3D
Simple container for a physics vector.
Definition: Segmentation.h:48
dd4hep::DDSegmentation::BitFieldCoder
Helper class for decoding and encoding a bit field of 64bits for convenient declaration.
Definition: BitFieldCoder.h:114
dd4hep::DDSegmentation::CartesianGridXYStaggered::gridSizeX
double gridSizeX() const
access the grid size in X
Definition: CartesianGridXYStaggered.h:41
dd4hep::DDSegmentation::CartesianGridXYStaggered::_staggerKeyword
std::string _staggerKeyword
the keyword used to determine which volumes to stagger
Definition: CartesianGridXYStaggered.h:141
dd4hep::DDSegmentation::CartesianGridXYStaggered::offsetY
double offsetY() const
access the coordinate offset in Y
Definition: CartesianGridXYStaggered.h:53
dd4hep::DDSegmentation::CartesianGridXYStaggered::staggerX
int staggerX() const
access the staggering option in X
Definition: CartesianGridXYStaggered.h:65
dd4hep::DDSegmentation::CartesianGridXYStaggered::offsetX
double offsetX() const
access the coordinate offset in X
Definition: CartesianGridXYStaggered.h:49
dd4hep::DDSegmentation::CartesianGridXYStaggered::cellID
virtual CellID cellID(const Vector3D &localPosition, const Vector3D &globalPosition, const VolumeID &volumeID) const
determine the cell ID based on the position
Definition: CartesianGridXYStaggered.cpp:89
dd4hep::DDSegmentation::CartesianGridXYStaggered::_yId
std::string _yId
the field name used for Y
Definition: CartesianGridXYStaggered.h:139
dd4hep::DDSegmentation::CartesianGridXYStaggered::_gridSizeX
double _gridSizeX
the grid size in X
Definition: CartesianGridXYStaggered.h:125
dd4hep::DDSegmentation::CartesianGridXYStaggered::setStaggerY
void setStaggerY(int staggerY)
set the staggering option in Y
Definition: CartesianGridXYStaggered.h:105
dd4hep::DDSegmentation::CartesianGridXYStaggered::setStaggerKeyword
void setStaggerKeyword(const std::string &staggerKeyword)
set the keyword used to determine which volumes to stagger
Definition: CartesianGridXYStaggered.h:109
dd4hep::DDSegmentation::CartesianGridXYStaggered::_staggerX
int _staggerX
staggering option in X. 0 = no staggering. 1 = stagger by _gridSizeX/2.0 in odd layers
Definition: CartesianGridXYStaggered.h:129
dd4hep::DDSegmentation::CartesianGridXYStaggered::setGridSizeX
void setGridSizeX(double cellSize)
set the grid size in X
Definition: CartesianGridXYStaggered.h:77
dd4hep::DDSegmentation::CartesianGridXYStaggered::setGridSizeY
void setGridSizeY(double cellSize)
set the grid size in Y
Definition: CartesianGridXYStaggered.h:81
dd4hep::DDSegmentation::CartesianGridXYStaggered::fieldNameY
const std::string & fieldNameY() const
access the field name used for Y
Definition: CartesianGridXYStaggered.h:61
dd4hep::DDSegmentation::CartesianGridXYStaggered::_xId
std::string _xId
the field name used for X
Definition: CartesianGridXYStaggered.h:137
CartesianGrid.h
dd4hep::DDSegmentation::Segmentation::decoder
virtual const BitFieldCoder * decoder() const
Access the underlying decoder.
Definition: Segmentation.h:112
dd4hep::DDSegmentation::CartesianGridXYStaggered::gridSizeY
double gridSizeY() const
access the grid size in Y
Definition: CartesianGridXYStaggered.h:45
dd4hep::DDSegmentation::CellID
uint64_t CellID
Definition: BitFieldCoder.h:26
dd4hep::DDSegmentation::CartesianGridXYStaggered::_staggerY
int _staggerY
staggering option in Y. 0 = no staggering. 1 = stagger by _gridSizeY/2.0 in odd layers
Definition: CartesianGridXYStaggered.h:135
dd4hep::DDSegmentation::CartesianGridXYStaggered::fieldNameX
const std::string & fieldNameX() const
access the field name used for X
Definition: CartesianGridXYStaggered.h:57
dd4hep::DDSegmentation::CartesianGridXYStaggered::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: CartesianGridXYStaggered.cpp:104
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::CartesianGridXYStaggered::position
virtual Vector3D position(const CellID &cellID) const
determine the position based on the cell ID
Definition: CartesianGridXYStaggered.cpp:75
dd4hep::DDSegmentation::CartesianGridXYStaggered::setOffsetY
void setOffsetY(double offset)
set the coordinate offset in Y
Definition: CartesianGridXYStaggered.h:89
dd4hep::DDSegmentation::CartesianGridXYStaggered::setStaggerX
void setStaggerX(int staggerX)
set the staggering option in X
Definition: CartesianGridXYStaggered.h:101
dd4hep::DDSegmentation::CartesianGridXYStaggered::~CartesianGridXYStaggered
virtual ~CartesianGridXYStaggered()
destructor
Definition: CartesianGridXYStaggered.cpp:70
dd4hep::DDSegmentation::CartesianGridXYStaggered::CartesianGridXYStaggered
CartesianGridXYStaggered(const std::string &cellEncoding="")
Default constructor passing the encoding string.
Definition: CartesianGridXYStaggered.cpp:24
dd4hep
Namespace for the AIDA detector description toolkit.
Definition: AlignmentsCalib.h:28
dd4hep::DDSegmentation::CartesianGridXYStaggered
Segmentation base class describing cartesian grid segmentation in the X-Y plane.
Definition: CartesianGridXYStaggered.h:27
dd4hep::DDSegmentation::CartesianGridXYStaggered::staggerY
int staggerY() const
access the staggering option in Y
Definition: CartesianGridXYStaggered.h:69
dd4hep::DDSegmentation::CartesianGridXYStaggered::setOffsetX
void setOffsetX(double offset)
set the coordinate offset in X
Definition: CartesianGridXYStaggered.h:85
dd4hep::DDSegmentation::CartesianGridXYStaggered::_offsetY
double _offsetY
the coordinate offset in Y
Definition: CartesianGridXYStaggered.h:133
dd4hep::DDSegmentation::CartesianGridXYStaggered::_offsetX
double _offsetX
the coordinate offset in X
Definition: CartesianGridXYStaggered.h:127
dd4hep::DDSegmentation::CartesianGrid
Segmentation base class describing cartesian grid segmentation.
Definition: CartesianGrid.h:28