19#include "BDSAuxiliaryNavigator.hh"
20#include "BDSElectronQuantumLevel.hh"
21#include "BDSGlobalConstants.hh"
22#include "BDSIonExcitationEngine.hh"
23#include "BDSLaserIonExcitation.hh"
24#include "BDSLogicalVolumeLaser.hh"
27#include "BDSUserTrackInformation.hh"
30#include "G4AffineTransform.hh"
31#include "G4Electron.hh"
32#include "G4DecayProducts.hh"
33#include "G4Hydrogen.hh"
34#include "G4LogicalVolume.hh"
35#include "G4ParticleTable.hh"
36#include "G4ProcessType.hh"
39#include "G4StepPoint.hh"
40#include "G4ThreeVector.hh"
42#include "G4VTouchable.hh"
43#include "Randomize.hh"
44#include "G4TransportationManager.hh"
45#include "G4VPhysicalVolume.hh"
46#include "BDSElectronOccupancy.hh"
48#include "CLHEP/Units/PhysicalConstants.h"
49#include "CLHEP/Units/SystemOfUnits.h"
54BDSLaserIonExcitation::BDSLaserIonExcitation(
const G4String& processName):
55 G4VDiscreteProcess(processName, G4ProcessType::fUserDefined),
59BDSLaserIonExcitation::~BDSLaserIonExcitation()
64G4double BDSLaserIonExcitation::GetMeanFreePath(
const G4Track& track,
66 G4ForceCondition* forceCondition)
68 G4LogicalVolume* lv = track.GetVolume()->GetLogicalVolume();
71 if (!lv->IsExtended())
73 return std::numeric_limits<double>::max();
78 return std::numeric_limits<double>::max();
80 G4bool excited = trackInfo->GetElectronOccupancy()->StatePopulated(2,1,0.5);
83 return std::numeric_limits<double>::max();
87 aParticleChange.Initialize(track);
89 *forceCondition = Forced;
93G4VParticleChange* BDSLaserIonExcitation::PostStepDoIt(
const G4Track& track,
97 aParticleChange.Initialize(track);
100 G4LogicalVolume* lv = track.GetVolume()->GetLogicalVolume();
101 if (!lv->IsExtended())
102 {
return pParticleChange;}
106 {
return pParticleChange;}
110 G4double stepLength = step.GetStepLength();
111 G4DynamicParticle* ion =
const_cast<G4DynamicParticle*
>(track.GetDynamicParticle());
113 G4ThreeVector particlePositionGlobal = track.GetPosition();
114 G4ThreeVector particleDirectionMomentumGlobal = track.GetMomentumDirection();
115 const G4RotationMatrix* rot = track.GetTouchable()->GetRotation();
116 const G4AffineTransform transform = track.GetTouchable()->GetHistory()->GetTopTransform();
117 G4ThreeVector particlePositionLocal = transform.TransformPoint(particlePositionGlobal);
118 G4ThreeVector particleDirectionMomentumLocal = transform.TransformPoint(particleDirectionMomentumGlobal).unit();
123 G4ThreeVector photonUnit(0, 0, 1);
125 G4double photonE = (CLHEP::h_Planck * CLHEP::c_light) / laser->
Wavelength();
126 G4ThreeVector photonVector = photonUnit * photonE;
127 photonVector.transform(*rot);
128 G4LorentzVector photonLorentz = G4LorentzVector(photonVector, photonE);
130 G4double ionEnergy = ion->GetTotalEnergy();
131 G4ThreeVector ionMomentum = ion->GetMomentum();
132 G4ThreeVector ionBeta = ionMomentum / ionEnergy;
133 G4double ionVelocity = ionBeta.mag() * CLHEP::c_light;
134 photonLorentz.boost(-ionBeta);
135 G4double photonEnergy = photonLorentz.e();
136 G4double crossSection = ionExcitationEngine->CrossSection(photonEnergy);
137 G4double particleGlobalTime = track.GetGlobalTime();
138 G4double photonFlux = (laser->Intensity(particlePositionLocal)*laser->TemporalProfileGaussian(particleGlobalTime,particlePositionLocal.z()))/photonEnergy;
139 G4LorentzVector ion4Vector = ion->Get4Momentum();
140 ion4Vector.boost(-ionBeta);
142 G4double ionTime = (stepLength / ionVelocity);
143 G4double excitationProbability = 1.0 - std::exp(-crossSection * photonFlux * ionTime);
145 G4double scaleFactor = g->ScaleFactorLaser();
146 G4double randomNumber = G4UniformRand();
148 if ((excitationProbability * scaleFactor) > randomNumber)
151 userInfo->GetElectronOccupancy()->RemoveElectrons(2,0,0.5,1);
152 userInfo->GetElectronOccupancy()->AddElectrons(2,1,0.5,1);
153 userInfo->GetElectronOccupancy()->SetTimeOfExciation(ion->GetProperTime(),2,1,(1/2));
155 ionExcitationEngine->setIncomingGamma(photonLorentz);
156 ionExcitationEngine->setIncomingIon(ion4Vector);
157 ionExcitationEngine->PhotonAbsorption(ionBeta);
158 G4LorentzVector scatteredIon = ionExcitationEngine->GetScatteredIonAbsorption();
160 G4LorentzVector IonLorentz = G4LorentzVector(scatteredIon.vect().unit(),scatteredIon.e());
162 aParticleChange.ProposeEnergy(scatteredIon.e());
163 aParticleChange.ProposeMomentumDirection(IonLorentz.getX(),IonLorentz.getY(),IonLorentz.getZ());
164 aParticleChange.ProposeWeight(scaleFactor);
167 delete ionExcitationEngine;
169 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.