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     : M.Frank
0011 //
0012 //==========================================================================
0013 #ifndef DD4HEP_OPTICALSURFACEMANAGER_H
0014 #define DD4HEP_OPTICALSURFACEMANAGER_H
0015 
0016 // Framework include files
0017 #include <DD4hep/OpticalSurfaces.h>
0018 
0019 // ROOT include files
0020 #include <TGeoManager.h>
0021 
0022 /// Namespace for the AIDA detector description toolkit
0023 namespace dd4hep {
0024 
0025   /// Namespace for implementation details of the AIDA detector description toolkit
0026   namespace detail  {
0027     class OpticalSurfaceManagerObject;
0028   }
0029   
0030   /// Class to support the handling of optical surfaces.
0031   /**
0032    *
0033    *   \author  M.Frank
0034    *   \version 1.0
0035    *   \ingroup DD4HEP_CORE
0036    */
0037   class OpticalSurfaceManager: public Handle<detail::OpticalSurfaceManagerObject> {
0038   public:
0039     typedef detail::OpticalSurfaceManagerObject Object;
0040 
0041   public:
0042     /// Default constructor
0043     OpticalSurfaceManager() = default;
0044     /// Copy constructor
0045     OpticalSurfaceManager(const OpticalSurfaceManager& e) = default;
0046     /// Constructor taking object pointer
0047     OpticalSurfaceManager(TGeoManager* obj) : Handle<Object>(obj) { }
0048     /// Constructor from same-type handle
0049     OpticalSurfaceManager(const Handle<Object>& e) : Handle<Object>(e) { }
0050     /// Constructor from arbitrary handle
0051     template <typename Q>
0052     OpticalSurfaceManager(const Handle<Q>& e) : Handle<Object>(e) { }
0053     /// Initializing constructor.
0054     OpticalSurfaceManager(Detector& description);
0055     /// Assignment operator
0056     OpticalSurfaceManager& operator=(const OpticalSurfaceManager& m) = default;
0057 
0058     /// static accessor calling DD4hepOpticalSurfaceManagerPlugin if necessary
0059     static OpticalSurfaceManager getOpticalSurfaceManager(Detector& description);
0060 
0061     /// Access skin surface by its full name
0062     SkinSurface    skinSurface(const std::string& full_name)  const;
0063     /// Access skin surface by its identifier tuple (DetElement, name)
0064     SkinSurface    skinSurface(DetElement de, const std::string& nam)  const;
0065     /// Access border surface by its full name
0066     BorderSurface  borderSurface(const std::string& full_name)  const;
0067     /// Access border surface by its identifier tuple (DetElement, name)
0068     BorderSurface  borderSurface(DetElement de, const std::string& nam)  const;
0069     /// Access optical surface data by its full name
0070     OpticalSurface opticalSurface(const std::string& full_name)  const;
0071     /// Access optical surface data by its identifier tuple (DetElement, name)
0072     OpticalSurface opticalSurface(DetElement de, const std::string& nam)  const;
0073     /// Add skin surface to manager
0074     void addSkinSurface(DetElement de, SkinSurface surf)  const;
0075     /// Add border surface to manager
0076     void addBorderSurface(DetElement de, BorderSurface surf)  const;
0077     /// Add optical surface data to manager
0078     void addOpticalSurface(OpticalSurface surf)  const;
0079 
0080     /// Register the temporary surface objects with the TGeoManager
0081     void registerSurfaces(DetElement subdetector);
0082   };
0083 }         /* End namespace dd4hep                  */
0084 #endif // DD4HEP_OPTICALSURFACEMANAGER_H