Geant4  10.00.p02
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 
214 
215  void CopyTables(const G4ParticleDefinition* aParticle,
217 
218  void CopyDEDXTables();
219 
220  void SetParameters(const G4ParticleDefinition* aParticle,
222 
225 
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 
246 
249 
252 
265 
274 
280 
284 
285 };
286 
287 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
288 
289 #endif
290 
std::vector< G4PhysicsTable * > range_vector
Definition: G4EmManager.hh:238
void DeRegister(G4PhysicsTable *p)
G4double maxKinEnergy
Definition: G4EmManager.hh:270
std::vector< G4VMultipleScattering * > msc_vector
Definition: G4EmManager.hh:241
G4double maxRangeVariation
Definition: G4EmManager.hh:267
G4bool flagLPM
Definition: G4EmManager.hh:263
G4bool BuildCSDARange() const
Definition: G4EmManager.cc:613
void Register(G4VEnergyLossProcess *p)
Definition: G4EmManager.cc:172
G4int nbinsPerDecade
Definition: G4EmManager.hh:282
G4double minKinEnergy
Definition: G4EmManager.hh:269
G4bool startInitialisation
Definition: G4EmManager.hh:251
G4bool rndmStepFlag
Definition: G4EmManager.hh:255
G4VEnergyLossProcess * BuildTables(const G4ParticleDefinition *aParticle)
Definition: G4EmManager.cc:474
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
void SetRandomStep(G4bool val)
Definition: G4EmManager.cc:665
void SetVerbose(G4int val)
Definition: G4EmManager.cc:766
void SetLossFluctuations(G4bool val)
Definition: G4EmManager.cc:620
G4EmManager & operator=(const G4EmManager &right)
void SetDEDXBinningForCSDARange(G4int val)
Definition: G4EmManager.cc:731
std::vector< G4PhysicsTable * > inv_range_vector
Definition: G4EmManager.hh:239
G4bool integralActive
Definition: G4EmManager.hh:257
G4bool LPMFlag() const
Definition: G4EmManager.cc:868
G4ElectronIonPair * emElectronIonPair
Definition: G4EmManager.hh:279
void SetSubCutoff(G4bool val, const G4Region *r=0)
Definition: G4EmManager.cc:630
int G4int
Definition: G4Types.hh:78
G4bool all_tables_are_built
Definition: G4EmManager.hh:250
const G4ParticleDefinition * PD
Definition: G4EmManager.hh:228
void PreparePhysicsTable(const G4ParticleDefinition *aParticle, G4VEnergyLossProcess *p)
Definition: G4EmManager.cc:264
static G4EmManager * Instance()
Definition: G4EmManager.cc:72
G4EmConfigurator * emConfigurator
Definition: G4EmManager.hh:278
G4double MaxKinEnergy() const
Definition: G4EmManager.cc:925
void SetBremsstrahlungTh(G4double val)
Definition: G4EmManager.cc:890
G4bool stepFunctionActive
Definition: G4EmManager.hh:262
G4ElectronIonPair * ElectronIonPair()
Definition: G4EmManager.cc:946
std::map< PD, G4VEnergyLossProcess *, std::less< PD > > loss_map
Definition: G4EmManager.hh:230
std::vector< G4PhysicsTable * > xsection_vector
Definition: G4EmManager.hh:240
std::vector< PD > part_vector
Definition: G4EmManager.hh:233
G4int nbinsLambda
Definition: G4EmManager.hh:281
void SetIntegral(G4bool val)
Definition: G4EmManager.cc:640
void SetFactorForAngleLimit(G4double val)
Definition: G4EmManager.cc:904
G4double minSubRange
Definition: G4EmManager.hh:266
G4double FactorForAngleLimit() const
Definition: G4EmManager.cc:911
void SetBuildCSDARange(G4bool val)
Definition: G4EmManager.cc:815
bool G4bool
Definition: G4Types.hh:79
G4double maxFinalStep
Definition: G4EmManager.hh:268
G4double BremsstrahlungTh() const
Definition: G4EmManager.cc:897
void SetDEDXBinning(G4int val)
Definition: G4EmManager.cc:722
void CopyDEDXTables()
G4int GetNumberOfBinsPerDecade() const
Definition: G4EmManager.cc:759
G4bool lossFluctuationFlag
Definition: G4EmManager.hh:253
std::vector< PD > base_part_vector
Definition: G4EmManager.hh:234
G4double factorForAngleLimit
Definition: G4EmManager.hh:273
std::vector< G4bool > isActive
Definition: G4EmManager.hh:236
G4bool splineFlag
Definition: G4EmManager.hh:264
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
void SetParameters(const G4ParticleDefinition *aParticle, G4VEnergyLossProcess *)
Definition: G4EmManager.cc:822
std::vector< G4VEmProcess * > emp_vector
Definition: G4EmManager.hh:242
std::vector< G4VEnergyLossProcess * > loss_vector
Definition: G4EmManager.hh:232
void RegisterExtraParticle(const G4ParticleDefinition *aParticle, G4VEnergyLossProcess *p)
Definition: G4EmManager.cc:237
G4bool maxEnergyForMuonsActive
Definition: G4EmManager.hh:261
std::vector< G4bool > tables_are_built
Definition: G4EmManager.hh:235
void SetLPMFlag(G4bool val)
Definition: G4EmManager.cc:861
G4bool subCutoffFlag
Definition: G4EmManager.hh:254
void InitialiseProcess(const G4ParticleDefinition *aParticle, G4VEnergyLossProcess *)
Definition: G4EmManager.cc:840
G4bool integral
Definition: G4EmManager.hh:256
void SetStepFunction(G4double v1, G4double v2)
Definition: G4EmManager.cc:794
void CopyTables(const G4ParticleDefinition *aParticle, G4VEnergyLossProcess *)
Definition: G4EmManager.cc:435
G4LossTableBuilder * tableBuilder
Definition: G4EmManager.hh:275
void BuildPhysicsTable(const G4ParticleDefinition *aParticle)
Definition: G4EmManager.cc:332
G4EmSaturation * emSaturation
Definition: G4EmManager.hh:277
G4bool minEnergyActive
Definition: G4EmManager.hh:259
G4double bremsTh
Definition: G4EmManager.hh:272
std::vector< G4PhysicsTable * > dedx_vector
Definition: G4EmManager.hh:237
G4EmSaturation * EmSaturation()
Definition: G4EmManager.cc:932
double G4double
Definition: G4Types.hh:76
G4double maxKinEnergyForMuons
Definition: G4EmManager.hh:271
void SetMinSubRange(G4double val)
Definition: G4EmManager.cc:655
void SetMinEnergy(G4double val)
Definition: G4EmManager.cc:675
G4EmManagerMessenger * theMessenger
Definition: G4EmManager.hh:276
void SetMaxEnergyForMuons(G4double val)
Definition: G4EmManager.cc:714
static G4EmManager * theInstance
Definition: G4EmManager.hh:226
G4bool maxEnergyActive
Definition: G4EmManager.hh:260
G4bool buildCSDARange
Definition: G4EmManager.hh:258
G4double MinKinEnergy() const
Definition: G4EmManager.cc:918