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 #ifndef DDSEGMENTATION_GRIDRPHIETA_H
0013 #define DDSEGMENTATION_GRIDRPHIETA_H
0014 
0015 // Framework includes
0016 #include <DDSegmentation/GridPhiEta.h>
0017 
0018 /** GridRPhiEta DDSegmentation/include/DDSegmentation/GridRPhiEta.h GridRPhiEta.h
0019  *
0020  *  Segmentation in R, eta and phi.
0021  *  Based on GridPhiEta, addition of radial coordinate.
0022  *  This segmentation returns global position of the cell based on the cellID.
0023  *
0024  *  @author    Anna Zaborowska
0025  */
0026 
0027 namespace dd4hep {
0028   namespace DDSegmentation {
0029 
0030     /// Segmentation class describing segmentation in R-Phi-Eta
0031     class GridRPhiEta: public GridPhiEta {
0032     public:
0033       /// default constructor using an arbitrary type
0034       GridRPhiEta(const std::string& aCellEncoding);
0035 
0036       /// Default constructor used by derived classes passing an existing decoder
0037       GridRPhiEta(const BitFieldCoder* decoder);
0038 
0039       /// destructor
0040       virtual ~GridRPhiEta() = default;
0041 
0042       /**  Determine the global position based on the cell ID.
0043        *   @param[in] aCellId ID of a cell.
0044        *   return Position.
0045        */
0046       virtual Vector3D position(const CellID& aCellID) const;
0047       /**  Determine the cell ID based on the position.
0048        *   @param[in] aLocalPosition (not used).
0049        *   @param[in] aGlobalPosition position in the global coordinates.
0050        *   @param[in] aVolumeId ID of a volume.
0051        *   return Cell ID.
0052        */
0053       virtual CellID cellID(const Vector3D& aLocalPosition, const Vector3D& aGlobalPosition, const VolumeID& aVolumeID) const;
0054       /**  Determine the radius based on the cell ID.
0055        *   @param[in] aCellId ID of a cell.
0056        *   return Radius.
0057        */
0058       double r(const CellID& aCellID) const;
0059       /**  Get the grid size in radial distance from the detector centre.
0060        *   return Grid size in radial distance.
0061        */
0062       inline double gridSizeR() const {
0063         return m_gridSizeR;
0064       }
0065       /**  Get the coordinate offset in radial distance.
0066        *   return The offset in R.
0067        */
0068       inline double offsetR() const {
0069         return m_offsetR;
0070       }
0071       /**  Get the field name for radial distance.
0072        *   return The field name for radial distance.
0073        */
0074       inline const std::string& fieldNameR() const {
0075         return m_rID;
0076       }
0077       /**  Set the grid size in radial distance.
0078        *   @param[in] aCellSize Cell size in radial distance.
0079        */
0080       void setGridSizeR(double aCellSize) {
0081         m_gridSizeR = aCellSize;
0082       }
0083       /**  Set the coordinate offset in radial distance.
0084        *   @param[in] aOffset Offset in radial distance.
0085        */
0086       inline void setOffsetR(double offset) {
0087         m_offsetR = offset;
0088       }
0089       /**  Set the field name used for radial distance.
0090        *   @param[in] aFieldName Field name for R.
0091        */
0092       inline void setFieldNameR(const std::string& fieldName) {
0093         m_rID = fieldName;
0094       }
0095 
0096     private:
0097 
0098       /// the grid size in r
0099       double m_gridSizeR;
0100       /// the coordinate offset in r
0101       double m_offsetR;
0102       /// the field name used for r
0103       std::string m_rID;
0104 
0105     };
0106   }
0107 }
0108 #endif // DDSEGMENTATION_GRIDRPHIETA_H