]>
Commit | Line | Data |
---|---|---|
17929791 | 1 | // $Id$ |
2 | // Category: physics | |
3 | // | |
e5967ab3 | 4 | // Author: I. Hrivnacova |
5 | // | |
6 | // Class TG4G3PhysicsManager | |
7 | // ------------------------- | |
17929791 | 8 | // This class provides a Geant3 way control |
9 | // to Geant4 physics. | |
10 | // The G3 cuts and process controls are | |
11 | // stored in fCutVector and fControlVector vectors. | |
12 | // These special cuts/controls are activated | |
13 | // by registering their physics constructors | |
14 | // (TG4PhysicsConstructorSpecialCuts, G4PhysicsConstructorSpecialControl) | |
15 | // to the modular physics list (TG4ModularPhysicsList) | |
16 | // by physics manager (TG4PhysicsManager). | |
17 | ||
18 | #ifndef TG4_G3_PHYSICS_MANAGER_H | |
19 | #define TG4_G3_PHYSICS_MANAGER_H | |
20 | ||
21 | #include "TG4Globals.h" | |
e5967ab3 | 22 | #include "TG4G3Defaults.h" |
17929791 | 23 | #include "TG4G3Cut.h" |
24 | #include "TG4G3Control.h" | |
25 | #include "TG4G3ParticleWSP.h" | |
26 | ||
27 | #include <Rtypes.h> | |
28 | #include "AliMCProcess.h" | |
29 | ||
30 | #include <globals.hh> | |
31 | ||
32 | class TG4G3CutVector; | |
33 | class TG4G3ControlVector; | |
34 | ||
35 | class G4ParticleDefinition; | |
36 | class G4VProcess; | |
37 | ||
38 | class TG4G3PhysicsManager | |
39 | { | |
40 | public: | |
41 | TG4G3PhysicsManager(); | |
42 | // --> protected | |
43 | // TG4G3PhysicsManager(const TG4G3PhysicsManager& right); | |
44 | virtual ~TG4G3PhysicsManager(); | |
45 | ||
46 | // static access method | |
47 | static TG4G3PhysicsManager* Instance(); | |
48 | ||
49 | // methods | |
50 | void Lock(); | |
51 | void CheckLock(); | |
52 | G4VProcess* FindProcess(G4String processName) const; | |
53 | G4bool CheckCutWithTheVector( | |
54 | G4String name, G4double value, TG4G3Cut& cut); | |
55 | G4bool CheckControlWithTheVector( | |
e5967ab3 | 56 | G4String name, G4double value, |
57 | TG4G3Control& control, TG4G3ControlValue& controlValue); | |
17929791 | 58 | G4bool CheckCutWithG3Defaults( |
59 | G4String name, G4double value, TG4G3Cut& cut); | |
60 | G4bool CheckControlWithG3Defaults( | |
e5967ab3 | 61 | G4String name, G4double value, |
62 | TG4G3Control& control, TG4G3ControlValue& controlValue); | |
17929791 | 63 | |
64 | // set methods | |
65 | void SetCut(TG4G3Cut cut, G4double cutValue); | |
e5967ab3 | 66 | void SetProcess(TG4G3Control control, TG4G3ControlValue controlValue); |
17929791 | 67 | void SetG3DefaultCuts(); |
68 | void SetG3DefaultControls(); | |
69 | ||
70 | // get methods | |
71 | G4bool IsSpecialCuts() const; | |
72 | G4bool IsSpecialControls() const; | |
e5967ab3 | 73 | TG4G3CutVector* GetCutVector() const; |
17929791 | 74 | TG4G3ControlVector* GetControlVector() const; |
e5967ab3 | 75 | TG4boolVector* GetIsCutVector() const; |
76 | TG4boolVector* GetIsControlVector() const; | |
77 | // conversions | |
78 | TG4G3ParticleWSP GetG3ParticleWSP(G4ParticleDefinition* particle) const; | |
79 | G4String GetG3ParticleWSPName(G4int particleWSP) const; | |
17929791 | 80 | |
81 | protected: | |
82 | TG4G3PhysicsManager(const TG4G3PhysicsManager& right); | |
83 | ||
84 | // operators | |
85 | TG4G3PhysicsManager& operator=(const TG4G3PhysicsManager& right); | |
86 | ||
87 | private: | |
17929791 | 88 | // set methods |
89 | void SwitchIsCutVector(TG4G3Cut cut); | |
90 | void SwitchIsControlVector(TG4G3Control control); | |
91 | ||
92 | // static data members | |
93 | static TG4G3PhysicsManager* fgInstance; //this instance | |
94 | ||
95 | // data members | |
96 | TG4G3CutVector* fCutVector; //TG4CutVector | |
97 | TG4G3ControlVector* fControlVector;//TG4ControlVector | |
e5967ab3 | 98 | TG4boolVector* fIsCutVector; //vector of booleans which cuts are set |
17929791 | 99 | TG4boolVector* fIsControlVector; //vector of booleans which controls are set |
e5967ab3 | 100 | TG4G3Defaults fG3Defaults; // G3 default cuts/controls |
17929791 | 101 | G4bool fLock; //if true: cut/control vectors cannot be modified |
102 | }; | |
103 | ||
104 | // inline methods | |
105 | ||
106 | inline TG4G3PhysicsManager* TG4G3PhysicsManager::Instance() | |
107 | { return fgInstance; } | |
108 | ||
109 | inline void TG4G3PhysicsManager::Lock() | |
110 | { fLock = true; } | |
111 | ||
112 | inline TG4G3CutVector* TG4G3PhysicsManager::GetCutVector() const | |
113 | { return fCutVector; } | |
114 | ||
115 | inline TG4G3ControlVector* TG4G3PhysicsManager::GetControlVector() const | |
116 | { return fControlVector; } | |
117 | ||
118 | inline TG4boolVector* TG4G3PhysicsManager::GetIsCutVector() const | |
119 | { return fIsCutVector; } | |
120 | ||
121 | inline TG4boolVector* TG4G3PhysicsManager::GetIsControlVector() const | |
122 | { return fIsControlVector; } | |
123 | ||
124 | #endif //TG4_PHYSICS_MANAGER_H | |
125 |