DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
CartesianGridXYZ.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  * CartesianGridXYZ.h
13  *
14  * Created on: Jun 28, 2013
15  * Author: Christian Grefe, CERN
16  */
17 
18 #ifndef DDSEGMENTATION_CARTESIANGRIDXYZ_H
19 #define DDSEGMENTATION_CARTESIANGRIDXYZ_H
20 
22 
23 namespace dd4hep {
24  namespace DDSegmentation {
25 
28  public:
30  CartesianGridXYZ(const std::string& cellEncoding);
34  virtual ~CartesianGridXYZ();
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 gridSizeZ() const {
42  return _gridSizeZ;
43  }
45  double offsetZ() const {
46  return _offsetZ;
47  }
49  const std::string& fieldNameZ() const {
50  return _zId;
51  }
53  void setGridSizeZ(double cellSize) {
54  _gridSizeZ = cellSize;
55  }
57  void setOffsetZ(double offset) {
58  _offsetZ = offset;
59  }
61  void setFieldNameZ(const std::string& fieldName) {
62  _zId = fieldName;
63  }
74  virtual std::vector<double> cellDimensions(const CellID& cellID) const;
75 
76  protected:
78  double _gridSizeZ;
80  double _offsetZ;
82  std::string _zId;
83  };
84 
85  } /* namespace DDSegmentation */
86 } /* namespace dd4hep */
87 #endif // DDSEGMENTATION_CARTESIANGRIDXYZ_H
dd4hep::DDSegmentation::VolumeID
uint64_t VolumeID
Definition: BitFieldCoder.h:27
dd4hep::DDSegmentation::CartesianGridXYZ::position
virtual Vector3D position(const CellID &cellID) const
determine the position based on the cell ID
Definition: CartesianGridXYZ.cpp:55
dd4hep::DDSegmentation::CartesianGridXY
Segmentation base class describing cartesian grid segmentation in the X-Y plane.
Definition: CartesianGridXY.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::CartesianGridXYZ::CartesianGridXYZ
CartesianGridXYZ(const std::string &cellEncoding)
default constructor using an arbitrary type
Definition: CartesianGridXYZ.cpp:24
CartesianGridXY.h
dd4hep::DDSegmentation::CartesianGridXYZ::setGridSizeZ
void setGridSizeZ(double cellSize)
set the grid size in Z
Definition: CartesianGridXYZ.h:53
dd4hep::DDSegmentation::CartesianGridXYZ::_offsetZ
double _offsetZ
the coordinate offset in Z
Definition: CartesianGridXYZ.h:80
dd4hep::DDSegmentation::Segmentation::decoder
virtual const BitFieldCoder * decoder() const
Access the underlying decoder.
Definition: Segmentation.h:112
dd4hep::DDSegmentation::CartesianGridXYZ
Segmentation base class describing cartesian grid segmentation in space.
Definition: CartesianGridXYZ.h:27
dd4hep::DDSegmentation::CartesianGridXYZ::setOffsetZ
void setOffsetZ(double offset)
set the coordinate offset in Z
Definition: CartesianGridXYZ.h:57
dd4hep::DDSegmentation::CellID
uint64_t CellID
Definition: BitFieldCoder.h:26
dd4hep::DDSegmentation::CartesianGridXYZ::cellID
virtual CellID cellID(const Vector3D &localPosition, const Vector3D &globalPosition, const VolumeID &volumeID) const
determine the cell ID based on the position
Definition: CartesianGridXYZ.cpp:64
dd4hep::DDSegmentation::CartesianGridXYZ::_zId
std::string _zId
the field name used for Z
Definition: CartesianGridXYZ.h:82
dd4hep::DDSegmentation::CartesianGridXYZ::~CartesianGridXYZ
virtual ~CartesianGridXYZ()
destructor
Definition: CartesianGridXYZ.cpp:50
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
Namespace for the AIDA detector description toolkit.
Definition: AlignmentsCalib.h:28
dd4hep::DDSegmentation::CartesianGridXYZ::_gridSizeZ
double _gridSizeZ
the grid size in Z
Definition: CartesianGridXYZ.h:78
dd4hep::DDSegmentation::CartesianGridXYZ::fieldNameZ
const std::string & fieldNameZ() const
access the field name used for Z
Definition: CartesianGridXYZ.h:49
dd4hep::DDSegmentation::CartesianGridXYZ::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: CartesianGridXYZ.cpp:72
dd4hep::DDSegmentation::CartesianGridXYZ::offsetZ
double offsetZ() const
access the coordinate offset in Z
Definition: CartesianGridXYZ.h:45
dd4hep::DDSegmentation::CartesianGridXYZ::setFieldNameZ
void setFieldNameZ(const std::string &fieldName)
set the field name used for Z
Definition: CartesianGridXYZ.h:61
dd4hep::DDSegmentation::CartesianGridXYZ::gridSizeZ
double gridSizeZ() const
access the grid size in Z
Definition: CartesianGridXYZ.h:41