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