G4IonDEDXScalingICRU73.cc

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 source 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: 06. 08. 2009 - Minor bug fix (initialization of cache) AL
00040 //                12. 11. 2009 - Moved all decision logic concerning ICRU 73
00041 //                               scaling for heavy ions into this class.
00042 //                               Adapting ScalingFactorEnergy class according
00043 //                               to changes in base class (AL).
00044 //
00045 // Class description:
00046 //    dE/dx scaling algorithm applied on top of ICRU 73 data (for ions not
00047 //    covered by the ICRU 73 report) 
00048 //
00049 // Comments:
00050 //
00051 // =========================================================================== 
00052 
00053 #include "G4IonDEDXScalingICRU73.hh"
00054 #include "G4ParticleDefinition.hh"
00055 #include "G4ParticleTable.hh"
00056 #include "G4Material.hh"
00057 
00058 
00059 // ###########################################################################
00060 
00061 G4IonDEDXScalingICRU73::G4IonDEDXScalingICRU73(
00062                           G4int minAtomicNumberIon,
00063                           G4int maxAtomicNumberIon) :
00064      minAtomicNumber( minAtomicNumberIon ),
00065      maxAtomicNumber( maxAtomicNumberIon ),
00066      referenceFe( 0 ),
00067      atomicNumberRefFe( 26 ),
00068      massNumberRefFe( 56 ),
00069      atomicNumberRefPow23Fe( 0 ),
00070      chargeRefFe( 0 ),
00071      massRefFe( 0 ),
00072      referenceAr( 0 ),
00073      atomicNumberRefAr( 18 ),
00074      massNumberRefAr( 40 ),
00075      atomicNumberRefPow23Ar( 0 ),
00076      chargeRefAr( 0 ),
00077      massRefAr( 0 ),
00078      useFe( true ),
00079      cacheParticle( 0 ),
00080      cacheMassNumber( 0 ),
00081      cacheAtomicNumber( 0 ),
00082      cacheAtomicNumberPow23( 0 ),
00083      cacheCharge( 0 ),
00084      cacheMass( 0 ),
00085      cacheMaterial( 0 ) { 
00086 
00087 }
00088 
00089 // ###########################################################################
00090 
00091 G4IonDEDXScalingICRU73::~G4IonDEDXScalingICRU73() {
00092 
00093 }
00094 
00095 // ###########################################################################
00096 
00097 void G4IonDEDXScalingICRU73::CreateReferenceParticles() {
00098    
00099   G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
00100 
00101   G4double excitationEnergy = 0.0;
00102 
00103   referenceFe = particleTable -> GetIon(atomicNumberRefFe, massNumberRefFe,  
00104                                         excitationEnergy); 
00105   referenceAr = particleTable -> GetIon(atomicNumberRefAr, massNumberRefAr, 
00106                                         excitationEnergy); 
00107   
00108   massRefFe = referenceFe -> GetPDGMass();
00109   massRefAr = referenceAr -> GetPDGMass();
00110 
00111   chargeRefFe = referenceFe -> GetPDGCharge();
00112   chargeRefAr = referenceAr -> GetPDGCharge();
00113 
00114   atomicNumberRefPow23Fe = std::pow(G4double(atomicNumberRefFe), 2./3.);
00115   atomicNumberRefPow23Ar = std::pow(G4double(atomicNumberRefAr), 2./3.);
00116 }
00117 
00118 
00119 // ###########################################################################
00120 
00121 
00122 G4double G4IonDEDXScalingICRU73::ScalingFactorEnergy (
00123             const G4ParticleDefinition* particle,     // Projectile (ion) 
00124             const G4Material* material) {             // Target material
00125                                                          
00126   G4double factor = 1.0;
00127  
00128   UpdateCacheParticle(particle);
00129   UpdateCacheMaterial(material);
00130 
00131   if(cacheAtomicNumber >= minAtomicNumber &&
00132      cacheAtomicNumber <= maxAtomicNumber &&
00133      cacheAtomicNumber != atomicNumberRefFe &&
00134      cacheAtomicNumber != atomicNumberRefAr) {
00135 
00136      if(referenceFe == 0 || referenceAr == 0) CreateReferenceParticles();
00137 
00138      if( useFe )
00139          factor = cacheMassNumber * (massRefFe / cacheMass) / massNumberRefFe;
00140      else
00141          factor = cacheMassNumber * (massRefAr / cacheMass) / massNumberRefAr;
00142   }
00143 
00144   return factor;
00145 }
00146 
00147 // ###########################################################################
00148 
00149 G4double G4IonDEDXScalingICRU73::ScalingFactorDEDX(
00150              const G4ParticleDefinition* particle,     // Projectile (ion) 
00151              const G4Material* material,               // Target material
00152              G4double kineticEnergy) {                 // Kinetic energy
00153 
00154   G4double factor = 1.0;
00155 
00156   UpdateCacheParticle(particle);
00157   UpdateCacheMaterial(material);
00158 
00159   if(cacheAtomicNumber >= minAtomicNumber &&
00160      cacheAtomicNumber <= maxAtomicNumber &&
00161      cacheAtomicNumber != atomicNumberRefFe &&
00162      cacheAtomicNumber != atomicNumberRefAr) {
00163       
00164       if(referenceFe == 0 || referenceAr == 0) CreateReferenceParticles();
00165 
00166       if( useFe ) {
00167 
00168          G4double equilibriumCharge = EquilibriumCharge(cacheMass,
00169                                                      cacheCharge,
00170                                                      cacheAtomicNumberPow23,
00171                                                      kineticEnergy);
00172 
00173          G4double scaledKineticEnergy = kineticEnergy * (massRefFe / cacheMass);
00174       
00175          G4double equilibriumChargeRefFe = EquilibriumCharge(massRefFe,
00176                                                         chargeRefFe,
00177                                                         atomicNumberRefPow23Fe,
00178                                                         scaledKineticEnergy);
00179 
00180          factor = equilibriumCharge * equilibriumCharge/ 
00181                    ( equilibriumChargeRefFe * equilibriumChargeRefFe );
00182 
00183       }
00184       else {
00185 
00186          G4double equilibriumCharge = EquilibriumCharge(cacheMass,
00187                                                      cacheCharge,
00188                                                      cacheAtomicNumberPow23,
00189                                                      kineticEnergy);
00190 
00191          G4double scaledKineticEnergy = kineticEnergy * (massRefAr / cacheMass);
00192       
00193          G4double equilibriumChargeRefAr = EquilibriumCharge(massRefAr,
00194                                                         chargeRefAr,
00195                                                         atomicNumberRefPow23Ar,
00196                                                         scaledKineticEnergy);
00197 
00198          factor = equilibriumCharge * equilibriumCharge/ 
00199                    ( equilibriumChargeRefAr * equilibriumChargeRefAr );
00200 
00201       }
00202   }  
00203 
00204   return factor;
00205 }
00206 
00207 // ###########################################################################
00208 
00209 G4int G4IonDEDXScalingICRU73::AtomicNumberBaseIon(
00210              G4int atomicNumberIon,           // Atomic number of ion 
00211              const G4Material* material) {    // Target material
00212 
00213   UpdateCacheMaterial(material);
00214 
00215   G4int atomicNumber = atomicNumberIon;
00216 
00217   if(atomicNumberIon >= minAtomicNumber &&
00218      atomicNumberIon <= maxAtomicNumber &&
00219      atomicNumberIon != atomicNumberRefFe &&
00220      atomicNumberIon != atomicNumberRefAr) {
00221 
00222      if(referenceFe == 0 || referenceAr == 0) CreateReferenceParticles();
00223 
00224      if( useFe ) atomicNumber = atomicNumberRefFe;
00225      else atomicNumber = atomicNumberRefAr;     
00226   }
00227 
00228   return atomicNumber;
00229 }
00230 
00231 // ###########################################################################

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