Back to home page

EIC code displayed by LXR

 
 

    


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

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 // G4PhysicsListWorkspace
0027 //
0028 // Class description:
0029 //
0030 // Manage the per-thread state of lists - those which have a per-thread
0031 // state and dependent classes (if any). In particular it
0032 //  - owns the arrays that implement 'split' classes
0033 //  - classes/objects which are owned by the split classes.
0034 // The classes/objects affected are:
0035 //  - 'split' classes part of its state is per-thread,
0036 //  - per-thread objects, in particular those owned by the split classes.
0037 // Goal: take ownership and control of per-thread state of classes
0038 // to work with multi-threading.
0039 
0040 // Authors: J.Apostolakis, A.Dotti - 4 October 2013
0041 // --------------------------------------------------------------------
0042 #ifndef G4PhysicsListWorkspace_hh
0043 #define G4PhysicsListWorkspace_hh 1
0044 
0045 #include "G4TWorkspacePool.hh"
0046 #include "G4VModularPhysicsList.hh"
0047 #include "G4VPhysicsConstructor.hh"
0048 #include "G4VUserPhysicsList.hh"
0049 
0050 class G4PhysicsListWorkspace
0051 {
0052   public:
0053     using pool_type = G4TWorkspacePool<G4PhysicsListWorkspace>;
0054 
0055   public:
0056     G4PhysicsListWorkspace(G4bool verbose = false);
0057     ~G4PhysicsListWorkspace() = default;
0058 
0059     // Take ownership
0060     void UseWorkspace();
0061 
0062     // Release ownership
0063     void ReleaseWorkspace();
0064 
0065     // Release ownership and destroy
0066     void DestroyWorkspace();
0067 
0068     // To be called at start of each run (especially 2nd and further runs)
0069     void InitialiseWorkspace();
0070 
0071     inline void SetVerbose(G4bool v) { fVerbose = v; }
0072     inline G4bool GetVerbose() { return fVerbose; }
0073 
0074     static pool_type* GetPool();
0075 
0076   protected:  // Implementation methods
0077     void InitialisePhysicsList();
0078 
0079   private:  // Helper pointers - can be per instance or shared
0080     // Store SubInstanceManager object pointers (SIM pointers)
0081     G4VUPLManager* fpVUPLSIM = nullptr;
0082     G4VPCManager* fpVPCSIM = nullptr;
0083     G4VMPLManager* fpVMPLSIM = nullptr;
0084 
0085     // Per Instance variables
0086     // The ownership of the Data Arrays is IN this object
0087     G4VUPLData* fpVUPLOffset = nullptr;
0088     G4VPCData* fpVPCOffset = nullptr;
0089     G4VMPLData* fpVMPLOffset = nullptr;
0090 
0091     G4bool fVerbose = false;
0092 };
0093 
0094 #endif