Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:13:36

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  * CylindricalGridPhiZ.h
0013  *
0014  *  Created on: Jun 28, 2024
0015  *      Author: Yann Bedfer, ePIC/Saclay
0016  */
0017 
0018 #ifndef DDSEGMENTATION_CYLINDRICALGRIDPHIZ_H
0019 #define DDSEGMENTATION_CYLINDRICALGRIDPHIZ_H
0020 
0021 #include <DDSegmentation/CylindricalSegmentation.h>
0022 
0023 namespace dd4hep {
0024   namespace DDSegmentation {
0025 
0026     /// Segmentation base class describing cylindrical grid segmentation in the Phi-Z cylinder
0027     class CylindricalGridPhiZ: public CylindricalSegmentation {
0028     public:
0029       /// default constructor using an arbitrary type
0030       CylindricalGridPhiZ(const std::string& cellEncoding);
0031       /// Default constructor used by derived classes passing an existing decoder
0032       CylindricalGridPhiZ(const BitFieldCoder* decoder);
0033       /// destructor
0034       virtual ~CylindricalGridPhiZ();
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 phi
0041       double gridSizePhi() const {
0042         return _gridSizePhi;
0043       }
0044       /// access the grid size in Z
0045       double gridSizeZ() const {
0046         return _gridSizeZ;
0047       }
0048       /// access the coordinate offset in phi
0049       double offsetPhi() const {
0050         return _offsetPhi;
0051       }
0052       /// access the coordinate offset in Z
0053       double offsetZ() const {
0054         return _offsetZ;
0055       }
0056       /// access the radius
0057       double radius() const {
0058         return _radius;
0059       }
0060       /// access the field name used for phi
0061       const std::string& fieldNamePhi() const {
0062         return _phiId;
0063       }
0064       /// access the field name used for Z
0065       const std::string& fieldNameZ() const {
0066         return _zId;
0067       }
0068       /// set the grid size in phi
0069       void setGridSizePhi(double cellSize) {
0070         _gridSizePhi = cellSize;
0071       }
0072       /// set the grid size in Z
0073       void setGridSizeZ(double cellSize) {
0074         _gridSizeZ = cellSize;
0075       }
0076       /// set the coordinate offset in phi
0077       void setOffsetPhi(double offset) {
0078         _offsetPhi = offset;
0079       }
0080       /// set the coordinate offset in Z
0081       void setOffsetZ(double offset) {
0082         _offsetZ = offset;
0083       }
0084       /// set the radius
0085       void setRadius(double radius) {
0086         _radius = radius;
0087       }
0088       /// set the field name used for phi
0089       void setFieldNamePhi(const std::string& fieldName) {
0090         _phiId = fieldName;
0091       }
0092       /// set the field name used for Z
0093       void setFieldNameZ(const std::string& fieldName) {
0094         _zId = fieldName;
0095       }
0096       /** \brief Returns a vector<double> of the cellDimensions of the given cell ID
0097           in the following order: R*dPhi,dZ
0098 
0099           Returns a vector of the cellDimensions of the given cell ID
0100           \param cellID is ignored as all cells have the same dimension
0101           \return std::vector<double> size 2:
0102           -# size in x = R * size in phi
0103           -# size in z
0104       */
0105       virtual std::vector<double> cellDimensions(const CellID& cellID) const;
0106 
0107       /// Set the underlying decoder (setting, inter alia, whether phi isSigned)
0108       virtual void setDecoder(const BitFieldCoder* decoder);
0109 
0110     protected:
0111       /// the grid size in phi
0112       double _gridSizePhi;
0113       /// the coordinate offset in phi
0114       double _offsetPhi;
0115       /// the grid size in Z
0116       double _gridSizeZ;
0117       /// the coordinate offset in Z
0118       double _offsetZ;
0119       /// the radius
0120       double _radius;
0121       /// the field name used for phi
0122       std::string _phiId;
0123       /// the field name used for Z
0124       std::string _zId;
0125       /// the isSigned attribute of the bitfield used for phi
0126       bool _phiIsSigned;
0127     };
0128 
0129   } /* namespace DDSegmentation */
0130 } /* namespace dd4hep */
0131 #endif // DDSEGMENTATION_CYLINDRICALGRIDPHIZ_H