Ignore:
Timestamp:
Nov 19, 2009, 2:53:25 PM (15 years ago)
Author:
garnier
Message:

update par rapport a CVS

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/electromagnetic/lowenergy/include/G4IonDEDXScalingICRU73.hh

    r1066 r1192  
    3737// First implementation: 10. 05. 2009
    3838//
    39 // Modifications:
    40 //
     39// Modifications: 12. 11. 2009 - Moved all decision logic concerning ICRU 73
     40//                               scaling for heavy ions into this class.
     41//                               Adapting ScalingFactorEnergy class according
     42//                               to changes in base class (AL).
    4143//
    4244// Class description:
     
    5355#include "globals.hh"
    5456#include "G4VIonDEDXScalingAlgorithm.hh"
     57#include "G4Material.hh"
     58#include "G4ParticleDefinition.hh"
    5559#include <vector>
    5660
     
    5963
    6064 public:
    61    G4IonDEDXScalingICRU73(G4int minAtomicNumberIon,
    62                           G4int maxAtomicNumberIon,
    63                           G4int atomicNumberReference,
    64                           G4int massNumberReference);
     65   G4IonDEDXScalingICRU73(G4int minAtomicNumberIon = 19,
     66                          G4int maxAtomicNumberIon = 102);
    6567   ~G4IonDEDXScalingICRU73();
    6668
     
    6870   // Returns scaling factor for a given ion.
    6971   G4double ScalingFactorEnergy(
    70            const G4ParticleDefinition* particle);      // Projectile (ion)
     72             const G4ParticleDefinition* particle,     // Projectile (ion)
     73             const G4Material* material);              // Target material
    7174                                                         
    7275
     
    8790             const G4Material*);              // Target material
    8891
    89    void AddException(G4int atomicNumberIon);
    90 
    9192 private:
    92    void UpdateCache(
     93   void UpdateCacheParticle(
    9394             const G4ParticleDefinition* particle);    // Projectile (ion)
    9495
    95    void CreateReferenceParticle();
     96   void UpdateCacheMaterial(
     97             const G4Material* material);              // Target material
     98
     99   void CreateReferenceParticles();
    96100 
    97101   G4double EquilibriumCharge(
     
    106110   G4int maxAtomicNumber;
    107111
    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;
     112   // Some properties of reference particle (Fe) are stored for faster access
     113   G4ParticleDefinition* referenceFe;
     114   G4int atomicNumberRefFe;
     115   G4int massNumberRefFe;
     116   G4double atomicNumberRefPow23Fe;
     117   G4double chargeRefFe;
     118   G4double massRefFe;
     119
     120   // Some properties of reference particle (Ar) are stored for faster access
     121   G4ParticleDefinition* referenceAr;
     122   G4int atomicNumberRefAr;
     123   G4int massNumberRefAr;
     124   G4double atomicNumberRefPow23Ar;
     125   G4double chargeRefAr;
     126   G4double massRefAr;
     127
     128   // Flag indicating the use of Fe ions as reference particles
     129   G4bool useFe;
    119130
    120131   // Some properties of projectiles are stored for faster access
     
    125136   G4double cacheCharge;
    126137   G4double cacheMass;
     138
     139   // Material pointer
     140   const G4Material* cacheMaterial;
    127141};
    128142
    129143// ###########################################################################
    130144
    131 inline void G4IonDEDXScalingICRU73::UpdateCache (
    132             const G4ParticleDefinition* particle) {    // Projectile (ion)
     145inline void G4IonDEDXScalingICRU73::UpdateCacheParticle (
     146            const G4ParticleDefinition* particle) {   // Projectile (ion)
    133147
    134148  if(particle != cacheParticle) {
     
    139153     cacheCharge = particle -> GetPDGCharge();
    140154     cacheMass = particle -> GetPDGMass();
    141 
    142155     cacheAtomicNumberPow23 = std::pow(G4double(cacheAtomicNumber), 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      }
     156  }
     157}
     158
     159// ###########################################################################
     160
     161inline void G4IonDEDXScalingICRU73::UpdateCacheMaterial (
     162            const G4Material* material) {            // Target material
     163
     164  if(cacheMaterial != material) {
     165
     166     cacheMaterial = material;
     167
     168     useFe = true;
     169
     170     size_t nmbElements = material -> GetNumberOfElements();
     171     if( nmbElements > 1 ) useFe = false;
     172
     173     if( material -> GetName() == "G4_WATER" ) useFe = true;   
    151174  }
    152175}
     
    175198// ###########################################################################
    176199
    177 inline void G4IonDEDXScalingICRU73::AddException(G4int atomicNumber) {
    178 
    179   if(atomicNumber >= minAtomicNumber &&
    180      atomicNumber <= maxAtomicNumber) {
    181 
    182      excludedAtomicNumbers.push_back( atomicNumber );
    183   }
    184 }
    185 
    186 // ###########################################################################
    187 
    188200#endif
Note: See TracChangeset for help on using the changeset viewer.