Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:55:22

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 DDG4_GEANT4ASSEMBLYVOLUME_H
0014 #define DDG4_GEANT4ASSEMBLYVOLUME_H
0015 
0016 /// ROOT includes
0017 #include <TGeoNode.h>
0018 
0019 /// Geant4 include files
0020 #include <G4AssemblyVolume.hh>
0021 
0022 /// C/C++ include files
0023 #include <vector>
0024 
0025 /// Namespace for the AIDA detector description toolkit
0026 namespace dd4hep {
0027 
0028   /// Namespace for the Geant4 based simulation part of the AIDA detector description toolkit
0029   namespace sim {
0030 
0031     /// Forward declarations
0032     class Geant4Converter;
0033     class Geant4GeometryInfo;
0034     
0035     /// Hack! Wrapper around G4AssemblyVolume to access protected members.
0036     /**
0037      *  \author  M.Frank
0038      *  \version 1.0
0039      *  \ingroup DD4HEP_SIMULATION
0040      */
0041     class Geant4AssemblyVolume  {
0042       
0043     public:
0044 
0045       typedef std::vector<const TGeoNode*> Chain;
0046       std::vector<const TGeoNode*>       m_entries;
0047       std::vector<Geant4AssemblyVolume*> m_places;
0048       G4AssemblyVolume*                  m_assembly { nullptr };
0049 
0050     public:
0051       /// Default constructor with initialization
0052       Geant4AssemblyVolume();
0053       /// Inhibit move construction
0054       Geant4AssemblyVolume(Geant4AssemblyVolume&& copy) = delete;
0055       /// Inhibit copy construction
0056       Geant4AssemblyVolume(const Geant4AssemblyVolume& copy) = delete;
0057       /// Inhibit move assignment
0058       Geant4AssemblyVolume& operator=(Geant4AssemblyVolume&& copy) = delete;
0059       /// Inhibit copy assignment
0060       Geant4AssemblyVolume& operator=(const Geant4AssemblyVolume& copy) = delete;
0061       /// Default destructor
0062       virtual ~Geant4AssemblyVolume();
0063       /// Place logical daughter volume into the assembly
0064       long placeVolume(const TGeoNode* n, G4LogicalVolume* pPlacedVolume, G4Transform3D& transformation);
0065       /// Place daughter assembly into the assembly      
0066       long placeAssembly(const TGeoNode* n, Geant4AssemblyVolume* pPlacedVolume, G4Transform3D& transformation);
0067       /// Expand all daughter placements and expand the contained assemblies to imprints
0068       void imprint(const Geant4Converter& cnv,
0069                    const TGeoNode*        n,
0070                    Chain                  chain,
0071                    Geant4AssemblyVolume*  pAssembly,
0072                    G4LogicalVolume*       pMotherLV,
0073                    G4Transform3D&         transformation,
0074                    G4int                  copyNumBase,
0075                    G4bool                 surfCheck );
0076     };
0077   }
0078 }
0079 #endif