/scratch0/jsnuveri/BDSIM/BDSIMgit/bdsim/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" 
00009 
00010 #include "BDSPlanckScatter.hh"
00011 #include "G4ios.hh"
00012 #include "G4Gamma.hh"
00013 
00014 BDSPlanckScatter::BDSPlanckScatter():G4VEnergyLossProcess("PlanckScatt")
00015 {
00016 
00017   // TODO: change to appropriate definition!!!
00018   itsTemperature = 300 * CLHEP::kelvin;
00019 
00020   if(itsTemperature<=0.){G4Exception("BDSPlanckScatter: Invalid Temperature", "-1", FatalException, "");}
00021   itsPlanckEngine=new BDSPlanckEngine(itsTemperature);
00022   itsComptonEngine=new BDSComptonEngine();
00023 
00024   // Thomspson cross sec (to be replaced below with Compton)
00025   G4double sigma_T=0.6652*CLHEP::barn;
00026   
00027   G4double AvPhotonEnergy=2.7*CLHEP::k_Boltzmann*itsTemperature;
00028   
00029   G4double w= BDSGlobalConstants::Instance()->GetBeamTotalEnergy()*AvPhotonEnergy/
00030     pow( CLHEP::electron_mass_c2,2);
00031   
00032   G4double sigma=sigma_T*3/4*(
00033                               (1+w)/pow(w,3)*( 2*w*(1+w)/(1+2*w) -log(1+2*w))
00034                               + log(1+2*w)/(2*w)
00035                               - (1+3*w)/pow((1+2*w),2) );
00036   
00037   G4double photon_density = pow((itsTemperature/295.15),3)*5.329e14*pow(CLHEP::m,-3);
00038   itsPlanckMeanFreePath=1/(photon_density*sigma);
00039   
00040   // include scaling so that statistics are more reasonable:
00041   itsPlanckMeanFreePath /= BDSGlobalConstants::Instance()->GetPlanckScatterFe(); 
00042 } 
00043 
00044 
00045 BDSPlanckScatter::~BDSPlanckScatter()
00046 {
00047   delete itsComptonEngine;
00048   delete itsPlanckEngine;
00049 }
00050 
00051 
00052 G4VParticleChange* BDSPlanckScatter::PostStepDoIt(const G4Track& trackData,
00053                                                   const G4Step& stepData)
00054 {
00055   
00056   aParticleChange.Initialize(trackData);
00057   
00058   const G4DynamicParticle* aDynamicParticle=trackData.GetDynamicParticle(); 
00059   itsComptonEngine->SetIncomingElectron4Vec(aDynamicParticle->Get4Momentum());
00060   
00061   itsComptonEngine->SetIncomingPhoton4Vec(itsPlanckEngine->PerformPlanck());
00062   
00063   itsComptonEngine->PerformCompton();
00064   
00065   // create G4DynamicParticle object for the Gamma 
00066   G4LorentzVector ScatGam=itsComptonEngine->GetScatteredGamma();
00067   
00068   G4DynamicParticle* aGamma= 
00069     new G4DynamicParticle (G4Gamma::Gamma(), 
00070                            ScatGam.vect().unit(),// direction 
00071                            ScatGam.e());
00072   
00073   aParticleChange.SetNumberOfSecondaries(1);
00074   aParticleChange.AddSecondary(aGamma); 
00075   
00076   //
00077   // Update the incident particle 
00078   //
00079   G4double NewKinEnergy=
00080     itsComptonEngine->GetScatteredElectron().e()-CLHEP::electron_mass_c2;
00081   
00082   G4LorentzVector ScatEl=itsComptonEngine->GetScatteredElectron();
00083   
00084   if (NewKinEnergy > 0.)
00085     {
00086       aParticleChange.ProposeMomentumDirection(ScatEl.vect().unit());
00087       aParticleChange.ProposeEnergy(NewKinEnergy);
00088       aParticleChange.ProposeLocalEnergyDeposit (0.); 
00089     } 
00090   else
00091     { 
00092       aParticleChange.ProposeEnergy( 0. );
00093       aParticleChange.ProposeLocalEnergyDeposit (0.);
00094       G4double charge= aDynamicParticle->GetCharge();
00095       if (charge<0.) aParticleChange.ProposeTrackStatus(fStopAndKill);
00096       else       aParticleChange.ProposeTrackStatus(fStopButAlive);
00097     }    
00098   
00099   return G4VContinuousDiscreteProcess::PostStepDoIt(trackData,stepData);
00100 }
00101 
00102 void BDSPlanckScatter::InitialiseEnergyLossProcess(const G4ParticleDefinition*, const G4ParticleDefinition*)
00103 {
00104 }
00105 
00106 void BDSPlanckScatter::PrintInfo()
00107 {
00108 }
00109 

Generated on 28 Jun 2015 for BDSIM by  doxygen 1.4.7