18#include "BDSAuxiliaryNavigator.hh"
19#include "BDSElectronQuantumLevel.hh"
20#include "BDSGlobalConstants.hh"
21#include "BDSIonExcitationEngine.hh"
22#include "BDSLaserIonExcitation.hh"
23#include "BDSLogicalVolumeLaser.hh"
26#include "BDSUserTrackInformation.hh"
29#include "G4AffineTransform.hh"
30#include "G4Electron.hh"
31#include "G4DecayProducts.hh"
32#include "G4Hydrogen.hh"
33#include "G4LogicalVolume.hh"
34#include "G4ParticleTable.hh"
35#include "G4ProcessType.hh"
38#include "G4StepPoint.hh"
39#include "G4ThreeVector.hh"
41#include "G4VTouchable.hh"
42#include "Randomize.hh"
43#include "G4TransportationManager.hh"
44#include "G4VPhysicalVolume.hh"
45#include "BDSElectronOccupancy.hh"
47#include "CLHEP/Units/PhysicalConstants.h"
48#include "CLHEP/Units/SystemOfUnits.h"
53BDSLaserIonExcitation::BDSLaserIonExcitation(
const G4String& processName):
54 G4VDiscreteProcess(processName, G4ProcessType::fUserDefined),
58BDSLaserIonExcitation::~BDSLaserIonExcitation()
63G4double BDSLaserIonExcitation::GetMeanFreePath(
const G4Track& track,
65 G4ForceCondition* forceCondition)
67 G4LogicalVolume* lv = track.GetVolume()->GetLogicalVolume();
70 if (!lv->IsExtended())
72 return std::numeric_limits<double>::max();
77 return std::numeric_limits<double>::max();
79 G4bool excited = trackInfo->GetElectronOccupancy()->StatePopulated(2,1,0.5);
82 return std::numeric_limits<double>::max();
86 aParticleChange.Initialize(track);
88 *forceCondition = Forced;
92G4VParticleChange* BDSLaserIonExcitation::PostStepDoIt(
const G4Track& track,
96 aParticleChange.Initialize(track);
99 G4LogicalVolume* lv = track.GetVolume()->GetLogicalVolume();
100 if (!lv->IsExtended())
101 {
return pParticleChange;}
105 {
return pParticleChange;}
109 G4double stepLength = step.GetStepLength();
110 G4DynamicParticle* ion =
const_cast<G4DynamicParticle*
>(track.GetDynamicParticle());
112 G4ThreeVector particlePositionGlobal = track.GetPosition();
113 G4ThreeVector particleDirectionMomentumGlobal = track.GetMomentumDirection();
114 const G4RotationMatrix* rot = track.GetTouchable()->GetRotation();
115 const G4AffineTransform transform = track.GetTouchable()->GetHistory()->GetTopTransform();
116 G4ThreeVector particlePositionLocal = transform.TransformPoint(particlePositionGlobal);
117 G4ThreeVector particleDirectionMomentumLocal = transform.TransformPoint(particleDirectionMomentumGlobal).unit();
122 G4ThreeVector photonUnit(0, 0, 1);
124 G4double photonE = (CLHEP::h_Planck * CLHEP::c_light) / laser->
Wavelength();
125 G4ThreeVector photonVector = photonUnit * photonE;
126 photonVector.transform(*rot);
127 G4LorentzVector photonLorentz = G4LorentzVector(photonVector, photonE);
129 G4double ionEnergy = ion->GetTotalEnergy();
130 G4ThreeVector ionMomentum = ion->GetMomentum();
131 G4ThreeVector ionBeta = ionMomentum / ionEnergy;
132 G4double ionVelocity = ionBeta.mag() * CLHEP::c_light;
133 photonLorentz.boost(-ionBeta);
134 G4double photonEnergy = photonLorentz.e();
135 G4double crossSection = ionExcitationEngine->CrossSection(photonEnergy);
136 G4double particleGlobalTime = track.GetGlobalTime();
137 G4double photonFlux = (laser->Intensity(particlePositionLocal)*laser->TemporalProfileGaussian(particleGlobalTime,particlePositionLocal.z()))/photonEnergy;
138 G4LorentzVector ion4Vector = ion->Get4Momentum();
139 ion4Vector.boost(-ionBeta);
141 G4double ionTime = (stepLength / ionVelocity);
142 G4double excitationProbability = 1.0 - std::exp(-crossSection * photonFlux * ionTime);
144 G4double scaleFactor = g->ScaleFactorLaser();
145 G4double randomNumber = G4UniformRand();
147 if ((excitationProbability * scaleFactor) > randomNumber)
150 userInfo->GetElectronOccupancy()->RemoveElectrons(2,0,0.5,1);
151 userInfo->GetElectronOccupancy()->AddElectrons(2,1,0.5,1);
152 userInfo->GetElectronOccupancy()->SetTimeOfExciation(ion->GetProperTime(),2,1,(1/2));
154 ionExcitationEngine->setIncomingGamma(photonLorentz);
155 ionExcitationEngine->setIncomingIon(ion4Vector);
156 ionExcitationEngine->PhotonAbsorption(ionBeta);
157 G4LorentzVector scatteredIon = ionExcitationEngine->GetScatteredIonAbsorption();
159 G4LorentzVector IonLorentz = G4LorentzVector(scatteredIon.vect().unit(),scatteredIon.e());
161 aParticleChange.ProposeEnergy(scatteredIon.e());
162 aParticleChange.ProposeMomentumDirection(IonLorentz.getX(),IonLorentz.getY(),IonLorentz.getZ());
163 aParticleChange.ProposeWeight(scaleFactor);
166 delete ionExcitationEngine;
168 return G4VDiscreteProcess::PostStepDoIt(track,step);
Extra G4Navigator to get coordinate transforms.
A class that holds global options and constants.
static BDSGlobalConstants * Instance()
Access method.
Class to provide laser intensity at any point.
G4double Wavelength() const
Accessor.
G4double Sigma0() const
Accessor.
Extended logical volume with laser definition.
const BDSLaser * Laser() const
Access the laser.