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/lowenergy/src/G4LowEnergyPolarizedCompton.cc

    r819 r961  
    2525//
    2626//
    27 // $Id: G4LowEnergyPolarizedCompton.cc,v 1.22 2006/06/29 19:40:25 gunter Exp $
    28 // GEANT4 tag $Name: $
     27// $Id: G4LowEnergyPolarizedCompton.cc,v 1.25 2008/05/02 19:23:38 pia Exp $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// ------------------------------------------------------------
     
    110110  rangeTest = new G4RangeTest;
    111111
     112  // For Doppler broadening
     113  shellData.SetOccupancyData();
     114
     115
    112116   if (verboseLevel > 0)
    113117     {
     
    139143  delete meanFreePathTable;
    140144  meanFreePathTable = crossSectionHandler->BuildMeanFreePathForMaterials();
     145
     146  // For Doppler broadening
     147  G4String file = "/doppler/shell-doppler";
     148  shellData.LoadData(file);
     149
    141150}
    142151
     
    327336  G4double dirz = cosTheta ;
    328337 
     338
     339  // oneCosT , eom
     340
     341
     342
     343  // Doppler broadening -  Method based on:
     344  // Y. Namito, S. Ban and H. Hirayama,
     345  // "Implementation of the Doppler Broadening of a Compton-Scattered Photon Into the EGS4 Code"
     346  // NIM A 349, pp. 489-494, 1994
     347 
     348  // Maximum number of sampling iterations
     349
     350  G4int maxDopplerIterations = 1000;
     351  G4double bindingE = 0.;
     352  G4double photonEoriginal = epsilon * gammaEnergy0;
     353  G4double photonE = -1.;
     354  G4int iteration = 0;
     355  G4double eMax = gammaEnergy0;
     356
     357  do
     358    {
     359      iteration++;
     360      // Select shell based on shell occupancy
     361      G4int shell = shellData.SelectRandomShell(Z);
     362      bindingE = shellData.BindingEnergy(Z,shell);
     363     
     364      eMax = gammaEnergy0 - bindingE;
     365     
     366      // Randomly sample bound electron momentum (memento: the data set is in Atomic Units)
     367      G4double pSample = profileData.RandomSelectMomentum(Z,shell);
     368      // Rescale from atomic units
     369      G4double pDoppler = pSample * fine_structure_const;
     370      G4double pDoppler2 = pDoppler * pDoppler;
     371      G4double var2 = 1. + onecost * E0_m;
     372      G4double var3 = var2*var2 - pDoppler2;
     373      G4double var4 = var2 - pDoppler2 * cosTheta;
     374      G4double var = var4*var4 - var3 + pDoppler2 * var3;
     375      if (var > 0.)
     376        {
     377          G4double varSqrt = std::sqrt(var);       
     378          G4double scale = gammaEnergy0 / var3; 
     379          // Random select either root
     380          if (G4UniformRand() < 0.5) photonE = (var4 - varSqrt) * scale;               
     381          else photonE = (var4 + varSqrt) * scale;
     382        }
     383      else
     384        {
     385          photonE = -1.;
     386        }
     387   } while ( iteration <= maxDopplerIterations &&
     388             (photonE < 0. || photonE > eMax || photonE < eMax*G4UniformRand()) );
     389 
     390  // End of recalculation of photon energy with Doppler broadening
     391  // Revert to original if maximum number of iterations threshold has been reached
     392  if (iteration >= maxDopplerIterations)
     393    {
     394      photonE = photonEoriginal;
     395      bindingE = 0.;
     396    }
     397
     398  gammaEnergy1 = photonE;
     399 
     400  // G4cout << "--> PHOTONENERGY1 = " << photonE/keV << G4endl;
     401
     402
     403  /// Doppler Broadeing
     404
     405
     406
     407
    329408  //
    330409  // update G4VParticleChange for the scattered photon
    331410  //
    332411
    333   gammaEnergy1 = epsilon*gammaEnergy0;
     412  //  gammaEnergy1 = epsilon*gammaEnergy0;
     413
    334414
    335415  // New polarization
     
    365445  //
    366446
    367   G4double ElecKineEnergy = gammaEnergy0 - gammaEnergy1 ;
     447  G4double ElecKineEnergy = gammaEnergy0 - gammaEnergy1 -bindingE;
     448
    368449
    369450  // Generate the electron only if with large enough range w.r.t. cuts and safety
    370451
    371452  G4double safety = aStep.GetPostStepPoint()->GetSafety();
     453
    372454
    373455  if (rangeTest->Escape(G4Electron::Electron(),couple,ElecKineEnergy,safety))
     
    379461      aParticleChange.SetNumberOfSecondaries(1);
    380462      aParticleChange.AddSecondary(electron);
    381       aParticleChange.ProposeLocalEnergyDeposit(0.);
     463      //      aParticleChange.ProposeLocalEnergyDeposit(0.);
     464      aParticleChange.ProposeLocalEnergyDeposit(bindingE);
    382465    }
    383466  else
    384467    {
    385468      aParticleChange.SetNumberOfSecondaries(0);
    386       aParticleChange.ProposeLocalEnergyDeposit(ElecKineEnergy);
     469      aParticleChange.ProposeLocalEnergyDeposit(ElecKineEnergy+bindingE);
    387470    }
    388471 
     
    492575  //  G4double sinsqrphi = sinPhi*sinPhi;
    493576  G4double normalisation = std::sqrt(1. - cosSqrPhi*sinSqrTh);
    494   
     577 
    495578
    496579  // Determination of Theta
    497580 
    498   G4double thetaProbability;
     581  // ---- MGP ---- Commented out the following 3 lines to avoid compilation
     582  // warnings (unused variables)
     583  // G4double thetaProbability;
    499584  G4double theta;
    500   G4double a, b;
    501   G4double cosTheta;
    502 
     585  // G4double a, b;
     586  // G4double cosTheta;
     587
     588  /*
     589
     590  depaola method
     591 
    503592  do
    504     {
     593  {
    505594      rand1 = G4UniformRand();
    506595      rand2 = G4UniformRand();
     
    515604 
    516605  G4double cosBeta = cosTheta;
     606
     607  */
     608
     609
     610  // Dan Xu method (IEEE TNS, 52, 1160 (2005))
     611
     612  rand1 = G4UniformRand();
     613  rand2 = G4UniformRand();
     614
     615  if (rand1<(epsilon+1.0/epsilon-2)/(2.0*(epsilon+1.0/epsilon)-4.0*sinSqrTh*cosSqrPhi))
     616    {
     617      if (rand2<0.5)
     618        theta = pi/2.0;
     619      else
     620        theta = 3.0*pi/2.0;
     621    }
     622  else
     623    {
     624      if (rand2<0.5)
     625        theta = 0;
     626      else
     627        theta = pi;
     628    }
     629  G4double cosBeta = std::cos(theta);
    517630  G4double sinBeta = std::sqrt(1-cosBeta*cosBeta);
    518631 
Note: See TracChangeset for help on using the changeset viewer.