File indexing completed on 2025-01-18 09:58:56
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
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045 #ifndef G4PhysListRegistry_hh
0046 #define G4PhysListRegistry_hh 1
0047
0048 #include <vector>
0049 #include <map>
0050 #include "globals.hh"
0051
0052
0053 class G4VModularPhysicsList;
0054 class G4VBasePhysListStamper;
0055
0056 class G4PhysListRegistry
0057 {
0058 public:
0059
0060 static G4PhysListRegistry* Instance();
0061
0062
0063 ~G4PhysListRegistry();
0064
0065 void AddFactory(G4String name, G4VBasePhysListStamper*);
0066 void AddPhysicsExtension(G4String name, G4String procname);
0067
0068
0069 G4VModularPhysicsList* GetModularPhysicsList(const G4String& name);
0070 G4VModularPhysicsList* GetModularPhysicsListFromEnv();
0071
0072 G4bool IsReferencePhysList(G4String nam) const;
0073
0074 const std::vector<G4String>& AvailablePhysLists() const;
0075 const std::vector<G4String>& AvailablePhysicsExtensions() const;
0076 const std::vector<G4String>& AvailablePhysListsEM() const;
0077
0078 void PrintAvailablePhysLists() const;
0079
0080 G4bool DeconstructPhysListName(const G4String& name, G4String& plBase,
0081 std::vector<G4String>& physExt,
0082 std::vector<G4int>& replace,
0083 G4int verbose=0) const;
0084
0085 G4bool FindLongestMatch(const G4String& workName,
0086 const G4String& searchName,
0087 const std::vector<G4String>& validNames,
0088 G4String& bestMatch,
0089 G4int verbose=0) const;
0090
0091 inline void SetVerbose(G4int val) { verbose = val; }
0092 inline G4int GetVerbose() const { return verbose; }
0093
0094 inline void SetUnknownFatal(G4int val) { unknownFatal = val; }
0095 inline G4int GetUnknownFatal() const { return unknownFatal; }
0096
0097 void SetUserDefaultPhysList(const G4String& name="");
0098 inline G4String GetUserDefaultPhysList() const { return userDefault; }
0099
0100
0101
0102 inline G4String GetSystemDefaultPhysList() const { return systemDefault; }
0103
0104 private:
0105
0106 G4PhysListRegistry();
0107
0108 static G4ThreadLocal G4PhysListRegistry* theInstance;
0109
0110 std::map <G4String, G4VBasePhysListStamper*> factories;
0111 std::map <G4String, G4String> physicsExtensions;
0112
0113 G4int verbose;
0114 G4int unknownFatal;
0115 G4String userDefault;
0116 G4String systemDefault;
0117
0118
0119
0120
0121
0122
0123
0124 mutable std::vector<G4String> availBasePhysLists;
0125 mutable std::vector<G4String> availExtensions;
0126
0127 };
0128
0129 #endif