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