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/G4eBremsstrahlungModel.cc

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 // $Id: G4eBremsstrahlungModel.cc,v 1.46 2010/04/28 18:39:40 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4eBremsstrahlungModel.cc,v 1.48 2010/10/26 10:35:22 vnivanch Exp $
     27// GEANT4 tag $Name: emstand-V09-03-24 $
    2828//
    2929// -------------------------------------------------------------------
     
    5555// 15-02-07  correct LPMconstant by a factor 2, thanks to G. Depaola (mma)
    5656// 09-09-08  MigdalConstant increased in (2pi)^2 times (A.Schaelicke)
     57// 13-10-10  Add angular distributon interface (VI)
    5758//
    5859// Class Description:
     
    7576#include "G4DataVector.hh"
    7677#include "G4ParticleChangeForLoss.hh"
     78#include "G4ModifiedTsai.hh"
    7779
    7880//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     
    9092    isInitialised(false)
    9193{
    92   if(p) SetParticle(p);
     94  if(p) { SetParticle(p); }
    9395  theGamma = G4Gamma::Gamma();
    9496  minThreshold = 0.1*keV;
     97  SetAngularDistribution(new G4ModifiedTsai());
     98  highKinEnergy = HighEnergyLimit();
     99  lowKinEnergy  = LowEnergyLimit();
    95100}
    96101
     
    129134                                        const G4DataVector& cuts)
    130135{
    131   if(p) SetParticle(p);
     136  if(p) { SetParticle(p); }
    132137  highKinEnergy = HighEnergyLimit();
    133138  lowKinEnergy  = LowEnergyLimit();
     
    172177                                                   G4double cutEnergy)
    173178{
    174   if(!particle) SetParticle(p);
    175   if(kineticEnergy < lowKinEnergy) return 0.0;
     179  if(!particle) { SetParticle(p); }
     180  if(kineticEnergy < lowKinEnergy) { return 0.0; }
    176181
    177182  const G4double thigh = 100.*GeV;
     
    272277    dedx += loss;
    273278  }
    274   if(dedx < 0.) dedx = 0.;
     279  if(dedx < 0.) { dedx = 0.; }
    275280  return dedx;
    276281}
     
    413418                                                    G4double maxEnergy)
    414419{
    415   if(!particle) SetParticle(p);
     420  if(!particle) { SetParticle(p); }
    416421  G4double cross = 0.0;
    417422  G4double tmax = min(maxEnergy, kineticEnergy);
    418423  G4double cut  = max(cutEnergy, minThreshold);
    419   if(cut >= tmax) return cross;
     424  if(cut >= tmax) { return cross; }
    420425
    421426  const G4ElementVector* theElementVector = material->GetElementVector();
     
    495500{
    496501  G4double cross = 0.0 ;
    497   if ( kineticEnergy < 1*keV || kineticEnergy < cut) return cross;
     502  if ( kineticEnergy < 1*keV || kineticEnergy < cut) { return cross; }
    498503
    499504  static const G4double ksi=2.0, alfa=1.00;
     
    664669  G4double kineticEnergy = dp->GetKineticEnergy();
    665670  G4double tmax = min(maxEnergy, kineticEnergy);
    666   if(tmin >= tmax) return;
     671  if(tmin >= tmax) { return; }
    667672
    668673//
     
    709714  G4double xmax     = tmax/kineticEnergy;
    710715  G4double kappa    = 0.0;
    711   if(xmax >= 1.) xmax = 1.;
    712   else     kappa    = log(xmax)/log(xmin);
     716  if(xmax >= 1.) { xmax = 1.; }
     717  else   { kappa    = log(xmax)/log(xmin); }
    713718  G4double epsilmin = tmin/totalEnergy;
    714719  G4double epsilmax = tmax/totalEnergy;
     
    812817      } while( greject < G4UniformRand()*grejmax );
    813818    }
    814     /*
    815     if(x > 0.999) {
    816       G4cout << "### G4eBremsstrahlungModel Warning: e= " << kineticEnergy
    817              << " tlow= " << tlow
    818              << " x= " << x
    819              << " greject= " << greject
    820              << " grejmax= " << grejmax
    821              << " migdal= " << migdal
    822              << G4endl;
    823       //      if(x >= 1.0) G4Exception("X=1");
    824     }
    825     */
    826819    gammaEnergy = x*kineticEnergy;
    827820
     
    837830
    838831  //
    839   //  angles of the emitted gamma. ( Z - axis along the parent particle)
     832  // angles of the emitted gamma. ( Z - axis along the parent particle)
     833  // use general interface
    840834  //
    841   //  universal distribution suggested by L. Urban
    842   // (Geant3 manual (1993) Phys211),
    843   //  derived from Tsai distribution (Rev Mod Phys 49,421(1977))
    844 
    845   G4double u;
    846   const G4double a1 = 0.625 , a2 = 3.*a1 , d = 27. ;
    847 
    848   if (9./(9.+d) > G4UniformRand()) u = - log(G4UniformRand()*G4UniformRand())/a1;
    849      else                          u = - log(G4UniformRand()*G4UniformRand())/a2;
    850 
    851   G4double theta = u*electron_mass_c2/totalEnergy;
     835  G4double theta = GetAngularDistribution()->PolarAngle(totalEnergy,
     836                                                        totalEnergy-gammaEnergy,
     837                                                        (G4int)anElement->GetZ());
    852838
    853839  G4double sint = sin(theta);
Note: See TracChangeset for help on using the changeset viewer.