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 //==========================================================================
11 
12 #ifndef DDSEGMENTATION_GRIDPHIETA_H
13 #define DDSEGMENTATION_GRIDPHIETA_H
14 
16 
17 #include <cmath>
18 
26 namespace dd4hep {
27  namespace DDSegmentation {
28 
30  class GridPhiEta : public Segmentation {
31  public:
33  GridPhiEta(const std::string& aCellEncoding);
36 
38  virtual ~GridPhiEta() = default;
39 
45  virtual Vector3D position(const CellID& aCellID) const;
52  virtual CellID cellID(const Vector3D& aLocalPosition, const Vector3D& aGlobalPosition, const VolumeID& aVolumeID) const;
57  double eta(const CellID& aCellID) const;
62  double phi(const CellID& aCellID) const;
66  inline double gridSizeEta() const {
67  return m_gridSizeEta;
68  }
72  inline double gridSizePhi() const {
73  return 2 * M_PI / static_cast<double>(m_phiBins);
74  }
78  inline int phiBins() const {
79  return m_phiBins;
80  }
84  inline double offsetEta() const {
85  return m_offsetEta;
86  }
90  inline double offsetPhi() const {
91  return m_offsetPhi;
92  }
96  inline const std::string& fieldNameEta() const {
97  return m_etaID;
98  }
102  inline const std::string& fieldNamePhi() const {
103  return m_phiID;
104  }
108  void setGridSizeEta(double aCellSize) {
109  m_gridSizeEta = aCellSize;
110  }
114  inline void setPhiBins(int bins) {
115  m_phiBins = bins;
116  }
120  inline void setOffsetEta(double offset) {
121  m_offsetEta = offset;
122  }
126  inline void setOffsetPhi(double offset) {
127  m_offsetPhi = offset;
128  }
132  inline void setFieldNameEta(const std::string& fieldName) {
133  m_etaID = fieldName;
134  }
138  inline void setFieldNamePhi(const std::string& fieldName) {
139  m_phiID = fieldName;
140  }
141 
142  protected:
143 
149  double m_offsetEta;
151  double m_offsetPhi;
153  std::string m_etaID;
155  std::string m_phiID;
156  };
157  }
158 }
159 #endif // DDSEGMENTATION_GRIDPHIETA_H
dd4hep::DDSegmentation::GridPhiEta::setFieldNamePhi
void setFieldNamePhi(const std::string &fieldName)
Definition: GridPhiEta.h:138
dd4hep::DDSegmentation::VolumeID
uint64_t VolumeID
Definition: BitFieldCoder.h:27
dd4hep::DDSegmentation::GridPhiEta::m_phiID
std::string m_phiID
the field name used for phi
Definition: GridPhiEta.h:155
dd4hep::DDSegmentation::Vector3D
Simple container for a physics vector.
Definition: Segmentation.h:48
dd4hep::DDSegmentation::GridPhiEta::offsetEta
double offsetEta() const
Definition: GridPhiEta.h:84
M_PI
#define M_PI
Definition: Handle.h:33
dd4hep::DDSegmentation::GridPhiEta::gridSizePhi
double gridSizePhi() const
Definition: GridPhiEta.h:72
dd4hep::DDSegmentation::BitFieldCoder
Helper class for decoding and encoding a bit field of 64bits for convenient declaration.
Definition: BitFieldCoder.h:114
dd4hep::DDSegmentation::GridPhiEta::m_phiBins
int m_phiBins
the number of bins in phi
Definition: GridPhiEta.h:147
dd4hep::DDSegmentation::GridPhiEta::m_offsetEta
double m_offsetEta
the coordinate offset in eta
Definition: GridPhiEta.h:149
dd4hep::DDSegmentation::GridPhiEta::setOffsetPhi
void setOffsetPhi(double offset)
Definition: GridPhiEta.h:126
dd4hep::DDSegmentation::GridPhiEta::m_offsetPhi
double m_offsetPhi
the coordinate offset in phi
Definition: GridPhiEta.h:151
dd4hep::DDSegmentation::GridPhiEta::position
virtual Vector3D position(const CellID &aCellID) const
Definition: GridPhiEta.cpp:47
dd4hep::DDSegmentation::GridPhiEta::GridPhiEta
GridPhiEta(const std::string &aCellEncoding)
default constructor using an arbitrary type
Definition: GridPhiEta.cpp:17
dd4hep::DDSegmentation::GridPhiEta::setOffsetEta
void setOffsetEta(double offset)
Definition: GridPhiEta.h:120
dd4hep::DDSegmentation::GridPhiEta::fieldNamePhi
const std::string & fieldNamePhi() const
Definition: GridPhiEta.h:102
dd4hep::DDSegmentation::GridPhiEta::m_etaID
std::string m_etaID
the field name used for eta
Definition: GridPhiEta.h:153
dd4hep::DDSegmentation::Segmentation::decoder
virtual const BitFieldCoder * decoder() const
Access the underlying decoder.
Definition: Segmentation.h:112
dd4hep::DDSegmentation::GridPhiEta::fieldNameEta
const std::string & fieldNameEta() const
Definition: GridPhiEta.h:96
dd4hep::DDSegmentation::CellID
uint64_t CellID
Definition: BitFieldCoder.h:26
dd4hep::DDSegmentation::GridPhiEta::setPhiBins
void setPhiBins(int bins)
Definition: GridPhiEta.h:114
dd4hep::DDSegmentation::GridPhiEta::phiBins
int phiBins() const
Definition: GridPhiEta.h:78
dd4hep::DDSegmentation::GridPhiEta::eta
double eta(const CellID &aCellID) const
Definition: GridPhiEta.cpp:60
dd4hep::DDSegmentation::GridPhiEta::m_gridSizeEta
double m_gridSizeEta
the grid size in eta
Definition: GridPhiEta.h:145
dd4hep::DDSegmentation::GridPhiEta::setFieldNameEta
void setFieldNameEta(const std::string &fieldName)
Definition: GridPhiEta.h:132
dd4hep::DDSegmentation::GridPhiEta::gridSizeEta
double gridSizeEta() const
Definition: GridPhiEta.h:66
dd4hep::DDSegmentation::GridPhiEta::setGridSizeEta
void setGridSizeEta(double aCellSize)
Definition: GridPhiEta.h:108
dd4hep
Namespace for the AIDA detector description toolkit.
Definition: AlignmentsCalib.h:28
dd4hep::DDSegmentation::GridPhiEta
Segmentation class describing segmentation in Phi-Eta.
Definition: GridPhiEta.h:30
dd4hep::DDSegmentation::GridPhiEta::phi
double phi(const CellID &aCellID) const
Definition: GridPhiEta.cpp:64
Segmentation.h
dd4hep::DDSegmentation::GridPhiEta::~GridPhiEta
virtual ~GridPhiEta()=default
destructor
dd4hep::DDSegmentation::Segmentation
Base class for all segmentations.
Definition: Segmentation.h:75
dd4hep::DDSegmentation::GridPhiEta::offsetPhi
double offsetPhi() const
Definition: GridPhiEta.h:90
dd4hep::DDSegmentation::GridPhiEta::cellID
virtual CellID cellID(const Vector3D &aLocalPosition, const Vector3D &aGlobalPosition, const VolumeID &aVolumeID) const
Definition: GridPhiEta.cpp:51