Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:58:21

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 1
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 class G4GeometryWorkspace
0057 {
0058   public:
0059  
0060     using pool_type = G4TWorkspacePool<G4GeometryWorkspace>;
0061 
0062     G4GeometryWorkspace();
0063    ~G4GeometryWorkspace() = default;
0064 
0065     void UseWorkspace();     // Take ownership
0066     void ReleaseWorkspace(); // Release ownership
0067     void DestroyWorkspace(); // Release ownership and destroy
0068 
0069     void InitialiseWorkspace();
0070       // To be called at start of each run (especially 2nd and further runs)
0071 
0072     static pool_type* GetPool();
0073   
0074   protected:  // Implementation methods
0075 
0076     void InitialisePhysicalVolumes();
0077     G4bool CloneReplicaSolid( G4PVReplica* );
0078   
0079   private:    // Helper pointers - can be per instance or shared
0080 
0081     G4LVManager*     fpLogicalVolumeSIM;
0082     G4PVManager*     fpPhysicalVolumeSIM;
0083     G4PVRManager*    fpReplicaSIM;
0084     G4RegionManager* fpRegionSIM;
0085   
0086     // Per Instance variables
0087     // NOTE: the ownership of the Data Arrays is IN this object
0088     // Store SubInstanceManager object pointers (SIM pointers)
0089 
0090     G4LVData*      fLogicalVolumeOffset;
0091     G4PVData*      fPhysicalVolumeOffset;
0092     G4ReplicaData* fReplicaOffset;       
0093     G4RegionData*  fRegionOffset;        
0094 };
0095 
0096 #endif