Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/Geant4/G4GeometryWorkspace.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 // G4GeometryWorkspace
0027 //
0028 // Class Description:
0029 //
0030 // Class managing the per-thread state of the geometry, spanning those
0031 // which have a per-thread state and their dependents.
0032 // In particular it:
0033 //       - owns the arrays that implement 'split' classes 
0034 //       - owns classes/objects which are owned by the split classes.
0035 // 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 
0042 // Authors: John Apostolakis (CERN), Andrea Dotti (SLAC), July 2013
0043 // --------------------------------------------------------------------
0044 #ifndef G4GEOMETRYWORKSPACE_HH
0045 #define G4GEOMETRYWORKSPACE_HH
0046 
0047 #include "G4TWorkspacePool.hh"
0048 
0049 // Headers defining MT "manager" types
0050 //
0051 #include "G4PVReplica.hh"
0052 #include "G4VSolid.hh"
0053 #include "G4LogicalVolume.hh"
0054 #include "G4Region.hh"
0055 
0056 /**
0057  * @brief G4GeometryWorkspace is a class managing the per-thread state of the
0058  * geometry, spanning those which have a per-thread state and their dependents.
0059  * In particular, it owns the arrays that implement 'split' classes and owns
0060  * classes/objects which are owned by the split classes.
0061  */
0062 
0063 class G4GeometryWorkspace
0064 {
0065   public:
0066  
0067     using pool_type = G4TWorkspacePool<G4GeometryWorkspace>;
0068 
0069     /**
0070      * Constructor and default Destructor.
0071      */
0072     G4GeometryWorkspace();
0073    ~G4GeometryWorkspace() = default;
0074 
0075     /**
0076      * Methods for the handling of the workspace.
0077      * To take/release ownership and destroy.
0078      */
0079     void UseWorkspace();     // Take ownership
0080     void ReleaseWorkspace(); // Release ownership
0081     void DestroyWorkspace(); // Release ownership and destroy
0082 
0083     /**
0084      * Initialisation of the workspace.
0085      * To be called at start of each run (especially 2nd and further runs).
0086      */
0087     void InitialiseWorkspace();
0088 
0089     /**
0090      * Static accessor returning the global geometry pool.
0091      */
0092     static pool_type* GetPool();
0093   
0094   protected:  // Implementation methods
0095 
0096     /**
0097      * Initialises the workspace for all physical volumes in the store.
0098      */
0099     void InitialisePhysicalVolumes();
0100 
0101     /**
0102      * Creates a clone of the solid for the given replica in this thread.
0103      */
0104     G4bool CloneReplicaSolid( G4PVReplica* );
0105   
0106   private:    // Helper pointers - can be per instance or shared
0107 
0108     G4LVManager*     fpLogicalVolumeSIM;
0109     G4PVManager*     fpPhysicalVolumeSIM;
0110     G4PVRManager*    fpReplicaSIM;
0111     G4RegionManager* fpRegionSIM;
0112   
0113     // Per Instance variables
0114     // NOTE: the ownership of the Data Arrays is IN this object
0115     // Store SubInstanceManager object pointers (SIM pointers)
0116 
0117     G4LVData*      fLogicalVolumeOffset;
0118     G4PVData*      fPhysicalVolumeOffset;
0119     G4ReplicaData* fReplicaOffset;       
0120     G4RegionData*  fRegionOffset;        
0121 };
0122 
0123 #endif