source: trunk/source/processes/electromagnetic/lowenergy/src/G4IonDEDXScalingICRU73.cc @ 1168

Last change on this file since 1168 was 1066, checked in by garnier, 15 years ago

Fix by new tag into CVS

File size: 6.3 KB
Line 
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//
27//
28// ===========================================================================
29// GEANT4 class source file
30//
31// Class:                G4IonDEDXScalingICRU73
32//
33// Base class:           G4VIonDEDXScalingAlgorithm
34//
35// Author:               Anton Lechner (Anton.Lechner@cern.ch)
36//
37// First implementation: 10. 05. 2009
38//
39// Modifications:
40//
41//
42// Class description:
43//    dE/dx scaling algorithm applied on top of ICRU 73 data (for ions not
44//    covered by the ICRU 73 report)
45//
46// Comments:
47//
48// ===========================================================================
49
50#include "G4IonDEDXScalingICRU73.hh"
51#include "G4ParticleDefinition.hh"
52#include "G4ParticleTable.hh"
53#include "G4Material.hh"
54
55
56// ###########################################################################
57
58G4IonDEDXScalingICRU73::G4IonDEDXScalingICRU73(
59                          G4int minAtomicNumberIon,
60                          G4int maxAtomicNumberIon,
61                          G4int atomicNumberReference, 
62                          G4int massNumberReference) :
63     minAtomicNumber( minAtomicNumberIon ),
64     maxAtomicNumber( maxAtomicNumberIon ),
65     excludedIon( false ),
66     reference( 0 ),
67     atomicNumberRef( atomicNumberReference ),
68     massNumberRef( massNumberReference ) { 
69
70}
71
72// ###########################################################################
73
74G4IonDEDXScalingICRU73::~G4IonDEDXScalingICRU73() {
75
76}
77
78// ###########################################################################
79
80void G4IonDEDXScalingICRU73::CreateReferenceParticle() {
81
82   
83  G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
84
85  G4double excitationEnergy = 0.0;
86
87  reference = 
88    particleTable -> GetIon(atomicNumberRef, massNumberRef, excitationEnergy); 
89 
90  massRef = reference -> GetPDGMass();
91  chargeRef = reference -> GetPDGCharge();
92
93  atomicNumberRefPow23 = std::pow(G4double(atomicNumberRef), 2./3.);
94}
95
96
97// ###########################################################################
98
99
100G4double G4IonDEDXScalingICRU73::ScalingFactorEnergy (
101            const G4ParticleDefinition* particle) {    // Projectile (ion)
102                                                         
103  G4double factor = 1.0;
104 
105  UpdateCache(particle);
106
107  if(! excludedIon &&
108     cacheAtomicNumber >= minAtomicNumber &&
109     cacheAtomicNumber <= maxAtomicNumber) {
110
111     if(reference == 0) CreateReferenceParticle();
112
113     factor = cacheMassNumber * (massRef / cacheMass) / massNumberRef;
114  }
115
116  return factor;
117}
118
119// ###########################################################################
120
121G4double G4IonDEDXScalingICRU73::ScalingFactorDEDX(
122             const G4ParticleDefinition* particle,     // Projectile (ion)
123             const G4Material*,                        // Target material
124             G4double kineticEnergy) {                 // Kinetic energy
125
126  G4double factor = 1.0;
127
128  UpdateCache(particle);
129
130  if(! excludedIon &&
131     cacheAtomicNumber >= minAtomicNumber &&
132     cacheAtomicNumber <= maxAtomicNumber) {
133     
134      if(reference == 0) CreateReferenceParticle();
135
136      G4double equilibriumCharge = EquilibriumCharge(cacheMass,
137                                                     cacheCharge,
138                                                     cacheAtomicNumberPow23,
139                                                     kineticEnergy);
140
141      G4double scaledKineticEnergy = kineticEnergy * (massRef / cacheMass);
142     
143      G4double equilibriumChargeRef = EquilibriumCharge(massRef,
144                                                        chargeRef,
145                                                        atomicNumberRefPow23,
146                                                        scaledKineticEnergy);
147
148      factor = equilibriumCharge * equilibriumCharge/ 
149                ( equilibriumChargeRef * equilibriumChargeRef );
150 } 
151
152  return factor;
153}
154
155// ###########################################################################
156
157G4int G4IonDEDXScalingICRU73::AtomicNumberBaseIon(
158             G4int atomicNumberIon,           // Atomic number of ion
159             const G4Material*) {             // Target material
160
161  G4int atomicNumber = atomicNumberIon;
162
163  if(atomicNumberIon >= minAtomicNumber &&
164     atomicNumberIon <= maxAtomicNumber) {
165 
166     G4bool ionIsExcluded = false;
167     size_t nmb = excludedAtomicNumbers.size();
168 
169     for(size_t i = 0; i < nmb; i++) {
170       
171        if(atomicNumberIon == excludedAtomicNumbers[i]) 
172           ionIsExcluded = true;
173     }
174
175     if(! ionIsExcluded) {
176        if(reference == 0) CreateReferenceParticle();
177
178        atomicNumber = atomicNumberRef;
179     }
180  }
181
182  return atomicNumber;
183}
184
185// ###########################################################################
Note: See TracBrowser for help on using the repository browser.