G4IonParametrisedLossModel Class Reference

#include <G4IonParametrisedLossModel.hh>

Inheritance diagram for G4IonParametrisedLossModel:

G4VEmModel

Public Member Functions

 G4IonParametrisedLossModel (const G4ParticleDefinition *particle=0, const G4String &name="ParamICRU73")
virtual ~G4IonParametrisedLossModel ()
virtual void Initialise (const G4ParticleDefinition *, const G4DataVector &)
virtual G4double MinEnergyCut (const G4ParticleDefinition *, const G4MaterialCutsCouple *)
virtual G4double ComputeCrossSectionPerAtom (const G4ParticleDefinition *, G4double, G4double, G4double, G4double, G4double)
virtual G4double CrossSectionPerVolume (const G4Material *, const G4ParticleDefinition *, G4double, G4double, G4double)
virtual G4double ComputeDEDXPerVolume (const G4Material *, const G4ParticleDefinition *, G4double, G4double)
G4double ComputeLossForStep (const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double, G4double)
G4double DeltaRayMeanEnergyTransferRate (const G4Material *, const G4ParticleDefinition *, G4double, G4double)
virtual void SampleSecondaries (std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double, G4double)
virtual G4double GetChargeSquareRatio (const G4ParticleDefinition *, const G4Material *, G4double)
virtual G4double GetParticleCharge (const G4ParticleDefinition *, const G4Material *, G4double)
virtual void CorrectionsAlongStep (const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double &, G4double &, G4double)
G4bool AddDEDXTable (const G4String &name, G4VIonDEDXTable *table, G4VIonDEDXScalingAlgorithm *algorithm=0)
G4bool RemoveDEDXTable (const G4String &name)
void DeactivateICRU73Scaling ()
LossTableList::iterator IsApplicable (const G4ParticleDefinition *, const G4Material *)
void PrintDEDXTable (const G4ParticleDefinition *, const G4Material *, G4double, G4double, G4int, G4bool)
void PrintDEDXTableHandlers (const G4ParticleDefinition *, const G4Material *, G4double, G4double, G4int, G4bool)
void SetEnergyLossLimit (G4double ionEnergyLossLimit)

Protected Member Functions

virtual G4double MaxSecondaryEnergy (const G4ParticleDefinition *, G4double)

Detailed Description

Definition at line 93 of file G4IonParametrisedLossModel.hh.


Constructor & Destructor Documentation

G4IonParametrisedLossModel::G4IonParametrisedLossModel ( const G4ParticleDefinition particle = 0,
const G4String name = "ParamICRU73" 
)

Definition at line 103 of file G4IonParametrisedLossModel.cc.

References AddDEDXTable(), G4GenericIon::Definition(), G4VEmModel::HighEnergyLimit(), G4LossTableManager::Instance(), and G4VEmModel::SetHighEnergyLimit().

00106   : G4VEmModel(nam),
00107     braggIonModel(0),
00108     betheBlochModel(0),
00109     nmbBins(90),
00110     nmbSubBins(100),
00111     particleChangeLoss(0),
00112     corrFactor(1.0),
00113     energyLossLimit(0.01),
00114     cutEnergies(0) 
00115 {
00116   genericIon = G4GenericIon::Definition();
00117   genericIonPDGMass = genericIon -> GetPDGMass();
00118   corrections = G4LossTableManager::Instance() -> EmCorrections();
00119  
00120   // The upper limit of the current model is set to 100 TeV
00121   SetHighEnergyLimit(100.0 * TeV);
00122 
00123   // The Bragg ion and Bethe Bloch models are instantiated
00124   braggIonModel = new G4BraggIonModel();
00125   betheBlochModel = new G4BetheBlochModel();
00126 
00127   // By default ICRU 73 stopping power tables are loaded:
00128   AddDEDXTable("ICRU73",
00129                new G4IonStoppingData("ion_stopping_data/icru73"),
00130                new G4IonDEDXScalingICRU73());
00131 
00132   // The boundaries for the range tables are set
00133   lowerEnergyEdgeIntegr = 0.025 * MeV;
00134   upperEnergyEdgeIntegr = betheBlochModel -> HighEnergyLimit();
00135 
00136   // Cache parameters are set
00137   cacheParticle = 0;
00138   cacheMass = 0;
00139   cacheElecMassRatio = 0;
00140   cacheChargeSquare = 0;
00141 
00142   // Cache parameters are set
00143   rangeCacheParticle = 0; 
00144   rangeCacheMatCutsCouple = 0; 
00145   rangeCacheEnergyRange = 0; 
00146   rangeCacheRangeEnergy = 0;
00147 
00148   // Cache parameters are set
00149   dedxCacheParticle = 0;
00150   dedxCacheMaterial = 0;
00151   dedxCacheEnergyCut = 0;
00152   dedxCacheIter = lossTableList.end();
00153   dedxCacheTransitionEnergy = 0.0;  
00154   dedxCacheTransitionFactor = 0.0;
00155   dedxCacheGenIonMassRatio = 0.0;
00156 }

G4IonParametrisedLossModel::~G4IonParametrisedLossModel (  )  [virtual]

Definition at line 160 of file G4IonParametrisedLossModel.cc.

00160                                                         {
00161 
00162   // Range vs energy table objects are deleted and the container is cleared
00163   RangeEnergyTable::iterator iterRange = r.begin();
00164   RangeEnergyTable::iterator iterRange_end = r.end();
00165 
00166   for(;iterRange != iterRange_end; iterRange++) delete iterRange -> second;
00167   r.clear();
00168 
00169   // Energy vs range table objects are deleted and the container is cleared
00170   EnergyRangeTable::iterator iterEnergy = E.begin();
00171   EnergyRangeTable::iterator iterEnergy_end = E.end();
00172 
00173   for(;iterEnergy != iterEnergy_end; iterEnergy++) delete iterEnergy -> second;
00174   E.clear();
00175 
00176   // dE/dx table objects are deleted and the container is cleared
00177   LossTableList::iterator iterTables = lossTableList.begin();
00178   LossTableList::iterator iterTables_end = lossTableList.end();
00179 
00180   for(;iterTables != iterTables_end; iterTables++) delete *iterTables;
00181   lossTableList.clear();
00182 
00183   // The Bragg ion and Bethe Bloch objects are deleted
00184   delete betheBlochModel;
00185   delete braggIonModel;
00186 }


Member Function Documentation

G4bool G4IonParametrisedLossModel::AddDEDXTable ( const G4String name,
G4VIonDEDXTable table,
G4VIonDEDXScalingAlgorithm algorithm = 0 
)

Definition at line 1246 of file G4IonParametrisedLossModel.cc.

References G4cerr, G4endl, and G4VEmModel::GetName().

Referenced by DeactivateICRU73Scaling(), and G4IonParametrisedLossModel().

01249                                                                        {
01250 
01251   if(table == 0) {
01252      G4cerr << "G4IonParametrisedLossModel::AddDEDXTable() Cannot "
01253             << " add table: Invalid pointer."
01254             << G4endl;      
01255 
01256      return false;
01257   }
01258 
01259   // Checking uniqueness of name
01260   LossTableList::iterator iter = lossTableList.begin();
01261   LossTableList::iterator iter_end = lossTableList.end();
01262   
01263   for(;iter != iter_end; iter++) {
01264      G4String tableName = (*iter) -> GetName();
01265 
01266      if(tableName == nam) { 
01267         G4cerr << "G4IonParametrisedLossModel::AddDEDXTable() Cannot "
01268                << " add table: Name already exists."      
01269                << G4endl;
01270 
01271         return false;
01272      }
01273   }
01274 
01275   G4VIonDEDXScalingAlgorithm* scalingAlgorithm = algorithm;
01276   if(scalingAlgorithm == 0) 
01277      scalingAlgorithm = new G4VIonDEDXScalingAlgorithm; 
01278  
01279   G4IonDEDXHandler* handler = 
01280                       new G4IonDEDXHandler(table, scalingAlgorithm, nam); 
01281 
01282   lossTableList.push_front(handler);
01283 
01284   return true;
01285 }

G4double G4IonParametrisedLossModel::ComputeCrossSectionPerAtom ( const G4ParticleDefinition ,
G4double  ,
G4double  ,
G4double  ,
G4double  ,
G4double   
) [virtual]

Reimplemented from G4VEmModel.

Definition at line 370 of file G4IonParametrisedLossModel.cc.

References G4cout, G4endl, and MaxSecondaryEnergy().

Referenced by CrossSectionPerVolume().

00376                                                           {
00377 
00378   // ############## Cross section per atom  ################################
00379   // Function computes ionization cross section per atom
00380   //
00381   // See Geant4 physics reference manual (version 9.1), section 9.1.3
00382   // 
00383   // Ref.: W.M. Yao et al, Jour. of Phys. G 33 (2006) 1.
00384   //       B. Rossi, High energy particles, New York, NY: Prentice-Hall (1952).
00385   //
00386   // (Implementation adapted from G4BraggIonModel)
00387 
00388   G4double crosssection     = 0.0;
00389   G4double tmax      = MaxSecondaryEnergy(particle, kineticEnergy);
00390   G4double maxEnergy = std::min(tmax, maxKinEnergy);
00391 
00392   if(cutEnergy < tmax) {
00393 
00394      G4double energy  = kineticEnergy + cacheMass;
00395      G4double betaSquared  = kineticEnergy * 
00396                                      (energy + cacheMass) / (energy * energy);
00397 
00398      crosssection = 1.0 / cutEnergy - 1.0 / maxEnergy - 
00399                          betaSquared * std::log(maxEnergy / cutEnergy) / tmax;
00400 
00401      crosssection *= twopi_mc2_rcl2 * cacheChargeSquare / betaSquared;
00402   }
00403 
00404 #ifdef PRINT_DEBUG_CS
00405   G4cout << "########################################################"
00406          << G4endl
00407          << "# G4IonParametrisedLossModel::ComputeCrossSectionPerAtom"
00408          << G4endl
00409          << "# particle =" << particle -> GetParticleName() 
00410          <<  G4endl
00411          << "# cut(MeV) = " << cutEnergy/MeV  
00412          << G4endl;
00413 
00414   G4cout << "#"
00415          << std::setw(13) << std::right << "E(MeV)"
00416          << std::setw(14) << "CS(um)"
00417          << std::setw(14) << "E_max_sec(MeV)"
00418          << G4endl
00419          << "# ------------------------------------------------------"
00420          << G4endl;
00421 
00422   G4cout << std::setw(14) << std::right << kineticEnergy / MeV
00423          << std::setw(14) << crosssection / (um * um)
00424          << std::setw(14) << tmax / MeV
00425          << G4endl;
00426 #endif
00427 
00428   crosssection *= atomicNumber;
00429 
00430   return crosssection;
00431 }

G4double G4IonParametrisedLossModel::ComputeDEDXPerVolume ( const G4Material ,
const G4ParticleDefinition ,
G4double  ,
G4double   
) [virtual]

Reimplemented from G4VEmModel.

Definition at line 454 of file G4IonParametrisedLossModel.cc.

References DeltaRayMeanEnergyTransferRate(), GetChargeSquareRatio(), and G4VEmModel::LowEnergyLimit().

Referenced by CorrectionsAlongStep(), and PrintDEDXTable().

00458                                                           {
00459 
00460   // ############## dE/dx ##################################################
00461   // Function computes dE/dx values, where following rules are adopted:
00462   //   A. If the ion-material pair is covered by any native ion data
00463   //      parameterisation, then: 
00464   //      * This parameterization is used for energies below a given energy 
00465   //        limit,
00466   //      * whereas above the limit the Bethe-Bloch model is applied, in 
00467   //        combination with an effective charge estimate and high order 
00468   //        correction terms.
00469   //      A smoothing procedure is applied to dE/dx values computed with
00470   //      the second approach. The smoothing factor is based on the dE/dx
00471   //      values of both approaches at the transition energy (high order
00472   //      correction terms are included in the calculation of the transition
00473   //      factor).
00474   //   B. If the particle is a generic ion, the BraggIon and Bethe-Bloch
00475   //      models are used and a smoothing procedure is applied to values
00476   //      obtained with the second approach.
00477   //   C. If the ion-material is not covered by any ion data parameterization
00478   //      then:
00479   //      * The BraggIon model is used for energies below a given energy 
00480   //        limit,
00481   //      * whereas above the limit the Bethe-Bloch model is applied, in 
00482   //        combination with an effective charge estimate and high order 
00483   //        correction terms.
00484   //      Also in this case, a smoothing procedure is applied to dE/dx values 
00485   //      computed with the second model. 
00486 
00487   G4double dEdx = 0.0;
00488   UpdateDEDXCache(particle, material, cutEnergy);
00489 
00490   LossTableList::iterator iter = dedxCacheIter;
00491 
00492   if(iter != lossTableList.end()) {
00493 
00494      G4double transitionEnergy = dedxCacheTransitionEnergy;
00495 
00496      if(transitionEnergy > kineticEnergy) {
00497 
00498         dEdx = (*iter) -> GetDEDX(particle, material, kineticEnergy);
00499 
00500         G4double dEdxDeltaRays = DeltaRayMeanEnergyTransferRate(material, 
00501                                            particle, 
00502                                            kineticEnergy, 
00503                                            cutEnergy);
00504         dEdx -= dEdxDeltaRays;    
00505      }
00506      else {
00507         G4double massRatio = dedxCacheGenIonMassRatio;
00508                        
00509         G4double chargeSquare = 
00510                        GetChargeSquareRatio(particle, material, kineticEnergy);
00511 
00512         G4double scaledKineticEnergy = kineticEnergy * massRatio;
00513         G4double scaledTransitionEnergy = transitionEnergy * massRatio;
00514 
00515         G4double lowEnergyLimit = betheBlochModel -> LowEnergyLimit();
00516 
00517         if(scaledTransitionEnergy >= lowEnergyLimit) {
00518 
00519            dEdx = betheBlochModel -> ComputeDEDXPerVolume(
00520                                       material, genericIon,
00521                                       scaledKineticEnergy, cutEnergy);
00522         
00523            dEdx *= chargeSquare;
00524 
00525            dEdx += corrections -> ComputeIonCorrections(particle, 
00526                                                  material, kineticEnergy);
00527 
00528            G4double factor = 1.0 + dedxCacheTransitionFactor / 
00529                                                            kineticEnergy;
00530 
00531            dEdx *= factor;
00532         }
00533      }
00534   }
00535   else {
00536      G4double massRatio = 1.0;
00537      G4double chargeSquare = 1.0;
00538 
00539      if(particle != genericIon) {
00540 
00541         chargeSquare = GetChargeSquareRatio(particle, material, kineticEnergy);
00542         massRatio = genericIonPDGMass / particle -> GetPDGMass(); 
00543      }
00544 
00545      G4double scaledKineticEnergy = kineticEnergy * massRatio;
00546 
00547      G4double lowEnergyLimit = betheBlochModel -> LowEnergyLimit();
00548      if(scaledKineticEnergy < lowEnergyLimit) {
00549         dEdx = braggIonModel -> ComputeDEDXPerVolume(
00550                                       material, genericIon,
00551                                       scaledKineticEnergy, cutEnergy);
00552 
00553         dEdx *= chargeSquare;
00554      }
00555      else {
00556         G4double dEdxLimitParam = braggIonModel -> ComputeDEDXPerVolume(
00557                                       material, genericIon,
00558                                       lowEnergyLimit, cutEnergy);
00559 
00560         G4double dEdxLimitBetheBloch = betheBlochModel -> ComputeDEDXPerVolume(
00561                                       material, genericIon,
00562                                       lowEnergyLimit, cutEnergy);
00563 
00564         if(particle != genericIon) {
00565            G4double chargeSquareLowEnergyLimit = 
00566                GetChargeSquareRatio(particle, material, 
00567                                     lowEnergyLimit / massRatio);
00568 
00569            dEdxLimitParam *= chargeSquareLowEnergyLimit;
00570            dEdxLimitBetheBloch *= chargeSquareLowEnergyLimit;
00571 
00572            dEdxLimitBetheBloch += 
00573                     corrections -> ComputeIonCorrections(particle, 
00574                                       material, lowEnergyLimit / massRatio);
00575         }
00576 
00577         G4double factor = (1.0 + (dEdxLimitParam/dEdxLimitBetheBloch - 1.0)
00578                                * lowEnergyLimit / scaledKineticEnergy);
00579 
00580         dEdx = betheBlochModel -> ComputeDEDXPerVolume(
00581                                       material, genericIon,
00582                                       scaledKineticEnergy, cutEnergy);
00583 
00584         dEdx *= chargeSquare;
00585 
00586         if(particle != genericIon) {
00587            dEdx += corrections -> ComputeIonCorrections(particle, 
00588                                       material, kineticEnergy);
00589         }
00590 
00591         dEdx *= factor;
00592      }
00593 
00594   }
00595 
00596   if (dEdx < 0.0) dEdx = 0.0;
00597 
00598   return dEdx;
00599 }

G4double G4IonParametrisedLossModel::ComputeLossForStep ( const G4MaterialCutsCouple ,
const G4ParticleDefinition ,
G4double  ,
G4double   
)

Definition at line 1186 of file G4IonParametrisedLossModel.cc.

References G4cout, and G4endl.

Referenced by CorrectionsAlongStep().

01190                                           {
01191 
01192   G4double loss = 0.0;
01193 
01194   UpdateRangeCache(particle, matCutsCouple);
01195 
01196   G4PhysicsVector* energyRange = rangeCacheEnergyRange;
01197   G4PhysicsVector* rangeEnergy = rangeCacheRangeEnergy;
01198 
01199   if(energyRange != 0 && rangeEnergy != 0) {
01200      G4bool b;
01201 
01202      G4double lowerEnEdge = energyRange -> GetLowEdgeEnergy( 0 );
01203      G4double lowerRangeEdge = rangeEnergy -> GetLowEdgeEnergy( 0 );
01204 
01205      // Computing range for pre-step kinetic energy:
01206      G4double range = energyRange -> GetValue(kineticEnergy, b);
01207 
01208      // Energy below vector boundary:
01209      if(kineticEnergy < lowerEnEdge) {
01210 
01211         range =  energyRange -> GetValue(lowerEnEdge, b);
01212         range *= std::sqrt(kineticEnergy / lowerEnEdge);
01213      }
01214 
01215 #ifdef PRINT_DEBUG
01216      G4cout << "G4IonParametrisedLossModel::ComputeLossForStep() range = " 
01217             << range / mm << " mm, step = " << stepLength / mm << " mm" 
01218             << G4endl;
01219 #endif
01220 
01221      // Remaining range:
01222      G4double remRange = range - stepLength;
01223 
01224      // If range is smaller than step length, the loss is set to kinetic  
01225      // energy
01226      if(remRange < 0.0) loss = kineticEnergy;
01227      else if(remRange < lowerRangeEdge) {
01228  
01229         G4double ratio = remRange / lowerRangeEdge;
01230         loss = kineticEnergy - ratio * ratio * lowerEnEdge;
01231      }
01232      else {
01233 
01234         G4double energy = rangeEnergy -> GetValue(range - stepLength, b);
01235         loss = kineticEnergy - energy;      
01236      }
01237   }
01238 
01239   if(loss < 0.0) loss = 0.0;
01240 
01241   return loss;
01242 }

void G4IonParametrisedLossModel::CorrectionsAlongStep ( const G4MaterialCutsCouple ,
const G4DynamicParticle ,
G4double ,
G4double ,
G4double   
) [virtual]

Reimplemented from G4VEmModel.

Definition at line 919 of file G4IonParametrisedLossModel.cc.

References ComputeDEDXPerVolume(), ComputeLossForStep(), DBL_MAX, G4cout, G4endl, G4VEmModel::GetModelOfFluctuations(), and G4VEmModel::LowEnergyLimit().

00924                                               {
00925 
00926   // ############## Corrections for along step energy loss calculation ######
00927   // The computed energy loss (due to electronic stopping) is overwritten 
00928   // by this function if an ion data parameterization is available for the 
00929   // current ion-material pair.
00930   // No action on the energy loss (due to electronic stopping) is performed 
00931   // if no parameterization is available. In this case the original 
00932   // generic ion tables (in combination with the effective charge) are used
00933   // in the along step DoIt function.
00934   //
00935   //
00936   // (Implementation partly adapted from G4BraggIonModel/G4BetheBlochModel)
00937 
00938   const G4ParticleDefinition* particle = dynamicParticle -> GetDefinition();
00939   const G4Material* material = couple -> GetMaterial();
00940 
00941   G4double kineticEnergy = dynamicParticle -> GetKineticEnergy();
00942 
00943   if(kineticEnergy == eloss) { return; }
00944 
00945   G4double cutEnergy = DBL_MAX;
00946   size_t cutIndex = couple -> GetIndex();
00947   cutEnergy = cutEnergies[cutIndex];
00948 
00949   UpdateDEDXCache(particle, material, cutEnergy);
00950 
00951   LossTableList::iterator iter = dedxCacheIter;
00952 
00953   // If parameterization for ions is available the electronic energy loss
00954   // is overwritten
00955   if(iter != lossTableList.end()) {
00956 
00957      // The energy loss is calculated using the ComputeDEDXPerVolume function
00958      // and the step length (it is assumed that dE/dx does not change 
00959      // considerably along the step)
00960      eloss = 
00961         length * ComputeDEDXPerVolume(material, particle, 
00962                                       kineticEnergy, cutEnergy);
00963 
00964 #ifdef PRINT_DEBUG
00965   G4cout.precision(6);      
00966   G4cout << "########################################################"
00967          << G4endl
00968          << "# G4IonParametrisedLossModel::CorrectionsAlongStep"
00969          << G4endl
00970          << "# cut(MeV) = " << cutEnergy/MeV 
00971          << G4endl;
00972 
00973   G4cout << "#" 
00974          << std::setw(13) << std::right << "E(MeV)"
00975          << std::setw(14) << "l(um)"
00976          << std::setw(14) << "l*dE/dx(MeV)"
00977          << std::setw(14) << "(l*dE/dx)/E"
00978          << G4endl
00979          << "# ------------------------------------------------------"
00980          << G4endl;
00981 
00982   G4cout << std::setw(14) << std::right << kineticEnergy / MeV
00983          << std::setw(14) << length / um
00984          << std::setw(14) << eloss / MeV
00985          << std::setw(14) << eloss / kineticEnergy * 100.0
00986          << G4endl;
00987 #endif
00988 
00989      // If the energy loss exceeds a certain fraction of the kinetic energy
00990      // (the fraction is indicated by the parameter "energyLossLimit") then
00991      // the range tables are used to derive a more accurate value of the
00992      // energy loss
00993      if(eloss > energyLossLimit * kineticEnergy) {
00994 
00995         eloss = ComputeLossForStep(couple, particle, 
00996                                    kineticEnergy,length);
00997 
00998 #ifdef PRINT_DEBUG
00999   G4cout << "# Correction applied:"
01000          << G4endl;
01001 
01002   G4cout << std::setw(14) << std::right << kineticEnergy / MeV
01003          << std::setw(14) << length / um
01004          << std::setw(14) << eloss / MeV
01005          << std::setw(14) << eloss / kineticEnergy * 100.0
01006          << G4endl;
01007 #endif
01008 
01009      }
01010   }
01011 
01012   // For all corrections below a kinetic energy between the Pre- and 
01013   // Post-step energy values is used
01014   G4double energy = kineticEnergy - eloss * 0.5;
01015   if(energy < 0.0) energy = kineticEnergy * 0.5;
01016 
01017   G4double chargeSquareRatio = corrections ->
01018                                      EffectiveChargeSquareRatio(particle,
01019                                                                 material,
01020                                                                 energy);
01021   GetModelOfFluctuations() -> SetParticleAndCharge(particle, 
01022                                                    chargeSquareRatio);
01023 
01024   // A correction is applied considering the change of the effective charge 
01025   // along the step (the parameter "corrFactor" refers to the effective 
01026   // charge at the beginning of the step). Note: the correction is not
01027   // applied for energy loss values deriving directly from parameterized 
01028   // ion stopping power tables
01029   G4double transitionEnergy = dedxCacheTransitionEnergy;
01030 
01031   if(iter != lossTableList.end() && transitionEnergy < kineticEnergy) {
01032      chargeSquareRatio *= corrections -> EffectiveChargeCorrection(particle,
01033                                                                 material,
01034                                                                 energy);
01035 
01036      G4double chargeSquareRatioCorr = chargeSquareRatio/corrFactor;
01037      eloss *= chargeSquareRatioCorr;
01038   }
01039   else if (iter == lossTableList.end()) {
01040 
01041      chargeSquareRatio *= corrections -> EffectiveChargeCorrection(particle,
01042                                                                 material,
01043                                                                 energy);
01044 
01045      G4double chargeSquareRatioCorr = chargeSquareRatio/corrFactor;
01046      eloss *= chargeSquareRatioCorr;
01047   }
01048 
01049   // Ion high order corrections are applied if the current model does not
01050   // overwrite the energy loss (i.e. when the effective charge approach is
01051   // used)
01052   if(iter == lossTableList.end()) {
01053 
01054      G4double scaledKineticEnergy = kineticEnergy * dedxCacheGenIonMassRatio;
01055      G4double lowEnergyLimit = betheBlochModel -> LowEnergyLimit();
01056 
01057      // Corrections are only applied in the Bethe-Bloch energy region
01058      if(scaledKineticEnergy > lowEnergyLimit) 
01059        eloss += length * 
01060             corrections -> IonHighOrderCorrections(particle, couple, energy);
01061   }
01062 }

G4double G4IonParametrisedLossModel::CrossSectionPerVolume ( const G4Material ,
const G4ParticleDefinition ,
G4double  ,
G4double  ,
G4double   
) [virtual]

Reimplemented from G4VEmModel.

Definition at line 435 of file G4IonParametrisedLossModel.cc.

References ComputeCrossSectionPerAtom().

00440                                                        {
00441 
00442   G4double nbElecPerVolume = material -> GetTotNbOfElectPerVolume();
00443   G4double cross = ComputeCrossSectionPerAtom(particle, 
00444                                               kineticEnergy, 
00445                                               nbElecPerVolume, 0,
00446                                               cutEnergy,
00447                                               maxEnergy);
00448 
00449   return cross;
00450 }

void G4IonParametrisedLossModel::DeactivateICRU73Scaling (  ) 

Definition at line 1328 of file G4IonParametrisedLossModel.cc.

References AddDEDXTable(), and RemoveDEDXTable().

01328                                                          {
01329 
01330   RemoveDEDXTable("ICRU73");
01331   AddDEDXTable("ICRU73", new G4IonStoppingData("ion_stopping_data/icru73"));
01332 }

G4double G4IonParametrisedLossModel::DeltaRayMeanEnergyTransferRate ( const G4Material ,
const G4ParticleDefinition ,
G4double  ,
G4double   
) [inline]

Definition at line 58 of file G4IonParametrisedLossModel.icc.

References GetChargeSquareRatio(), G4Material::GetTotNbOfElectPerVolume(), and MaxSecondaryEnergy().

Referenced by ComputeDEDXPerVolume().

00062                                                           {
00063 
00064   // ############## Mean energy transferred to delta-rays ###################
00065   // Computes the mean energy transfered to delta-rays per unit length,
00066   // considering only delta-rays with energies above the energy threshold 
00067   // (energy cut)
00068   //
00069   // The mean energy transfer rate is derived by using the differential
00070   // cross section given in the references below.
00071   //
00072   // See Geant4 physics reference manual (version 9.1), section 9.1.3
00073   // 
00074   // Ref.: W.M. Yao et al, Jour. of Phys. G 33 (2006) 1.
00075   //       B. Rossi, High energy particles, New York, NY: Prentice-Hall (1952).
00076   //
00077   // (Implementation adapted from G4BraggIonModel)
00078 
00079 
00080   //   *** Variables:
00081   //   kineticEnergy = kinetic energy of projectile
00082   //   totEnergy     = total energy of projectile, i.e. kinetic energy
00083   //                   plus rest energy (Mc^2)
00084   //   betaSquared   = beta of projectile squared, calculated as
00085   //                      beta^2 = 1 - 1 / (E/Mc^2)^2
00086   //                             = T * ( E + Mc^2 ) / E^2
00087   //                   where T = kineticEnergy, E = totEnergy
00088   //   cutEnergy     = energy threshold for secondary particle production
00089   //                   i.e. energy cut, below which energy transfered to 
00090   //                   electrons is treated as continuous loss of projectile
00091   //   maxKinEnergy  = maximum energy transferable to secondary electrons
00092   //   meanRate      = mean kinetic energy of delta ray (per unit length) 
00093   //                   (above cutEnergy)  
00094 
00095   G4double meanRate = 0.0;
00096 
00097   G4double maxKinEnergy = MaxSecondaryEnergy(particle, kineticEnergy);
00098 
00099   if (cutEnergy < maxKinEnergy) {
00100 
00101     G4double totalEnergy  = kineticEnergy + cacheMass;
00102     G4double betaSquared  = kineticEnergy * 
00103                   (totalEnergy + cacheMass) / (totalEnergy * totalEnergy);
00104 
00105     G4double cutMaxEnergyRatio = cutEnergy / maxKinEnergy;
00106 
00107     meanRate = 
00108         (- std::log(cutMaxEnergyRatio) - (1.0 - cutMaxEnergyRatio) * betaSquared) * 
00109         CLHEP::twopi_mc2_rcl2 * 
00110         (material->GetTotNbOfElectPerVolume()) / betaSquared;
00111 
00112     meanRate *= GetChargeSquareRatio(particle, material, kineticEnergy);
00113   }
00114   
00115   return meanRate;
00116 }

G4double G4IonParametrisedLossModel::GetChargeSquareRatio ( const G4ParticleDefinition ,
const G4Material ,
G4double   
) [virtual]

Reimplemented from G4VEmModel.

Definition at line 228 of file G4IonParametrisedLossModel.cc.

Referenced by ComputeDEDXPerVolume(), and DeltaRayMeanEnergyTransferRate().

00231                                                      {    // Kinetic energy
00232 
00233   G4double chargeSquareRatio = corrections ->
00234                                      EffectiveChargeSquareRatio(particle,
00235                                                                 material,
00236                                                                 kineticEnergy);
00237   corrFactor = chargeSquareRatio * 
00238                        corrections -> EffectiveChargeCorrection(particle,
00239                                                                 material,
00240                                                                 kineticEnergy);
00241   return corrFactor;
00242 }

G4double G4IonParametrisedLossModel::GetParticleCharge ( const G4ParticleDefinition ,
const G4Material ,
G4double   
) [virtual]

Reimplemented from G4VEmModel.

Definition at line 246 of file G4IonParametrisedLossModel.cc.

00249                                                      {   // Kinetic energy 
00250 
00251   return corrections -> GetParticleCharge(particle, material, kineticEnergy);
00252 }

void G4IonParametrisedLossModel::Initialise ( const G4ParticleDefinition ,
const G4DataVector  
) [virtual]

Implements G4VEmModel.

Definition at line 256 of file G4IonParametrisedLossModel.cc.

References G4cout, G4endl, G4VEmModel::GetName(), G4VEmModel::GetParticleChangeForLoss(), G4ProductionCutsTable::GetProductionCutsTable(), and G4VEmModel::SetParticleChange().

00258                                                                  {
00259 
00260   // Cached parameters are reset
00261   cacheParticle = 0;
00262   cacheMass = 0;
00263   cacheElecMassRatio = 0;
00264   cacheChargeSquare = 0;
00265   
00266   // Cached parameters are reset
00267   rangeCacheParticle = 0; 
00268   rangeCacheMatCutsCouple = 0; 
00269   rangeCacheEnergyRange = 0; 
00270   rangeCacheRangeEnergy = 0;
00271 
00272   // Cached parameters are reset
00273   dedxCacheParticle = 0;
00274   dedxCacheMaterial = 0;
00275   dedxCacheEnergyCut = 0;
00276   dedxCacheIter = lossTableList.end();
00277   dedxCacheTransitionEnergy = 0.0;  
00278   dedxCacheTransitionFactor = 0.0;
00279   dedxCacheGenIonMassRatio = 0.0;
00280 
00281   // The cache of loss tables is cleared
00282   LossTableList::iterator iterTables = lossTableList.begin();
00283   LossTableList::iterator iterTables_end = lossTableList.end();
00284 
00285   for(;iterTables != iterTables_end; iterTables++) 
00286                                        (*iterTables) -> ClearCache();
00287 
00288   // Range vs energy and energy vs range vectors from previous runs are
00289   // cleared
00290   RangeEnergyTable::iterator iterRange = r.begin();
00291   RangeEnergyTable::iterator iterRange_end = r.end();
00292 
00293   for(;iterRange != iterRange_end; iterRange++) delete iterRange -> second;
00294   r.clear();
00295 
00296   EnergyRangeTable::iterator iterEnergy = E.begin();
00297   EnergyRangeTable::iterator iterEnergy_end = E.end();
00298 
00299   for(;iterEnergy != iterEnergy_end; iterEnergy++) delete iterEnergy -> second;
00300   E.clear();
00301 
00302   // The cut energies are (re)loaded
00303   size_t size = cuts.size();
00304   cutEnergies.clear();
00305   for(size_t i = 0; i < size; i++) cutEnergies.push_back(cuts[i]);
00306 
00307   // All dE/dx vectors are built
00308   const G4ProductionCutsTable* coupleTable=
00309                      G4ProductionCutsTable::GetProductionCutsTable();
00310   size_t nmbCouples = coupleTable -> GetTableSize();
00311 
00312 #ifdef PRINT_TABLE_BUILT
00313     G4cout << "G4IonParametrisedLossModel::Initialise():"
00314            << " Building dE/dx vectors:"
00315            << G4endl;         
00316 #endif
00317 
00318   for (size_t i = 0; i < nmbCouples; i++) {
00319 
00320     const G4MaterialCutsCouple* couple = 
00321                                      coupleTable -> GetMaterialCutsCouple(i);
00322 
00323     const G4Material* material = couple -> GetMaterial();
00324     //    G4ProductionCuts* productionCuts = couple -> GetProductionCuts();
00325 
00326     for(G4int atomicNumberIon = 3; atomicNumberIon < 102; atomicNumberIon++) {
00327 
00328        LossTableList::iterator iter = lossTableList.begin();
00329        LossTableList::iterator iter_end = lossTableList.end();
00330 
00331        for(;iter != iter_end; iter++) { 
00332 
00333           if(*iter == 0) {
00334               G4cout << "G4IonParametrisedLossModel::Initialise():"
00335                      << " Skipping illegal table."
00336                      << G4endl;         
00337           }
00338 
00339           G4bool isApplicable = 
00340                     (*iter) -> BuildDEDXTable(atomicNumberIon, material);
00341           if(isApplicable) {
00342 
00343 #ifdef PRINT_TABLE_BUILT
00344              G4cout << "  Atomic Number Ion = " << atomicNumberIon
00345                     << ", Material = " << material -> GetName()
00346                     << ", Table = " << (*iter) -> GetName()
00347                     << G4endl;      
00348 #endif
00349              break; 
00350           }
00351        }
00352     }
00353   }
00354 
00355   // The particle change object 
00356   if(! particleChangeLoss) {
00357     particleChangeLoss = GetParticleChangeForLoss();
00358     braggIonModel -> SetParticleChange(particleChangeLoss, 0);
00359     betheBlochModel -> SetParticleChange(particleChangeLoss, 0);
00360   }
00361  
00362   // The G4BraggIonModel and G4BetheBlochModel instances are initialised with
00363   // the same settings as the current model:
00364   braggIonModel -> Initialise(particle, cuts);
00365   betheBlochModel -> Initialise(particle, cuts);
00366 }

LossTableList::iterator G4IonParametrisedLossModel::IsApplicable ( const G4ParticleDefinition ,
const G4Material  
) [inline]

Definition at line 130 of file G4IonParametrisedLossModel.icc.

Referenced by PrintDEDXTableHandlers().

00132                                                 {          // Target material
00133 
00134   LossTableList::iterator iter = lossTableList.end();
00135   LossTableList::iterator iterTables = lossTableList.begin();
00136   LossTableList::iterator iterTables_end = lossTableList.end();
00137 
00138   for(;iterTables != iterTables_end; iterTables++) {
00139       G4bool isApplicable = (*iterTables) -> 
00140                        IsApplicable(particle, material);
00141       if(isApplicable) {
00142          iter = iterTables;
00143          break;
00144       }
00145   }
00146 
00147   return iter;
00148 }

G4double G4IonParametrisedLossModel::MaxSecondaryEnergy ( const G4ParticleDefinition ,
G4double   
) [protected, virtual]

Reimplemented from G4VEmModel.

Definition at line 200 of file G4IonParametrisedLossModel.cc.

Referenced by ComputeCrossSectionPerAtom(), and DeltaRayMeanEnergyTransferRate().

00202                                                      {
00203 
00204   // ############## Maximum energy of secondaries ##########################
00205   // Function computes maximum energy of secondary electrons which are 
00206   // released by an ion
00207   //
00208   // See Geant4 physics reference manual (version 9.1), section 9.1.1
00209   // 
00210   // Ref.: W.M. Yao et al, Jour. of Phys. G 33 (2006) 1.
00211   //       C.Caso et al. (Part. Data Group), Europ. Phys. Jour. C 3 1 (1998).
00212   //       B. Rossi, High energy particles, New York, NY: Prentice-Hall (1952).
00213   //
00214   // (Implementation adapted from G4BraggIonModel)
00215 
00216   if(particle != cacheParticle) UpdateCache(particle);
00217 
00218   G4double tau  = kineticEnergy/cacheMass;
00219   G4double tmax = 2.0 * electron_mass_c2 * tau * (tau + 2.) /
00220                   (1. + 2.0 * (tau + 1.) * cacheElecMassRatio + 
00221                   cacheElecMassRatio * cacheElecMassRatio);
00222 
00223   return tmax;
00224 }

G4double G4IonParametrisedLossModel::MinEnergyCut ( const G4ParticleDefinition ,
const G4MaterialCutsCouple  
) [virtual]

Definition at line 190 of file G4IonParametrisedLossModel.cc.

00192                                                                            {
00193 
00194   return couple -> GetMaterial() -> GetIonisation() -> 
00195                                                   GetMeanExcitationEnergy();
00196 }

void G4IonParametrisedLossModel::PrintDEDXTable ( const G4ParticleDefinition ,
const G4Material ,
G4double  ,
G4double  ,
G4int  ,
G4bool   
)

Definition at line 603 of file G4IonParametrisedLossModel.cc.

References ComputeDEDXPerVolume(), DBL_MAX, G4cout, G4endl, and G4VEmModel::GetName().

Referenced by PrintDEDXTableHandlers().

00609                                           {     // Logarithmic scaling of energy
00610 
00611   G4double atomicMassNumber = particle -> GetAtomicMass();
00612   G4double materialDensity = material -> GetDensity();
00613 
00614   G4cout << "# dE/dx table for " << particle -> GetParticleName() 
00615          << " in material " << material -> GetName()
00616          << " of density " << materialDensity / g * cm3
00617          << " g/cm3"
00618          << G4endl
00619          << "# Projectile mass number A1 = " << atomicMassNumber
00620          << G4endl
00621          << "# ------------------------------------------------------"
00622          << G4endl;
00623   G4cout << "#"
00624          << std::setw(13) << std::right << "E"
00625          << std::setw(14) << "E/A1"
00626          << std::setw(14) << "dE/dx"
00627          << std::setw(14) << "1/rho*dE/dx"
00628          << G4endl;
00629   G4cout << "#"
00630          << std::setw(13) << std::right << "(MeV)"
00631          << std::setw(14) << "(MeV)"
00632          << std::setw(14) << "(MeV/cm)"
00633          << std::setw(14) << "(MeV*cm2/mg)"
00634          << G4endl
00635          << "# ------------------------------------------------------"
00636          << G4endl;
00637 
00638   G4double energyLowerBoundary = lowerBoundary * atomicMassNumber;
00639   G4double energyUpperBoundary = upperBoundary * atomicMassNumber; 
00640 
00641   if(logScaleEnergy) {
00642 
00643      energyLowerBoundary = std::log(energyLowerBoundary);
00644      energyUpperBoundary = std::log(energyUpperBoundary); 
00645   }
00646 
00647   G4double deltaEnergy = (energyUpperBoundary - energyLowerBoundary) / 
00648                                                            G4double(nmbBins);
00649 
00650   for(int i = 0; i < numBins + 1; i++) {
00651 
00652       G4double energy = energyLowerBoundary + i * deltaEnergy;
00653       if(logScaleEnergy) energy = std::exp(energy);
00654 
00655       G4double dedx = ComputeDEDXPerVolume(material, particle, energy, DBL_MAX);
00656       G4cout.precision(6);
00657       G4cout << std::setw(14) << std::right << energy / MeV
00658              << std::setw(14) << energy / atomicMassNumber / MeV
00659              << std::setw(14) << dedx / MeV * cm
00660              << std::setw(14) << dedx / materialDensity / (MeV*cm2/(0.001*g)) 
00661              << G4endl;
00662   }
00663 }

void G4IonParametrisedLossModel::PrintDEDXTableHandlers ( const G4ParticleDefinition ,
const G4Material ,
G4double  ,
G4double  ,
G4int  ,
G4bool   
)

Definition at line 667 of file G4IonParametrisedLossModel.cc.

References IsApplicable(), and PrintDEDXTable().

00673                                           {     // Logarithmic scaling of energy
00674 
00675   LossTableList::iterator iter = lossTableList.begin();
00676   LossTableList::iterator iter_end = lossTableList.end();
00677 
00678   for(;iter != iter_end; iter++) { 
00679       G4bool isApplicable =  (*iter) -> IsApplicable(particle, material);
00680       if(isApplicable) {  
00681         (*iter) -> PrintDEDXTable(particle, material,
00682                                   lowerBoundary, upperBoundary, 
00683                                   numBins,logScaleEnergy); 
00684         break;
00685       } 
00686   }
00687 }

G4bool G4IonParametrisedLossModel::RemoveDEDXTable ( const G4String name  ) 

Definition at line 1289 of file G4IonParametrisedLossModel.cc.

References G4VEmModel::GetName().

Referenced by DeactivateICRU73Scaling().

01290                                                       {
01291 
01292   LossTableList::iterator iter = lossTableList.begin();
01293   LossTableList::iterator iter_end = lossTableList.end();
01294   
01295   for(;iter != iter_end; iter++) {
01296      G4String tableName = (*iter) -> GetName();
01297 
01298      if(tableName == nam) { 
01299         delete (*iter);
01300 
01301         // Remove from table list
01302         lossTableList.erase(iter);
01303 
01304         // Range vs energy and energy vs range vectors are cleared
01305         RangeEnergyTable::iterator iterRange = r.begin();
01306         RangeEnergyTable::iterator iterRange_end = r.end();
01307 
01308         for(;iterRange != iterRange_end; iterRange++) 
01309                                             delete iterRange -> second;
01310         r.clear();
01311 
01312         EnergyRangeTable::iterator iterEnergy = E.begin();
01313         EnergyRangeTable::iterator iterEnergy_end = E.end();
01314 
01315         for(;iterEnergy != iterEnergy_end; iterEnergy++) 
01316                                             delete iterEnergy -> second;
01317         E.clear();
01318 
01319         return true;
01320      }
01321   }
01322 
01323   return false;
01324 }

void G4IonParametrisedLossModel::SampleSecondaries ( std::vector< G4DynamicParticle * > *  ,
const G4MaterialCutsCouple ,
const G4DynamicParticle ,
G4double  ,
G4double   
) [virtual]

Implements G4VEmModel.

Definition at line 691 of file G4IonParametrisedLossModel.cc.

References G4Electron::Definition(), G4cout, G4endl, G4UniformRand, G4DynamicParticle::GetMomentumDirection(), and G4VEmModel::MaxSecondaryKinEnergy().

00696                                                            {
00697 
00698 
00699   // ############## Sampling of secondaries #################################
00700   // The probability density function (pdf) of the kinetic energy T of a 
00701   // secondary electron may be written as:
00702   //    pdf(T) = f(T) * g(T)
00703   // where 
00704   //    f(T) = (Tmax - Tcut) / (Tmax * Tcut) * (1 / T^2)
00705   //    g(T) = 1 - beta^2 * T / Tmax
00706   // where Tmax is the maximum kinetic energy of the secondary, Tcut
00707   // is the lower energy cut and beta is the kinetic energy of the 
00708   // projectile.
00709   //
00710   // Sampling of the kinetic energy of a secondary electron:
00711   //  1) T0 is sampled from f(T) using the cumulated distribution function
00712   //     F(T) = int_Tcut^T f(T')dT'
00713   //  2) T is accepted or rejected by evaluating the rejection function g(T)
00714   //     at the sampled energy T0 against a randomly sampled value
00715   //
00716   //
00717   // See Geant4 physics reference manual (version 9.1), section 9.1.4
00718   //
00719   //
00720   // Reference pdf: W.M. Yao et al, Jour. of Phys. G 33 (2006) 1.
00721   //
00722   // (Implementation adapted from G4BraggIonModel)
00723 
00724   G4double rossiMaxKinEnergySec = MaxSecondaryKinEnergy(particle);
00725   G4double maxKinEnergySec = 
00726                         std::min(rossiMaxKinEnergySec, userMaxKinEnergySec);
00727 
00728   if(cutKinEnergySec >= maxKinEnergySec) return;
00729 
00730   G4double kineticEnergy = particle -> GetKineticEnergy();
00731   G4ThreeVector direction = particle ->GetMomentumDirection();
00732 
00733   G4double energy  = kineticEnergy + cacheMass;
00734   G4double betaSquared  = kineticEnergy * 
00735                                     (energy + cacheMass) / (energy * energy);
00736 
00737   G4double kinEnergySec;
00738   G4double grej;
00739 
00740   do {
00741 
00742     // Sampling kinetic energy from f(T) (using F(T)):
00743     G4double xi = G4UniformRand();
00744     kinEnergySec = cutKinEnergySec * maxKinEnergySec / 
00745                         (maxKinEnergySec * (1.0 - xi) + cutKinEnergySec * xi);
00746 
00747     // Deriving the value of the rejection function at the obtained kinetic 
00748     // energy:
00749     grej = 1.0 - betaSquared * kinEnergySec / rossiMaxKinEnergySec;
00750 
00751     if(grej > 1.0) {
00752         G4cout << "G4IonParametrisedLossModel::SampleSecondary Warning: "
00753                << "Majorant 1.0 < "
00754                << grej << " for e= " << kinEnergySec
00755                << G4endl;
00756     }
00757 
00758   } while( G4UniformRand() >= grej );
00759 
00760   G4double momentumSec =
00761            std::sqrt(kinEnergySec * (kinEnergySec + 2.0 * electron_mass_c2));
00762 
00763   G4double totMomentum = energy*std::sqrt(betaSquared);
00764   G4double cost = kinEnergySec * (energy + electron_mass_c2) /
00765                                    (momentumSec * totMomentum);
00766   if(cost > 1.0) cost = 1.0;
00767   G4double sint = std::sqrt((1.0 - cost)*(1.0 + cost));
00768 
00769   G4double phi = twopi * G4UniformRand() ;
00770 
00771   G4ThreeVector directionSec(sint*std::cos(phi),sint*std::sin(phi), cost) ;
00772   directionSec.rotateUz(direction);
00773 
00774   // create G4DynamicParticle object for delta ray
00775   G4DynamicParticle* delta = new G4DynamicParticle(G4Electron::Definition(),
00776                                                    directionSec,
00777                                                    kinEnergySec);
00778 
00779   secondaries -> push_back(delta);
00780 
00781   // Change kinematics of primary particle
00782   kineticEnergy       -= kinEnergySec;
00783   G4ThreeVector finalP = direction*totMomentum - directionSec*momentumSec;
00784   finalP               = finalP.unit();
00785 
00786   particleChangeLoss -> SetProposedKineticEnergy(kineticEnergy);
00787   particleChangeLoss -> SetProposedMomentumDirection(finalP);
00788 }

void G4IonParametrisedLossModel::SetEnergyLossLimit ( G4double  ionEnergyLossLimit  )  [inline]

Definition at line 152 of file G4IonParametrisedLossModel.icc.

00153                                                                          {
00154 
00155   if(ionEnergyLossLimit > 0 && ionEnergyLossLimit <=1) {
00156 
00157      energyLossLimit = ionEnergyLossLimit;
00158   }
00159 }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:52:18 2013 for Geant4 by  doxygen 1.4.7