DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
CartesianGridUV.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  * CartesianGridUV.h
13  *
14  * Created on: December 5, 2024
15  * Author: Yann Bedfer, ePIC/Saclay
16  */
17 
18 #ifndef DDSEGMENTATION_CARTESIANGRIDUV_H
19 #define DDSEGMENTATION_CARTESIANGRIDUV_H
20 
22 
23 namespace dd4hep {
24  namespace DDSegmentation {
25 
28  public:
30  CartesianGridUV(const std::string& cellEncoding = "");
34  virtual ~CartesianGridUV();
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 gridSizeU() const {
42  return _gridSizeU;
43  }
45  double gridSizeV() const {
46  return _gridSizeV;
47  }
49  double offsetU() const {
50  return _offsetU;
51  }
53  double offsetV() const {
54  return _offsetV;
55  }
57  double gridAngle() const {
58  return _gridAngle;
59  }
61  const std::string& fieldNameU() const {
62  return _uId;
63  }
65  const std::string& fieldNameV() const {
66  return _vId;
67  }
69  void setGridSizeU(double cellSize) {
70  _gridSizeU = cellSize;
71  }
73  void setGridSizeV(double cellSize) {
74  _gridSizeV = cellSize;
75  }
77  void setOffsetU(double offset) {
78  _offsetU = offset;
79  }
81  void setOffsetV(double offset) {
82  _offsetV = offset;
83  }
85  void setGridAngle(double angle) {
86  _gridAngle = angle;
87  }
89  void setFieldNameU(const std::string& fieldName) {
90  _uId = fieldName;
91  }
93  void setFieldNameV(const std::string& fieldName) {
94  _vId = fieldName;
95  }
105  virtual std::vector<double> cellDimensions(const CellID& cellID) const;
106 
107  protected:
109  double _gridSizeU;
111  double _offsetU;
113  double _gridSizeV;
115  double _offsetV;
117  std::string _uId;
119  std::string _vId;
121  double _gridAngle;
122  };
123 
124  } /* namespace DDSegmentation */
125 } /* namespace dd4hep */
126 #endif // DDSEGMENTATION_CARTESIANGRIDUV_H
dd4hep::DDSegmentation::CartesianGridUV::cellID
virtual CellID cellID(const Vector3D &localPosition, const Vector3D &globalPosition, const VolumeID &volumeID) const
determine the cell ID based on the position
Definition: CartesianGridUV.cpp:74
dd4hep::DDSegmentation::VolumeID
uint64_t VolumeID
Definition: BitFieldCoder.h:27
dd4hep::DDSegmentation::CartesianGridUV::gridSizeU
double gridSizeU() const
access the grid size in U
Definition: CartesianGridUV.h:41
dd4hep::DDSegmentation::CartesianGridUV::setGridAngle
void setGridAngle(double angle)
set the rotation angle
Definition: CartesianGridUV.h:85
dd4hep::DDSegmentation::CartesianGridUV::setGridSizeU
void setGridSizeU(double cellSize)
set the grid size in U
Definition: CartesianGridUV.h:69
dd4hep::DDSegmentation::CartesianGridUV::setGridSizeV
void setGridSizeV(double cellSize)
set the grid size in V
Definition: CartesianGridUV.h:73
dd4hep::DDSegmentation::Vector3D
Simple container for a physics vector.
Definition: Segmentation.h:48
dd4hep::DDSegmentation::CartesianGridUV::setOffsetV
void setOffsetV(double offset)
set the coordinate offset in V
Definition: CartesianGridUV.h:81
dd4hep::DDSegmentation::BitFieldCoder
Helper class for decoding and encoding a bit field of 64bits for convenient declaration.
Definition: BitFieldCoder.h:114
dd4hep::DDSegmentation::CartesianGridUV::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: CartesianGridUV.cpp:84
dd4hep::DDSegmentation::CartesianGridUV::fieldNameU
const std::string & fieldNameU() const
access the field name used for U
Definition: CartesianGridUV.h:61
dd4hep::DDSegmentation::CartesianGridUV::offsetV
double offsetV() const
access the coordinate offset in V
Definition: CartesianGridUV.h:53
dd4hep::DDSegmentation::CartesianGridUV::setFieldNameU
void setFieldNameU(const std::string &fieldName)
set the field name used for U
Definition: CartesianGridUV.h:89
dd4hep::DDSegmentation::CartesianGridUV::_gridSizeU
double _gridSizeU
the grid size in U
Definition: CartesianGridUV.h:109
dd4hep::DDSegmentation::CartesianGridUV::offsetU
double offsetU() const
access the coordinate offset in U
Definition: CartesianGridUV.h:49
dd4hep::DDSegmentation::CartesianGridUV::_uId
std::string _uId
the field name used for U
Definition: CartesianGridUV.h:117
dd4hep::DDSegmentation::CartesianGridUV::setFieldNameV
void setFieldNameV(const std::string &fieldName)
set the field name used for V
Definition: CartesianGridUV.h:93
CartesianGrid.h
dd4hep::DDSegmentation::CartesianGridUV::position
virtual Vector3D position(const CellID &cellID) const
determine the position based on the cell ID
Definition: CartesianGridUV.cpp:65
dd4hep::DDSegmentation::CartesianGridUV::_offsetU
double _offsetU
the coordinate offset in U
Definition: CartesianGridUV.h:111
dd4hep::DDSegmentation::Segmentation::decoder
virtual const BitFieldCoder * decoder() const
Access the underlying decoder.
Definition: Segmentation.h:112
dd4hep::DDSegmentation::CartesianGridUV::_vId
std::string _vId
the field name used for V
Definition: CartesianGridUV.h:119
dd4hep::DDSegmentation::CellID
uint64_t CellID
Definition: BitFieldCoder.h:26
dd4hep::DDSegmentation::CartesianGridUV::~CartesianGridUV
virtual ~CartesianGridUV()
destructor
Definition: CartesianGridUV.cpp:60
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::CartesianGridUV
Segmentation base class describing cartesian grid segmentation in along U,V rotated some angle from l...
Definition: CartesianGridUV.h:27
dd4hep::DDSegmentation::CartesianGridUV::_gridAngle
double _gridAngle
the U grid angle
Definition: CartesianGridUV.h:121
dd4hep::DDSegmentation::CartesianGridUV::_gridSizeV
double _gridSizeV
the grid size in V
Definition: CartesianGridUV.h:113
dd4hep
Namespace for the AIDA detector description toolkit.
Definition: AlignmentsCalib.h:28
dd4hep::DDSegmentation::CartesianGridUV::_offsetV
double _offsetV
the coordinate offset in V
Definition: CartesianGridUV.h:115
dd4hep::DDSegmentation::CartesianGridUV::gridAngle
double gridAngle() const
access the rotation angle
Definition: CartesianGridUV.h:57
dd4hep::DDSegmentation::CartesianGridUV::CartesianGridUV
CartesianGridUV(const std::string &cellEncoding="")
Default constructor passing the encoding string.
Definition: CartesianGridUV.cpp:25
dd4hep::DDSegmentation::CartesianGridUV::setOffsetU
void setOffsetU(double offset)
set the coordinate offset in U
Definition: CartesianGridUV.h:77
dd4hep::DDSegmentation::CartesianGridUV::gridSizeV
double gridSizeV() const
access the grid size in V
Definition: CartesianGridUV.h:45
dd4hep::DDSegmentation::CartesianGridUV::fieldNameV
const std::string & fieldNameV() const
access the field name used for V
Definition: CartesianGridUV.h:65
dd4hep::DDSegmentation::CartesianGrid
Segmentation base class describing cartesian grid segmentation.
Definition: CartesianGrid.h:28