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 // \author Markus Frank
11 // \date 2016-10-18
12 // \version 1.0
13 //
14 //==========================================================================
15 #ifndef DD4HEP_CARTESIANGRIDXY_H
16 #define DD4HEP_CARTESIANGRIDXY_H 1
17 
18 // Framework include files
19 #include <DD4hep/Segmentations.h>
20 
22 namespace dd4hep {
23 
25  namespace DDSegmentation { class CartesianGridXY; }
26 
29 
31 
52  public:
54  CartesianGridXY() = default;
56  CartesianGridXY(const CartesianGridXY& e) = default;
62  template <typename Q> CartesianGridXY(const Handle<Q>& e) : Handle<Object>(e) { }
64  CartesianGridXY& operator=(const CartesianGridXY& seg) = default;
66  bool operator==(const CartesianGridXY& seg) const {
67  return m_element == seg.m_element;
68  }
69 
71  Position position(const CellID& cellID) const;
73  CellID cellID(const Position& local, const Position& global, const VolumeID& volID) const;
75  double gridSizeX() const;
77  double gridSizeY() const;
79  void setGridSizeX(double cellSize) const;
81  void setGridSizeY(double cellSize) const;
83  double offsetX() const;
85  double offsetY() const;
87  void setOffsetX(double offset) const;
89  void setOffsetY(double offset) const;
91  const std::string& fieldNameX() const;
93  const std::string& fieldNameY() const;
103  std::vector<double> cellDimensions(const CellID& cellID) const;
104  };
105 
106 } /* End namespace dd4hep */
107 #endif // DD4HEP_CARTESIANGRIDXY_H
dd4hep::CartesianGridXY::setOffsetX
void setOffsetX(double offset) const
set the coordinate offset in X
Definition: CartesianGridXY.cpp:64
Segmentations.h
dd4hep::CartesianGridXY::operator=
CartesianGridXY & operator=(const CartesianGridXY &seg)=default
Assignment operator.
dd4hep::DDSegmentation::CartesianGridXY
Segmentation base class describing cartesian grid segmentation in the X-Y plane.
Definition: CartesianGridXY.h:27
dd4hep::CartesianGridXY::CartesianGridXY
CartesianGridXY(const Handle< Object > &e)
Copy constructor from handle.
Definition: CartesianGridXY.h:60
dd4hep::Handle::Object
T Object
Extern accessible definition of the contained element type.
Definition: Handle.h:88
dd4hep::CartesianGridXY::setGridSizeX
void setGridSizeX(double cellSize) const
set the grid size in X
Definition: CartesianGridXY.cpp:44
dd4hep::CartesianGridXY::position
Position position(const CellID &cellID) const
determine the position based on the cell ID
Definition: CartesianGridXY.cpp:21
dd4hep::Handle
Handle: a templated class like a shared pointer, which allows specialized access to tgeometry objects...
Definition: Handle.h:84
dd4hep::CartesianGridXY::operator==
bool operator==(const CartesianGridXY &seg) const
Equality operator.
Definition: CartesianGridXY.h:66
dd4hep::CartesianGridXY::cellDimensions
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:84
dd4hep::CartesianGridXY::CartesianGridXY
CartesianGridXY()=default
Default constructor.
dd4hep::CartesianGridXY::fieldNameY
const std::string & fieldNameY() const
access the field name used for Y
Definition: CartesianGridXY.cpp:79
dd4hep::CartesianGridXY::setGridSizeY
void setGridSizeY(double cellSize) const
set the grid size in Y
Definition: CartesianGridXY.cpp:49
dd4hep::CartesianGridXY::CartesianGridXY
CartesianGridXY(const Handle< Q > &e)
Copy constructor from other equivalent handle.
Definition: CartesianGridXY.h:62
dd4hep::CartesianGridXY::CartesianGridXY
CartesianGridXY(const Segmentation &e)
Copy Constructor from segmentation base object.
Definition: CartesianGridXY.h:58
dd4hep::CartesianGridXY::offsetY
double offsetY() const
access the coordinate offset in Y
Definition: CartesianGridXY.cpp:59
dd4hep::Handle::m_element
T * m_element
Single and only data member: Reference to the actual element.
Definition: Handle.h:93
dd4hep::CartesianGridXY::cellID
CellID cellID(const Position &local, const Position &global, const VolumeID &volID) const
determine the cell ID based on the position
Definition: CartesianGridXY.cpp:26
dd4hep::CartesianGridXY::gridSizeX
double gridSizeX() const
access the grid size in X
Definition: CartesianGridXY.cpp:34
dd4hep::CartesianGridXYHandle
Handle< SegmentationWrapper< DDSegmentation::CartesianGridXY > > CartesianGridXYHandle
We need some abbreviation to make the code more readable.
Definition: CartesianGridXY.h:28
dd4hep::CartesianGridXY::fieldNameX
const std::string & fieldNameX() const
access the field name used for X
Definition: CartesianGridXY.cpp:74
dd4hep::CartesianGridXY::gridSizeY
double gridSizeY() const
access the grid size in Y
Definition: CartesianGridXY.cpp:39
dd4hep::Position
ROOT::Math::XYZVector Position
Definition: Objects.h:81
dd4hep::CartesianGridXY::CartesianGridXY
CartesianGridXY(const CartesianGridXY &e)=default
Copy constructor.
VolumeID
dd4hep::DDSegmentation::VolumeID VolumeID
Definition: SegmentationDictionary.h:49
dd4hep
Namespace for the AIDA detector description toolkit.
Definition: AlignmentsCalib.h:28
dd4hep::Segmentation
Handle class supporting generic Segmentations of sensitive detectors.
Definition: Segmentations.h:41
dd4hep::CartesianGridXY::setOffsetY
void setOffsetY(double offset) const
set the coordinate offset in Y
Definition: CartesianGridXY.cpp:69
dd4hep::CartesianGridXY::offsetX
double offsetX() const
access the coordinate offset in X
Definition: CartesianGridXY.cpp:54
dd4hep::CartesianGridXY
Implementation class for the grid XY segmentation.
Definition: CartesianGridXY.h:51
CellID
dd4hep::DDSegmentation::CellID CellID
Definition: SegmentationDictionary.h:50