Geant4_10
G4EmManager.hh
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 // $Id: G4EmManager.hh 66885 2013-01-16 17:37:13Z gunter $
27 //
28 //
29 // -------------------------------------------------------------------
30 //
31 // GEANT4 Class header file
32 //
33 //
34 // File name: G4EmManager
35 //
36 // Author: Vladimir Ivanchenko for migration to MT
37 //
38 //
39 // Creation date: 17.05.2013
40 //
41 // Modifications:
42 //
43 //
44 // Class Description:
45 //
46 // A utility static class, responsable for keeping pointers
47 // of all shared objects and main static parameters
48 // for EM physics models.
49 //
50 // It is a singleton which is initialized by the master thread.
51 // It keeps pointers to shared objects and is read-only in run time
52 //
53 // EM processes have to register their tables with this
54 // class. The responsibility of creating and deleting the tables
55 // remains with the energy loss classes.
56 //
57 // -------------------------------------------------------------------
58 //
59 
60 #ifndef G4EmManager_h
61 #define G4EmManager_h 1
62 
63 #include <map>
64 #include <vector>
65 #include "globals.hh"
66 
67 class G4PhysicsTable;
72 class G4VEmProcess;
74 class G4EmSaturation;
75 class G4EmConfigurator;
76 class G4ElectronIonPair;
77 class G4LossTableBuilder;
78 class G4Region;
79 
81 {
82 
83 public:
84 
85  static G4EmManager* Instance();
86 
87  ~G4EmManager();
88 
89  //-------------------------------------------------
90  // Initialisation
91  //-------------------------------------------------
92 
93  void PreparePhysicsTable(const G4ParticleDefinition* aParticle,
95 
96  void PreparePhysicsTable(const G4ParticleDefinition* aParticle,
97  G4VEmProcess* p);
98 
99  void PreparePhysicsTable(const G4ParticleDefinition* aParticle,
101 
102  void BuildPhysicsTable(const G4ParticleDefinition* aParticle);
103 
104  void BuildPhysicsTable(const G4ParticleDefinition* aParticle,
106 
107  void InitialiseProcess(const G4ParticleDefinition* aParticle,
109 
110  void InitialiseProcess(const G4ParticleDefinition* aParticle,
111  G4VEmProcess*);
112 
113  void InitialiseProcess(const G4ParticleDefinition* aParticle,
115 
116  //-------------------------------------------------
117  // Registration of processes and tables
118  //-------------------------------------------------
119 
121 
123 
124  void Register(G4VEmProcess* p);
125 
126  void RegisterExtraParticle(const G4ParticleDefinition* aParticle,
128 
129  void Register(G4PhysicsTable* p);
130 
131  void DeRegister(G4PhysicsTable* p);
132 
133  //-------------------------------------------------
134  // Parameter set methods
135  //-------------------------------------------------
136 
137  void SetLossFluctuations(G4bool val);
138 
139  void SetSubCutoff(G4bool val, const G4Region* r=0);
140 
141  void SetIntegral(G4bool val);
142 
143  void SetRandomStep(G4bool val);
144 
145  void SetMinSubRange(G4double val);
146 
147  void SetMinEnergy(G4double val);
148 
149  void SetMaxEnergy(G4double val);
150 
152 
153  void SetMaxEnergyForMuons(G4double val);
154 
155  void SetDEDXBinning(G4int val);
156 
158 
159  void SetLambdaBinning(G4int val);
160 
162 
163  void SetStepFunction(G4double v1, G4double v2);
164 
165  void SetBuildCSDARange(G4bool val);
166 
167  void SetLPMFlag(G4bool val);
168 
169  void SetSplineFlag(G4bool val);
170 
171  void SetLinearLossLimit(G4double val);
172 
173  void SetBremsstrahlungTh(G4double val);
174 
176 
177  void SetVerbose(G4int val);
178 
179  //-------------------------------------------------
180  // Access methods
181  //-------------------------------------------------
182 
183  G4bool BuildCSDARange() const;
184 
185  G4bool LPMFlag() const;
186 
187  G4bool SplineFlag() const;
188 
189  G4double BremsstrahlungTh() const;
190 
192 
193  G4double MinKinEnergy() const;
194 
195  G4double MaxKinEnergy() const;
196 
198 
200 
202 
204 
205 private:
206 
207  //-------------------------------------------------
208  // Private methods and members
209  //-------------------------------------------------
210 
211  G4EmManager();
212 
213  G4VEnergyLossProcess* BuildTables(const G4ParticleDefinition* aParticle);
214 
215  void CopyTables(const G4ParticleDefinition* aParticle,
217 
218  void CopyDEDXTables();
219 
220  void SetParameters(const G4ParticleDefinition* aParticle,
222 
224  G4EmManager & operator=(const G4EmManager &right);
225 
226  static G4EmManager* theInstance;
227 
228  typedef const G4ParticleDefinition* PD;
229 
230  std::map<PD,G4VEnergyLossProcess*,std::less<PD> > loss_map;
231 
232  std::vector<G4VEnergyLossProcess*> loss_vector;
233  std::vector<PD> part_vector;
234  std::vector<PD> base_part_vector;
235  std::vector<G4bool> tables_are_built;
236  std::vector<G4bool> isActive;
237  std::vector<G4PhysicsTable*> dedx_vector;
238  std::vector<G4PhysicsTable*> range_vector;
239  std::vector<G4PhysicsTable*> inv_range_vector;
240  std::vector<G4PhysicsTable*> xsection_vector;
241  std::vector<G4VMultipleScattering*> msc_vector;
242  std::vector<G4VEmProcess*> emp_vector;
243 
244  G4int n_loss;
245  G4int run;
246 
247  PD firstParticle;
248  PD theElectron;
249 
250  G4bool all_tables_are_built;
251  G4bool startInitialisation;
252 
253  G4bool lossFluctuationFlag;
254  G4bool subCutoffFlag;
255  G4bool rndmStepFlag;
256  G4bool integral;
257  G4bool integralActive;
258  G4bool buildCSDARange;
259  G4bool minEnergyActive;
260  G4bool maxEnergyActive;
261  G4bool maxEnergyForMuonsActive;
262  G4bool stepFunctionActive;
263  G4bool flagLPM;
264  G4bool splineFlag;
265 
266  G4double minSubRange;
267  G4double maxRangeVariation;
268  G4double maxFinalStep;
269  G4double minKinEnergy;
270  G4double maxKinEnergy;
271  G4double maxKinEnergyForMuons;
272  G4double bremsTh;
273  G4double factorForAngleLimit;
274 
275  G4LossTableBuilder* tableBuilder;
276  G4EmManagerMessenger* theMessenger;
277  G4EmSaturation* emSaturation;
278  G4EmConfigurator* emConfigurator;
279  G4ElectronIonPair* emElectronIonPair;
280 
281  G4int nbinsLambda;
282  G4int nbinsPerDecade;
283  G4int verbose;
284 
285 };
286 
287 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
288 
289 #endif
290 
void DeRegister(G4PhysicsTable *p)
G4bool BuildCSDARange() const
Definition: G4EmManager.cc:613
void Register(G4VEnergyLossProcess *p)
Definition: G4EmManager.cc:172
G4bool SplineFlag() const
Definition: G4EmManager.cc:883
void SetMaxEnergy(G4double val)
Definition: G4EmManager.cc:690
void SetMaxEnergyForCSDARange(G4double val)
Definition: G4EmManager.cc:705
void SetSplineFlag(G4bool val)
Definition: G4EmManager.cc:875
const char * p
Definition: xmltok.h:285
void SetRandomStep(G4bool val)
Definition: G4EmManager.cc:665
void SetVerbose(G4int val)
Definition: G4EmManager.cc:766
void SetLossFluctuations(G4bool val)
Definition: G4EmManager.cc:620
void SetDEDXBinningForCSDARange(G4int val)
Definition: G4EmManager.cc:731
G4bool LPMFlag() const
Definition: G4EmManager.cc:868
void SetSubCutoff(G4bool val, const G4Region *r=0)
Definition: G4EmManager.cc:630
int G4int
Definition: G4Types.hh:78
void PreparePhysicsTable(const G4ParticleDefinition *aParticle, G4VEnergyLossProcess *p)
Definition: G4EmManager.cc:264
static G4EmManager * Instance()
Definition: G4EmManager.cc:72
G4double MaxKinEnergy() const
Definition: G4EmManager.cc:925
void SetBremsstrahlungTh(G4double val)
Definition: G4EmManager.cc:890
G4ElectronIonPair * ElectronIonPair()
Definition: G4EmManager.cc:946
void SetIntegral(G4bool val)
Definition: G4EmManager.cc:640
void SetFactorForAngleLimit(G4double val)
Definition: G4EmManager.cc:904
G4double FactorForAngleLimit() const
Definition: G4EmManager.cc:911
void SetBuildCSDARange(G4bool val)
Definition: G4EmManager.cc:815
bool G4bool
Definition: G4Types.hh:79
G4double BremsstrahlungTh() const
Definition: G4EmManager.cc:897
void SetDEDXBinning(G4int val)
Definition: G4EmManager.cc:722
G4int GetNumberOfBinsPerDecade() const
Definition: G4EmManager.cc:759
G4LossTableBuilder * GetTableBuilder()
Definition: G4EmManager.cc:953
G4EmConfigurator * EmConfigurator()
Definition: G4EmManager.cc:939
void SetLinearLossLimit(G4double val)
Definition: G4EmManager.cc:806
void SetLambdaBinning(G4int val)
Definition: G4EmManager.cc:740
jump r
Definition: plot.C:36
void RegisterExtraParticle(const G4ParticleDefinition *aParticle, G4VEnergyLossProcess *p)
Definition: G4EmManager.cc:237
void SetLPMFlag(G4bool val)
Definition: G4EmManager.cc:861
void InitialiseProcess(const G4ParticleDefinition *aParticle, G4VEnergyLossProcess *)
Definition: G4EmManager.cc:840
void SetStepFunction(G4double v1, G4double v2)
Definition: G4EmManager.cc:794
void BuildPhysicsTable(const G4ParticleDefinition *aParticle)
Definition: G4EmManager.cc:332
G4EmSaturation * EmSaturation()
Definition: G4EmManager.cc:932
double G4double
Definition: G4Types.hh:76
void SetMinSubRange(G4double val)
Definition: G4EmManager.cc:655
void SetMinEnergy(G4double val)
Definition: G4EmManager.cc:675
void SetMaxEnergyForMuons(G4double val)
Definition: G4EmManager.cc:714
G4double MinKinEnergy() const
Definition: G4EmManager.cc:918