File indexing completed on 2025-09-17 08:59:14
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035 #ifndef G4PhysListRegistry_hh
0036 #define G4PhysListRegistry_hh 1
0037
0038 #include <vector>
0039 #include <map>
0040
0041 #include "globals.hh"
0042
0043 class G4VModularPhysicsList;
0044 class G4VBasePhysListStamper;
0045
0046 class G4PhysListRegistry
0047 {
0048 public:
0049
0050 static G4PhysListRegistry* Instance();
0051
0052
0053 ~G4PhysListRegistry();
0054
0055 void AddFactory(G4String name, G4VBasePhysListStamper*);
0056 void AddPhysicsExtension(G4String name, G4String procname);
0057
0058
0059 G4VModularPhysicsList* GetModularPhysicsList(const G4String& name);
0060 G4VModularPhysicsList* GetModularPhysicsListFromEnv();
0061
0062 G4bool IsReferencePhysList(G4String nam) const;
0063
0064 const std::vector<G4String>& AvailablePhysLists() const;
0065 const std::vector<G4String>& AvailablePhysicsExtensions() const;
0066 const std::vector<G4String>& AvailablePhysListsEM() const;
0067
0068 void PrintAvailablePhysLists() const;
0069
0070 G4bool DeconstructPhysListName(const G4String& name, G4String& plBase,
0071 std::vector<G4String>& physExt,
0072 std::vector<G4int>& replace,
0073 G4int verbose=0) const;
0074
0075 G4bool FindLongestMatch(const G4String& workName,
0076 const G4String& searchName,
0077 const std::vector<G4String>& validNames,
0078 G4String& bestMatch,
0079 G4int verbose=0) const;
0080
0081 inline void SetVerbose(G4int val) { verbose = val; }
0082 inline G4int GetVerbose() const { return verbose; }
0083
0084 inline void SetUnknownFatal(G4int val) { unknownFatal = val; }
0085 inline G4int GetUnknownFatal() const { return unknownFatal; }
0086
0087 void SetUserDefaultPhysList(const G4String& name="");
0088 inline G4String GetUserDefaultPhysList() const { return userDefault; }
0089
0090
0091
0092 inline G4String GetSystemDefaultPhysList() const { return systemDefault; }
0093
0094 private:
0095
0096 G4PhysListRegistry();
0097
0098 static G4ThreadLocal G4PhysListRegistry* theInstance;
0099
0100 std::map <G4String, G4VBasePhysListStamper*> factories;
0101 std::map <G4String, G4String> physicsExtensions;
0102
0103 G4int verbose;
0104 G4int unknownFatal;
0105 G4String userDefault;
0106 G4String systemDefault;
0107
0108
0109
0110
0111
0112
0113
0114 mutable std::vector<G4String> availBasePhysLists;
0115 mutable std::vector<G4String> availExtensions;
0116 };
0117
0118 #endif