DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
PolarGridRPhi.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  * PolarGridRPhi.h
14  *
15  * Created on: Sept 13, 2014
16  * Author: Marko Petric
17  */
18 
19 #ifndef DDSEGMENTATION_POLARGRIDRPHI_H
20 #define DDSEGMENTATION_POLARGRIDRPHI_H
21 
23 #include <math.h>
24 
25 namespace dd4hep {
26  namespace DDSegmentation {
27 
29  class PolarGridRPhi: public PolarGrid {
30  public:
32  PolarGridRPhi(const std::string& cellEncoding = "");
36  virtual ~PolarGridRPhi();
37 
39  virtual Vector3D position(const CellID& cellID) const;
41  virtual CellID cellID(const Vector3D& localPosition, const Vector3D& globalPosition, const VolumeID& volumeID) const;
43  double gridSizeR() const {
44  return _gridSizeR;
45  }
47  double gridSizePhi() const {
48  return _gridSizePhi;
49  }
51  double offsetR() const {
52  return _offsetR;
53  }
55  double offsetPhi() const {
56  return _offsetPhi;
57  }
59  const std::string& fieldNameR() const {
60  return _rId;
61  }
63  const std::string& fieldNamePhi() const {
64  return _phiId;
65  }
67  void setGridSizeR(double cellSize) {
68  _gridSizeR = cellSize;
69  }
71  void setGridSizePhi(double cellSize) {
72  _gridSizePhi = cellSize;
73  }
75  void setOffsetR(double offset) {
76  _offsetR = offset;
77  }
79  void setOffsetPhi(double offset) {
80  _offsetPhi = offset;
81  }
83  void setFieldNameR(const std::string& fieldName) {
84  _rId = fieldName;
85  }
87  void setFieldNamePhi(const std::string& fieldName) {
88  _phiId = fieldName;
89  }
99  virtual std::vector<double> cellDimensions(const CellID& cID) const;
100 
101  protected:
103  double _gridSizeR;
105  double _offsetR;
107  double _gridSizePhi;
109  double _offsetPhi;
111  std::string _rId;
113  std::string _phiId;
114  };
115 
116  } /* namespace DDSegmentation */
117 } /* namespace dd4hep */
118 #endif // DDSEGMENTATION_POLARGRIDRPHI_H
dd4hep::DDSegmentation::VolumeID
uint64_t VolumeID
Definition: BitFieldCoder.h:27
dd4hep::DDSegmentation::PolarGridRPhi::gridSizeR
double gridSizeR() const
access the grid size in R
Definition: PolarGridRPhi.h:43
dd4hep::DDSegmentation::PolarGridRPhi::setFieldNameR
void setFieldNameR(const std::string &fieldName)
set the field name used for X
Definition: PolarGridRPhi.h:83
dd4hep::DDSegmentation::Vector3D
Simple container for a physics vector.
Definition: Segmentation.h:48
dd4hep::DDSegmentation::PolarGridRPhi::setOffsetR
void setOffsetR(double offset)
set the coordinate offset in R
Definition: PolarGridRPhi.h:75
dd4hep::DDSegmentation::BitFieldCoder
Helper class for decoding and encoding a bit field of 64bits for convenient declaration.
Definition: BitFieldCoder.h:114
dd4hep::DDSegmentation::PolarGridRPhi::fieldNamePhi
const std::string & fieldNamePhi() const
access the field name used for Phi
Definition: PolarGridRPhi.h:63
dd4hep::DDSegmentation::PolarGridRPhi::setFieldNamePhi
void setFieldNamePhi(const std::string &fieldName)
set the field name used for Y
Definition: PolarGridRPhi.h:87
dd4hep::DDSegmentation::PolarGridRPhi::PolarGridRPhi
PolarGridRPhi(const std::string &cellEncoding="")
Default constructor passing the encoding string.
Definition: PolarGridRPhi.cpp:24
dd4hep::DDSegmentation::PolarGridRPhi::setGridSizeR
void setGridSizeR(double cellSize)
set the grid size in R
Definition: PolarGridRPhi.h:67
dd4hep::DDSegmentation::PolarGridRPhi::_offsetR
double _offsetR
the coordinate offset in R
Definition: PolarGridRPhi.h:105
dd4hep::DDSegmentation::PolarGridRPhi::position
virtual Vector3D position(const CellID &cellID) const
determine the position based on the cell ID
Definition: PolarGridRPhi.cpp:61
dd4hep::DDSegmentation::PolarGridRPhi::setGridSizePhi
void setGridSizePhi(double cellSize)
set the grid size in Phi
Definition: PolarGridRPhi.h:71
dd4hep::DDSegmentation::PolarGridRPhi::offsetR
double offsetR() const
access the coordinate offset in R
Definition: PolarGridRPhi.h:51
dd4hep::DDSegmentation::PolarGridRPhi::fieldNameR
const std::string & fieldNameR() const
access the field name used for R
Definition: PolarGridRPhi.h:59
PolarGrid.h
dd4hep::DDSegmentation::PolarGridRPhi::_gridSizePhi
double _gridSizePhi
the grid size in Phi
Definition: PolarGridRPhi.h:107
dd4hep::DDSegmentation::PolarGridRPhi
A segmentation for arbitrary sizes in R and R-dependent sizes in Phi.
Definition: PolarGridRPhi.h:29
dd4hep::DDSegmentation::Segmentation::decoder
virtual const BitFieldCoder * decoder() const
Access the underlying decoder.
Definition: Segmentation.h:112
dd4hep::DDSegmentation::PolarGridRPhi::_gridSizeR
double _gridSizeR
the grid size in R
Definition: PolarGridRPhi.h:103
dd4hep::DDSegmentation::PolarGrid
Segmentation base class for polar grids.
Definition: PolarGrid.h:28
dd4hep::DDSegmentation::PolarGridRPhi::cellDimensions
virtual std::vector< double > cellDimensions(const CellID &cID) const
Returns a vector<double> of the cellDimensions of the given cell ID in natural order of dimensions: d...
Definition: PolarGridRPhi.cpp:82
dd4hep::DDSegmentation::CellID
uint64_t CellID
Definition: BitFieldCoder.h:26
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::PolarGridRPhi::cellID
virtual CellID cellID(const Vector3D &localPosition, const Vector3D &globalPosition, const VolumeID &volumeID) const
determine the cell ID based on the position
Definition: PolarGridRPhi.cpp:73
dd4hep::DDSegmentation::PolarGridRPhi::_phiId
std::string _phiId
the field name used for Phi
Definition: PolarGridRPhi.h:113
dd4hep::DDSegmentation::PolarGridRPhi::offsetPhi
double offsetPhi() const
access the coordinate offset in Phi
Definition: PolarGridRPhi.h:55
dd4hep
Namespace for the AIDA detector description toolkit.
Definition: AlignmentsCalib.h:28
dd4hep::DDSegmentation::PolarGridRPhi::_offsetPhi
double _offsetPhi
the coordinate offset in Phi
Definition: PolarGridRPhi.h:109
dd4hep::DDSegmentation::PolarGridRPhi::_rId
std::string _rId
the field name used for R
Definition: PolarGridRPhi.h:111
dd4hep::DDSegmentation::PolarGridRPhi::setOffsetPhi
void setOffsetPhi(double offset)
set the coordinate offset in Phi
Definition: PolarGridRPhi.h:79
dd4hep::DDSegmentation::PolarGridRPhi::gridSizePhi
double gridSizePhi() const
access the grid size in Phi
Definition: PolarGridRPhi.h:47
dd4hep::DDSegmentation::PolarGridRPhi::~PolarGridRPhi
virtual ~PolarGridRPhi()
destructor
Definition: PolarGridRPhi.cpp:56