Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-21 09:58:02

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 //  \author   Markus Frank
0011 //  \date     2016-10-18
0012 //  \version  1.0
0013 //
0014 //==========================================================================
0015 #ifndef DD4HEP_MULTISEGMENTATION_H
0016 #define DD4HEP_MULTISEGMENTATION_H 1
0017 
0018 // Framework include files
0019 #include <DD4hep/Segmentations.h>
0020 #include <DDSegmentation/MultiSegmentation.h>
0021 
0022 /// Namespace for the AIDA detector description toolkit
0023 namespace dd4hep {
0024 
0025   /// Namespace for base segmentations
0026   namespace DDSegmentation  {    class MultiSegmentation;  }
0027   
0028   /// We need some abbreviation to make the code more readable.
0029   typedef Handle<SegmentationWrapper<DDSegmentation::MultiSegmentation> > MultiSegmentationHandle;
0030 
0031   /// Implementation class for the grid XZ segmentation.
0032   /**
0033    *  Concrete user handle to serve specific needs of client code
0034    *  which requires access to the base functionality not served
0035    *  by the super-class Segmentation.
0036    *
0037    *  Note:
0038    *  We only check the validity of the underlying handle.
0039    *  If for whatever reason the implementation object is not valid
0040    *  This is not checked.
0041    *  In principle this CANNOT happen unless some brain-dead has
0042    *  fiddled with the handled object directly.....
0043    *
0044    *  Note:
0045    *  The handle base corresponding to this object in for
0046    *  conveniance reasons instantiated in dd4hep/src/Segmentations.cpp.
0047    *
0048    *  \author  M.Frank
0049    *  \version 1.0
0050    *  \ingroup DD4HEP_CORE
0051    */
0052   class MultiSegmentation : public MultiSegmentationHandle  {
0053   public:
0054     typedef DDSegmentation::MultiSegmentation::Segmentations Segmentations;
0055 
0056   public:
0057     /// Default constructor
0058     MultiSegmentation() = default;
0059     /// Copy constructor
0060     MultiSegmentation(const MultiSegmentation& e) = default;
0061     /// Copy Constructor from segmentation base object
0062     MultiSegmentation(const Segmentation& e) : Handle<Object>(e) {}
0063     /// Copy constructor from handle
0064     MultiSegmentation(const Handle<Object>& e) : Handle<Object>(e) {}
0065     /// Copy constructor from other polymorph/equivalent handle
0066     template <typename Q> MultiSegmentation(const Handle<Q>& e) : Handle<Object>(e) {}
0067     /// Assignment operator
0068     MultiSegmentation& operator=(const MultiSegmentation& seg) = default;
0069     /// Equality operator
0070     bool operator==(const MultiSegmentation& seg) const
0071     {  return m_element == seg.m_element;      }
0072     /// access the field name used to discriminate sub-segmentations
0073     const std::string& discriminatorName() const;
0074     /// Discriminating bitfield entry
0075     const BitFieldElement* discriminator() const;
0076     /// The underlying sub-segementations
0077     const Segmentations& subSegmentations()  const;
0078     /// determine the position based on the cell ID
0079     Position position(const CellID& cellID) const;
0080     /// determine the cell ID based on the position
0081     CellID cellID(const Position& local, const Position& global, const VolumeID& volID) const;
0082     const std::string& fieldNameY() const;
0083     /** \brief Returns a vector<double> of the cellDimensions of the given cell ID
0084         in natural order of dimensions, e.g., dx/dy/dz, or dr/r*dPhi
0085 
0086         Returns a vector of the cellDimensions of the given cell ID
0087         \param cellID is ignored as all cells have the same dimension
0088         \return std::vector<double> size 2:
0089         -# size in x
0090         -# size in z
0091     */
0092     std::vector<double> cellDimensions(const CellID& cellID) const;
0093   };
0094 } /* End namespace dd4hep                */
0095 #endif // DD4HEP_MULTISEGMENTATION_H