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  * ProjectiveCylinder.h
0014  *
0015  *  Created on: Oct 31, 2013
0016  *      Author: Christian Grefe, CERN
0017  */
0018 
0019 #ifndef DDSEGMENTATION_PROJECTIVECYLINDER_H
0020 #define DDSEGMENTATION_PROJECTIVECYLINDER_H
0021 
0022 #include <DDSegmentation/CylindricalSegmentation.h>
0023 
0024 namespace dd4hep {
0025   namespace DDSegmentation {
0026 
0027     /// A segmentation class to describe projective cylinders
0028     class ProjectiveCylinder: public CylindricalSegmentation {
0029     public:
0030       /// default constructor using an arbitrary type
0031       ProjectiveCylinder(const std::string& cellEncoding);
0032       /// Default constructor used by derived classes passing an existing decoder
0033       ProjectiveCylinder(const BitFieldCoder* decoder);
0034       /// destructor
0035       virtual ~ProjectiveCylinder();
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, const VolumeID& volumeID) const;
0041       /// determine the polar angle theta based on the cell ID
0042       double theta(const CellID& cellID) const;
0043       /// determine the azimuthal angle phi based on the cell ID
0044       double phi(const CellID& cellID) const;
0045       /// access the number of bins in theta
0046       int thetaBins() const {
0047         return _thetaBins;
0048       }
0049       /// access the number of bins in theta
0050       int phiBins() const {
0051         return _phiBins;
0052       }
0053       /// access the coordinate offset in theta
0054       double offsetTheta() const {
0055         return _offsetTheta;
0056       }
0057       /// access the coordinate offset in phi
0058       double offsetPhi() const {
0059         return _offsetPhi;
0060       }
0061       /// access the field name used for theta
0062       std::string fieldNameTheta() const {
0063         return _thetaID;
0064       }
0065       /// access the field name used for phi
0066       std::string fieldNamePhi() const {
0067         return _phiID;
0068       }
0069       /// set the number of bins in theta
0070       void setThetaBins(int bins) {
0071         _thetaBins = bins;
0072       }
0073       /// set the number of bins in phi
0074       void setPhiBins(int bins) {
0075         _phiBins = bins;
0076       }
0077       /// set the coordinate offset in theta
0078       void setOffsetTheta(double offset) {
0079         _offsetTheta = offset;
0080       }
0081       /// set the coordinate offset in phi
0082       void setOffsetPhi(double offset) {
0083         _offsetPhi = offset;
0084       }
0085       /// set the field name used for theta
0086       void setFieldNameTheta(const std::string& fieldName) {
0087         _thetaID = fieldName;
0088       }
0089       /// set the field name used for phi
0090       void setFieldNamePhi(const std::string& fieldName) {
0091         _phiID = fieldName;
0092       }
0093 
0094     protected:
0095       /// the number of bins in theta
0096       int _thetaBins;
0097       /// the number of bins in phi
0098       int _phiBins;
0099       /// the coordinate offset in theta
0100       double _offsetTheta;
0101       /// the coordinate offset in phi
0102       double _offsetPhi;
0103       /// the field name used for theta
0104       std::string _thetaID;
0105       /// the field name used for phi
0106       std::string _phiID;
0107 
0108     };
0109 
0110   } /* namespace DDSegmentation */
0111 } /* namespace dd4hep */
0112 #endif // DDSEGMENTATION_PROJECTIVECYLINDER_H