/home/cern/BDSIM_new/src/BDSPlanckScatter.cc

00001 /* BDSIM code.    Version 1.0
00002    Author: Grahame A. Blair, Royal Holloway, Univ. of London.
00003    Last modified 24.7.2002
00004    Copyright (c) 2002 by G.A.Blair.  ALL RIGHTS RESERVED. 
00005 */
00006 //      ------------ BDSPlanckScatter physics process --------
00007 //                     by Grahame Blair, 18 October 2001
00008 #include "BDSGlobalConstants.hh" // must be first in include list
00009 
00010 #include "BDSPlanckScatter.hh"
00011 #include "G4ios.hh"
00012 #include "G4UnitsTable.hh"
00013 
00014 #if G4VERSION > 8
00015 BDSPlanckScatter::BDSPlanckScatter():G4VEnergyLossProcess("PlanckScatt")
00016 #else
00017 BDSPlanckScatter::BDSPlanckScatter():G4VeEnergyLoss("PlanckScatt")
00018 #endif
00019 {
00020 
00021   // TODO: change to appropriate definition!!!
00022   itsTemperature = 300 * kelvin;
00023 
00024   if(itsTemperature<=0.){G4Exception("BDSPlanckScatter: Invalid Temperature");}
00025   itsPlanckEngine=new BDSPlanckEngine(itsTemperature);
00026   itsComptonEngine=new BDSComptonEngine();
00027 
00028   // Thomspson cross sec (to be replaced below with Compton)
00029   G4double sigma_T=0.6652*barn;
00030   
00031   G4double AvPhotonEnergy=2.7*k_Boltzmann*itsTemperature;
00032   
00033   G4double w= BDSGlobals->GetBeamTotalEnergy()*AvPhotonEnergy/
00034     pow( electron_mass_c2,2);
00035   
00036   G4double sigma=sigma_T*3/4*(
00037                               (1+w)/pow(w,3)*( 2*w*(1+w)/(1+2*w) -log(1+2*w))
00038                               + log(1+2*w)/(2*w)
00039                               - (1+3*w)/pow((1+2*w),2) );
00040   
00041   G4double photon_density = pow((itsTemperature/295.15),3)*5.329e14*pow(m,-3);
00042   itsPlanckMeanFreePath=1/(photon_density*sigma);
00043   
00044   // include scaling so that statistics are more reasonable:
00045   itsPlanckMeanFreePath /= BDSGlobals->GetBackgroundScaleFactor(); 
00046 } 
00047 
00048 
00049 BDSPlanckScatter::~BDSPlanckScatter()
00050 {
00051   delete itsComptonEngine;
00052   delete itsPlanckEngine;
00053 }
00054 
00055 
00056 G4VParticleChange* BDSPlanckScatter::PostStepDoIt(const G4Track& trackData,
00057                                                   const G4Step& stepData)
00058 {
00059   
00060   aParticleChange.Initialize(trackData);
00061   
00062   const G4DynamicParticle* aDynamicParticle=trackData.GetDynamicParticle(); 
00063   itsComptonEngine->SetIncomingElectron4Vec(aDynamicParticle->Get4Momentum());
00064   
00065   itsComptonEngine->SetIncomingPhoton4Vec(itsPlanckEngine->PerformPlanck());
00066   
00067   itsComptonEngine->PerformCompton();
00068   
00069   // create G4DynamicParticle object for the Gamma 
00070   G4LorentzVector ScatGam=itsComptonEngine->GetScatteredGamma();
00071   
00072   G4DynamicParticle* aGamma= 
00073     new G4DynamicParticle (G4Gamma::Gamma(), 
00074                            ScatGam.vect().unit(),// direction 
00075                            ScatGam.e());
00076   
00077   aParticleChange.SetNumberOfSecondaries(1);
00078   aParticleChange.AddSecondary(aGamma); 
00079   
00080   //
00081   // Update the incident particle 
00082   //
00083   G4double NewKinEnergy=
00084     itsComptonEngine->GetScatteredElectron().e()-electron_mass_c2;
00085   
00086   G4LorentzVector ScatEl=itsComptonEngine->GetScatteredElectron();
00087   
00088 #if G4VERSION > 6
00089   if (NewKinEnergy > 0.)
00090     {
00091       aParticleChange.ProposeMomentumDirection(ScatEl.vect().unit());
00092       aParticleChange.ProposeEnergy(NewKinEnergy);
00093       aParticleChange.ProposeLocalEnergyDeposit (0.); 
00094     } 
00095   else
00096     { 
00097       aParticleChange.ProposeEnergy( 0. );
00098       aParticleChange.ProposeLocalEnergyDeposit (0.);
00099       G4double charge= aDynamicParticle->GetCharge();
00100       if (charge<0.) aParticleChange.ProposeTrackStatus(fStopAndKill);
00101       else       aParticleChange.ProposeTrackStatus(fStopButAlive);
00102     }    
00103 #else
00104   if (NewKinEnergy > 0.)
00105     {
00106       aParticleChange.SetMomentumChange(ScatEl.vect().unit());
00107       aParticleChange.SetEnergyChange(NewKinEnergy);
00108       aParticleChange.SetLocalEnergyDeposit (0.); 
00109     } 
00110   else
00111     { 
00112       aParticleChange.SetEnergyChange( 0. );
00113       aParticleChange.SetLocalEnergyDeposit (0.);
00114       G4double charge= aDynamicParticle->GetCharge();
00115       if (charge<0.) aParticleChange.SetStatusChange(fStopAndKill);
00116       else       aParticleChange.SetStatusChange(fStopButAlive);
00117     }    
00118 #endif
00119   
00120   
00121   
00122   return G4VContinuousDiscreteProcess::PostStepDoIt(trackData,stepData);
00123 }
00124 
00125 #if G4VERSION > 8
00126 void BDSPlanckScatter::InitialiseEnergyLossProcess(const G4ParticleDefinition* p, const G4ParticleDefinition*)
00127 {
00128 }
00129 
00130 void BDSPlanckScatter::PrintInfo()
00131 {
00132 }
00133 #endif
00134 

Generated on Wed Mar 5 17:25:22 2008 for BDSIM by  doxygen 1.5.3