Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4LowECapture.cc
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: 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),
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) = "
68  << kinEnergyThreshold/MeV << G4endl;
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 
105 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
106 
108 {
109  return true;
110 }
111 
113  const G4Track& aTrack, G4double, G4ForceCondition* condition)
114 {
115  *condition = NotForced;
116  G4double limit = DBL_MAX;
117  if(aTrack.GetKineticEnergy() < kinEnergyThreshold) {
118  for(G4int i=0; i<nRegions; ++i) {
119  if(aTrack.GetVolume()->GetLogicalVolume()->GetRegion() == region[i]) {
120  limit = 0.0;
121  break;
122  }
123  }
124  }
125  return limit;
126 }
127 
128 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
129 
131  const G4Step&)
132 {
133  pParticleChange->Initialize(aTrack);
136  return pParticleChange;
137 }
138 
139 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
140 
143 {
144  return DBL_MAX;
145 }
146 
147 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
148 
149 
G4double condition(const G4ErrorSymMatrix &m)
virtual void Initialize(const G4Track &)
G4Region * GetRegion(const G4String &name, G4bool verbose=true) const
G4int verboseLevel
Definition: G4VProcess.hh:368
virtual G4double GetMeanFreePath(const G4Track &, G4double, G4ForceCondition *)
G4Region * GetRegion() const
int G4int
Definition: G4Types.hh:78
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
static G4RegionStore * GetInstance()
G4double GetKineticEnergy() const
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
virtual G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &)
Definition: G4Step.hh:76
virtual void BuildPhysicsTable(const G4ParticleDefinition &)
void AddRegion(const G4String &)
virtual G4bool IsApplicable(const G4ParticleDefinition &)
G4LogicalVolume * GetLogicalVolume() const
virtual G4double PostStepGetPhysicalInteractionLength(const G4Track &track, G4double, G4ForceCondition *)
G4VParticleChange * pParticleChange
Definition: G4VProcess.hh:283
G4VPhysicalVolume * GetVolume() const
#define G4endl
Definition: G4ios.hh:61
static constexpr double MeV
Definition: G4SIunits.hh:214
double G4double
Definition: G4Types.hh:76
void ProposeTrackStatus(G4TrackStatus status)
void SetKinEnergyLimit(G4double)
G4ForceCondition
#define DBL_MAX
Definition: templates.hh:83
static constexpr double keV
Definition: G4SIunits.hh:216
G4LowECapture(G4double ekinlimit=0.0)
virtual ~G4LowECapture()