|
||||
File indexing completed on 2025-01-18 09:21:16
0001 // 0002 // ******************************************************************** 0003 // * License and Disclaimer * 0004 // * * 0005 // * The Geant4 software is copyright of the Copyright Holders of * 0006 // * the Geant4 Collaboration. It is provided under the terms and * 0007 // * conditions of the Geant4 Software License, included in the file * 0008 // * LICENSE and available at http://cern.ch/geant4/license . These * 0009 // * include a list of copyright holders. * 0010 // * * 0011 // * Neither the authors of this software system, nor their employing * 0012 // * institutes,nor the agencies providing financial support for this * 0013 // * work make any representation or warranty, express or implied, * 0014 // * regarding this software system or assume any liability for its * 0015 // * use. Please see the license in the file LICENSE and URL above * 0016 // * for the full disclaimer and the limitation of liability. * 0017 // * * 0018 // * This code implementation is the result of the scientific and * 0019 // * technical work of the GEANT4 collaboration. * 0020 // * By using, copying, modifying or distributing the software (or * 0021 // * any work based on the software) you agree to acknowledge its * 0022 // * use in resulting scientific publications, and indicate your * 0023 // * acceptance of all terms of the Geant4 Software license. * 0024 // ******************************************************************** 0025 // 0026 // G4GeometryTolerance 0027 // 0028 // Class description: 0029 // 0030 // A singleton class for computation and storage of the tolerance values 0031 // used by the geometry modeler for precision on boundaries. 0032 // The Cartesian tolerance defines the thickness of the surface of the 0033 // geometrical shapes for their inner funtions and for the tracking. The 0034 // tolerance must be greater than the largest mathematical error from the 0035 // shape distance calculation functions. The tolerance is centred on the 0036 // surface, e.g. the Inside() method of a solid uses a tolerance dx +/- kTol/2. 0037 // The Cartesian tolerance can either be set to a fixed value (1E-9 mm) 0038 // or to a value computed on the basis of the maximum extent of the 0039 // world volume assigned through the G4GeometryManager at the beginning 0040 // of the application -before- any geometrical object is created. 0041 0042 // ---------------- G4GeometryTolerance ---------------- 0043 // 0044 // Author: G.Cosmo (CERN), 30 October 2006 0045 // -------------------------------------------------------------------- 0046 #ifndef G4GeometryTolerance_hh 0047 #define G4GeometryTolerance_hh 0048 0049 #include "G4Types.hh" 0050 0051 class G4GeometryTolerance 0052 { 0053 friend class G4GeometryManager; 0054 0055 public: // with description 0056 static G4GeometryTolerance* GetInstance(); 0057 // Get a pointer to the unique G4GeometryTolerance, 0058 // creating it if necessary and setting the tolerances. 0059 G4double GetSurfaceTolerance() const; 0060 // Returns the current Cartesian tolerance of a surface. 0061 G4double GetAngularTolerance() const; 0062 // Returns the current angular tolerance. 0063 G4double GetRadialTolerance() const; 0064 // Returns the current radial tolerance. 0065 0066 public: // without description 0067 ~G4GeometryTolerance() = default; 0068 // Destructor. 0069 0070 protected: 0071 void SetSurfaceTolerance(G4double worldExtent); 0072 // Sets the Cartesian and Radial surface tolerance to a value computed 0073 // from the maximum extent of the world volume. This method 0074 // can be called only once, and is done only through the 0075 // G4GeometryManager class. 0076 0077 G4GeometryTolerance(); 0078 // Protected constructor. 0079 0080 private: 0081 static G4ThreadLocal G4GeometryTolerance* fpInstance; 0082 G4double fCarTolerance; 0083 G4double fAngTolerance; 0084 G4double fRadTolerance; 0085 G4bool fInitialised = false; 0086 }; 0087 0088 #endif
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |