Ignore:
Timestamp:
Nov 25, 2009, 5:13:58 PM (16 years ago)
Author:
garnier
Message:

update CVS release candidate geant4.9.3.01

Location:
trunk/source/processes/electromagnetic/utils/include
Files:
25 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/electromagnetic/utils/include/G4DummyModel.hh

    r1055 r1196  
    2525//
    2626// $Id: G4DummyModel.hh,v 1.4 2009/04/07 18:39:47 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
     27// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
  • trunk/source/processes/electromagnetic/utils/include/G4ElectronIonPair.hh

    r1007 r1196  
    2525//
    2626// $Id: G4ElectronIonPair.hh,v 1.2 2008/10/17 14:46:16 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     27// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2828//
    2929//
  • trunk/source/processes/electromagnetic/utils/include/G4EmCalculator.hh

    r1007 r1196  
    2424// ********************************************************************
    2525//
    26 // $Id: G4EmCalculator.hh,v 1.18 2007/03/15 12:34:46 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4EmCalculator.hh,v 1.19 2009/11/11 23:59:48 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2828//
    2929//
     
    6060#include "globals.hh"
    6161#include "G4DataVector.hh"
     62#include "G4DynamicParticle.hh"
    6263
    6364class G4LossTableManager;
     
    8283  ~G4EmCalculator();
    8384
     85  //==================================================================================
    8486  // Methods to access precalculated dE/dx and cross sections
    8587  // Materials should exist in the list of the G4MaterialCutsCouple
     88  //==================================================================================
    8689
    8790  G4double GetDEDX(G4double kinEnergy, const G4ParticleDefinition*, const G4Material*,
     
    136139  void PrintInverseRangeTable(const G4ParticleDefinition*);
    137140
     141  //==================================================================================
    138142  // Methods to calculate dE/dx and cross sections "on fly"
    139143  // Existing tables and G4MaterialCutsCouples are not used
     144  //==================================================================================
    140145
    141146  G4double ComputeDEDX(G4double kinEnergy, const G4ParticleDefinition*,
     
    150155                                 const G4String& mat, G4double cut = DBL_MAX);
    151156
    152   G4double ComputeNuclearDEDX(G4double kinEnergy, const G4ParticleDefinition*, const G4Material*);
    153   G4double ComputeNuclearDEDX(G4double kinEnergy, const G4String& part, const G4String& mat);
     157  G4double ComputeNuclearDEDX(G4double kinEnergy, const G4ParticleDefinition*,
     158                              const G4Material*);
     159  G4double ComputeNuclearDEDX(G4double kinEnergy, const G4String& part,
     160                              const G4String& mat);
    154161
    155162  G4double ComputeTotalDEDX(G4double kinEnergy, const G4ParticleDefinition*,
     
    190197                       const G4String&);
    191198
     199  //==================================================================================
     200  // Methods to access particles, materials, regions
     201  //==================================================================================
     202
    192203  const G4ParticleDefinition* FindParticle(const G4String&);
    193204
     205  const G4ParticleDefinition* FindIon(G4int Z, G4int A);
     206
    194207  const G4Material* FindMaterial(const G4String&);
    195208
     
    199212
    200213  void SetVerbose(G4int val);
     214
     215  //==================================================================================
     216  // Private methods
     217  //==================================================================================
    201218
    202219private:
     
    240257  const G4ParticleDefinition*  theGenericIon;
    241258  G4ionEffectiveCharge*        ionEffCharge;
     259  G4DynamicParticle            dynParticle;
    242260
    243261  G4String                     currentName;
  • trunk/source/processes/electromagnetic/utils/include/G4EmConfigurator.hh

    r1007 r1196  
    2525//
    2626// $Id: G4EmConfigurator.hh,v 1.2 2008/11/21 12:30:29 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     27// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
  • trunk/source/processes/electromagnetic/utils/include/G4EmCorrections.hh

    r1007 r1196  
    2525//
    2626// $Id: G4EmCorrections.hh,v 1.24 2008/09/12 14:44:48 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     27// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
  • trunk/source/processes/electromagnetic/utils/include/G4EmElementSelector.hh

    r1055 r1196  
    2424// ********************************************************************
    2525//
    26 // $Id: G4EmElementSelector.hh,v 1.4 2009/05/10 18:26:43 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
     26// $Id: G4EmElementSelector.hh,v 1.6 2009/09/29 11:31:37 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    109109{
    110110  if (nElmMinusOne > 0) {
    111     G4bool b;
    112111    G4double x = G4UniformRand();
    113     for(G4int i=0; i<nElmMinusOne; i++) {
    114       if (x <= (xSections[i])->GetValue(e,b)) {
     112    element = (*theElementVector)[nElmMinusOne];
     113    for(G4int i=0; i<nElmMinusOne; ++i) {
     114      if (x <= (xSections[i])->Value(e)) {
    115115        element = (*theElementVector)[i];
    116116        break;
  • trunk/source/processes/electromagnetic/utils/include/G4EmModelManager.hh

    r1055 r1196  
    2424// ********************************************************************
    2525//
    26 // $Id: G4EmModelManager.hh,v 1.28 2009/04/09 15:53:17 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
     26// $Id: G4EmModelManager.hh,v 1.34 2009/08/11 10:29:30 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    5454// 15-03-07 Add maxCutInRange (V.Ivanchenko)
    5555// 08-04-08 Simplify Select method for only one G4RegionModel (VI)
     56// 03-08-09 Removed unused members and simplify model search if only one
     57//          model is used (VI)
    5658//
    5759// Class Description:
     
    9698    if (nModelsForRegion>1) {
    9799      idx = nModelsForRegion;
    98       do {idx--;} while (idx && e <= lowKineticEnergy[idx]);
     100      do {--idx;} while (idx > 0 && e <= lowKineticEnergy[idx]);
    99101    }
    100102    return theListOfModelIndexes[idx];
     
    130132class G4Region;
    131133class G4ParticleDefinition;
    132 class G4DataVector;
    133134class G4PhysicsVector;
    134135class G4MaterialCutsCouple;
     
    174175
    175176private:
     177
     178  inline G4double ComputeDEDX(G4VEmModel* model,
     179                              const G4MaterialCutsCouple*,
     180                              G4double kinEnergy,
     181                              G4double cutEnergy,
     182                              G4double minEnergy);
    176183
    177184  // hide  assignment operator
     
    195202  G4int                       nEmModels;
    196203  G4int                       nRegions;
    197   G4int                       nCouples;
    198 
    199   G4int*                      idxOfRegionModels;
    200   G4RegionModels**            setOfRegionModels;
    201 
    202   G4double                    minSubRange;
    203   G4double                    maxCutInRange;
     204
     205  std::vector<G4int>            idxOfRegionModels;
     206  std::vector<G4RegionModels*>  setOfRegionModels;
     207
    204208  G4double                    maxSubCutInRange;
    205209
    206210  const G4ParticleDefinition* particle;
    207   const G4ParticleDefinition* secondaryParticle;
    208   const G4ParticleDefinition* theGamma;
    209   const G4ParticleDefinition* thePositron;
    210211
    211212  G4int                       verboseLevel;
     213  G4bool                      severalModels;
    212214
    213215  // may be changed in run time
    214216  G4RegionModels*             currRegionModel;
     217  G4VEmModel*                 currModel;
    215218};
    216219
     
    221224                                                 size_t& index)
    222225{
    223   if(nRegions > 1) currRegionModel = setOfRegionModels[idxOfRegionModels[index]];
    224   return models[currRegionModel->SelectIndex(kinEnergy)];
     226  if(severalModels) {
     227    if(nRegions > 1) {
     228      currRegionModel = setOfRegionModels[idxOfRegionModels[index]];
     229    }
     230    currModel = models[currRegionModel->SelectIndex(kinEnergy)];
     231  }
     232  return currModel;
    225233}
    226234
     
    248256//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    249257
     258inline G4double
     259G4EmModelManager::ComputeDEDX(G4VEmModel* model,
     260                              const G4MaterialCutsCouple* couple,
     261                              G4double e,
     262                              G4double cut,
     263                              G4double emin)
     264{
     265  G4double dedx = 0.0;
     266  if(model && cut > emin) {
     267    dedx = model->ComputeDEDX(couple,particle,e,cut);
     268    if(emin > 0.0) {dedx -= model->ComputeDEDX(couple,particle,e,emin);}
     269  }
     270  return dedx;
     271}
     272
     273//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     274
    250275#endif
    251276
  • trunk/source/processes/electromagnetic/utils/include/G4EmMultiModel.hh

    r1007 r1196  
    2525//
    2626// $Id: G4EmMultiModel.hh,v 1.6 2007/05/22 17:31:57 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     27// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
  • trunk/source/processes/electromagnetic/utils/include/G4EmProcessOptions.hh

    r1055 r1196  
    2424// ********************************************************************
    2525//
    26 // $Id: G4EmProcessOptions.hh,v 1.15 2009/02/18 14:40:10 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
     26// $Id: G4EmProcessOptions.hh,v 1.16 2009/10/29 19:25:28 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2828//
    2929//
     
    128128  void SetPolarAngleLimit(G4double val);
    129129
     130  void SetFactorForAngleLimit(G4double val);
     131
    130132private:
    131133
  • trunk/source/processes/electromagnetic/utils/include/G4EmProcessSubType.hh

    r1007 r1196  
    2626//
    2727// $Id: G4EmProcessSubType.hh,v 1.9 2008/12/18 13:01:42 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030//---------------------------------------------------------------
  • trunk/source/processes/electromagnetic/utils/include/G4EmSaturation.hh

    r1007 r1196  
    2424// ********************************************************************
    2525//
    26 // $Id: G4EmSaturation.hh,v 1.6 2008/03/17 11:27:32 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4EmSaturation.hh,v 1.7 2009/09/25 09:16:40 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2828//
    2929//
     
    104104  void Initialise();
    105105
    106   const G4ParticleDefinition* gamma;
    107106  const G4ParticleDefinition* electron;
    108   const G4ParticleDefinition* neutron;
    109107  const G4ParticleDefinition* proton;
    110108  G4LossTableManager*         manager;
  • trunk/source/processes/electromagnetic/utils/include/G4EmTableType.hh

    r1007 r1196  
    2626//
    2727// $Id: G4EmTableType.hh,v 1.4 2008/10/13 14:56:56 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030//---------------------------------------------------------------
  • trunk/source/processes/electromagnetic/utils/include/G4EnergyLossMessenger.hh

    r1055 r1196  
    2525//
    2626//
    27 // $Id: G4EnergyLossMessenger.hh,v 1.23 2009/02/18 14:40:10 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
     27// $Id: G4EnergyLossMessenger.hh,v 1.24 2009/10/29 19:25:28 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030// -------------------------------------------------------------------
     
    126126  G4UIcmdWithADouble*        frCmd;
    127127  G4UIcmdWithADouble*        fgCmd;
     128  G4UIcmdWithADouble*        mscfCmd;
    128129  G4UIcmdWithADoubleAndUnit* angCmd;
    129130};
  • trunk/source/processes/electromagnetic/utils/include/G4EnergyLossTables.hh

    r1007 r1196  
    2626//
    2727// $Id: G4EnergyLossTables.hh,v 1.19 2006/06/29 19:54:35 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030// $Id:
  • trunk/source/processes/electromagnetic/utils/include/G4LossTableBuilder.hh

    r1007 r1196  
    2525//
    2626// $Id: G4LossTableBuilder.hh,v 1.8 2008/07/22 15:55:15 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     27// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2828//
    2929//
  • trunk/source/processes/electromagnetic/utils/include/G4LossTableManager.hh

    r1055 r1196  
    2424// ********************************************************************
    2525//
    26 // $Id: G4LossTableManager.hh,v 1.54 2009/04/09 16:10:57 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
     26// $Id: G4LossTableManager.hh,v 1.55 2009/10/29 19:25:28 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2828//
    2929//
     
    210210  void SetBremsstrahlungTh(G4double val);
    211211
     212  void SetFactorForAngleLimit(G4double val);
     213
    212214  void SetVerbose(G4int val);
    213215
     
    221223
    222224  G4double BremsstrahlungTh() const;
     225
     226  G4double FactorForAngleLimit() const;
    223227
    224228  const std::vector<G4VEnergyLossProcess*>& GetEnergyLossProcessVector();
     
    302306  G4double maxKinEnergyForMuons;
    303307  G4double bremsTh;
     308  G4double factorForAngleLimit;
    304309
    305310  G4LossTableBuilder*         tableBuilder;
  • trunk/source/processes/electromagnetic/utils/include/G4MscStepLimitType.hh

    r1007 r1196  
    2626//
    2727// $Id: G4MscStepLimitType.hh,v 1.2 2007/06/11 14:56:51 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030//---------------------------------------------------------------
  • trunk/source/processes/electromagnetic/utils/include/G4VEmFluctuationModel.hh

    r1055 r1196  
    2525//
    2626// $Id: G4VEmFluctuationModel.hh,v 1.12 2009/02/19 11:25:50 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
     27// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
  • trunk/source/processes/electromagnetic/utils/include/G4VEmModel.hh

    r1055 r1196  
    2424// ********************************************************************
    2525//
    26 // $Id: G4VEmModel.hh,v 1.69 2009/05/26 15:00:49 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
     26// $Id: G4VEmModel.hh,v 1.72 2009/09/23 14:42:47 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    137137                                         G4double maxEnergy = DBL_MAX);
    138138
    139   // main method to compute cross section depending on atom
     139  // main method to compute cross section per atom
    140140  virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition*,
    141141                                              G4double kinEnergy,
     
    159159                                     G4double kineticEnergy);
    160160
    161   // add correction to energy loss and ompute non-ionizing energy loss
     161  // add correction to energy loss and compute non-ionizing energy loss
    162162  virtual void CorrectionsAlongStep(const G4MaterialCutsCouple*,
    163163                                    const G4DynamicParticle*,
     
    171171                                           G4double& eloss);
    172172
    173   // add region for the model
    174   virtual void DefineForRegion(const G4Region*);
    175 
    176   // initilisation at run time for given material
     173  // initilisation at run time for a given material
    177174  virtual void SetupForMaterial(const G4ParticleDefinition*,
    178175                                const G4Material*,
    179176                                G4double kineticEnergy);
     177
     178  // add a region for the model
     179  virtual void DefineForRegion(const G4Region*);
    180180
    181181protected:
     
    209209  // cross section per volume
    210210  inline G4double CrossSection(const G4MaterialCutsCouple*,
    211                                 const G4ParticleDefinition*,
    212                                 G4double kineticEnergy,
    213                                 G4double cutEnergy = 0.0,
    214                                 G4double maxEnergy = DBL_MAX);
     211                               const G4ParticleDefinition*,
     212                               G4double kineticEnergy,
     213                               G4double cutEnergy = 0.0,
     214                               G4double maxEnergy = DBL_MAX);
    215215
    216216  // compute mean free path via cross section per volume
     
    267267  inline void SetLowEnergyLimit(G4double);
    268268
     269  inline void SetActivationHighEnergyLimit(G4double);
     270
     271  inline void SetActivationLowEnergyLimit(G4double);
     272
     273  inline G4bool IsActive(G4double kinEnergy);
     274
    269275  inline void SetPolarAngleLimit(G4double);
    270276
     
    308314  G4double        lowLimit;
    309315  G4double        highLimit;
     316  G4double        eMinActive;
     317  G4double        eMaxActive;
    310318  G4double        polarAngleLimit;
    311319  G4double        secondaryThreshold;
     
    434442inline G4int G4VEmModel::SelectIsotopeNumber(const G4Element* elm)
    435443{
     444  currentElement = elm;
    436445  G4int N = G4int(elm->GetN() + 0.5);
    437446  G4int ni = elm->GetNumberOfIsotopes();
     
    439448    G4int idx = 0;
    440449    if(ni > 1) {
    441       G4double* ab = currentElement->GetRelativeAbundanceVector();
     450      G4double* ab = elm->GetRelativeAbundanceVector();
    442451      G4double x = G4UniformRand();
    443452      for(; idx<ni; idx++) {
     
    517526//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    518527
     528inline void G4VEmModel::SetActivationHighEnergyLimit(G4double val)
     529{
     530  eMaxActive = val;
     531}
     532
     533//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     534
     535inline void G4VEmModel::SetActivationLowEnergyLimit(G4double val)
     536{
     537  eMinActive = val;
     538}
     539
     540//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     541
     542inline G4bool G4VEmModel::IsActive(G4double kinEnergy)
     543{
     544  return (kinEnergy >= eMinActive && kinEnergy <= eMaxActive);
     545}
     546
     547//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     548
    519549inline void G4VEmModel::SetPolarAngleLimit(G4double val)
    520550{
  • trunk/source/processes/electromagnetic/utils/include/G4VEmProcess.hh

    r1055 r1196  
    2424// ********************************************************************
    2525//
    26 // $Id: G4VEmProcess.hh,v 1.51 2009/04/07 18:39:47 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
     26// $Id: G4VEmProcess.hh,v 1.55 2009/09/23 14:42:47 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    202202protected:
    203203  // Select model in run time
    204   inline void SelectModel(G4double& kinEnergy);
     204  inline G4VEmModel* SelectModel(G4double& kinEnergy, size_t index);
    205205
    206206public:
     
    344344  const G4Material*            currentMaterial;
    345345  const G4MaterialCutsCouple*  currentCouple;
    346   size_t                       currentMaterialIndex;
     346  size_t                       currentCoupleIndex;
    347347
    348348  G4double                     mfpKinEnergy;
     
    358358                 G4double kineticEnergy, G4double Z, G4double A, G4double cut)
    359359{
    360   SelectModel(kineticEnergy);
     360  SelectModel(kineticEnergy, currentCoupleIndex);
    361361  G4double x = 0.0;
    362362  if(currentModel) {
     
    468468//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    469469
    470 inline void G4VEmProcess::SelectModel(G4double& kinEnergy)
    471 {
    472   currentModel = modelManager->SelectModel(kinEnergy, currentMaterialIndex);
     470inline
     471G4VEmModel* G4VEmProcess::SelectModel(G4double& kinEnergy, size_t index)
     472{
     473  currentModel = modelManager->SelectModel(kinEnergy, index);
    473474  currentModel->SetCurrentCouple(currentCouple);
    474 }
    475 
    476 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    477 
    478 inline G4VEmModel* G4VEmProcess::SelectModelForMaterial(
    479                                    G4double kinEnergy, size_t& idxRegion) const
     475  return currentModel;
     476}
     477
     478//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     479
     480inline
     481G4VEmModel* G4VEmProcess::SelectModelForMaterial(G4double kinEnergy,
     482                                                 size_t& idxRegion) const
    480483{
    481484  return modelManager->SelectModel(kinEnergy, idxRegion);
     
    545548inline size_t G4VEmProcess::CurrentMaterialCutsCoupleIndex() const
    546549{
    547   return currentMaterialIndex;
     550  return currentCoupleIndex;
    548551}
    549552
     
    552555inline G4double G4VEmProcess::GetGammaEnergyCut()
    553556{
    554   return (*theCutsGamma)[currentMaterialIndex];
     557  return (*theCutsGamma)[currentCoupleIndex];
    555558}
    556559
     
    559562inline G4double G4VEmProcess::GetElectronEnergyCut()
    560563{
    561   return (*theCutsElectron)[currentMaterialIndex];
     564  return (*theCutsElectron)[currentCoupleIndex];
    562565}
    563566
     
    583586  preStepKinEnergy = track.GetKineticEnergy();
    584587  DefineMaterial(track.GetMaterialCutsCouple());
     588  SelectModel(preStepKinEnergy, currentCoupleIndex);
    585589  if (theNumberOfInteractionLengthLeft < 0.0) mfpKinEnergy = DBL_MAX;
    586590}
     
    593597    currentCouple   = couple;
    594598    currentMaterial = couple->GetMaterial();
    595     currentMaterialIndex = couple->GetIndex();
     599    currentCoupleIndex = couple->GetIndex();
    596600    mfpKinEnergy = DBL_MAX;
    597601  }
     
    602606inline void G4VEmProcess::ComputeIntegralLambda(G4double e)
    603607{
    604   mfpKinEnergy  = theEnergyOfCrossSectionMax[currentMaterialIndex];
     608  mfpKinEnergy  = theEnergyOfCrossSectionMax[currentCoupleIndex];
    605609  if (e <= mfpKinEnergy) {
    606610    preStepLambda = GetLambdaFromTable(e);
     
    616620      }
    617621    } else {
    618       preStepLambda = theCrossSectionMax[currentMaterialIndex];
     622      preStepLambda = theCrossSectionMax[currentCoupleIndex];
    619623    }
    620624  }
     
    625629inline G4double G4VEmProcess::GetLambdaFromTable(G4double e)
    626630{
    627   G4bool b;
    628   return (((*theLambdaTable)[currentMaterialIndex])->GetValue(e, b));
     631  return (((*theLambdaTable)[currentCoupleIndex])->Value(e));
    629632}
    630633
     
    634637{
    635638  G4double x = 0.0;
    636   if(theLambdaTable) x = GetLambdaFromTable(e);
    637   else               x = ComputeCurrentLambda(e);
     639  if(theLambdaTable) { x = GetLambdaFromTable(e); }
     640  else               { x = ComputeCurrentLambda(e); }
    638641  return x;
    639642}
     
    643646inline G4double G4VEmProcess::ComputeCurrentLambda(G4double e)
    644647{
    645   SelectModel(e);
    646   G4double x = 0.0;
    647   if(currentModel) {
    648     x = currentModel->CrossSectionPerVolume(currentMaterial,particle,
    649                                             e,(*theCuts)[currentMaterialIndex]);
    650   }
    651   return x;
     648  SelectModel(e, currentCoupleIndex);
     649  return currentModel->CrossSectionPerVolume(currentMaterial,particle,
     650                                             e,(*theCuts)[currentCoupleIndex]);
    652651}
    653652
  • trunk/source/processes/electromagnetic/utils/include/G4VEnergyLoss.hh

    r1007 r1196  
    2626//
    2727// $Id: G4VEnergyLoss.hh,v 1.18 2006/06/29 19:54:47 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030//
  • trunk/source/processes/electromagnetic/utils/include/G4VEnergyLossProcess.hh

    r1055 r1196  
    2424// ********************************************************************
    2525//
    26 // $Id: G4VEnergyLossProcess.hh,v 1.87 2009/04/07 18:39:47 vnivanch Exp $
     26// $Id: G4VEnergyLossProcess.hh,v 1.89 2009/07/03 14:39:17 vnivanch Exp $
    2727// GEANT4 tag $Name:
    2828//
     
    355355  inline void SetLambdaFactor(G4double val);
    356356  inline void SetStepFunction(G4double v1, G4double v2);
     357  inline void SetLowestEnergyLimit(G4double);
    357358
    358359  inline G4int NumberOfSubCutoffRegions() const;
     
    717718//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    718719
     720inline void G4VEnergyLossProcess::SetLowestEnergyLimit(G4double val)
     721{
     722  lowestKinEnergy = val;
     723}
     724
     725//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     726
    719727inline G4int G4VEnergyLossProcess::NumberOfSubCutoffRegions() const
    720728{
     
    958966{
    959967  G4double e = amu_c2*preStepKinEnergy/particle->GetPDGMass();
    960   G4bool b;
    961   G4double s = fRange*std::pow(10.,vstrag->GetValue(e,b));
     968  G4double s = fRange*std::pow(10.,vstrag->Value(e));
    962969  G4double x = fRange + G4RandGauss::shoot(0.0,s);
    963970  if(x > 0.0) fRange = x;
     
    992999inline G4double G4VEnergyLossProcess::GetDEDXForScaledEnergy(G4double e)
    9931000{
    994   G4bool b;
    995   G4double x =
    996     ((*theDEDXTable)[currentMaterialIndex]->GetValue(e, b))*chargeSqRatio;
     1001  G4double x = ((*theDEDXTable)[currentMaterialIndex]->Value(e))*chargeSqRatio;
    9971002  if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);
    9981003  return x;
     
    10031008inline G4double G4VEnergyLossProcess::GetSubDEDXForScaledEnergy(G4double e)
    10041009{
    1005   G4bool b;
    1006   G4double x =
    1007     ((*theDEDXSubTable)[currentMaterialIndex]->GetValue(e, b))*chargeSqRatio;
     1010  G4double x = ((*theDEDXSubTable)[currentMaterialIndex]->Value(e))*chargeSqRatio;
    10081011  if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);
    10091012  return x;
     
    10141017inline G4double G4VEnergyLossProcess::GetIonisationForScaledEnergy(G4double e)
    10151018{
    1016   G4bool b;
    1017   G4double x = 0.0;
     1019  //G4double x = 0.0;
    10181020  //  if(theIonisationTable) {
    1019   x = ((*theIonisationTable)[currentMaterialIndex]->GetValue(e, b))
    1020     *chargeSqRatio;
     1021  G4double x = ((*theIonisationTable)[currentMaterialIndex]->Value(e))*chargeSqRatio;
    10211022  if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);
    10221023  //}
     
    10291030G4double G4VEnergyLossProcess::GetSubIonisationForScaledEnergy(G4double e)
    10301031{
    1031   G4bool b;
    1032   G4double x = 0.0;
     1032  //  G4double x = 0.0;
    10331033  //if(theIonisationSubTable) {
    1034   x = ((*theIonisationSubTable)[currentMaterialIndex]->GetValue(e, b))
    1035     *chargeSqRatio;
     1034  G4double x = ((*theIonisationSubTable)[currentMaterialIndex]->Value(e))*chargeSqRatio;
    10361035  if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);
    10371036  //}
     
    10431042inline G4double G4VEnergyLossProcess::GetScaledRangeForScaledEnergy(G4double e)
    10441043{
    1045   G4bool b;
    1046   G4double x = ((*theRangeTableForLoss)[currentMaterialIndex])->GetValue(e, b);
     1044  G4double x = ((*theRangeTableForLoss)[currentMaterialIndex])->Value(e);
    10471045  if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);
    10481046  return x;
     
    10541052                G4double e)
    10551053{
    1056   G4bool b;
    10571054  G4double x;
    10581055
    10591056  if (e < maxKinEnergyCSDA) {
    1060     x = ((*theCSDARangeTable)[currentMaterialIndex])->GetValue(e, b);
     1057    x = ((*theCSDARangeTable)[currentMaterialIndex])->Value(e);
    10611058    if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);
    10621059  } else {
     
    10721069{
    10731070  G4PhysicsVector* v = (*theInverseRangeTable)[currentMaterialIndex];
    1074   G4double rmin = v->GetLowEdgeEnergy(0);
     1071  G4double rmin = v->Energy(0);
    10751072  G4double e = 0.0;
    1076   if(r >= rmin) {
    1077     G4bool b;
    1078     e = v->GetValue(r, b);
    1079   } else if(r > 0.0) {
     1073  if(r >= rmin) { e = v->Value(r); }
     1074  else if(r > 0.0) {
    10801075    G4double x = r/rmin;
    10811076    e = minKinEnergy*x*x;
     
    10881083inline G4double G4VEnergyLossProcess::GetLambdaForScaledEnergy(G4double e)
    10891084{
    1090   G4bool b;
    1091   return
    1092     chargeSqRatio*(((*theLambdaTable)[currentMaterialIndex])->GetValue(e, b));
     1085  return chargeSqRatio*(((*theLambdaTable)[currentMaterialIndex])->Value(e));
    10931086}
    10941087
  • trunk/source/processes/electromagnetic/utils/include/G4VMscModel.hh

    r1055 r1196  
    2525//
    2626// $Id: G4VMscModel.hh,v 1.9 2009/04/07 18:39:47 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
     27// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
  • trunk/source/processes/electromagnetic/utils/include/G4VMultipleScattering.hh

    r1055 r1196  
    2424// ********************************************************************
    2525//
    26 // $Id: G4VMultipleScattering.hh,v 1.56 2009/04/07 18:39:47 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
     26// $Id: G4VMultipleScattering.hh,v 1.62 2009/10/29 17:56:04 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    127127  void PrintInfoDefinition();
    128128
    129   G4VParticleChange* AlongStepDoIt(const G4Track&, const G4Step&);
    130 
    131   G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&);
    132 
    133129  // Store PhysicsTable in a file.
    134130  // Return false in case of failure at I/O
     
    158154  // The function overloads the corresponding function of the base
    159155  // class.
    160   G4double PostStepGetPhysicalInteractionLength(
     156  inline G4double PostStepGetPhysicalInteractionLength(
    161157                                            const G4Track&,
    162158                                            G4double  previousStepSize,
    163159                                            G4ForceCondition* condition);
     160
     161  // Along step actions
     162  inline G4VParticleChange* AlongStepDoIt(const G4Track&, const G4Step&);
     163
     164  // Post step actions
     165  inline G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&);
    164166
    165167  // This method does not used for tracking, it is intended only for tests
     
    209211  void AddEmModel(G4int order, G4VEmModel*, const G4Region* region = 0);
    210212
     213  // Assign a model to a process
     214  void SetModel(G4VMscModel*, G4int index = 1);
     215 
     216  // return the assigned model
     217  G4VMscModel* Model(G4int index = 1);
     218
    211219  // Access to models by index
    212   G4VEmModel* GetModelByIndex(G4int idx = 0, G4bool ver = false);
     220  G4VEmModel* GetModelByIndex(G4int idx = 0, G4bool ver = false) const;
    213221
    214222  //------------------------------------------------------------------------
     
    255263                            G4double& kineticEnergy);
    256264
    257   // This method is used for tracking, it returns step limit
    258   inline G4double GetMscContinuousStepLimit(const G4Track& track,
    259                                             G4double scaledKinEnergy,
    260                                             G4double currentMinimalStep,
    261                                             G4double& currentSafety);
    262 
    263265  // defines current material in run time
    264266  inline void DefineMaterial(const G4MaterialCutsCouple* couple);
     
    278280
    279281  // ======== Parameters of the class fixed at initialisation =======
     282
     283  std::vector<G4VMscModel*>   mscModels;
    280284
    281285  G4PhysicsTable*             theLambdaTable;
     
    294298
    295299  G4bool                      latDisplasment;
     300  G4bool                      isIon;
    296301
    297302  // ======== Cashed values - may be state dependent ================
     
    322327                                       G4double& currentSafety)
    323328{
    324   return GetMscContinuousStepLimit(track,previousStepSize,currentMinimalStep,
    325                                    currentSafety);
     329  return GetContinuousStepLimit(track,previousStepSize,currentMinimalStep,
     330                                currentSafety);
    326331}
    327332
     
    500505  G4double x;
    501506  if(theLambdaTable) {
    502     G4bool b;
    503     x = ((*theLambdaTable)[currentMaterialIndex])->GetValue(e, b);
     507    x = ((*theLambdaTable)[currentMaterialIndex])->Value(e);
    504508  } else {
    505509    x = currentModel->CrossSection(currentCouple,p,e);
     
    512516//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    513517
    514 inline G4double G4VMultipleScattering::GetMscContinuousStepLimit(
    515                                           const G4Track& track,
    516                                           G4double scaledKinEnergy,
    517                                           G4double currentMinimalStep,
    518                                           G4double&)
    519 {
    520   G4double x = currentMinimalStep;
    521   DefineMaterial(track.GetMaterialCutsCouple());
    522   currentModel = static_cast<G4VMscModel*>(SelectModel(scaledKinEnergy));
    523   if(x > 0.0 && scaledKinEnergy > 0.0) {
    524     G4double tPathLength =
    525       currentModel->ComputeTruePathLengthLimit(track, theLambdaTable, x);
    526     if (tPathLength < x) valueGPILSelectionMSC = CandidateForSelection;
    527     x = currentModel->ComputeGeomPathLength(tPathLength); 
    528     //  G4cout << "tPathLength= " << tPathLength
    529     //         << " stepLimit= " << x
    530     //        << " currentMinimalStep= " << currentMinimalStep<< G4endl;
    531   }
    532   return x;
    533 }
    534 
    535 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    536 
    537518inline
    538519void G4VMultipleScattering::DefineMaterial(const G4MaterialCutsCouple* couple)
     
    553534
    554535//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     536//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     537
     538// Follwoing methods are virtual, they are inlined because they applied at
     539// each simulation step and some compilers may inline these methods
     540
     541inline G4double
     542G4VMultipleScattering::PostStepGetPhysicalInteractionLength(
     543              const G4Track&, G4double, G4ForceCondition* condition)
     544{
     545  *condition = Forced;
     546  return DBL_MAX;
     547}
     548
     549//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     550
     551inline G4VParticleChange*
     552G4VMultipleScattering::AlongStepDoIt(const G4Track& track, const G4Step& step)
     553{
     554  if(currentModel->IsActive(track.GetKineticEnergy())) {
     555    fParticleChange.ProposeTrueStepLength(currentModel->ComputeTrueStepLength(step.GetStepLength()));
     556  }
     557  return &fParticleChange;
     558}
     559
     560//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     561
     562inline G4VParticleChange*
     563G4VMultipleScattering::PostStepDoIt(const G4Track& track, const G4Step& step)
     564{
     565  fParticleChange.Initialize(track);
     566  if(currentModel->IsActive(track.GetKineticEnergy())) {
     567    currentModel->SampleScattering(track.GetDynamicParticle(),
     568                                   step.GetPostStepPoint()->GetSafety());
     569  }
     570  return &fParticleChange;
     571}
     572
     573//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    555574
    556575#endif
  • trunk/source/processes/electromagnetic/utils/include/G4ionEffectiveCharge.hh

    r1007 r1196  
    2525//
    2626// $Id: G4ionEffectiveCharge.hh,v 1.12 2008/09/20 19:39:34 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     27// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.