#include <G4AdjointeIonisationModel.hh>
Inheritance diagram for G4AdjointeIonisationModel:
Public Member Functions | |
G4AdjointeIonisationModel () | |
virtual | ~G4AdjointeIonisationModel () |
virtual void | SampleSecondaries (const G4Track &aTrack, G4bool IsScatProjToProjCase, G4ParticleChange *fParticleChange) |
virtual G4double | DiffCrossSectionPerAtomPrimToSecond (G4double kinEnergyProj, G4double kinEnergyProd, G4double Z, G4double A=0.) |
Definition at line 53 of file G4AdjointeIonisationModel.hh.
G4AdjointeIonisationModel::G4AdjointeIonisationModel | ( | ) |
Definition at line 42 of file G4AdjointeIonisationModel.cc.
References G4AdjointElectron::AdjointElectron(), G4VEmAdjointModel::ApplyCutInRange, G4VEmAdjointModel::CS_biasing_factor, G4Electron::Electron(), G4VEmAdjointModel::second_part_of_same_type, G4VEmAdjointModel::theAdjEquivOfDirectPrimPartDef, G4VEmAdjointModel::theAdjEquivOfDirectSecondPartDef, G4VEmAdjointModel::theDirectPrimaryPartDef, G4VEmAdjointModel::UseMatrix, G4VEmAdjointModel::UseMatrixPerElement, and G4VEmAdjointModel::UseOnlyOneMatrixForAllElements.
00042 : 00043 G4VEmAdjointModel("Inv_eIon_model") 00044 00045 { 00046 00047 UseMatrix =true; 00048 UseMatrixPerElement = true; 00049 ApplyCutInRange = true; 00050 UseOnlyOneMatrixForAllElements = true; 00051 CS_biasing_factor =1.; 00052 WithRapidSampling = false; 00053 00054 theAdjEquivOfDirectPrimPartDef =G4AdjointElectron::AdjointElectron(); 00055 theAdjEquivOfDirectSecondPartDef=G4AdjointElectron::AdjointElectron(); 00056 theDirectPrimaryPartDef=G4Electron::Electron(); 00057 second_part_of_same_type=true; 00058 }
G4AdjointeIonisationModel::~G4AdjointeIonisationModel | ( | ) | [virtual] |
G4double G4AdjointeIonisationModel::DiffCrossSectionPerAtomPrimToSecond | ( | G4double | kinEnergyProj, | |
G4double | kinEnergyProd, | |||
G4double | Z, | |||
G4double | A = 0. | |||
) | [virtual] |
Reimplemented from G4VEmAdjointModel.
Definition at line 176 of file G4AdjointeIonisationModel.cc.
References G4VEmAdjointModel::GetSecondAdjEnergyMaxForProdToProjCase(), and G4VEmAdjointModel::GetSecondAdjEnergyMinForProdToProjCase().
00181 { 00182 G4double dSigmadEprod=0; 00183 G4double Emax_proj = GetSecondAdjEnergyMaxForProdToProjCase(kinEnergyProd); 00184 G4double Emin_proj = GetSecondAdjEnergyMinForProdToProjCase(kinEnergyProd); 00185 00186 00187 if (kinEnergyProj>Emin_proj && kinEnergyProj<=Emax_proj){ //the produced particle should have a kinetic energy smaller than the projectile 00188 dSigmadEprod=Z*DiffCrossSectionMoller(kinEnergyProj,kinEnergyProd); 00189 } 00190 return dSigmadEprod; 00191 00192 00193 00194 }
void G4AdjointeIonisationModel::SampleSecondaries | ( | const G4Track & | aTrack, | |
G4bool | IsScatProjToProjCase, | |||
G4ParticleChange * | fParticleChange | |||
) | [virtual] |
Implements G4VEmAdjointModel.
Definition at line 65 of file G4AdjointeIonisationModel.cc.
References G4ParticleChange::AddSecondary(), G4VEmAdjointModel::CorrectPostStepWeight(), G4VEmAdjointModel::currentMaterial, G4VEmAdjointModel::currentTcutForDirectSecond, G4VEmAdjointModel::DiffCrossSectionPerVolumePrimToScatPrim(), G4VEmAdjointModel::DiffCrossSectionPerVolumePrimToSecond(), fStopAndKill, G4UniformRand, G4Track::GetDynamicParticle(), G4DynamicParticle::GetKineticEnergy(), G4DynamicParticle::GetMomentumDirection(), G4ParticleDefinition::GetPDGMass(), G4VEmAdjointModel::GetSecondAdjEnergyMaxForProdToProjCase(), G4VEmAdjointModel::GetSecondAdjEnergyMaxForScatProjToProjCase(), G4VEmAdjointModel::GetSecondAdjEnergyMinForProdToProjCase(), G4VEmAdjointModel::GetSecondAdjEnergyMinForScatProjToProjCase(), G4DynamicParticle::GetTotalMomentum(), G4Track::GetWeight(), G4VEmAdjointModel::HighEnergyLimit, G4VEmAdjointModel::lastAdjointCSForProdToProjCase, G4VEmAdjointModel::lastAdjointCSForScatProjToProjCase, G4VEmAdjointModel::lastCS, G4ParticleChange::ProposeEnergy(), G4ParticleChange::ProposeMomentumDirection(), G4VParticleChange::ProposeParentWeight(), G4VParticleChange::ProposeTrackStatus(), G4VEmAdjointModel::SampleAdjSecEnergyFromCSMatrix(), G4VParticleChange::SetParentWeightByProcess(), G4VParticleChange::SetSecondaryWeightByProcess(), G4VEmAdjointModel::theAdjEquivOfDirectPrimPartDef, and G4VEmAdjointModel::theAdjEquivOfDirectSecondPartDef.
00068 { 00069 00070 00071 const G4DynamicParticle* theAdjointPrimary =aTrack.GetDynamicParticle(); 00072 00073 //Elastic inverse scattering 00074 //--------------------------------------------------------- 00075 G4double adjointPrimKinEnergy = theAdjointPrimary->GetKineticEnergy(); 00076 G4double adjointPrimP =theAdjointPrimary->GetTotalMomentum(); 00077 00078 if (adjointPrimKinEnergy>HighEnergyLimit*0.999){ 00079 return; 00080 } 00081 00082 //Sample secondary energy 00083 //----------------------- 00084 G4double projectileKinEnergy; 00085 if (!WithRapidSampling ) { //used by default 00086 projectileKinEnergy = SampleAdjSecEnergyFromCSMatrix(adjointPrimKinEnergy, IsScatProjToProjCase); 00087 00088 CorrectPostStepWeight(fParticleChange, 00089 aTrack.GetWeight(), 00090 adjointPrimKinEnergy, 00091 projectileKinEnergy, 00092 IsScatProjToProjCase); //Caution !!!this weight correction should be always applied 00093 } 00094 else { //only for test at the moment 00095 00096 G4double Emin,Emax; 00097 if (IsScatProjToProjCase) { 00098 Emin=GetSecondAdjEnergyMinForScatProjToProjCase(adjointPrimKinEnergy,currentTcutForDirectSecond); 00099 Emax=GetSecondAdjEnergyMaxForScatProjToProjCase(adjointPrimKinEnergy); 00100 } 00101 else { 00102 Emin=GetSecondAdjEnergyMinForProdToProjCase(adjointPrimKinEnergy); 00103 Emax=GetSecondAdjEnergyMaxForProdToProjCase(adjointPrimKinEnergy); 00104 } 00105 projectileKinEnergy = Emin*std::pow(Emax/Emin,G4UniformRand()); 00106 00107 00108 00109 lastCS=lastAdjointCSForScatProjToProjCase; 00110 if ( !IsScatProjToProjCase) lastCS=lastAdjointCSForProdToProjCase; 00111 00112 G4double new_weight=aTrack.GetWeight(); 00113 G4double used_diffCS=lastCS*std::log(Emax/Emin)/projectileKinEnergy; 00114 G4double needed_diffCS=adjointPrimKinEnergy/projectileKinEnergy; 00115 if (!IsScatProjToProjCase) needed_diffCS *=DiffCrossSectionPerVolumePrimToSecond(currentMaterial,projectileKinEnergy,adjointPrimKinEnergy); 00116 else needed_diffCS *=DiffCrossSectionPerVolumePrimToScatPrim(currentMaterial,projectileKinEnergy,adjointPrimKinEnergy); 00117 new_weight*=needed_diffCS/used_diffCS; 00118 fParticleChange->SetParentWeightByProcess(false); 00119 fParticleChange->SetSecondaryWeightByProcess(false); 00120 fParticleChange->ProposeParentWeight(new_weight); 00121 00122 00123 } 00124 00125 00126 00127 //Kinematic: 00128 //we consider a two body elastic scattering for the forward processes where the projectile knock on an e- at rest and gives 00129 // him part of its energy 00130 //---------------------------------------------------------------------------------------- 00131 00132 G4double projectileM0 = theAdjEquivOfDirectPrimPartDef->GetPDGMass(); 00133 G4double projectileTotalEnergy = projectileM0+projectileKinEnergy; 00134 G4double projectileP2 = projectileTotalEnergy*projectileTotalEnergy - projectileM0*projectileM0; 00135 00136 00137 00138 //Companion 00139 //----------- 00140 G4double companionM0 = theAdjEquivOfDirectPrimPartDef->GetPDGMass(); 00141 if (IsScatProjToProjCase) { 00142 companionM0=theAdjEquivOfDirectSecondPartDef->GetPDGMass(); 00143 } 00144 G4double companionTotalEnergy =companionM0+ projectileKinEnergy-adjointPrimKinEnergy; 00145 G4double companionP2 = companionTotalEnergy*companionTotalEnergy - companionM0*companionM0; 00146 00147 00148 //Projectile momentum 00149 //-------------------- 00150 G4double P_parallel = (adjointPrimP*adjointPrimP + projectileP2 - companionP2)/(2.*adjointPrimP); 00151 G4double P_perp = std::sqrt( projectileP2 - P_parallel*P_parallel); 00152 G4ThreeVector dir_parallel=theAdjointPrimary->GetMomentumDirection(); 00153 G4double phi =G4UniformRand()*2.*3.1415926; 00154 G4ThreeVector projectileMomentum = G4ThreeVector(P_perp*std::cos(phi),P_perp*std::sin(phi),P_parallel); 00155 projectileMomentum.rotateUz(dir_parallel); 00156 00157 00158 00159 if (!IsScatProjToProjCase ){ //kill the primary and add a secondary 00160 fParticleChange->ProposeTrackStatus(fStopAndKill); 00161 fParticleChange->AddSecondary(new G4DynamicParticle(theAdjEquivOfDirectPrimPartDef,projectileMomentum)); 00162 //G4cout<<"projectileMomentum "<<projectileMomentum<<G4endl; 00163 } 00164 else { 00165 fParticleChange->ProposeEnergy(projectileKinEnergy); 00166 fParticleChange->ProposeMomentumDirection(projectileMomentum.unit()); 00167 } 00168 00169 00170 00171 00172 }