]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TGeant4/TG4PhysicsManager.h
moved from geometry to digits+hits; added comment lines separating methods
[u/mrichter/AliRoot.git] / TGeant4 / TG4PhysicsManager.h
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 "TG4G3Cut.h"
14 #include "TG4G3Control.h"
15
16 #include <Rtypes.h>
17 #include "AliMCProcess.h"
18
19 #include <globals.hh>
20
21 class AliDecayer;
22 class TG4ParticlesManager;
23 class TG4G3PhysicsManager;
24
25 class G4ParticleDefinition;
26 class G4VProcess;
27 class G4VModularPhysicsList;
28
29 class TG4PhysicsManager
30 {
31   public:
32     TG4PhysicsManager(G4VModularPhysicsList* physicsList);
33     // --> protected
34     // TG4PhysicsManager();
35     // TG4PhysicsManager(const TG4PhysicsManager& right);
36     virtual ~TG4PhysicsManager();
37
38     // static access method
39     static TG4PhysicsManager* Instance();
40         
41     // methods
42     void BuildPhysics();
43     void Gstpar(Int_t itmed, const char *param, Float_t parval); 
44
45     // set methods
46     void SetCut(const char* cutName, Float_t cutValue);
47     void SetProcess(const char* controlName, Int_t controlValue);
48     Float_t Xsec(char* reac, Float_t energy, Int_t part, Int_t mate);
49     void SetExternalDecayer(AliDecayer* decayer);
50      
51     // get methods
52     AliDecayer* Decayer() const;
53
54         // particle table usage         
55     Int_t IdFromPDG(Int_t pdgID) const;
56     Int_t PDGFromId(Int_t mcID) const;
57     void  DefineParticles();      
58     
59     //
60     // methods for Geant4 only 
61     //
62
63     void CreatePhysicsConstructors();
64     void SetProcessActivation();  
65     AliMCProcess GetMCProcess(const G4VProcess* process);
66
67     // set methods
68     void SetPhysicsList(G4VModularPhysicsList* physicsList);
69     void SetEMPhysics(G4bool value);
70     void SetOpticalPhysics(G4bool value);
71     void SetHadronPhysics(G4bool value);
72     void SetSpecialCutsPhysics(G4bool value);
73     void SetSpecialControlsPhysics(G4bool value);
74     
75     // get methods
76     G4VModularPhysicsList* GetPhysicsList() const; 
77    
78   protected:
79     TG4PhysicsManager();
80     TG4PhysicsManager(const TG4PhysicsManager& right);
81
82     // operators
83     TG4PhysicsManager& operator=(const TG4PhysicsManager& right);
84
85   private:
86     // methods
87     void FillProcessMap();
88     void GstparCut(G4int itmed, TG4G3Cut par, G4double parval);
89     void GstparControl(G4int itmed, TG4G3Control control, G4double parval);
90
91     // static data members
92     static TG4PhysicsManager*  fgInstance; //this instance
93     
94     // data members
95     TG4ParticlesManager*   fParticlesManager; //particles manager
96     TG4G3PhysicsManager*   fG3PhysicsManager; //G3 physics manager
97     G4VModularPhysicsList* fPhysicsList; //physics list
98     AliDecayer*            fDecayer;     //external decayer
99     TG4IntMap              fProcessMap;  //the mapping between G4 process names
100                                          //and AliMCProcess codes
101     G4bool  fSetEMPhysics;          //electromagnetic physics control
102     G4bool  fSetOpticalPhysics;     //optical physics control
103     G4bool  fSetHadronPhysics;      //hadron physics control
104     G4bool  fSetSpecialCutsPhysics; //special cuts process control 
105                                     //(under development)                  
106     G4bool  fSetSpecialControlsPhysics;//special controls process control
107                                     //(under development)
108 };
109
110 // inline methods
111
112 inline TG4PhysicsManager* TG4PhysicsManager::Instance() 
113 { return fgInstance; }
114
115 inline void TG4PhysicsManager::SetExternalDecayer(AliDecayer* decayer) 
116 { fDecayer = decayer; }
117
118 inline AliDecayer* TG4PhysicsManager::Decayer() const
119 { return fDecayer; }
120
121 inline void TG4PhysicsManager::SetPhysicsList(G4VModularPhysicsList* physicsList)
122 { fPhysicsList = physicsList; }
123
124 inline void TG4PhysicsManager::SetEMPhysics(G4bool value)
125 { fSetEMPhysics = value; }
126
127 inline void TG4PhysicsManager::SetOpticalPhysics(G4bool value)
128 { fSetOpticalPhysics = value; }
129
130 inline void TG4PhysicsManager::SetHadronPhysics(G4bool value)
131 { fSetHadronPhysics = value; }
132
133 inline void TG4PhysicsManager::SetSpecialCutsPhysics(G4bool value)
134 { fSetSpecialCutsPhysics = value; }
135
136 inline void TG4PhysicsManager::SetSpecialControlsPhysics(G4bool value)
137 { fSetSpecialControlsPhysics = value; }
138
139 inline G4VModularPhysicsList* TG4PhysicsManager::GetPhysicsList() const
140 { return fPhysicsList; }
141
142 #endif //TG4_PHYSICS_MANAGER_H
143