Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4NuclearStopping.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: G4NuclearStopping.cc 107058 2017-11-01 14:54:12Z gcosmo $
27 //
28 // -----------------------------------------------------------------------------
29 //
30 // GEANT4 Class file
31 //
32 // File name: G4NuclearStopping
33 //
34 // Author: Vladimir Ivanchenko
35 //
36 // Creation date: 20 July 2009
37 //
38 // Modified:
39 //
40 // Warning: this class should be instantiated after G4ionIonisation
41 //
42 // -----------------------------------------------------------------------------
43 //
44 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
45 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
46 
47 #include "G4NuclearStopping.hh"
49 #include "G4SystemOfUnits.hh"
50 #include "G4PhysicalConstants.hh"
51 
52 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
53 
54 using namespace std;
55 
57  : G4VEmProcess(processName)
58 {
59  isInitialized = false;
61  SetBuildTableFlag(false);
62  enableAlongStepDoIt = true;
63  enablePostStepDoIt = false;
64 }
65 
66 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
67 
69 {}
70 
71 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
72 
74 {
75  return (p.GetPDGCharge() != 0.0 && !p.IsShortLived());
76 }
77 
78 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
79 
81 {
82  if(!isInitialized) {
83  isInitialized = true;
84 
86  AddEmModel(1, EmModel());
89  }
90 }
91 
92 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
93 
94 G4double
96  const G4Track&, G4double, G4double, G4double&, G4GPILSelection* selection)
97 {
98  *selection = NotCandidateForSelection;
99  return DBL_MAX;
100 }
101 
102 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
103 
105  const G4Step& step)
106 {
108 
109  // this line only valid if nuclear stopping
110  // is computed after G4ionIonisation process
112 
114 
116  G4double Z = std::abs(part->GetPDGCharge()/eplus);
117  G4double massR = proton_mass_c2/part->GetPDGMass();
118 
119  if(T2 > 0.0 && T2*massR < Z*Z*MeV) {
120 
121  G4double length = step.GetStepLength();
122  if(length > 0.0) {
123 
124  // primary
126  G4double T = 0.5*(T1 + T2);
127  const G4MaterialCutsCouple* couple = track.GetMaterialCutsCouple();
128  G4double Tscaled = T*massR;
129  G4VEmModel* mod = SelectModel(Tscaled, couple->GetIndex());
130 
131  // sample stopping
132  if(mod->IsActive(Tscaled)) {
133  G4double nloss =
134  length*mod->ComputeDEDXPerVolume(couple->GetMaterial(), part, T);
135  nloss = std::min(nloss, T1);
139  }
140  }
141  }
142  return &nParticleChange;
143 }
144 
145 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
146 
148 {}
149 
150 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
151 
152 void G4NuclearStopping::ProcessDescription(std::ostream& out) const
153 {
154  out << "<strong>Nuclear stopping</strong>";
156 }
157 
158 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double GetCharge() const
G4bool IsActive(G4double kinEnergy)
Definition: G4VEmModel.hh:735
static constexpr double MeV
Definition: G4SIunits.hh:214
G4StepPoint * GetPreStepPoint() const
void InitializeForAlongStep(const G4Track &)
const char * p
Definition: xmltok.h:285
void SetBuildTableFlag(G4bool val)
G4VEmModel * EmModel(size_t index=0) const
void SetActivationHighEnergyLimit(G4double)
Definition: G4VEmModel.hh:721
G4double GetPDGCharge() const
virtual ~G4NuclearStopping()
G4bool enablePostStepDoIt
Definition: G4VProcess.hh:352
const G4ParticleDefinition * GetParticleDefinition() const
void SetProposedCharge(G4double theCharge)
G4double GetPDGMass() const
G4VEmModel * SelectModel(G4double &kinEnergy, size_t index)
void ProposeNonIonizingEnergyDeposit(G4double anEnergyPart)
G4ParticleChangeForLoss nParticleChange
G4double AlongStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4double currentMinimumStep, G4double &proposedSafety, G4GPILSelection *selection) final
void InitialiseProcess(const G4ParticleDefinition *) final
static constexpr double proton_mass_c2
Float_t Z
G4bool IsApplicable(const G4ParticleDefinition &p) final
double G4double
Definition: G4Types.hh:76
bool G4bool
Definition: G4Types.hh:79
G4VParticleChange * AlongStepDoIt(const G4Track &track, const G4Step &step) final
TString part[npart]
Definition: Style.C:32
virtual void ProcessDescription(std::ostream &outFile) const override
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
void SetEmModel(G4VEmModel *, G4int index=0)
G4double GetStepLength() const
virtual void ProcessDescription(std::ostream &) const override
G4GPILSelection
Definition: G4Step.hh:76
G4StepPoint * GetPostStepPoint() const
G4double GetKineticEnergy() const
G4NuclearStopping(const G4String &processName="nuclearStopping")
static constexpr double eplus
Definition: G4SIunits.hh:199
void SetParticleChange(G4VParticleChange *, G4VEmFluctuationModel *f=nullptr)
Definition: G4VEmModel.cc:454
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void SetProcessSubType(G4int)
Definition: G4VProcess.hh:435
void AddEmModel(G4int, G4VEmModel *, const G4Region *region=nullptr)
const G4Material * GetMaterial() const
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
G4bool enableAlongStepDoIt
Definition: G4VProcess.hh:351
virtual G4double ComputeDEDXPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=DBL_MAX)
Definition: G4VEmModel.cc:243
#define DBL_MAX
Definition: templates.hh:83
static constexpr double GeV
Definition: G4SIunits.hh:217
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
virtual void PrintInfo() final