DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
CartesianGridXY.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  * CartesianGridXY.h
13  *
14  * Created on: Jun 28, 2013
15  * Author: Christian Grefe, CERN
16  */
17 
18 #ifndef DDSEGMENTATION_CARTESIANGRIDXY_H
19 #define DDSEGMENTATION_CARTESIANGRIDXY_H
20 
22 
23 namespace dd4hep {
24  namespace DDSegmentation {
25 
28  public:
30  CartesianGridXY(const std::string& cellEncoding = "");
34  virtual ~CartesianGridXY();
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  void setGridSizeX(double cellSize) {
66  _gridSizeX = cellSize;
67  }
69  void setGridSizeY(double cellSize) {
70  _gridSizeY = cellSize;
71  }
73  void setOffsetX(double offset) {
74  _offsetX = offset;
75  }
77  void setOffsetY(double offset) {
78  _offsetY = offset;
79  }
81  void setFieldNameX(const std::string& fieldName) {
82  _xId = fieldName;
83  }
85  void setFieldNameY(const std::string& fieldName) {
86  _yId = fieldName;
87  }
97  virtual std::vector<double> cellDimensions(const CellID& cellID) const;
98 
99  protected:
101  double _gridSizeX;
103  double _offsetX;
105  double _gridSizeY;
107  double _offsetY;
109  std::string _xId;
111  std::string _yId;
112  };
113 
114  } /* namespace DDSegmentation */
115 } /* namespace dd4hep */
116 #endif // DDSEGMENTATION_CARTESIANGRIDXY_H
dd4hep::DDSegmentation::VolumeID
uint64_t VolumeID
Definition: BitFieldCoder.h:27
dd4hep::DDSegmentation::CartesianGridXY::gridSizeX
double gridSizeX() const
access the grid size in X
Definition: CartesianGridXY.h:41
dd4hep::DDSegmentation::CartesianGridXY::_offsetY
double _offsetY
the coordinate offset in Y
Definition: CartesianGridXY.h:107
dd4hep::DDSegmentation::CartesianGridXY::~CartesianGridXY
virtual ~CartesianGridXY()
destructor
Definition: CartesianGridXY.cpp:57
dd4hep::DDSegmentation::CartesianGridXY
Segmentation base class describing cartesian grid segmentation in the X-Y plane.
Definition: CartesianGridXY.h:27
dd4hep::DDSegmentation::CartesianGridXY::_yId
std::string _yId
the field name used for Y
Definition: CartesianGridXY.h:111
dd4hep::DDSegmentation::Vector3D
Simple container for a physics vector.
Definition: Segmentation.h:48
dd4hep::DDSegmentation::CartesianGridXY::position
virtual Vector3D position(const CellID &cellID) const
determine the position based on the cell ID
Definition: CartesianGridXY.cpp:62
dd4hep::DDSegmentation::CartesianGridXY::offsetX
double offsetX() const
access the coordinate offset in X
Definition: CartesianGridXY.h:49
dd4hep::DDSegmentation::CartesianGridXY::_gridSizeY
double _gridSizeY
the grid size in Y
Definition: CartesianGridXY.h:105
dd4hep::DDSegmentation::BitFieldCoder
Helper class for decoding and encoding a bit field of 64bits for convenient declaration.
Definition: BitFieldCoder.h:114
dd4hep::DDSegmentation::CartesianGridXY::offsetY
double offsetY() const
access the coordinate offset in Y
Definition: CartesianGridXY.h:53
dd4hep::DDSegmentation::CartesianGridXY::setGridSizeX
void setGridSizeX(double cellSize)
set the grid size in X
Definition: CartesianGridXY.h:65
dd4hep::DDSegmentation::CartesianGridXY::_offsetX
double _offsetX
the coordinate offset in X
Definition: CartesianGridXY.h:103
dd4hep::DDSegmentation::CartesianGridXY::fieldNameX
const std::string & fieldNameX() const
access the field name used for X
Definition: CartesianGridXY.h:57
dd4hep::DDSegmentation::CartesianGridXY::setOffsetY
void setOffsetY(double offset)
set the coordinate offset in Y
Definition: CartesianGridXY.h:77
CartesianGrid.h
dd4hep::DDSegmentation::CartesianGridXY::setGridSizeY
void setGridSizeY(double cellSize)
set the grid size in Y
Definition: CartesianGridXY.h:69
dd4hep::DDSegmentation::Segmentation::decoder
virtual const BitFieldCoder * decoder() const
Access the underlying decoder.
Definition: Segmentation.h:112
dd4hep::DDSegmentation::CellID
uint64_t CellID
Definition: BitFieldCoder.h:26
dd4hep::DDSegmentation::CartesianGridXY::setOffsetX
void setOffsetX(double offset)
set the coordinate offset in X
Definition: CartesianGridXY.h:73
dd4hep::DDSegmentation::CartesianGridXY::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: CartesianGridXY.cpp:79
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::CartesianGridXY::setFieldNameY
void setFieldNameY(const std::string &fieldName)
set the field name used for Y
Definition: CartesianGridXY.h:85
dd4hep::DDSegmentation::CartesianGridXY::cellID
virtual CellID cellID(const Vector3D &localPosition, const Vector3D &globalPosition, const VolumeID &volumeID) const
determine the cell ID based on the position
Definition: CartesianGridXY.cpp:70
dd4hep::DDSegmentation::CartesianGridXY::fieldNameY
const std::string & fieldNameY() const
access the field name used for Y
Definition: CartesianGridXY.h:61
dd4hep
Namespace for the AIDA detector description toolkit.
Definition: AlignmentsCalib.h:28
dd4hep::DDSegmentation::CartesianGridXY::_gridSizeX
double _gridSizeX
the grid size in X
Definition: CartesianGridXY.h:101
dd4hep::DDSegmentation::CartesianGridXY::gridSizeY
double gridSizeY() const
access the grid size in Y
Definition: CartesianGridXY.h:45
dd4hep::DDSegmentation::CartesianGridXY::setFieldNameX
void setFieldNameX(const std::string &fieldName)
set the field name used for X
Definition: CartesianGridXY.h:81
dd4hep::DDSegmentation::CartesianGridXY::CartesianGridXY
CartesianGridXY(const std::string &cellEncoding="")
Default constructor passing the encoding string.
Definition: CartesianGridXY.cpp:24
dd4hep::DDSegmentation::CartesianGridXY::_xId
std::string _xId
the field name used for X
Definition: CartesianGridXY.h:109
dd4hep::DDSegmentation::CartesianGrid
Segmentation base class describing cartesian grid segmentation.
Definition: CartesianGrid.h:28