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 /*
0013  * CartesianStripZ.h
0014  *
0015  *  Created on: Jun 28, 2013
0016  *      Author: Christian Grefe, CERN
0017  *              David Blyth, ANL
0018  */
0019 
0020 #ifndef DDSEGMENTATION_CARTESIANSTRIPZ_H
0021 #define DDSEGMENTATION_CARTESIANSTRIPZ_H
0022 
0023 #include <DDSegmentation/CartesianStrip.h>
0024 
0025 namespace dd4hep {
0026   namespace DDSegmentation {
0027 
0028     /// Segmentation base class describing cartesian strip segmentation in Z
0029     class CartesianStripZ : public DDSegmentation::CartesianStrip {
0030     public:
0031       /// Default constructor passing the encoding string
0032       CartesianStripZ(const std::string& cellEncoding = "");
0033       /// Default constructor used by derived classes passing an existing decoder
0034       CartesianStripZ(const BitFieldCoder* decoder);
0035       /// destructor
0036       virtual ~CartesianStripZ();
0037 
0038       /// determine the position based on the cell ID
0039       virtual Vector3D position(const CellID& cellID) const;
0040       /// determine the cell ID based on the position
0041       virtual CellID cellID(const Vector3D& localPosition, const Vector3D& globalPosition,
0042                             const VolumeID& volumeID) const;
0043       /// access the strip size in Z
0044       double stripSizeZ() const { return _stripSizeZ; }
0045       /// access the coordinate offset in Z
0046       double offsetZ() const { return _offsetZ; }
0047       /// access the field name used for Z
0048       const std::string& fieldNameZ() const { return _xId; }
0049       /// set the strip size in Z
0050       void setStripSizeZ(double cellSize) { _stripSizeZ = cellSize; }
0051       /// set the coordinate offset in Z
0052       void setOffsetZ(double offset) { _offsetZ = offset; }
0053       /// set the field name used for Z
0054       void setFieldNameZ(const std::string& fieldName) { _xId = fieldName; }
0055       /** \brief Returns a vector<double> of the cellDimensions of the given cell ID
0056           in natural order of dimensions, e.g., dx/dy/dz, or dr/r*dPhi
0057 
0058           Returns a vector of the cellDimensions of the given cell ID
0059           \param cellID is ignored as all cells have the same dimension
0060           \return std::vector<double> size 1:
0061           -# size in x
0062       */
0063       virtual std::vector<double> cellDimensions(const CellID& cellID) const;
0064 
0065     protected:
0066       /// the strip size in Z
0067       double _stripSizeZ;
0068       /// the coordinate offset in Z
0069       double _offsetZ;
0070       /// the field name used for Z
0071       std::string _xId;
0072     };
0073   }  // namespace DDSegmentation
0074 } /* namespace dd4hep */
0075 #endif // DDSEGMENTATION_CARTESIANSTRIPZ_H