Back to home page

EIC code displayed by LXR

 
 

    


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  * CartesianGridXYZ.h
0013  *
0014  *  Created on: Jun 28, 2013
0015  *      Author: Christian Grefe, CERN
0016  */
0017 
0018 #ifndef DDSEGMENTATION_CARTESIANGRIDXYZ_H
0019 #define DDSEGMENTATION_CARTESIANGRIDXYZ_H
0020 
0021 #include <DDSegmentation/CartesianGridXY.h>
0022 
0023 namespace dd4hep {
0024   namespace DDSegmentation {
0025 
0026     /// Segmentation base class describing cartesian grid segmentation in space
0027     class CartesianGridXYZ: public CartesianGridXY {
0028     public:
0029       /// default constructor using an arbitrary type
0030       CartesianGridXYZ(const std::string& cellEncoding);
0031       /// Default constructor used by derived classes passing an existing decoder
0032       CartesianGridXYZ(const BitFieldCoder* decoder);
0033       /// destructor
0034       virtual ~CartesianGridXYZ();
0035 
0036       /// determine the position 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 Z
0041       double gridSizeZ() const {
0042         return _gridSizeZ;
0043       }
0044       /// access the coordinate offset in Z
0045       double offsetZ() const {
0046         return _offsetZ;
0047       }
0048       /// access the field name used for Z
0049       const std::string& fieldNameZ() const {
0050         return _zId;
0051       }
0052       /// set the grid size in Z
0053       void setGridSizeZ(double cellSize) {
0054         _gridSizeZ = cellSize;
0055       }
0056       /// set the coordinate offset in Z
0057       void setOffsetZ(double offset) {
0058         _offsetZ = offset;
0059       }
0060       /// set the field name used for Z
0061       void setFieldNameZ(const std::string& fieldName) {
0062         _zId = fieldName;
0063       }
0064       /** \brief Returns a vector<double> of the cellDimensions of the given cell ID
0065           in natural order of dimensions, e.g., dx/dy/dz, or dr/r*dPhi
0066 
0067           Returns a vector of the cellDimensions of the given cell ID
0068           \param cellID is ignored as all cells have the same dimension
0069           \return std::vector<double> size 3:
0070           -# size in x
0071           -# size in y
0072           -# size in z
0073       */
0074       virtual std::vector<double> cellDimensions(const CellID& cellID) const;
0075 
0076     protected:
0077       /// the grid size in Z
0078       double _gridSizeZ;
0079       /// the coordinate offset in Z
0080       double _offsetZ;
0081       /// the field name used for Z
0082       std::string _zId;
0083     };
0084 
0085   } /* namespace DDSegmentation */
0086 } /* namespace dd4hep */
0087 #endif // DDSEGMENTATION_CARTESIANGRIDXYZ_H