Ignore:
Timestamp:
Apr 6, 2009, 12:21:12 PM (15 years ago)
Author:
garnier
Message:

update processes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/electromagnetic/standard/include/G4eCoulombScatteringModel.hh

    r819 r961  
    2424// ********************************************************************
    2525//
    26 // $Id: G4eCoulombScatteringModel.hh,v 1.20 2007/10/24 10:42:05 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     26// $Id: G4eCoulombScatteringModel.hh,v 1.36 2008/08/04 08:49:09 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// -------------------------------------------------------------------
     
    4545//                       make some members protected
    4646// 09.10.07 V.Ivanchenko reorganized methods, add cut dependence in scattering off e-
     47// 09.06.08 V.Ivanchenko add SelectIsotope and sampling of the recoil ion
    4748//
    4849// Class Description:
     
    7576public:
    7677
    77   G4eCoulombScatteringModel(G4double thetaMin = 0.0, G4double thetaMax = pi,
    78                            G4bool build = false, G4double tlim = TeV*TeV,
    79                            const G4String& nam = "eCoulombScattering");
     78  G4eCoulombScatteringModel(const G4String& nam = "eCoulombScattering");
    8079 
    8180  virtual ~G4eCoulombScatteringModel();
     
    9796                                 G4double maxEnergy);
    9897
     98  inline void SetRecoilThreshold(G4double eth);
     99
    99100protected:
    100101
    101   G4double ComputeElectronXSectionPerAtom(
    102                                  const G4ParticleDefinition*,
    103                                  G4double kinEnergy,
    104                                  G4double Z,
    105                                  G4double A,
    106                                  G4double cut);
    107 
    108   virtual G4double CalculateCrossSectionPerAtom(
    109                                  const G4ParticleDefinition*,
    110                                  G4double kinEnergy,
    111                                  G4double Z, G4double A);
     102  G4double CrossSectionPerAtom();
     103
     104  G4double SampleCosineTheta();
     105
     106  inline void DefineMaterial(const G4MaterialCutsCouple*);
    112107
    113108  inline void SetupParticle(const G4ParticleDefinition*);
    114109
    115   inline void SetupKinematic(G4double kinEnergy);
     110  inline void SetupKinematic(G4double kinEnergy, G4double cut);
    116111 
    117   inline void SetupTarget(G4double Z, G4double A, G4double kinEnergy);
     112  inline void SetupTarget(G4double Z, G4double kinEnergy);
    118113
    119114private:
     115
     116  void ComputeMaxElectronScattering(G4double cut);
    120117
    121118  // hide assignment operator
     
    124121
    125122protected:
    126 
     123 
    127124  const G4ParticleDefinition* theProton;
    128125  const G4ParticleDefinition* theElectron;
    129126  const G4ParticleDefinition* thePositron;
    130127
     128  G4ParticleTable*          theParticleTable;
    131129  G4ParticleChangeForGamma* fParticleChange;
    132130  G4NistManager*            fNistManager;
     131  const G4DataVector*       currentCuts;
     132
     133  const G4MaterialCutsCouple* currentCouple;
     134  const G4Material*           currentMaterial;
     135  const G4Element*            currentElement;
     136  G4int                       currentMaterialIndex;
    133137
    134138  G4double                  coeff;
     
    136140  G4double                  cosThetaMin;
    137141  G4double                  cosThetaMax;
     142  G4double                  cosTetMinNuc;
    138143  G4double                  cosTetMaxNuc;
     144  G4double                  cosTetMaxNuc2;
    139145  G4double                  cosTetMaxElec;
     146  G4double                  cosTetMaxElec2;
    140147  G4double                  q2Limit;
     148  G4double                  recoilThreshold;
    141149  G4double                  elecXSection;
    142150  G4double                  nucXSection;
     
    152160  G4double                  mom2;
    153161  G4double                  invbeta2;
     162  G4double                  etag;
     163  G4double                  lowEnergyLimit;
    154164
    155165  // target
    156166  G4double                  targetZ;
    157   G4double                  targetA;
    158167  G4double                  screenZ;
    159168  G4double                  formfactA;
     169  G4int                     idxelm;
    160170
    161171private:
    162172
    163   G4PhysicsTable*           theCrossSectionTable;
    164 
    165173  G4double                  a0;
    166   G4double                  lowKEnergy;
    167   G4double                  highKEnergy;
    168174  G4double                  alpha2;
    169175  G4double                  faclim;
    170 
    171   G4int                     nbins;
    172   G4int                     nmax;
    173   G4int                     index[100];
    174 
    175   G4bool                    buildTable;             
     176  G4double                  FF[100];
     177
    176178  G4bool                    isInitialised;             
    177179};
     180
     181//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     182
     183inline
     184void G4eCoulombScatteringModel::DefineMaterial(const G4MaterialCutsCouple* cup)
     185{
     186  if(cup != currentCouple) {
     187    currentCouple = cup;
     188    currentMaterial = cup->GetMaterial();
     189    currentMaterialIndex = currentCouple->GetIndex();
     190  }
     191}
    178192
    179193//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     
    190204    chargeSquare = q*q;
    191205    tkin = 0.0;
     206    lowEnergyLimit = keV*mass/electron_mass_c2;
    192207  }
    193208}
     
    195210//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    196211
    197 inline void G4eCoulombScatteringModel::SetupKinematic(G4double ekin)
    198 {
    199   if(ekin != tkin) {
    200     tkin  = ekin;
    201     mom2  = tkin*(tkin + 2.0*mass);
     212inline void G4eCoulombScatteringModel::SetupKinematic(G4double ekin,
     213                                                      G4double cut)
     214{
     215  if(ekin != tkin || ecut != cut) {
     216    tkin = ekin;
     217    mom2 = tkin*(tkin + 2.0*mass);
    202218    invbeta2 = 1.0 +  mass*mass/mom2;
    203   }
     219    cosTetMinNuc = cosThetaMin;
     220    cosTetMaxNuc = cosThetaMax;
     221    if(ekin <= 10.*cut && mass < MeV && cosThetaMin < 1.0) {
     222      cosTetMinNuc = ekin*(cosThetaMin + 1.0)/(10.*cut) - 1.0;
     223    }
     224    ComputeMaxElectronScattering(cut);
     225  }
    204226}
    205227
    206228//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    207229 
    208 inline void G4eCoulombScatteringModel::SetupTarget(G4double Z, G4double A,
    209                                                    G4double e)
    210 {
    211   if(e != tkin || Z != targetZ || A != targetA) {
     230inline void G4eCoulombScatteringModel::SetupTarget(G4double Z, G4double e)
     231{
     232  if(Z != targetZ || e != etag) {
     233    etag    = e;
    212234    targetZ = Z;
    213     targetA = A;
    214     SetupKinematic(e);
    215     cosTetMaxNuc = std::max(cosThetaMax, 1.0 - 0.5*q2Limit/mom2);
    216     G4double x = fNistManager->GetZ13(Z);
    217     screenZ = a0*x*x*(1.13 + 3.76*invbeta2*Z*Z*chargeSquare*alpha2)/mom2;
    218     if(particle == theProton && A < 1.5 && cosTetMaxNuc < 0.0)
    219       cosTetMaxNuc = 0.0;
     235    G4int iz= G4int(Z);
     236    if(iz > 99) iz = 99;
     237    G4double x = fNistManager->GetZ13(iz);
     238    screenZ = a0*x*x/mom2;
     239    if(iz > 1) screenZ *=(1.13 + 3.76*invbeta2*Z*Z*chargeSquare*alpha2);
     240    //screenZ = a0*x*x*(1.13 + 3.76*Z*Z*chargeSquare*alpha2)/mom2;
    220241    // A.V. Butkevich et al., NIM A 488 (2002) 282
    221     x =  fNistManager->GetLOGA(A);
    222     formfactA = mom2*constn*std::exp(0.54*x);
     242    formfactA = FF[iz];
     243    if(formfactA == 0.0) {
     244      x = fNistManager->GetA27(iz);
     245      formfactA = constn*x*x;
     246      FF[iz] = formfactA;
     247    }
     248    formfactA *= mom2;
     249    cosTetMaxNuc2 = cosTetMaxNuc;
     250    if(particle == theProton && 1 == iz && cosTetMaxNuc2 < 0.0) {
     251      cosTetMaxNuc2 = 0.0;
     252    }
     253    /*
     254    G4double ee = 10.*eV*Z;
     255    if(1 == iz) ee *= 2.0;
     256    G4double z = std::min(cosTetMaxElec, 1.0 - std::max(ecut,ee)*amu_c2
     257                          *fNistManager->GetAtomicMassAmu(iz)/mom2);
     258    cosTetMaxElec2 = std::max(cosTetMaxNuc2, z);
     259    */
     260    cosTetMaxElec2 = cosTetMaxElec;
    223261  }
    224262}
     
    226264//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    227265
     266inline void G4eCoulombScatteringModel::SetRecoilThreshold(G4double eth)
     267{
     268  recoilThreshold = eth;
     269}
     270
     271//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     272
    228273#endif
Note: See TracChangeset for help on using the changeset viewer.