DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
CartesianGridYZ.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 #ifndef DDSEGMENTATION_CARTESIANGRIDYZ_H
12 #define DDSEGMENTATION_CARTESIANGRIDYZ_H
13 
15 
16 namespace dd4hep {
17  namespace DDSegmentation {
18 
20 
30  public:
32  CartesianGridYZ(const std::string& cellEncoding = "");
36  virtual ~CartesianGridYZ();
37 
39  virtual Vector3D position(const CellID& cellID) const;
41  virtual CellID cellID(const Vector3D& localPosition, const Vector3D& globalPosition, const VolumeID& volumeID) const;
43  double gridSizeY() const {
44  return _gridSizeY;
45  }
47  double gridSizeZ() const {
48  return _gridSizeZ;
49  }
51  double offsetY() const {
52  return _offsetY;
53  }
55  double offsetZ() const {
56  return _offsetZ;
57  }
59  const std::string& fieldNameY() const {
60  return _yId;
61  }
63  const std::string& fieldNameZ() const {
64  return _zId;
65  }
67  void setGridSizeY(double cellSize) {
68  _gridSizeY = cellSize;
69  }
71  void setGridSizeZ(double cellSize) {
72  _gridSizeZ = cellSize;
73  }
75  void setOffsetY(double offset) {
76  _offsetY = offset;
77  }
79  void setOffsetZ(double offset) {
80  _offsetZ = offset;
81  }
83  void setFieldNameY(const std::string& fieldName) {
84  _yId = fieldName;
85  }
87  void setFieldNameZ(const std::string& fieldName) {
88  _zId = fieldName;
89  }
99  virtual std::vector<double> cellDimensions(const CellID& cellID) const;
100 
101  protected:
103  double _gridSizeY;
105  double _offsetY;
107  double _gridSizeZ;
109  double _offsetZ;
111  std::string _yId;
113  std::string _zId;
114  };
115 
116  } /* namespace DDSegmentation */
117 } /* namespace dd4hep */
118 #endif // DDSEGMENTATION_CARTESIANGRIDYZ_H
dd4hep::DDSegmentation::VolumeID
uint64_t VolumeID
Definition: BitFieldCoder.h:27
dd4hep::DDSegmentation::CartesianGridYZ::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: CartesianGridYZ.cpp:75
dd4hep::DDSegmentation::CartesianGridYZ::setFieldNameY
void setFieldNameY(const std::string &fieldName)
set the field name used for Y
Definition: CartesianGridYZ.h:83
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::CartesianGridYZ::_offsetY
double _offsetY
the coordinate offset in Y
Definition: CartesianGridYZ.h:105
dd4hep::DDSegmentation::CartesianGridYZ::setOffsetY
void setOffsetY(double offset)
set the coordinate offset in Y
Definition: CartesianGridYZ.h:75
dd4hep::DDSegmentation::CartesianGridYZ::position
virtual Vector3D position(const CellID &cellID) const
determine the position based on the cell ID
Definition: CartesianGridYZ.cpp:60
dd4hep::DDSegmentation::CartesianGridYZ::cellID
virtual CellID cellID(const Vector3D &localPosition, const Vector3D &globalPosition, const VolumeID &volumeID) const
determine the cell ID based on the position
Definition: CartesianGridYZ.cpp:68
dd4hep::DDSegmentation::CartesianGridYZ::~CartesianGridYZ
virtual ~CartesianGridYZ()
destructor
Definition: CartesianGridYZ.cpp:55
dd4hep::DDSegmentation::CartesianGridYZ::CartesianGridYZ
CartesianGridYZ(const std::string &cellEncoding="")
Default constructor passing the encoding string.
Definition: CartesianGridYZ.cpp:22
dd4hep::DDSegmentation::CartesianGridYZ::setGridSizeY
void setGridSizeY(double cellSize)
set the grid size in Y
Definition: CartesianGridYZ.h:67
dd4hep::DDSegmentation::CartesianGridYZ::fieldNameZ
const std::string & fieldNameZ() const
access the field name used for Z
Definition: CartesianGridYZ.h:63
dd4hep::DDSegmentation::CartesianGridYZ::offsetY
double offsetY() const
access the coordinate offset in Y
Definition: CartesianGridYZ.h:51
dd4hep::DDSegmentation::CartesianGridYZ::setOffsetZ
void setOffsetZ(double offset)
set the coordinate offset in Z
Definition: CartesianGridYZ.h:79
CartesianGrid.h
dd4hep::DDSegmentation::Segmentation::decoder
virtual const BitFieldCoder * decoder() const
Access the underlying decoder.
Definition: Segmentation.h:112
dd4hep::DDSegmentation::CartesianGridYZ::_zId
std::string _zId
the field name used for Z
Definition: CartesianGridYZ.h:113
dd4hep::DDSegmentation::CartesianGridYZ::fieldNameY
const std::string & fieldNameY() const
access the field name used for Y
Definition: CartesianGridYZ.h:59
dd4hep::DDSegmentation::CellID
uint64_t CellID
Definition: BitFieldCoder.h:26
dd4hep::DDSegmentation::CartesianGridYZ::setFieldNameZ
void setFieldNameZ(const std::string &fieldName)
set the field name used for Z
Definition: CartesianGridYZ.h:87
dd4hep::DDSegmentation::CartesianGridYZ::offsetZ
double offsetZ() const
access the coordinate offset in Z
Definition: CartesianGridYZ.h:55
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::CartesianGridYZ::gridSizeZ
double gridSizeZ() const
access the grid size in Z
Definition: CartesianGridYZ.h:47
dd4hep::DDSegmentation::CartesianGridYZ
Segmentation base class describing cartesian grid segmentation in the Y-Z plane.
Definition: CartesianGridYZ.h:29
dd4hep::DDSegmentation::CartesianGridYZ::setGridSizeZ
void setGridSizeZ(double cellSize)
set the grid size in Z
Definition: CartesianGridYZ.h:71
dd4hep
Namespace for the AIDA detector description toolkit.
Definition: AlignmentsCalib.h:28
dd4hep::DDSegmentation::CartesianGridYZ::_offsetZ
double _offsetZ
the coordinate offset in Z
Definition: CartesianGridYZ.h:109
dd4hep::DDSegmentation::CartesianGridYZ::_yId
std::string _yId
the field name used for Y
Definition: CartesianGridYZ.h:111
dd4hep::DDSegmentation::CartesianGridYZ::_gridSizeZ
double _gridSizeZ
the grid size in Z
Definition: CartesianGridYZ.h:107
dd4hep::DDSegmentation::CartesianGridYZ::_gridSizeY
double _gridSizeY
the grid size in Y
Definition: CartesianGridYZ.h:103
dd4hep::DDSegmentation::CartesianGrid
Segmentation base class describing cartesian grid segmentation.
Definition: CartesianGrid.h:28
dd4hep::DDSegmentation::CartesianGridYZ::gridSizeY
double gridSizeY() const
access the grid size in Y
Definition: CartesianGridYZ.h:43