DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
CartesianGridXZ.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  * CartesianGridXZ.h
13  *
14  * Created on: Jun 28, 2013
15  * Author: Christian Grefe, CERN
16  */
17 
18 #ifndef DDSEGMENTATION_CARTESIANGRIDXZ_H
19 #define DDSEGMENTATION_CARTESIANGRIDXZ_H
20 
22 
23 namespace dd4hep {
24  namespace DDSegmentation {
25 
28  public:
30  CartesianGridXZ(const std::string& cellEncoding);
34  virtual ~CartesianGridXZ();
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 gridSizeZ() const {
46  return _gridSizeZ;
47  }
49  double offsetX() const {
50  return _offsetX;
51  }
53  double offsetZ() const {
54  return _offsetZ;
55  }
57  const std::string& fieldNameX() const {
58  return _xId;
59  }
61  const std::string& fieldNameZ() const {
62  return _zId;
63  }
65  void setGridSizeX(double cellSize) {
66  _gridSizeX = cellSize;
67  }
69  void setGridSizeZ(double cellSize) {
70  _gridSizeZ = cellSize;
71  }
73  void setOffsetX(double offset) {
74  _offsetX = offset;
75  }
77  void setOffsetZ(double offset) {
78  _offsetZ = offset;
79  }
81  void setFieldNameX(const std::string& fieldName) {
82  _xId = fieldName;
83  }
85  void setFieldNameZ(const std::string& fieldName) {
86  _zId = fieldName;
87  }
97  virtual std::vector<double> cellDimensions(const CellID& cellID) const;
98 
99  protected:
101  double _gridSizeX;
103  double _offsetX;
105  double _gridSizeZ;
107  double _offsetZ;
109  std::string _xId;
111  std::string _zId;
112  };
113 
114  } /* namespace DDSegmentation */
115 } /* namespace dd4hep */
116 #endif // DDSEGMENTATION_CARTESIANGRIDXZ_H
dd4hep::DDSegmentation::CartesianGridXZ::setFieldNameX
void setFieldNameX(const std::string &fieldName)
set the field name used for X
Definition: CartesianGridXZ.h:81
dd4hep::DDSegmentation::VolumeID
uint64_t VolumeID
Definition: BitFieldCoder.h:27
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::CartesianGridXZ::offsetZ
double offsetZ() const
access the coordinate offset in Z
Definition: CartesianGridXZ.h:53
dd4hep::DDSegmentation::CartesianGridXZ::fieldNameX
const std::string & fieldNameX() const
access the field name used for X
Definition: CartesianGridXZ.h:57
dd4hep::DDSegmentation::CartesianGridXZ::offsetX
double offsetX() const
access the coordinate offset in X
Definition: CartesianGridXZ.h:49
dd4hep::DDSegmentation::CartesianGridXZ::_gridSizeX
double _gridSizeX
the grid size in X
Definition: CartesianGridXZ.h:101
dd4hep::DDSegmentation::CartesianGridXZ::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: CartesianGridXZ.cpp:78
dd4hep::DDSegmentation::CartesianGridXZ
Segmentation base class describing cartesian grid segmentation in the X-Z plane.
Definition: CartesianGridXZ.h:27
dd4hep::DDSegmentation::CartesianGridXZ::gridSizeX
double gridSizeX() const
access the grid size in X
Definition: CartesianGridXZ.h:41
dd4hep::DDSegmentation::CartesianGridXZ::setGridSizeZ
void setGridSizeZ(double cellSize)
set the grid size in Z
Definition: CartesianGridXZ.h:69
dd4hep::DDSegmentation::CartesianGridXZ::_gridSizeZ
double _gridSizeZ
the grid size in Z
Definition: CartesianGridXZ.h:105
dd4hep::DDSegmentation::CartesianGridXZ::position
virtual Vector3D position(const CellID &cellID) const
determine the local based on the cell ID
Definition: CartesianGridXZ.cpp:62
CartesianGrid.h
dd4hep::DDSegmentation::CartesianGridXZ::gridSizeZ
double gridSizeZ() const
access the grid size in Z
Definition: CartesianGridXZ.h:45
dd4hep::DDSegmentation::CartesianGridXZ::_zId
std::string _zId
the field name used for Z
Definition: CartesianGridXZ.h:111
dd4hep::DDSegmentation::Segmentation::decoder
virtual const BitFieldCoder * decoder() const
Access the underlying decoder.
Definition: Segmentation.h:112
dd4hep::DDSegmentation::CartesianGridXZ::_offsetZ
double _offsetZ
the coordinate offset in Z
Definition: CartesianGridXZ.h:107
dd4hep::DDSegmentation::CartesianGridXZ::CartesianGridXZ
CartesianGridXZ(const std::string &cellEncoding)
default constructor using an arbitrary type
Definition: CartesianGridXZ.cpp:25
dd4hep::DDSegmentation::CellID
uint64_t CellID
Definition: BitFieldCoder.h:26
dd4hep::DDSegmentation::CartesianGridXZ::setOffsetZ
void setOffsetZ(double offset)
set the coordinate offset in Z
Definition: CartesianGridXZ.h:77
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::CartesianGridXZ::fieldNameZ
const std::string & fieldNameZ() const
access the field name used for Z
Definition: CartesianGridXZ.h:61
dd4hep::DDSegmentation::CartesianGridXZ::setOffsetX
void setOffsetX(double offset)
set the coordinate offset in X
Definition: CartesianGridXZ.h:73
dd4hep::DDSegmentation::CartesianGridXZ::setGridSizeX
void setGridSizeX(double cellSize)
set the grid size in X
Definition: CartesianGridXZ.h:65
dd4hep
Namespace for the AIDA detector description toolkit.
Definition: AlignmentsCalib.h:28
dd4hep::DDSegmentation::CartesianGridXZ::_offsetX
double _offsetX
the coordinate offset in X
Definition: CartesianGridXZ.h:103
dd4hep::DDSegmentation::CartesianGridXZ::cellID
virtual CellID cellID(const Vector3D &localPosition, const Vector3D &globalPosition, const VolumeID &volumeID) const
determine the cell ID based on the position
Definition: CartesianGridXZ.cpp:71
dd4hep::DDSegmentation::CartesianGridXZ::setFieldNameZ
void setFieldNameZ(const std::string &fieldName)
set the field name used for Y
Definition: CartesianGridXZ.h:85
dd4hep::DDSegmentation::CartesianGridXZ::_xId
std::string _xId
the field name used for X
Definition: CartesianGridXZ.h:109
dd4hep::DDSegmentation::CartesianGridXZ::~CartesianGridXZ
virtual ~CartesianGridXZ()
destructor
Definition: CartesianGridXZ.cpp:57
dd4hep::DDSegmentation::CartesianGrid
Segmentation base class describing cartesian grid segmentation.
Definition: CartesianGrid.h:28