DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
GridPhiEta.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 A. Zaborowska
11 // \date 2016-10-18
12 // \version 1.0
13 //
14 //==========================================================================
15 #ifndef DD4HEP_GRIDPHIETA_H
16 #define DD4HEP_GRIDPHIETA_H 1
17 
18 // Framework includes
20 #include <DD4hep/Segmentations.h>
21 
23 namespace dd4hep {
24 
27 
29 
48  class GridPhiEta : public GridPhiEtaHandle {
49  public:
51  GridPhiEta() = default;
53  GridPhiEta(const GridPhiEta& e) = default;
55  GridPhiEta(const Segmentation& e) : Handle<Object>(e) {}
59  template <typename Q>
60  GridPhiEta(const Handle<Q>& e) : Handle<Object>(e) {}
62  GridPhiEta& operator=(const GridPhiEta& seg) = default;
64  bool operator==(const GridPhiEta& seg) const { return m_element == seg.m_element; }
66  inline Position position(const CellID& id) const { return Position(access()->implementation->position(id)); }
67 
69  inline dd4hep::CellID cellID(const Position& local, const Position& global, const VolumeID& volID) const {
70  return access()->implementation->cellID(local, global, volID);
71  }
72 
74  inline double gridSizeEta() const { return access()->implementation->gridSizeEta(); }
75 
77  inline int phiBins() const { return access()->implementation->phiBins(); }
78 
80  inline double offsetEta() const { return access()->implementation->offsetEta(); }
81 
83  inline double offsetPhi() const { return access()->implementation->offsetPhi(); }
84 
86  inline void setOffsetEta(double offset) const { access()->implementation->setOffsetEta(offset); }
87 
89  inline void setOffsetPhi(double offset) const { access()->implementation->setOffsetPhi(offset); }
90 
92  inline void setGridSizeEta(double cellSize) const { access()->implementation->setGridSizeEta(cellSize); }
93 
95  inline void setPhiBins(int cellSize) const { access()->implementation->setPhiBins(cellSize); }
96 
98  inline const std::string& fieldNameEta() const { return access()->implementation->fieldNameEta(); }
99 
101  inline const std::string& fieldNamePhi() const { return access()->implementation->fieldNamePhi(); }
102 
112  inline std::vector<double> cellDimensions(const CellID& /*id*/) const {
113  return {access()->implementation->gridSizePhi(), access()->implementation->gridSizeEta()};
114  }
115  };
116 } /* End namespace dd4hep */
117 #endif // DD4HEP_GRIDPHIETA_H
dd4hep::GridPhiEta::operator==
bool operator==(const GridPhiEta &seg) const
Equality operator.
Definition: GridPhiEta.h:64
Segmentations.h
dd4hep::Handle::Object
T Object
Extern accessible definition of the contained element type.
Definition: Handle.h:88
dd4hep::GridPhiEta::setPhiBins
void setPhiBins(int cellSize) const
set the grid size in Phi
Definition: GridPhiEta.h:95
dd4hep::Handle
Handle: a templated class like a shared pointer, which allows specialized access to tgeometry objects...
Definition: Handle.h:84
dd4hep::GridPhiEta::offsetEta
double offsetEta() const
access the coordinate offset in Eta
Definition: GridPhiEta.h:80
dd4hep::GridPhiEta::setGridSizeEta
void setGridSizeEta(double cellSize) const
set the grid size in Eta
Definition: GridPhiEta.h:92
dd4hep::GridPhiEta::GridPhiEta
GridPhiEta(const Handle< Object > &e)
Copy constructor from handle.
Definition: GridPhiEta.h:57
dd4hep::GridPhiEta::phiBins
int phiBins() const
access the grid size in Phi
Definition: GridPhiEta.h:77
dd4hep::GridPhiEta::setOffsetEta
void setOffsetEta(double offset) const
set the coordinate offset in Eta
Definition: GridPhiEta.h:86
dd4hep::GridPhiEta::setOffsetPhi
void setOffsetPhi(double offset) const
set the coordinate offset in Phi
Definition: GridPhiEta.h:89
GridPhiEta.h
dd4hep::GridPhiEta::GridPhiEta
GridPhiEta(const Handle< Q > &e)
Copy constructor from other polymorph/equivalent handle.
Definition: GridPhiEta.h:60
dd4hep::GridPhiEta::fieldNameEta
const std::string & fieldNameEta() const
access the field name used for Eta
Definition: GridPhiEta.h:98
dd4hep::GridPhiEta::operator=
GridPhiEta & operator=(const GridPhiEta &seg)=default
Assignment operator.
dd4hep::Handle::m_element
T * m_element
Single and only data member: Reference to the actual element.
Definition: Handle.h:93
dd4hep::GridPhiEta::cellID
dd4hep::CellID cellID(const Position &local, const Position &global, const VolumeID &volID) const
determine the cell ID based on the position
Definition: GridPhiEta.h:69
dd4hep::Position
ROOT::Math::XYZVector Position
Definition: Objects.h:81
VolumeID
dd4hep::DDSegmentation::VolumeID VolumeID
Definition: SegmentationDictionary.h:50
dd4hep::Handle::access
T * access() const
Checked object access. Throws invalid handle runtime exception if invalid handle.
dd4hep::GridPhiEta::cellDimensions
std::vector< double > cellDimensions(const CellID &) const
Returns a std::vector<double> of the cellDimensions of the given cell ID in natural order of dimensio...
Definition: GridPhiEta.h:112
dd4hep::GridPhiEta::offsetPhi
double offsetPhi() const
access the coordinate offset in Phi
Definition: GridPhiEta.h:83
dd4hep
Namespace for the AIDA detector description toolkit.
Definition: AlignmentsCalib.h:28
dd4hep::GridPhiEta::GridPhiEta
GridPhiEta(const GridPhiEta &e)=default
Copy constructor.
dd4hep::GridPhiEta
Implementation class for the grid phi-eta segmentation.
Definition: GridPhiEta.h:48
dd4hep::Segmentation
Handle class supporting generic Segmentations of sensitive detectors.
Definition: Segmentations.h:41
dd4hep::GridPhiEta::fieldNamePhi
const std::string & fieldNamePhi() const
access the field name used for Phi
Definition: GridPhiEta.h:101
dd4hep::GridPhiEta::GridPhiEta
GridPhiEta()=default
Default constructor.
dd4hep::GridPhiEta::gridSizeEta
double gridSizeEta() const
access the grid size in Eta
Definition: GridPhiEta.h:74
dd4hep::GridPhiEta::position
Position position(const CellID &id) const
determine the position based on the cell ID
Definition: GridPhiEta.h:66
dd4hep::GridPhiEtaHandle
Handle< SegmentationWrapper< DDSegmentation::GridPhiEta > > GridPhiEtaHandle
We need some abbreviation to make the code more readable.
Definition: GridPhiEta.h:26
dd4hep::GridPhiEta::GridPhiEta
GridPhiEta(const Segmentation &e)
Copy Constructor from segmentation base object.
Definition: GridPhiEta.h:55
CellID
dd4hep::DDSegmentation::CellID CellID
Definition: SegmentationDictionary.h:51