Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4VMscModel.cc
이 파일의 문서화 페이지로 가기
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: G4VMscModel.cc 105745 2017-08-16 13:14:37Z gcosmo $
27 //
28 // -------------------------------------------------------------------
29 //
30 // GEANT4 Class file
31 //
32 //
33 // File name: G4VMscModel
34 //
35 // Author: Vladimir Ivanchenko
36 //
37 // Creation date: 07.03.2008
38 //
39 // Modifications:
40 //
41 //
42 // Class Description:
43 //
44 // General interface to msc models
45 
46 // -------------------------------------------------------------------
47 //
48 
49 #include "G4VMscModel.hh"
50 #include "G4SystemOfUnits.hh"
53 #include "G4LossTableManager.hh"
54 #include "G4LossTableBuilder.hh"
55 #include "G4EmParameters.hh"
56 
57 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
58 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
59 
61  G4VEmModel(nam),
62  safetyHelper(nullptr),
63  ionisation(nullptr),
64  facrange(0.04),
65  facgeom(2.5),
66  facsafety(0.3),
67  skin(1.0),
68  dtrl(0.05),
69  lambdalimit(mm),
70  geomMin(1.e-6*CLHEP::mm),
71  geomMax(1.e50*CLHEP::mm),
72  fDisplacement(0.,0.,0.),
73  steppingAlgorithm(fUseSafety),
74  samplez(false),
75  latDisplasment(true)
76 {
79  localtkin = 0.0;
80  currentPart = nullptr;
81 }
82 
83 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
84 
86 {}
87 
88 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
89 
92 {
93  // recomputed for each new run
94  if(!safetyHelper) {
96  ->GetSafetyHelper();
98  }
99  G4ParticleChangeForMSC* change = nullptr;
100  if (pParticleChange) {
101  change = static_cast<G4ParticleChangeForMSC*>(pParticleChange);
102  } else {
103  change = new G4ParticleChangeForMSC();
104  }
105  if(p) {
106 
107  // table is never built for GenericIon
108  if(p->GetParticleName() == "GenericIon") {
109  if(xSectionTable) {
111  delete xSectionTable;
112  xSectionTable = nullptr;
113  }
114 
115  // table is always built for low mass particles
116  } else if(p->GetPDGMass() < 4.5*GeV || ForceBuildTableFlag()) {
117 
119  idxTable = 0;
120  G4LossTableBuilder* builder =
122  if(IsMaster()) {
125  emin = std::max(emin, param->MinKinEnergy());
126  emax = std::min(emax, param->MaxKinEnergy());
127  if(emin < emax) {
128  xSectionTable = builder->BuildTableForModel(xSectionTable, this, p,
129  emin, emax, true);
130  }
131  }
132  theDensityFactor = builder->GetDensityFactors();
133  theDensityIdx = builder->GetCoupleIndexes();
134  }
135  }
136  return change;
137 }
138 
139 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
140 
143 {
144  return fDisplacement;
145 }
146 
147 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
148 
150 {
151  return DBL_MAX;
152 }
153 
154 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
155 
157 {
158  return truePathLength;
159 }
160 
161 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
162 
164 {
165  return geomPathLength;
166 }
167 
168 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
169 
170 void G4VMscModel::SampleSecondaries(std::vector<G4DynamicParticle*>*,
171  const G4MaterialCutsCouple*,
172  const G4DynamicParticle*,
174 {}
175 
176 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
T max(const T t1, const T t2)
brief Return the largest of the two arguments
G4SafetyHelper * GetSafetyHelper() const
G4SafetyHelper * safetyHelper
Definition: G4VMscModel.hh:165
G4ThreeVector fDisplacement
Definition: G4VMscModel.hh:184
G4bool ForceBuildTableFlag() const
Definition: G4VEmModel.hh:665
static constexpr double g
static constexpr double mm
Definition: G4SIunits.hh:115
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double tmax) override
Definition: G4VMscModel.cc:170
const std::vector< G4int > * GetCoupleIndexes()
const char * p
Definition: xmltok.h:285
virtual G4ThreeVector & SampleScattering(const G4ThreeVector &, G4double safety)
Definition: G4VMscModel.cc:142
G4double MaxKinEnergy() const
const G4String & GetParticleName() const
const G4ParticleDefinition * currentPart
Definition: G4VMscModel.hh:167
static const G4double emax
G4double GetPDGMass() const
G4double LowEnergyActivationLimit() const
Definition: G4VEmModel.hh:630
G4double LowEnergyLimit() const
Definition: G4VEmModel.hh:616
double G4double
Definition: G4Types.hh:76
G4VMscModel(const G4String &nam)
Definition: G4VMscModel.cc:60
G4double dedx
Definition: G4VMscModel.hh:169
static constexpr double MeV
const std::vector< G4double > * GetDensityFactors()
G4double localrange
Definition: G4VMscModel.hh:171
virtual G4double ComputeTruePathLengthLimit(const G4Track &track, G4double &stepLimit)
Definition: G4VMscModel.cc:149
void InitialiseHelper()
G4double localtkin
Definition: G4VMscModel.hh:170
G4LossTableBuilder * GetTableBuilder()
G4double MinKinEnergy() const
static constexpr double cm2
static G4TransportationManager * GetTransportationManager()
virtual G4double ComputeTrueStepLength(G4double geomPathLength)
Definition: G4VMscModel.cc:163
G4PhysicsTable * BuildTableForModel(G4PhysicsTable *table, G4VEmModel *model, const G4ParticleDefinition *, G4double emin, G4double emax, G4bool spline)
G4ParticleChangeForMSC * GetParticleChangeForMSC(const G4ParticleDefinition *p=nullptr)
Definition: G4VMscModel.cc:91
G4VParticleChange * pParticleChange
Definition: G4VEmModel.hh:431
const std::vector< G4int > * theDensityIdx
Definition: G4VEmModel.hh:434
virtual G4double ComputeGeomPathLength(G4double truePathLength)
Definition: G4VMscModel.cc:156
static G4LossTableManager * Instance()
G4bool IsMaster() const
Definition: G4VEmModel.hh:700
G4double HighEnergyActivationLimit() const
Definition: G4VEmModel.hh:623
void clearAndDestroy()
virtual ~G4VMscModel()
Definition: G4VMscModel.cc:85
size_t idxTable
Definition: G4VEmModel.hh:435
G4PhysicsTable * xSectionTable
Definition: G4VEmModel.hh:432
G4double HighEnergyLimit() const
Definition: G4VEmModel.hh:609
#define DBL_MAX
Definition: templates.hh:83
static constexpr double GeV
Definition: G4SIunits.hh:217
static G4EmParameters * Instance()
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
const std::vector< G4double > * theDensityFactor
Definition: G4VEmModel.hh:433