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 /*
0013  * CartesianStripX.h
0014  *
0015  *  Created on: Jun 28, 2013
0016  *      Author: Christian Grefe, CERN
0017  *              David Blyth, ANL
0018  */
0019 
0020 #ifndef DDSEGMENTATION_CARTESIANSTRIPX_H
0021 #define DDSEGMENTATION_CARTESIANSTRIPX_H
0022 
0023 #include <DDSegmentation/CartesianStrip.h>
0024 
0025 namespace dd4hep {
0026 namespace DDSegmentation {
0027 
0028       /// Segmentation base class describing cartesian strip segmentation in X
0029 class CartesianStripX : public DDSegmentation::CartesianStrip {
0030    public:
0031     /// Default constructor passing the encoding string
0032     CartesianStripX(const std::string& cellEncoding = "");
0033     /// Default constructor used by derived classes passing an existing decoder
0034     CartesianStripX(const BitFieldCoder* decoder);
0035     /// destructor
0036     virtual ~CartesianStripX();
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 X
0044     double stripSizeX() const { return _stripSizeX; }
0045     /// access the coordinate offset in X
0046     double offsetX() const { return _offsetX; }
0047     /// access the field name used for X
0048     const std::string& fieldNameX() const { return _xId; }
0049     /// set the strip size in X
0050     void setStripSizeX(double cellSize) { _stripSizeX = cellSize; }
0051     /// set the coordinate offset in X
0052     void setOffsetX(double offset) { _offsetX = offset; }
0053     /// set the field name used for X
0054     void setFieldNameX(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 X
0067     double _stripSizeX;
0068     /// the coordinate offset in X
0069     double _offsetX;
0070     /// the field name used for X
0071     std::string _xId;
0072 };
0073 }  // namespace DDSegmentation
0074 } /* namespace dd4hep */
0075 #endif // DDSEGMENTATION_CARTESIANSTRIPX_H