DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
PolarGridRPhi2.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 /*
13  * PolarGridRPhi2.h
14  *
15  * Created on: Sept 13, 2014
16  * Author: Marko Petric
17  */
18 
19 #ifndef DDSEGMENTATION_POLARGRIDRPHI2_H
20 #define DDSEGMENTATION_POLARGRIDRPHI2_H
21 
23 #include <cmath>
24 #include <vector>
25 
26 namespace dd4hep {
27  namespace DDSegmentation {
28 
29 
31 
57  class PolarGridRPhi2: public PolarGrid {
58  public:
60  PolarGridRPhi2(const std::string& cellEncoding = "");
64  virtual ~PolarGridRPhi2();
65 
67  virtual Vector3D position(const CellID& cellID) const;
69  virtual CellID cellID(const Vector3D& localPosition, const Vector3D& globalPosition, const VolumeID& volumeID) const;
71  std::vector<double> gridRValues() const {
72  return _gridRValues;
73  }
75  std::vector<double> gridPhiValues() const {
76  return _gridPhiValues;
77  }
79  double offsetR() const {
80  return _offsetR;
81  }
83  double offsetPhi() const {
84  return _offsetPhi;
85  }
87  const std::string& fieldNameR() const {
88  return _rId;
89  }
91  const std::string& fieldNamePhi() const {
92  return _phiId;
93  }
95  void setGridRValues(double cellSize, int rID) {
96  _gridRValues[rID] = cellSize;
97  }
99  void setGridSizePhi(double cellSize, int phiID) {
100  _gridPhiValues[phiID] = cellSize;
101  }
102 
105  void setGridRValues(std::vector<double> const& rValues) {
106  _gridRValues = std::vector<double>(rValues);
107  }
108 
111  void setGridPhiValues(std::vector<double> const& phiValues) {
112  _gridPhiValues = std::vector<double>(phiValues);
113  }
114 
115 
117  void setOffsetR(double offset) {
118  _offsetR = offset;
119  }
121  void setOffsetPhi(double offset) {
122  _offsetPhi = offset;
123  }
125  void setFieldNameR(const std::string& fieldName) {
126  _rId = fieldName;
127  }
129  void setFieldNamePhi(const std::string& fieldName) {
130  _phiId = fieldName;
131  }
141  virtual std::vector<double> cellDimensions(const CellID& cellID) const;
142 
143  protected:
145  std::vector<double> _gridRValues;
147  double _offsetR;
149  std::vector<double> _gridPhiValues;
151  double _offsetPhi;
153  std::string _rId;
155  std::string _phiId;
156  };
157 
158  } /* namespace DDSegmentation */
159 } /* namespace dd4hep */
160 #endif // DDSEGMENTATION_POLARGRIDRPHI2_H
dd4hep::DDSegmentation::PolarGridRPhi2::setOffsetPhi
void setOffsetPhi(double offset)
set the coordinate offset in Phi
Definition: PolarGridRPhi2.h:121
dd4hep::DDSegmentation::VolumeID
uint64_t VolumeID
Definition: BitFieldCoder.h:27
dd4hep::DDSegmentation::PolarGridRPhi2
A segmentation for arbitrary sizes in R and R-dependent sizes in Phi.
Definition: PolarGridRPhi2.h:57
dd4hep::DDSegmentation::PolarGridRPhi2::setOffsetR
void setOffsetR(double offset)
set the coordinate offset in R
Definition: PolarGridRPhi2.h:117
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::PolarGridRPhi2::fieldNameR
const std::string & fieldNameR() const
access the field name used for R
Definition: PolarGridRPhi2.h:87
dd4hep::DDSegmentation::PolarGridRPhi2::setGridRValues
void setGridRValues(std::vector< double > const &rValues)
Definition: PolarGridRPhi2.h:105
dd4hep::DDSegmentation::PolarGridRPhi2::offsetR
double offsetR() const
access the coordinate offset in R
Definition: PolarGridRPhi2.h:79
dd4hep::DDSegmentation::PolarGridRPhi2::_rId
std::string _rId
the field name used for R
Definition: PolarGridRPhi2.h:153
dd4hep::DDSegmentation::PolarGridRPhi2::gridRValues
std::vector< double > gridRValues() const
access the grid size in R
Definition: PolarGridRPhi2.h:71
dd4hep::DDSegmentation::PolarGridRPhi2::_offsetR
double _offsetR
the coordinate offset in R
Definition: PolarGridRPhi2.h:147
dd4hep::DDSegmentation::PolarGridRPhi2::~PolarGridRPhi2
virtual ~PolarGridRPhi2()
destructor
Definition: PolarGridRPhi2.cpp:56
PolarGrid.h
dd4hep::DDSegmentation::PolarGridRPhi2::cellID
virtual CellID cellID(const Vector3D &localPosition, const Vector3D &globalPosition, const VolumeID &volumeID) const
determine the cell ID based on the position
Definition: PolarGridRPhi2.cpp:78
dd4hep::DDSegmentation::Segmentation::decoder
virtual const BitFieldCoder * decoder() const
Access the underlying decoder.
Definition: Segmentation.h:112
dd4hep::DDSegmentation::PolarGrid
Segmentation base class for polar grids.
Definition: PolarGrid.h:28
dd4hep::DDSegmentation::PolarGridRPhi2::offsetPhi
double offsetPhi() const
access the coordinate offset in Phi
Definition: PolarGridRPhi2.h:83
dd4hep::DDSegmentation::PolarGridRPhi2::setFieldNameR
void setFieldNameR(const std::string &fieldName)
set the field name used for X
Definition: PolarGridRPhi2.h:125
dd4hep::DDSegmentation::CellID
uint64_t CellID
Definition: BitFieldCoder.h:26
dd4hep::DDSegmentation::PolarGridRPhi2::setFieldNamePhi
void setFieldNamePhi(const std::string &fieldName)
set the field name used for Y
Definition: PolarGridRPhi2.h:129
dd4hep::DDSegmentation::PolarGridRPhi2::PolarGridRPhi2
PolarGridRPhi2(const std::string &cellEncoding="")
Default constructor passing the encoding string.
Definition: PolarGridRPhi2.cpp:24
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::PolarGridRPhi2::_offsetPhi
double _offsetPhi
the coordinate offset in Phi
Definition: PolarGridRPhi2.h:151
dd4hep::DDSegmentation::PolarGridRPhi2::fieldNamePhi
const std::string & fieldNamePhi() const
access the field name used for Phi
Definition: PolarGridRPhi2.h:91
dd4hep
Namespace for the AIDA detector description toolkit.
Definition: AlignmentsCalib.h:28
dd4hep::DDSegmentation::PolarGridRPhi2::position
virtual Vector3D position(const CellID &cellID) const
determine the position based on the cell ID
Definition: PolarGridRPhi2.cpp:61
dd4hep::DDSegmentation::PolarGridRPhi2::gridPhiValues
std::vector< double > gridPhiValues() const
access the grid size in Phi
Definition: PolarGridRPhi2.h:75
dd4hep::DDSegmentation::PolarGridRPhi2::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: d...
Definition: PolarGridRPhi2.cpp:98
dd4hep::DDSegmentation::PolarGridRPhi2::setGridRValues
void setGridRValues(double cellSize, int rID)
set the grid Boundaries in R
Definition: PolarGridRPhi2.h:95
dd4hep::DDSegmentation::PolarGridRPhi2::_phiId
std::string _phiId
the field name used for Phi
Definition: PolarGridRPhi2.h:155
dd4hep::DDSegmentation::PolarGridRPhi2::_gridPhiValues
std::vector< double > _gridPhiValues
the grid sizes in Phi
Definition: PolarGridRPhi2.h:149
dd4hep::DDSegmentation::PolarGridRPhi2::setGridSizePhi
void setGridSizePhi(double cellSize, int phiID)
set the grid size in Phi
Definition: PolarGridRPhi2.h:99
dd4hep::DDSegmentation::PolarGridRPhi2::_gridRValues
std::vector< double > _gridRValues
the grid boundaries in R
Definition: PolarGridRPhi2.h:145
dd4hep::DDSegmentation::PolarGridRPhi2::setGridPhiValues
void setGridPhiValues(std::vector< double > const &phiValues)
Definition: PolarGridRPhi2.h:111