|
||||
File indexing completed on 2025-01-18 09:55:26
0001 //========================================================================== 0002 // AIDA Detector description implementation 0003 //-------------------------------------------------------------------------- 0004 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN) 0005 // All rights reserved. 0006 // 0007 // For the licensing terms see $DD4hepINSTALL/LICENSE. 0008 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS. 0009 // 0010 //========================================================================== 0011 /* 0012 * CartesianGridXZ.h 0013 * 0014 * Created on: Jun 28, 2013 0015 * Author: Christian Grefe, CERN 0016 */ 0017 0018 #ifndef DDSEGMENTATION_CARTESIANGRIDXZ_H 0019 #define DDSEGMENTATION_CARTESIANGRIDXZ_H 0020 0021 #include <DDSegmentation/CartesianGrid.h> 0022 0023 namespace dd4hep { 0024 namespace DDSegmentation { 0025 0026 /// Segmentation base class describing cartesian grid segmentation in the X-Z plane 0027 class CartesianGridXZ: public CartesianGrid { 0028 public: 0029 /// default constructor using an arbitrary type 0030 CartesianGridXZ(const std::string& cellEncoding); 0031 /// Default constructor used by derived classes passing an existing decoder 0032 CartesianGridXZ(const BitFieldCoder* decoder); 0033 /// destructor 0034 virtual ~CartesianGridXZ(); 0035 0036 /// determine the local based on the cell ID 0037 virtual Vector3D position(const CellID& cellID) const; 0038 /// determine the cell ID based on the position 0039 virtual CellID cellID(const Vector3D& localPosition, const Vector3D& globalPosition, const VolumeID& volumeID) const; 0040 /// access the grid size in X 0041 double gridSizeX() const { 0042 return _gridSizeX; 0043 } 0044 /// access the grid size in Z 0045 double gridSizeZ() const { 0046 return _gridSizeZ; 0047 } 0048 /// access the coordinate offset in X 0049 double offsetX() const { 0050 return _offsetX; 0051 } 0052 /// access the coordinate offset in Z 0053 double offsetZ() const { 0054 return _offsetZ; 0055 } 0056 /// access the field name used for X 0057 const std::string& fieldNameX() const { 0058 return _xId; 0059 } 0060 /// access the field name used for Z 0061 const std::string& fieldNameZ() const { 0062 return _zId; 0063 } 0064 /// set the grid size in X 0065 void setGridSizeX(double cellSize) { 0066 _gridSizeX = cellSize; 0067 } 0068 /// set the grid size in Z 0069 void setGridSizeZ(double cellSize) { 0070 _gridSizeZ = cellSize; 0071 } 0072 /// set the coordinate offset in X 0073 void setOffsetX(double offset) { 0074 _offsetX = offset; 0075 } 0076 /// set the coordinate offset in Z 0077 void setOffsetZ(double offset) { 0078 _offsetZ = offset; 0079 } 0080 /// set the field name used for X 0081 void setFieldNameX(const std::string& fieldName) { 0082 _xId = fieldName; 0083 } 0084 /// set the field name used for Y 0085 void setFieldNameZ(const std::string& fieldName) { 0086 _zId = fieldName; 0087 } 0088 /** \brief Returns a vector<double> of the cellDimensions of the given cell ID 0089 in natural order of dimensions, e.g., dx/dy/dz, or dr/r*dPhi 0090 0091 Returns a vector of the cellDimensions of the given cell ID 0092 \param cellID is ignored as all cells have the same dimension 0093 \return std::vector<double> size 2: 0094 -# size in x 0095 -# size in z 0096 */ 0097 virtual std::vector<double> cellDimensions(const CellID& cellID) const; 0098 0099 protected: 0100 /// the grid size in X 0101 double _gridSizeX; 0102 /// the coordinate offset in X 0103 double _offsetX; 0104 /// the grid size in Z 0105 double _gridSizeZ; 0106 /// the coordinate offset in Z 0107 double _offsetZ; 0108 /// the field name used for X 0109 std::string _xId; 0110 /// the field name used for Z 0111 std::string _zId; 0112 }; 0113 0114 } /* namespace DDSegmentation */ 0115 } /* namespace dd4hep */ 0116 #endif // DDSEGMENTATION_CARTESIANGRIDXZ_H
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |