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