]>
Commit | Line | Data |
---|---|---|
2817d3e2 | 1 | // $Id$ |
2 | // Category: physics | |
3 | // | |
4 | // Geant4 implementation of the MonteCarlo interface methods | |
5 | // for building Geant4 physics and access to it | |
6 | ||
7 | #ifndef TG4_PHYSICS_MANAGER_H | |
8 | #define TG4_PHYSICS_MANAGER_H | |
9 | ||
10 | #include "TG4Globals.h" | |
11 | #include "TG4NameMap.h" | |
12 | #include "TG4IntMap.h" | |
13 | #include "TG3Cut.h" | |
14 | #include "TG3Flag.h" | |
15 | #include "TG3ParticleWSP.h" | |
16 | ||
17 | #include <globals.hh> | |
18 | ||
19 | #include <Rtypes.h> | |
20 | ||
21 | class TG4CutVector; | |
22 | class TG4FlagVector; | |
23 | class TG4PhysicsList; | |
24 | ||
25 | class G4ParticleDefinition; | |
26 | ||
27 | class TG4PhysicsManager | |
28 | { | |
29 | public: | |
30 | TG4PhysicsManager(); | |
31 | // --> protected | |
32 | // TG4PhysicsManager(const TG4PhysicsManager& right); | |
33 | virtual ~TG4PhysicsManager(); | |
34 | ||
35 | // static access method | |
36 | static TG4PhysicsManager* Instance(); | |
37 | ||
38 | // methods | |
39 | void BuildPhysics(); | |
40 | ||
41 | // set methods | |
42 | void SetCut(const char* cutName, Float_t cutValue); | |
43 | void SetProcess(const char* flagName, Int_t flagValue); | |
44 | Float_t Xsec(char* reac, Float_t energy, Int_t part, Int_t mate); | |
45 | ||
46 | // particle table usage | |
47 | Int_t IdFromPDG(Int_t pdgID) const; | |
48 | Int_t PDGFromId(Int_t mcID) const; | |
49 | void DefineParticles(); | |
50 | ||
51 | // | |
52 | // methods for Geant4 only | |
53 | // | |
54 | ||
55 | void Lock(); | |
56 | void SetProcessActivation(); | |
57 | G4int GetPDGEncodingFast(G4ParticleDefinition* particle); | |
58 | G4bool CheckCutWithCutVector( | |
59 | G4String name, G4double value, TG3Cut& cut); | |
60 | G4bool CheckFlagWithFlagVector( | |
61 | G4String name, G4double value, TG3Flag& flag); | |
62 | G4bool CheckCutWithG3Defaults( | |
63 | G4String name, G4double value, TG3Cut& cut); | |
64 | G4bool CheckFlagWithG3Defaults( | |
65 | G4String name, G4double value, TG3Flag& flag); | |
66 | ||
67 | // set methods | |
68 | void SetPhysicsList(TG4PhysicsList* physicsList); | |
69 | void SetG3DefaultCuts(); | |
70 | void SetG3DefaultProcesses(); | |
71 | ||
72 | // get methods | |
73 | G4bool IsLock() const; | |
74 | G4bool IsSpecialCuts() const; | |
75 | G4bool IsSpecialFlags() const; | |
76 | TG4CutVector* GetCutVector() const; | |
77 | TG4FlagVector* GetFlagVector() const; | |
78 | TG4boolVector* GetIsCutVector() const; | |
79 | TG4boolVector* GetIsFlagVector() const; | |
80 | TG3ParticleWSP GetG3ParticleWSP(G4ParticleDefinition* particle) const; | |
81 | void GetG3ParticleWSPName(G4int particleWSP, G4String& name) const; | |
82 | ||
83 | protected: | |
84 | TG4PhysicsManager(const TG4PhysicsManager& right); | |
85 | ||
86 | // operators | |
87 | TG4PhysicsManager& operator=(const TG4PhysicsManager& right); | |
88 | ||
89 | private: | |
90 | // methods | |
91 | void LockException() const; | |
92 | G4int GetPDGEncoding(G4ParticleDefinition* particle); | |
93 | G4int GetPDGEncoding(G4String particleName); | |
94 | ||
95 | // set methods | |
96 | void SetCut(TG3Cut cut, G4double cutValue); | |
97 | void SetProcess(TG3Flag flag, G4int flagValue); | |
98 | void SwitchIsCutVector(TG3Cut cut); | |
99 | void SwitchIsFlagVector(TG3Flag flag); | |
100 | ||
101 | // get methods | |
102 | TG3Cut GetG3Cut(G4String cutName); | |
103 | TG3Flag GetG3Flag(G4String flagName); | |
104 | ||
105 | // static data members | |
106 | static TG4PhysicsManager* fgInstance; //this instance | |
107 | ||
108 | // data members | |
109 | G4bool fLock; //if true: cut/flag vectors cannot be modified | |
110 | TG4PhysicsList* fPhysicsList; //physics list | |
111 | TG4CutVector* fCutVector; //TG4CutVector | |
112 | TG4FlagVector* fFlagVector; //TG4FlagVector | |
113 | TG4boolVector* fIsCutVector; //vector of booleans which cuts are set | |
114 | TG4boolVector* fIsFlagVector; //vector of booleans which flags are set | |
115 | TG4StringVector fG3CutNameVector; //vector of cut parameters names | |
116 | TG4StringVector fG3FlagNameVector; //vector of process control parameters | |
117 | //names | |
118 | TG4NameMap fParticleNameMap; //the mapping between G4 particle names | |
119 | //and TDatabasePDG names | |
120 | TG4IntMap fParticlePDGMap; //the mapping between G4 particle names | |
121 | //and TDatabasePDG codes | |
122 | }; | |
123 | ||
124 | // inline methods | |
125 | ||
126 | inline TG4PhysicsManager* TG4PhysicsManager::Instance() | |
127 | { return fgInstance; } | |
128 | ||
129 | inline void TG4PhysicsManager::Lock() | |
130 | { fLock = true; } | |
131 | ||
132 | inline void TG4PhysicsManager::SetPhysicsList(TG4PhysicsList* physicsList) | |
133 | { fPhysicsList = physicsList; } | |
134 | ||
135 | inline G4bool TG4PhysicsManager::IsLock() const | |
136 | { return fLock; } | |
137 | ||
138 | inline TG4CutVector* TG4PhysicsManager::GetCutVector() const | |
139 | { return fCutVector; } | |
140 | ||
141 | inline TG4FlagVector* TG4PhysicsManager::GetFlagVector() const | |
142 | { return fFlagVector; } | |
143 | ||
144 | inline TG4boolVector* TG4PhysicsManager::GetIsCutVector() const | |
145 | { return fIsCutVector; } | |
146 | ||
147 | inline TG4boolVector* TG4PhysicsManager::GetIsFlagVector() const | |
148 | { return fIsFlagVector; } | |
149 | ||
150 | #endif //TG4_PHYSICS_MANAGER_H | |
151 |