Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4EmModelManager.hh
이 파일의 문서화 페이지로 가기
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: G4EmModelManager.hh 106714 2017-10-20 09:38:06Z gcosmo $
27 //
28 // -------------------------------------------------------------------
29 //
30 // GEANT4 Class header file
31 //
32 // File name: G4EmModelManager
33 //
34 // Author: Vladimir Ivanchenko
35 //
36 // Creation date: 07.05.2002
37 //
38 // Modifications:
39 //
40 // 03-12-02 V.Ivanchenko fix a bug in model selection
41 // 20-01-03 Migrade to cut per region (V.Ivanchenko)
42 // 27-01-03 Make models region aware (V.Ivanchenko)
43 // 13-02-03 The set of models is defined for region (V.Ivanchenko)
44 // 26-03-03 Add GetDEDXDispersion (V.Ivanchenko)
45 // 13-04-03 Add startFromNull (V.Ivanchenko)
46 // 13-05-03 Add calculation of precise range (V.Ivanchenko)
47 // 21-07-03 Add UpdateEmModel method (V.Ivanchenko)
48 // 03-11-03 Substitute STL vector for G4RegionModels (V.Ivanchenko)
49 // 11-04-05 Remove access to fluctuation models (V.Ivanchenko)
50 // 10-01-06 PreciseRange -> CSDARange (V.Ivantchenko)
51 // 20-01-06 Introduce G4EmTableType and reducing number of methods (VI)
52 // 13-05-06 Add GetModel by index method (VI)
53 // 15-03-07 Add maxCutInRange (V.Ivanchenko)
54 // 08-04-08 Simplify Select method for only one G4RegionModel (VI)
55 // 03-08-09 Removed unused members and simplify model search if only one
56 // model is used (VI)
57 // 14-07-11 Use pointer to the vector of cuts and not local copy (VI)
58 //
59 // Class Description:
60 //
61 // It is the unified energy loss process it calculates the continuous
62 // energy loss for charged particles using a set of Energy Loss
63 // models valid for different energy regions. There are a possibility
64 // to create and access to dE/dx and range tables, or to calculate
65 // that information on fly.
66 
67 // -------------------------------------------------------------------
68 //
69 
70 
71 #ifndef G4EmModelManager_h
72 #define G4EmModelManager_h 1
73 
74 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
75 
76 #include "globals.hh"
77 #include "G4DataVector.hh"
78 #include "G4EmTableType.hh"
79 #include "G4EmProcessSubType.hh"
80 #include "G4Region.hh"
81 
83 {
84 
85 friend class G4EmModelManager;
86 
87 private:
88 
89  G4RegionModels(G4int nMod, std::vector<G4int>& indx,
90  G4DataVector& lowE, const G4Region* reg);
91 
93 
94  inline G4int SelectIndex(G4double e) const {
95  G4int idx = 0;
96  if (nModelsForRegion>1) {
97  idx = nModelsForRegion;
98  // Loop checking, 03-Aug-2015, Vladimir Ivanchenko
99  do {--idx;} while (idx > 0 && e <= lowKineticEnergy[idx]);
100  }
101  return theListOfModelIndexes[idx];
102  };
103 
104  inline G4int ModelIndex(G4int n) const {
105  return theListOfModelIndexes[n];
106  };
107 
108  inline G4int NumberOfModels() const {
109  return nModelsForRegion;
110  };
111 
112  inline G4double LowEdgeEnergy(G4int n) const {
113  return lowKineticEnergy[n];
114  };
115 
116  inline const G4Region* Region() const {
117  return theRegion;
118  };
119 
120  G4RegionModels(G4RegionModels &) = delete;
121  G4RegionModels & operator=(const G4RegionModels &right) = delete;
122 
127 
128 };
129 
130 #include "G4VEmModel.hh"
131 #include "G4VEmFluctuationModel.hh"
132 #include "G4DynamicParticle.hh"
133 #include <iostream>
134 
135 class G4Region;
137 class G4PhysicsVector;
139 
140 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
141 
143 {
144 public:
145 
147 
149 
150  void Clear();
151 
153  const G4ParticleDefinition* secPart,
154  G4double minSubRange,
155  G4int verb);
156 
159 
161  G4bool startFromNull = true,
163 
165 
166  void UpdateEmModel(const G4String& model_name, G4double emin, G4double emax);
167 
168  // Get model pointer from the model list
169  G4VEmModel* GetModel(G4int idx, G4bool ver = false);
170 
171  // Get model pointer from the model list for a given material cuts couple
172  // no check on material cuts couple index
173  G4VEmModel* GetRegionModel(G4int idx, size_t index_couple);
174 
175  // total number of models for material cut couples
176  // no check on material cuts couple index
177  G4int NumberOfRegionModels(size_t index_couple) const;
178 
179  // Automatic documentation
180  void DumpModelList(std::ostream& out, G4int verb);
181  void DumpModelList(std::ostream& out, G4int verb, G4String endOfLine);
182 
183  // Select model for given material cuts couple index
184  inline G4VEmModel* SelectModel(G4double& energy, size_t& index);
185 
186  // Access to cuts
187  inline const G4DataVector* Cuts() const;
188  inline const G4DataVector* SubCutoff() const;
189 
190  // Set flag of fluorescence
191  inline void SetFluoFlag(G4bool val);
192 
193  // total number of models
194  inline G4int NumberOfModels() const;
195 
196 private:
197 
199  const G4MaterialCutsCouple*,
200  G4double kinEnergy,
201  G4double cutEnergy,
202  G4double minEnergy);
203 
204  // hide assignment operator
205 
208 
209 // =====================================================================
210 
211 private:
212 
216 
217  std::vector<G4VEmModel*> models;
218  std::vector<G4VEmFluctuationModel*> flucModels;
219  std::vector<const G4Region*> regions;
220  std::vector<G4int> orderOfModels;
221  std::vector<G4int> isUsed;
222 
225 
226  std::vector<G4int> idxOfRegionModels;
227  std::vector<G4RegionModels*> setOfRegionModels;
228 
230 
232 
236 
237  // may be changed in run time
240 };
241 
242 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
243 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
244 
246  size_t& index)
247 {
248  if(severalModels) {
249  if(nRegions > 1) {
251  }
253  }
254  return currModel;
255 }
256 
257 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
258 
260 {
261  return theCuts;
262 }
263 
264 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
265 
267 {
268  return theSubCuts;
269 }
270 
271 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
272 
274 {
275  fluoFlag = val;
276 }
277 
278 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
279 
281 {
282  return nEmModels;
283 }
284 
285 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
286 
287 inline G4double
289  const G4MaterialCutsCouple* couple,
290  G4double e,
291  G4double cut,
292  G4double emin)
293 {
294  G4double dedx = 0.0;
295  if(model && cut > emin) {
296  dedx = model->ComputeDEDX(couple,particle,e,cut);
297  if(emin > 0.0) {dedx -= model->ComputeDEDX(couple,particle,e,emin);}
298  }
299  return dedx;
300 }
301 
302 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
303 
304 #endif
305 
G4VEmModel * currModel
void FillDEDXVector(G4PhysicsVector *, const G4MaterialCutsCouple *, G4EmTableType t=fRestricted)
std::vector< const G4Region * > regions
const G4Region * theRegion
const G4DataVector * Initialise(const G4ParticleDefinition *part, const G4ParticleDefinition *secPart, G4double minSubRange, G4int verb)
G4int SelectIndex(G4double e) const
std::vector< G4VEmModel * > models
const G4DataVector * SubCutoff() const
G4DataVector * theCutsNew
std::vector< G4int > orderOfModels
static const G4double emax
G4int * theListOfModelIndexes
const G4ParticleDefinition * particle
const G4Region * Region() const
G4VEmModel * GetRegionModel(G4int idx, size_t index_couple)
G4EmTableType
G4VEmModel * GetModel(G4int idx, G4bool ver=false)
void DumpModelList(std::ostream &out, G4int verb)
std::vector< G4int > isUsed
G4int NumberOfModels() const
G4int ModelIndex(G4int n) const
double G4double
Definition: G4Types.hh:76
bool G4bool
Definition: G4Types.hh:79
TString part[npart]
Definition: Style.C:32
void AddEmModel(G4int, G4VEmModel *, G4VEmFluctuationModel *, const G4Region *)
G4RegionModels & operator=(const G4RegionModels &right)=delete
G4VEmModel * SelectModel(G4double &energy, size_t &index)
double energy
Definition: plottest35.C:25
virtual G4double ComputeDEDX(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=DBL_MAX)
Definition: G4VEmModel.hh:500
void UpdateEmModel(const G4String &model_name, G4double emin, G4double emax)
const G4DataVector * theCuts
G4RegionModels(G4int nMod, std::vector< G4int > &indx, G4DataVector &lowE, const G4Region *reg)
G4DataVector * theSubCuts
G4double ComputeDEDX(G4VEmModel *model, const G4MaterialCutsCouple *, G4double kinEnergy, G4double cutEnergy, G4double minEnergy)
G4int NumberOfRegionModels(size_t index_couple) const
int G4int
Definition: G4Types.hh:78
void FillLambdaVector(G4PhysicsVector *, const G4MaterialCutsCouple *, G4bool startFromNull=true, G4EmTableType t=fRestricted)
std::vector< G4VEmFluctuationModel * > flucModels
Char_t n[5]
std::vector< G4int > idxOfRegionModels
G4RegionModels * currRegionModel
static const G4double reg
G4EmModelManager & operator=(const G4EmModelManager &right)=delete
G4double * lowKineticEnergy
const XML_Char XML_Content * model
Definition: expat.h:151
void SetFluoFlag(G4bool val)
G4double LowEdgeEnergy(G4int n) const
G4int NumberOfModels() const
const G4DataVector * Cuts() const
std::vector< G4RegionModels * > setOfRegionModels