DD4hep - The AIDA detector description toolkit for high energy physics experiments
DD4hep  Rev:Unversioneddirectory
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ProjectiveCylinder.h
Go to the documentation of this file.
1 /*
2  * ProjectiveCylinder.h
3  *
4  * Created on: Oct 31, 2013
5  * Author: Christian Grefe, CERN
6  */
7 
8 #ifndef PROJECTIVECYLINDER_H_
9 #define PROJECTIVECYLINDER_H_
10 
12 
13 namespace DD4hep {
14 namespace DDSegmentation {
15 
17 public:
19  ProjectiveCylinder(const std::string& cellEncoding);
23  virtual ~ProjectiveCylinder();
24 
26  virtual Vector3D position(const CellID& cellID) const;
28  virtual CellID cellID(const Vector3D& localPosition, const Vector3D& globalPosition, const VolumeID& volumeID) const;
30  double theta(const CellID& cellID) const;
32  double phi(const CellID& cellID) const;
34  int thetaBins() const {
35  return _thetaBins;
36  }
38  int phiBins() const {
39  return _phiBins;
40  }
42  double offsetTheta() const {
43  return _offsetTheta;
44  }
46  double offsetPhi() const {
47  return _offsetPhi;
48  }
50  std::string fieldNameTheta() const {
51  return _thetaID;
52  }
54  std::string fieldNamePhi() const {
55  return _phiID;
56  }
58  void setThetaBins(int bins) {
59  _thetaBins = bins;
60  }
62  void setPhiBins(int bins) {
63  _phiBins = bins;
64  }
66  void setOffsetTheta(double offset) {
67  _offsetTheta = offset;
68  }
70  void setOffsetPhi(double offset) {
71  _offsetPhi = offset;
72  }
74  void setFieldNameTheta(const std::string& fieldName) {
75  _thetaID = fieldName;
76  }
78  void setFieldNamePhi(const std::string& fieldName) {
79  _phiID = fieldName;
80  }
81 
82 protected:
86  int _phiBins;
88  double _offsetTheta;
90  double _offsetPhi;
92  std::string _thetaID;
94  std::string _phiID;
95 
97  double theta() const;
99  double phi() const;
100 
101 };
102 
103 } /* namespace DDSegmentation */
104 } /* namespace DD4hep */
105 #endif /* PROJECTIVECYLINDER_H_ */
long long int CellID
Useful typedefs to differentiate cell IDs and volume IDs.
Definition: Primitives.h:32
virtual VolumeID volumeID(const CellID &cellID) const
Determine the volume ID from the full cell ID by removing all local fields.
std::string _phiID
the field name used for phi
virtual CellID cellID(const Vector3D &localPosition, const Vector3D &globalPosition, const VolumeID &volumeID) const
determine the cell ID based on the position
virtual BitField64 * decoder() const
Access the underlying decoder.
Definition: Segmentation.h:105
int _phiBins
the number of bins in phi
int thetaBins() const
access the number of bins in theta
void setOffsetPhi(double offset)
set the coordinate offset in phi
virtual Vector3D position(const CellID &cellID) const
determine the position based on the cell ID
void setFieldNameTheta(const std::string &fieldName)
set the field name used for theta
void setPhiBins(int bins)
set the number of bins in phi
int _thetaBins
the number of bins in theta
int phiBins() const
access the number of bins in theta
Simple container for a physics vector.
Definition: Segmentation.h:41
void setFieldNamePhi(const std::string &fieldName)
set the field name used for phi
std::string _thetaID
the field name used for theta
void setOffsetTheta(double offset)
set the coordinate offset in theta
double theta() const
determine the polar angle theta based on the current cell ID
double offsetPhi() const
access the coordinate offset in phi
double phi() const
determine the azimuthal angle phi based on the current cell ID
double offsetTheta() const
access the coordinate offset in theta
long long int VolumeID
Definition: Primitives.h:35
ProjectiveCylinder(const std::string &cellEncoding)
default constructor using an arbitrary type
std::string fieldNamePhi() const
access the field name used for phi
std::string fieldNameTheta() const
access the field name used for theta
double _offsetTheta
the coordinate offset in theta
void setThetaBins(int bins)
set the number of bins in theta
double _offsetPhi
the coordinate offset in phi