Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/Geant4/G4SolidsWorkspace.hh was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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 // G4SolidsWorkspace
0027 //
0028 // Class description:
0029 //
0030 //   Manages the per-thread state of solids - those which 
0031 //   have a per-thread state and dependent classes (if any)
0032 //   In particular it 
0033 //       - owns the arrays that implement 'split' classes 
0034 //       - classes/objects which are owned by the split classes.
0035 //   Background: the classes/objects affected are  
0036 //       - 'split' classes part of its state is per-thread,
0037 //       - per-thread objects, in particular those which are owned 
0038 //         by the split classes.
0039 // Goal: Take ownership and control of per-thread state of 
0040 //       classes to work with multi-threading. 
0041 //       Offshoot of G4GeometryWorkspace, to deal with Solids.
0042 
0043 // 4.10.2013 - Created: John Apostolakis, Andrea Dotti
0044 // --------------------------------------------------------------------
0045 #ifndef G4SOLIDSWORKSPACE_HH
0046 #define G4SOLIDSWORKSPACE_HH
0047 
0048 #include "G4TWorkspacePool.hh"
0049 #include "G4VSolid.hh"
0050 
0051 #include "G4PolyconeSide.hh"
0052 #include "G4PolyhedraSide.hh"
0053 
0054 class G4SolidsWorkspace
0055 {
0056   public: 
0057 
0058     using pool_type = G4TWorkspacePool<G4SolidsWorkspace>;
0059 
0060     G4SolidsWorkspace(G4bool verbose = false);
0061     ~G4SolidsWorkspace() = default;
0062 
0063     void UseWorkspace();     // Take ownership
0064     void ReleaseWorkspace(); // Release ownership
0065     void DestroyWorkspace(); // Release ownership and destroy
0066 
0067     void InitialiseWorkspace();
0068       // To be called at start of each run (especially 2nd and further runs)
0069 
0070     inline void SetVerbose(G4bool v) { fVerbose=v; } 
0071     inline G4bool GetVerbose()  { return fVerbose; } 
0072 
0073     static pool_type* GetPool();
0074 
0075   protected:
0076 
0077     void InitialiseSolids();
0078 
0079   private:
0080 
0081     // Helper pointers - can be per instance or shared
0082     //
0083     G4PlSideManager* fpPolyconeSideSIM = nullptr;
0084     G4PhSideManager* fpPolyhedraSideSIM = nullptr;
0085   
0086     // Per Instance variables
0087     // NOTE: the ownership of the Data Arrays is IN this object
0088  
0089     // Store SubInstanceManager object pointers (SIM pointers)
0090     //
0091     G4PlSideData* fPolyconeSideOffset = nullptr;
0092     G4PhSideData* fPolyhedraSideOffset = nullptr;
0093 
0094     G4bool fVerbose = false;
0095 };
0096 
0097 #endif // G4SOLIDSWORKSPACE_HH