ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4GeometryManager.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4GeometryManager.hh
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 // G4GeometryManager
27 //
28 // Class description:
29 //
30 // A class responsible for high level geometrical functions, and for
31 // high level objects in the geometry subdomain.
32 // The class is a `singleton', with access via the static method
33 // G4GeometryManager::GetInstance().
34 //
35 // Member data:
36 //
37 // - fgInstance
38 // Ptr to the unique instance of class
39 
40 // 26.07.95, P.Kent - Initial version, including optimisation build
41 // --------------------------------------------------------------------
42 #ifndef G4GEOMETRYMANAGER_HH
43 #define G4GEOMETRYMANAGER_HH
44 
45 #include <vector>
46 #include "G4Types.hh"
47 #include "G4SmartVoxelStat.hh"
48 
49 class G4VPhysicalVolume;
50 
52 {
53  public: // with description
54 
55  G4bool CloseGeometry(G4bool pOptimise = true, G4bool verbose = false,
56  G4VPhysicalVolume* vol = nullptr);
57  // Close (`lock') the geometry: perform sanity and `completion' checks
58  // and optionally [default=yes] build optimisation information.
59  // Applies to just a specific subtree if a physical volume is specified.
60 
61  void OpenGeometry(G4VPhysicalVolume* vol = nullptr);
62  // Open (`unlock') the geometry and remove optimisation information if
63  // present. Applies to just a specific subtree if a physical volume is
64  // specified.
65 
66  static G4bool IsGeometryClosed();
67  // Return true/false according to state of optimised geoemtry.
68 
69  void SetWorldMaximumExtent(G4double worldExtent);
70  // Set the maximum extent of the world volume. The operation is
71  // allowed only if NO solids have been created already.
72 
74  // Return ptr to singleton instance of the class, creating it if
75  // not existing.
76 
78  // Return ptr to singleton instance.
79 
80  public: // without description
81 
83  // Destructor.
84 
85  protected:
86 
88  // Protected constructor
89 
90  private:
91 
92  void BuildOptimisations(G4bool allOpt, G4bool verbose = false);
93  void BuildOptimisations(G4bool allOpt, G4VPhysicalVolume* vol);
94  void DeleteOptimisations();
96  static void ReportVoxelStats( std::vector<G4SmartVoxelStat>& stats,
97  G4double totalCpuTime );
100 };
101 
102 #endif