Ignore:
Timestamp:
Nov 5, 2010, 3:45:55 PM (14 years ago)
Author:
garnier
Message:

update ti head

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/electromagnetic/standard/src/G4eBremsstrahlungRelModel.cc

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 // $Id: G4eBremsstrahlungRelModel.cc,v 1.15 2010/04/06 17:02:23 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4eBremsstrahlungRelModel.cc,v 1.18 2010/11/04 17:30:32 vnivanch Exp $
     27// GEANT4 tag $Name: emstand-V09-03-25 $
    2828//
    2929// -------------------------------------------------------------------
     
    4242// 13.11.08    add SetLPMflag and SetLPMconstant methods
    4343// 13.11.08    change default LPMconstant value
     44// 13.10.10    add angular distributon interface (VI)
    4445//
    4546// Main References:
     
    6566#include "G4ParticleChangeForLoss.hh"
    6667#include "G4LossTableManager.hh"
    67 
     68#include "G4ModifiedTsai.hh"
    6869
    6970//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     
    9091    use_completescreening(true),isInitialised(false)
    9192{
    92   if(p) SetParticle(p);
    9393  theGamma = G4Gamma::Gamma();
    9494
    9595  minThreshold = 0.1*keV;
    96   SetLowEnergyLimit(GeV); 
     96  lowKinEnergy = GeV;
     97  SetLowEnergyLimit(lowKinEnergy); 
    9798
    9899  nist = G4NistManager::Instance(); 
     100
     101  SetLPMFlag(true);
     102  SetAngularDistribution(new G4ModifiedTsai());
     103
     104  particleMass = kinEnergy = totalEnergy = currentZ = z13 = z23 = lnZ = Fel
     105    = Finel = fCoulomb = fMax = densityFactor = densityCorr = lpmEnergy
     106    = xiLPM = phiLPM = gLPM = klpm = kp = 0.0;
     107
     108  energyThresholdLPM = 1.e39;
     109
    99110  InitialiseConstants();
    100 
    101   SetLPMFlag(true);
     111  if(p) { SetParticle(p); }
    102112}
    103113
     
    125135  particle = p;
    126136  particleMass = p->GetPDGMass();
    127   if(p == G4Electron::Electron()) isElectron = true;
    128   else                            isElectron = false;
     137  if(p == G4Electron::Electron()) { isElectron = true; }
     138  else                            { isElectron = false;}
    129139}
    130140
     
    140150
    141151void G4eBremsstrahlungRelModel::SetupForMaterial(const G4ParticleDefinition*,
    142                                                  const G4Material* mat, G4double kineticEnergy)
     152                                                 const G4Material* mat,
     153                                                 G4double kineticEnergy)
    143154{
    144155  densityFactor = mat->GetElectronDensity()*fMigdalConstant;
     
    146157
    147158  // Threshold for LPM effect (i.e. below which LPM hidden by density effect)
    148   if (LPMFlag())
     159  if (LPMFlag()) {
    149160    energyThresholdLPM=sqrt(densityFactor)*lpmEnergy;
    150   else
     161  } else {
    151162     energyThresholdLPM=1.e39;   // i.e. do not use LPM effect
    152 
     163  }
    153164  // calculate threshold for density effect
    154165  kinEnergy   = kineticEnergy;
     
    168179                                           const G4DataVector& cuts)
    169180{
    170   if(p) SetParticle(p);
    171 
    172   highKinEnergy = HighEnergyLimit();
     181  if(p) { SetParticle(p); }
     182
    173183  lowKinEnergy  = LowEnergyLimit();
    174184
     
    177187  InitialiseElementSelectors(p, cuts);
    178188
    179   if(isInitialised) return;
     189  if(isInitialised) { return; }
    180190  fParticleChange = GetParticleChangeForLoss();
    181191  isInitialised = true;
     
    190200                                                   G4double cutEnergy)
    191201{
    192   if(!particle) SetParticle(p);
    193   if(kineticEnergy < lowKinEnergy) return 0.0;
     202  if(!particle) { SetParticle(p); }
     203  if(kineticEnergy < lowKinEnergy) { return 0.0; }
    194204  G4double cut = std::min(cutEnergy, kineticEnergy);
    195   if(cut == 0.0) return 0.0;
     205  if(cut == 0.0) { return 0.0; }
    196206
    197207  SetupForMaterial(particle, material,kineticEnergy);
     
    261271                                              G4double maxEnergy)
    262272{
    263   if(!particle) SetParticle(p);
    264   if(kineticEnergy < lowKinEnergy) return 0.0;
     273  if(!particle) { SetParticle(p); }
     274  if(kineticEnergy < lowKinEnergy) { return 0.0; }
    265275  G4double cut  = std::min(cutEnergy, kineticEnergy);
    266276  G4double tmax = std::min(maxEnergy, kineticEnergy);
    267277
    268   if(cut >= tmax) return 0.0;
     278  if(cut >= tmax) { return 0.0; }
    269279
    270280  SetCurrentElement(Z);
     
    273283
    274284  // allow partial integration
    275   if(tmax < kinEnergy) cross -= ComputeXSectionPerAtom(tmax);
     285  if(tmax < kinEnergy) { cross -= ComputeXSectionPerAtom(tmax); }
    276286 
    277287  cross *= Z*Z*bremFactor;
     
    390400  // *** make sure suppression is smaller than 1 ***
    391401  // *** caused by Migdal approximation in xi    ***
    392   if (xiLPM*phiLPM>1. || s>0.57)  xiLPM=1./phiLPM;
     402  if (xiLPM*phiLPM>1. || s>0.57)  { xiLPM=1./phiLPM; }
    393403}
    394404
     
    401411//    * complete screening
    402412{
    403   if(gammaEnergy < 0.0) return 0.0;
     413  if(gammaEnergy < 0.0) { return 0.0; }
    404414
    405415  G4double y = gammaEnergy/totalEnergy;
     
    429439{
    430440
    431   if(gammaEnergy < 0.0) return 0.0;
     441  if(gammaEnergy < 0.0) { return 0.0; }
    432442
    433443  G4double y = gammaEnergy/totalEnergy;
     
    465475{
    466476  G4double kineticEnergy = dp->GetKineticEnergy();
    467   if(kineticEnergy < lowKinEnergy) return;
     477  if(kineticEnergy < lowKinEnergy) { return; }
    468478  G4double cut  = std::min(cutEnergy, kineticEnergy);
    469479  G4double emax = std::min(maxEnergy, kineticEnergy);
    470   if(cut >= emax) return;
     480  if(cut >= emax) { return; }
    471481
    472482  SetupForMaterial(particle, couple->GetMaterial(),kineticEnergy);
     
    483493  //  G4double fmax= fMax;
    484494  G4bool highe = true;
    485   if(totalEnergy < energyThresholdLPM) highe = false;
     495  if(totalEnergy < energyThresholdLPM) { highe = false; }
    486496 
    487497  G4double xmin = log(cut*cut + densityCorr);
     
    507517
    508518  //
    509   //  angles of the emitted gamma. ( Z - axis along the parent particle)
     519  // angles of the emitted gamma. ( Z - axis along the parent particle)
     520  // use general interface
    510521  //
    511   //  universal distribution suggested by L. Urban
    512   // (Geant3 manual (1993) Phys211),
    513   //  derived from Tsai distribution (Rev Mod Phys 49,421(1977))
    514 
    515   G4double u;
    516   const G4double a1 = 0.625 , a2 = 3.*a1 , d = 27. ;
    517 
    518   if (9./(9.+d) > G4UniformRand()) u = - log(G4UniformRand()*G4UniformRand())/a1;
    519      else                          u = - log(G4UniformRand()*G4UniformRand())/a2;
    520 
    521   G4double theta = u*particleMass/totalEnergy;
     522  G4double theta = GetAngularDistribution()->PolarAngle(totalEnergy,
     523                                                        totalEnergy-gammaEnergy,
     524                                                        (G4int)currentZ);
     525
    522526  G4double sint = sin(theta);
    523527  G4double phi = twopi * G4UniformRand();
Note: See TracChangeset for help on using the changeset viewer.