G4IonDEDXScalingICRU73.hh

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 //
00028 // ===========================================================================
00029 // GEANT4 class header file
00030 //
00031 // Class:                G4IonDEDXScalingICRU73
00032 //
00033 // Base class:           G4VIonDEDXScalingAlgorithm
00034 //
00035 // Author:               Anton Lechner (Anton.Lechner@cern.ch)
00036 //
00037 // First implementation: 10. 05. 2009
00038 //
00039 // Modifications: 12. 11. 2009 - Moved all decision logic concerning ICRU 73
00040 //                               scaling for heavy ions into this class.
00041 //                               Adapting ScalingFactorEnergy class according
00042 //                               to changes in base class (AL).
00043 //
00044 // Class description:
00045 //    dE/dx scaling algorithm applied on top of ICRU 73 data (for ions not
00046 //    covered by the ICRU 73 report) 
00047 //
00048 // Comments:
00049 //
00050 // =========================================================================== 
00051 
00052 #ifndef G4IONDEDXSCALINGICRU73_HH
00053 #define G4IONDEDXSCALINGICRU73_HH
00054 
00055 #include "globals.hh"
00056 #include "G4VIonDEDXScalingAlgorithm.hh"
00057 #include "G4Material.hh"
00058 #include "G4ParticleDefinition.hh"
00059 #include <vector>
00060 
00061 
00062 class G4IonDEDXScalingICRU73 : public G4VIonDEDXScalingAlgorithm {
00063 
00064  public:
00065    G4IonDEDXScalingICRU73(G4int minAtomicNumberIon = 19,
00066                           G4int maxAtomicNumberIon = 102);
00067    ~G4IonDEDXScalingICRU73();
00068 
00069    // Function for scaling the kinetic energy (no scaling by default).
00070    // Returns scaling factor for a given ion.
00071    G4double ScalingFactorEnergy(
00072              const G4ParticleDefinition* particle,     // Projectile (ion) 
00073              const G4Material* material);              // Target material
00074                                                          
00075 
00076    // Function for scaling the dE/dx value (no scaling by default).
00077    // Returns scaling factor for a given ion-material couple and
00078    // a given kinetic energy.
00079    G4double ScalingFactorDEDX(
00080              const G4ParticleDefinition* particle,     // Projectile (ion) 
00081              const G4Material*,                        // Target material
00082              G4double kineticEnergy);                  // Kinetic energy
00083 
00084 
00085    // Function for defining a base particle for dE/dx calculation.
00086    // (no base particle by default). Returns atomic number of base
00087    // particle.
00088    G4int AtomicNumberBaseIon(
00089              G4int atomicNumberIon,           // Atomic number of ion 
00090              const G4Material*);              // Target material
00091 
00092  private:
00093    void UpdateCacheParticle(
00094              const G4ParticleDefinition* particle);    // Projectile (ion) 
00095 
00096    void UpdateCacheMaterial(
00097              const G4Material* material);              // Target material 
00098 
00099    void CreateReferenceParticles();
00100  
00101    G4double EquilibriumCharge(
00102              G4double mass,                            // Ion mass
00103              G4double charge,                          // Ion charge
00104              G4double atomicNumberPow,                 // Power of atomic nmb  
00105              G4double kineticEnergy);                  // Kinetic energy
00106 
00107    // Scaling is only applied for ions with atomic numbers in the range
00108    // defined by the following parameters:
00109    G4int minAtomicNumber;
00110    G4int maxAtomicNumber;
00111 
00112    // Some properties of reference particle (Fe) are stored for faster access
00113    G4ParticleDefinition* referenceFe; 
00114    G4int atomicNumberRefFe;
00115    G4int massNumberRefFe;
00116    G4double atomicNumberRefPow23Fe;
00117    G4double chargeRefFe;
00118    G4double massRefFe;
00119 
00120    // Some properties of reference particle (Ar) are stored for faster access
00121    G4ParticleDefinition* referenceAr; 
00122    G4int atomicNumberRefAr;
00123    G4int massNumberRefAr;
00124    G4double atomicNumberRefPow23Ar;
00125    G4double chargeRefAr;
00126    G4double massRefAr;
00127 
00128    // Flag indicating the use of Fe ions as reference particles
00129    G4bool useFe;
00130 
00131    // Some properties of projectiles are stored for faster access
00132    const G4ParticleDefinition* cacheParticle;
00133    G4int cacheMassNumber;
00134    G4int cacheAtomicNumber;
00135    G4double cacheAtomicNumberPow23;
00136    G4double cacheCharge;
00137    G4double cacheMass;
00138 
00139    // Material pointer
00140    const G4Material* cacheMaterial;
00141 };
00142 
00143 // ###########################################################################
00144 
00145 inline void G4IonDEDXScalingICRU73::UpdateCacheParticle (
00146             const G4ParticleDefinition* particle) {   // Projectile (ion) 
00147 
00148   if(particle != cacheParticle) {
00149 
00150      cacheParticle = particle;
00151      cacheAtomicNumber = particle -> GetAtomicNumber();
00152      cacheMassNumber = particle -> GetAtomicMass();
00153      cacheCharge = particle -> GetPDGCharge();
00154      cacheMass = particle -> GetPDGMass();
00155      cacheAtomicNumberPow23 = std::pow(G4double(cacheAtomicNumber), 2./3.);
00156   }
00157 }
00158 
00159 // ###########################################################################
00160 
00161 inline void G4IonDEDXScalingICRU73::UpdateCacheMaterial (
00162             const G4Material* material) {            // Target material
00163 
00164   if(cacheMaterial != material) {
00165 
00166      cacheMaterial = material;
00167 
00168      useFe = true;
00169 
00170      size_t nmbElements = material -> GetNumberOfElements();
00171      if( nmbElements > 1 ) useFe = false;
00172 
00173      if( material -> GetName() == "G4_WATER" ) useFe = true;   
00174   }
00175 }
00176 
00177 // ###########################################################################
00178 
00179 inline G4double G4IonDEDXScalingICRU73::EquilibriumCharge(
00180                                     G4double mass, 
00181                                     G4double charge,
00182                                     G4double atomicNumberPow, 
00183                                     G4double kineticEnergy) {
00184 
00185   G4double totalEnergy  = kineticEnergy + mass;
00186   G4double betaSquared  = kineticEnergy * 
00187                   (totalEnergy + mass) / (totalEnergy * totalEnergy);
00188 
00189   G4double beta = std::sqrt( betaSquared );
00190 
00191   G4double velOverBohrVel = beta / CLHEP::fine_structure_const;
00192 
00193   G4double q1 = 1.0 - std::exp(-velOverBohrVel / atomicNumberPow);
00194  
00195   return q1 * charge;
00196 }
00197 
00198 // ###########################################################################
00199 
00200 #endif

Generated on Mon May 27 17:48:39 2013 for Geant4 by  doxygen 1.4.7