19#include "BDSAuxiliaryNavigator.hh"
20#include "BDSLaserPhotoDetachment.hh"
21#include "BDSLogicalVolumeLaser.hh"
23#include "BDSPhotoDetachmentEngine.hh"
25#include "BDSGlobalConstants.hh"
28#include "G4AffineTransform.hh"
29#include "G4Electron.hh"
30#include "G4LogicalVolume.hh"
31#include "G4ParticleTable.hh"
32#include "G4ProcessType.hh"
35#include "G4StepPoint.hh"
36#include "G4ThreeVector.hh"
38#include "G4VTouchable.hh"
39#include "Randomize.hh"
40#include "G4TransportationManager.hh"
41#include "G4VPhysicalVolume.hh"
42#include "G4RandomDirection.hh"
44#include "CLHEP/Units/PhysicalConstants.h"
45#include "CLHEP/Units/SystemOfUnits.h"
49BDSLaserPhotoDetachment::BDSLaserPhotoDetachment(
const G4String& processName):
50 G4VDiscreteProcess(processName, G4ProcessType::fElectromagnetic),
55BDSLaserPhotoDetachment::~BDSLaserPhotoDetachment()
58 delete photoDetachmentEngine;
61G4double BDSLaserPhotoDetachment::GetMeanFreePath(
const G4Track& track,
63 G4ForceCondition* forceCondition)
65 G4LogicalVolume* lv = track.GetVolume()->GetLogicalVolume();
66 if (!lv->IsExtended())
79 aParticleChange.Initialize(track);
80 const G4DynamicParticle* ion = track.GetDynamicParticle();
82 if (ion->GetCharge()==-1)
84 *forceCondition = Forced;
91G4VParticleChange* BDSLaserPhotoDetachment::PostStepDoIt(
const G4Track& track,
95 aParticleChange.Initialize(track);
97 G4LogicalVolume* lv = track.GetVolume()->GetLogicalVolume();
98 if (!lv->IsExtended())
99 {
return pParticleChange;}
103 {
return pParticleChange;}
110 G4DynamicParticle* ion =
const_cast<G4DynamicParticle*
>(track.GetDynamicParticle());
112 G4ThreeVector particlePositionPostStepGlobal = 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(particlePositionPostStepGlobal);
117 G4ThreeVector particleDirectionMomentumLocal = transform.TransformPoint(particleDirectionMomentumGlobal).unit();
120 G4ThreeVector photonUnit(0,0,1);
121 photonUnit.transform(*rot);
122 G4double photonEnergy = (CLHEP::h_Planck*CLHEP::c_light)/laser->
Wavelength();
123 G4ThreeVector photonVector = photonUnit*photonEnergy;
124 G4LorentzVector photonLorentz = G4LorentzVector(photonVector,photonEnergy);
126 G4double ionEnergy = ion->GetTotalEnergy();
127 G4ThreeVector ionMomentum = ion->GetMomentum();
128 G4double ionMass = ion->GetMass();
129 G4ThreeVector ionBeta = ionMomentum/ionEnergy;
132 photonLorentz.boost(-ionBeta);
133 G4double photonEnergyLorentz = photonLorentz.e();
134 G4double crossSection = photoDetachmentEngine->CrossSection(photonEnergyLorentz);
136 G4double particleTimePostStepGlobal = track.GetGlobalTime();
137 G4double intensity =laser->Intensity(particlePositionLocal);
138 G4double timeProfile=laser->TemporalProfileGaussian(particleTimePostStepGlobal,particlePositionLocal.z());
139 G4double photonFlux = (intensity/photonEnergyLorentz)*timeProfile;
141 G4double ionTime = track.GetStep()->GetPreStepPoint()->GetGlobalTime();
142 G4double NeutralisationProbability = 1.0-std::exp(-crossSection*photonFlux*ionTime);
144 G4double scaleFactor = g->ScaleFactorLaser();
145 G4double randomNumber = G4UniformRand();
147 if((NeutralisationProbability*scaleFactor)>randomNumber)
150 G4ThreeVector randomDirection = G4RandomDirection();
151 G4double hydrogenMass = (CLHEP::electron_mass_c2 + CLHEP::proton_mass_c2);
152 G4double outgoingElectronEnergy = CLHEP::electron_mass_c2;
154 G4LorentzVector outgoingElectron;
155 outgoingElectron.setE(outgoingElectronEnergy);
159 G4double outgoingH0Energy = ionMass+photonEnergyLorentz-outgoingElectronEnergy;
160 G4double outgoingH0Momentum = std::sqrt(outgoingH0Energy*outgoingH0Energy-hydrogenMass*hydrogenMass);
161 G4LorentzVector outgoingH0;
162 outgoingH0.setPx(-1.0*randomDirection.x()*outgoingH0Momentum);
163 outgoingH0.setPy(-1.0*randomDirection.y()*outgoingH0Momentum);
164 outgoingH0.setPz(-1.0*randomDirection.z()*outgoingH0Momentum);
165 outgoingH0.setE(outgoingH0Energy);
167 outgoingElectron.boost(ionBeta);
168 outgoingH0.boost(ionBeta);
172 aParticleChange.SetNumberOfSecondaries(1);
173 aParticleChange.ProposeMass(hydrogenMass);
174 G4ThreeVector H0Momentum;
175 H0Momentum.set(outgoingH0.px(),outgoingH0.py(),outgoingH0.pz());
176 aParticleChange.ProposeMomentumDirection(H0Momentum.unit());
177 aParticleChange.ProposeCharge(0);
178 ion->RemoveElectron(1);
182 G4DynamicParticle* electron =
new G4DynamicParticle(G4Electron::ElectronDefinition(),
183 outgoingElectron.vect().unit(),
184 outgoingElectron.e());
185 aParticleChange.AddSecondary(electron);
187 aParticleChange.ProposeWeight(1.0/scaleFactor);
189 return G4VDiscreteProcess::PostStepDoIt(track, step);
192 {
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.