source: trunk/source/processes/electromagnetic/lowenergy/include/G4IonDEDXScalingICRU73.hh @ 1064

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

bug fix

File size: 6.8 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 header 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#ifndef G4IONDEDXSCALINGICRU73_HH
51#define G4IONDEDXSCALINGICRU73_HH
52
53#include "globals.hh"
54#include "G4VIonDEDXScalingAlgorithm.hh"
55#include <vector>
56
57
58class G4IonDEDXScalingICRU73 : public G4VIonDEDXScalingAlgorithm {
59
60 public:
61   G4IonDEDXScalingICRU73(G4int minAtomicNumberIon,
62                          G4int maxAtomicNumberIon,
63                          G4int atomicNumberReference, 
64                          G4int massNumberReference);
65   ~G4IonDEDXScalingICRU73();
66
67   // Function for scaling the kinetic energy (no scaling by default).
68   // Returns scaling factor for a given ion.
69   G4double ScalingFactorEnergy(
70           const G4ParticleDefinition* particle);      // Projectile (ion)
71                                                         
72
73   // Function for scaling the dE/dx value (no scaling by default).
74   // Returns scaling factor for a given ion-material couple and
75   // a given kinetic energy.
76   G4double ScalingFactorDEDX(
77             const G4ParticleDefinition* particle,     // Projectile (ion) 
78             const G4Material*,                        // Target material
79             G4double kineticEnergy);                  // Kinetic energy
80
81
82   // Function for defining a base particle for dE/dx calculation.
83   // (no base particle by default). Returns atomic number of base
84   // particle.
85   G4int AtomicNumberBaseIon(
86             G4int atomicNumberIon,           // Atomic number of ion
87             const G4Material*);              // Target material
88
89   void AddException(G4int atomicNumberIon);
90
91 private:
92   void UpdateCache(
93             const G4ParticleDefinition* particle);    // Projectile (ion)
94
95   void CreateReferenceParticle();
96 
97   G4double EquilibriumCharge(
98             G4double mass,                            // Ion mass
99             G4double charge,                          // Ion charge
100             G4double atomicNumberPow,                 // Power of atomic nmb 
101             G4double kineticEnergy);                  // Kinetic energy
102
103   // Scaling is only applied for ions with atomic numbers in the range
104   // defined by the following parameters:
105   G4int minAtomicNumber;
106   G4int maxAtomicNumber;
107
108   // Vector with atomic numbers excepted from scaling procedure
109   std::vector<G4int> excludedAtomicNumbers;
110   G4bool excludedIon;
111
112   // Some properties of reference particles are stored for faster access
113   G4ParticleDefinition* reference; 
114   G4int atomicNumberRef;
115   G4int massNumberRef;
116   G4double atomicNumberRefPow23;
117   G4double chargeRef;
118   G4double massRef;
119
120   // Some properties of projectiles are stored for faster access
121   const G4ParticleDefinition* cacheParticle;
122   G4int cacheMassNumber;
123   G4int cacheAtomicNumber;
124   G4double cacheAtomicNumberPow23;
125   G4double cacheCharge;
126   G4double cacheMass;
127};
128
129// ###########################################################################
130
131inline void G4IonDEDXScalingICRU73::UpdateCache (
132            const G4ParticleDefinition* particle) {    // Projectile (ion)
133
134  if(particle != cacheParticle) {
135
136     cacheParticle = particle;
137     cacheAtomicNumber = particle -> GetAtomicNumber();
138     cacheMassNumber = particle -> GetAtomicMass();
139     cacheCharge = particle -> GetPDGCharge();
140     cacheMass = particle -> GetPDGMass();
141
142     cacheAtomicNumberPow23 = std::pow((double)cacheAtomicNumber, (double)2./3.);
143
144     excludedIon = false;
145     size_t nmb = excludedAtomicNumbers.size();
146     for(size_t i = 0; i < nmb; i++) {
147       
148        if(cacheAtomicNumber == excludedAtomicNumbers[i]) 
149           excludedIon = true;
150     }
151  }
152}
153
154// ###########################################################################
155
156inline G4double G4IonDEDXScalingICRU73::EquilibriumCharge(
157                                    G4double mass, 
158                                    G4double charge,
159                                    G4double atomicNumberPow, 
160                                    G4double kineticEnergy) {
161
162  G4double totalEnergy  = kineticEnergy + mass;
163  G4double betaSquared  = kineticEnergy * 
164                  (totalEnergy + mass) / (totalEnergy * totalEnergy);
165
166  G4double beta = std::sqrt( betaSquared );
167
168  G4double velOverBohrVel = beta / CLHEP::fine_structure_const;
169
170  G4double q1 = 1.0 - std::exp(-velOverBohrVel / atomicNumberPow);
171 
172  return q1 * charge;
173}
174
175// ###########################################################################
176
177inline void G4IonDEDXScalingICRU73::AddException(G4int atomicNumber) {
178
179  if(atomicNumber >= minAtomicNumber &&
180     atomicNumber <= maxAtomicNumber) {
181
182     excludedAtomicNumbers.push_back( atomicNumber );
183  }
184}
185
186// ###########################################################################
187
188#endif
Note: See TracBrowser for help on using the repository browser.