Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4LowECapture.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: G4LowECapture.cc,v 1.1 2010-08-31 11:23:58 vnivanch Exp $
27 // GEANT4 tag $Name: not supported by cvs2svn $
28 //
29 //---------------------------------------------------------------------------
30 //
31 // ClassName: G4LowECapture
32 //
33 // Author: V.Ivanchenko 31 August 2010
34 //
35 //----------------------------------------------------------------------------
36 //
37 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
38 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
39 
40 #include "G4LowECapture.hh"
41 #include "G4SystemOfUnits.hh"
42 #include "G4ParticleDefinition.hh"
43 #include "G4Step.hh"
44 #include "G4Track.hh"
45 #include "G4Region.hh"
46 #include "G4RegionStore.hh"
47 
48 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
49 
51  : G4VDiscreteProcess("Capture", fElectromagnetic),
52  kinEnergyThreshold(ekinlim), isIon(false),
53  nRegions(0)
54 {}
55 
56 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
57 
59 {}
60 
61 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
62 
64 {
65  kinEnergyThreshold = val;
66  if(verboseLevel > 0) {
67  G4cout << "### G4LowECapture: Tracking cut E(MeV) = "
69  }
70 }
71 
72 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
73 
75 {
76  G4String r = nam;
77  if(r == "" || r == "world" || r == "World") r = "DefaultRegionForTheWorld";
78  for(G4int i=0; i<nRegions; ++i) {
79  if(regionName[i] == r) { return; }
80  }
81  regionName.push_back(r);
82  ++nRegions;
83  if(verboseLevel > 1) {
84  G4cout << "### G4LowECapture: new G4Region <" << r << ">" << G4endl;
85  }
86 }
87 
88 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
89 
91 {
93  for(G4int i=0; i<nRegions; ++i) {
94  const G4Region* r = store->GetRegion(regionName[i]);
95  if(r && verboseLevel > 0) {
96  G4cout << "### G4LowECapture: new G4Region <"
97  << regionName[i] << "> with tracking cut "
98  << kinEnergyThreshold/keV << " keV" << G4endl;
99  }
100  if(r) { region.push_back(r); }
101  }
102  nRegions = region.size();
103 
104  // ions reusing G4GenericIon parameters
105  if(part.GetParticleType() == "nucleus") {
106  G4String pname = part.GetParticleName();
107  if(pname != "deuteron" && pname != "triton" &&
108  pname != "alpha" && pname != "He3" &&
109  pname != "alpha+" && pname != "helium" &&
110  pname != "hydrogen") { isIon = true; }
111  }
112 }
113 
114 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
115 
117 {
118  return true;
119 }
120 
122  const G4Track& aTrack, G4double, G4ForceCondition* condition)
123 {
124  *condition = NotForced;
125  G4double limit = DBL_MAX;
126  G4double eLimit = kinEnergyThreshold;
127  if(isIon) {
128  eLimit *= aTrack.GetDefinition()->GetPDGMass()/CLHEP::proton_mass_c2;
129  }
130  if(aTrack.GetKineticEnergy() < eLimit) {
131  for(G4int i=0; i<nRegions; ++i) {
132  if(aTrack.GetVolume()->GetLogicalVolume()->GetRegion() == region[i]) {
133  limit = 0.0;
134  break;
135  }
136  }
137  }
138  return limit;
139 }
140 
141 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
142 
144  const G4Step&)
145 {
146  pParticleChange->Initialize(aTrack);
149  return pParticleChange;
150 }
151 
152 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
153 
156 {
157  return DBL_MAX;
158 }
159 
160 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
161 
162 
G4double GetKineticEnergy() const
G4double kinEnergyThreshold
virtual G4bool IsApplicable(const G4ParticleDefinition &)
G4LogicalVolume * GetLogicalVolume() const
static constexpr double MeV
Definition: G4SIunits.hh:214
virtual G4double GetMeanFreePath(const G4Track &, G4double, G4ForceCondition *)
void AddRegion(const G4String &)
static constexpr double keV
Definition: G4SIunits.hh:216
#define G4endl
Definition: G4ios.hh:61
const G4String & GetParticleName() const
const G4String & GetParticleType() const
G4double condition(const G4ErrorSymMatrix &m)
G4ParticleDefinition * GetDefinition() const
G4double GetPDGMass() const
G4Region * GetRegion(const G4String &name, G4bool verbose=true) const
G4LowECapture(G4double ekinlimit=0.0)
virtual void Initialize(const G4Track &)
static constexpr double proton_mass_c2
double G4double
Definition: G4Types.hh:76
bool G4bool
Definition: G4Types.hh:79
TString part[npart]
Definition: Style.C:32
G4VParticleChange * pParticleChange
Definition: G4VProcess.hh:283
std::vector< const G4Region * > region
Definition: G4Step.hh:76
virtual void BuildPhysicsTable(const G4ParticleDefinition &)
void SetKinEnergyLimit(G4double)
std::vector< G4String > regionName
virtual G4double PostStepGetPhysicalInteractionLength(const G4Track &track, G4double, G4ForceCondition *)
static G4RegionStore * GetInstance()
int G4int
Definition: G4Types.hh:78
G4int verboseLevel
Definition: G4VProcess.hh:371
G4ForceCondition
G4GLOB_DLL std::ostream G4cout
virtual G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
virtual ~G4LowECapture()
#define DBL_MAX
Definition: templates.hh:83
void ProposeTrackStatus(G4TrackStatus status)
G4Region * GetRegion() const
G4VPhysicalVolume * GetVolume() const