#include <G4AdjointAlongStepWeightCorrection.hh>
Inheritance diagram for G4AdjointAlongStepWeightCorrection:
Public Member Functions | |
G4AdjointAlongStepWeightCorrection (const G4String &name="ContinuousWeightCorrection", G4ProcessType type=fElectromagnetic) | |
virtual | ~G4AdjointAlongStepWeightCorrection () |
void | PreparePhysicsTable (const G4ParticleDefinition &) |
void | BuildPhysicsTable (const G4ParticleDefinition &) |
G4VParticleChange * | AlongStepDoIt (const G4Track &, const G4Step &) |
Protected Member Functions | |
virtual G4double | GetContinuousStepLimit (const G4Track &track, G4double previousStepSize, G4double currentMinimumStep, G4double ¤tSafety) |
Protected Attributes | |
G4ParticleChange * | fParticleChange |
Definition at line 70 of file G4AdjointAlongStepWeightCorrection.hh.
G4AdjointAlongStepWeightCorrection::G4AdjointAlongStepWeightCorrection | ( | const G4String & | name = "ContinuousWeightCorrection" , |
|
G4ProcessType | type = fElectromagnetic | |||
) |
Definition at line 37 of file G4AdjointAlongStepWeightCorrection.cc.
References fParticleChange.
00038 : G4VContinuousProcess(name, type) 00039 {fParticleChange = new G4ParticleChange(); 00040 currentMaterialIndex=0; 00041 preStepKinEnergy=1.; 00042 currentCouple=0; 00043 }
G4AdjointAlongStepWeightCorrection::~G4AdjointAlongStepWeightCorrection | ( | ) | [virtual] |
Definition at line 48 of file G4AdjointAlongStepWeightCorrection.cc.
References fParticleChange.
00049 {delete fParticleChange; 00050 }
G4VParticleChange * G4AdjointAlongStepWeightCorrection::AlongStepDoIt | ( | const G4Track & | , | |
const G4Step & | ||||
) | [virtual] |
Reimplemented from G4VContinuousProcess.
Definition at line 66 of file G4AdjointAlongStepWeightCorrection.cc.
References fParticleChange, G4AdjointCSManager::GetAdjointCSManager(), G4AdjointCSManager::GetContinuousWeightCorrection(), G4DynamicParticle::GetDefinition(), G4Track::GetDynamicParticle(), G4StepPoint::GetKineticEnergy(), G4Step::GetPostStepPoint(), G4Step::GetStepLength(), G4StepPoint::GetWeight(), G4ParticleChange::Initialize(), G4VParticleChange::ProposeParentWeight(), G4VParticleChange::SetParentWeightByProcess(), and G4VParticleChange::SetSecondaryWeightByProcess().
00068 { 00069 00070 fParticleChange->Initialize(track); 00071 00072 // Get the actual (true) Step length 00073 //---------------------------------- 00074 G4double length = step.GetStepLength(); 00075 00076 00077 G4double Tkin = step.GetPostStepPoint()->GetKineticEnergy(); 00078 G4ParticleDefinition* thePartDef= const_cast<G4ParticleDefinition*> (track.GetDynamicParticle()->GetDefinition()); 00079 G4double weight_correction=G4AdjointCSManager::GetAdjointCSManager()->GetContinuousWeightCorrection(thePartDef, 00080 preStepKinEnergy,Tkin, currentCouple,length); 00081 00082 00083 00084 00085 //Caution!!! 00086 // It is important to select the weight of the post_step_point 00087 // as the current weight and not the weight of the track, as t 00088 // the weight of the track is changed after having applied all 00089 // the along_step_do_it. 00090 00091 // G4double new_weight=weight_correction*track.GetWeight(); //old 00092 G4double new_weight=weight_correction*step.GetPostStepPoint()->GetWeight(); 00093 00094 00095 00096 //if (weight_correction >2.) new_weight=1.e-300; 00097 00098 00099 //The following test check for zero weight. 00100 //This happens after weight correction of gamma for photo electric effect. 00101 //When the new weight is 0 it will be later on consider as nan by G4. 00102 //Therefore we do put a lower limit of 1.e-300. for new_weight 00103 //Correction by L.Desorgher on 15 July 2009 00104 if (new_weight==0 || (new_weight<=0 && new_weight>0)){ 00105 //G4cout<<new_weight<<'\t'<<weight_correction<<'\t'<<track.GetWeight()<<G4endl; 00106 new_weight=1.e-300; 00107 } 00108 00109 //G4cout<<new_weight<<'\t'<<weight_correction<<'\t'<<track.GetWeight()<<G4endl; 00110 fParticleChange->SetParentWeightByProcess(false); 00111 fParticleChange->SetSecondaryWeightByProcess(false); 00112 fParticleChange->ProposeParentWeight(new_weight); 00113 00114 00115 return fParticleChange; 00116 00117 }
void G4AdjointAlongStepWeightCorrection::BuildPhysicsTable | ( | const G4ParticleDefinition & | ) | [virtual] |
G4double G4AdjointAlongStepWeightCorrection::GetContinuousStepLimit | ( | const G4Track & | track, | |
G4double | previousStepSize, | |||
G4double | currentMinimumStep, | |||
G4double & | currentSafety | |||
) | [protected, virtual] |
Implements G4VContinuousProcess.
Definition at line 120 of file G4AdjointAlongStepWeightCorrection.cc.
References DBL_MAX, G4Track::GetKineticEnergy(), and G4Track::GetMaterialCutsCouple().
00122 { 00123 G4double x = DBL_MAX; 00124 DefineMaterial(track.GetMaterialCutsCouple()); 00125 preStepKinEnergy = track.GetKineticEnergy(); 00126 return x; 00127 }
void G4AdjointAlongStepWeightCorrection::PreparePhysicsTable | ( | const G4ParticleDefinition & | ) | [virtual] |
Definition at line 112 of file G4AdjointAlongStepWeightCorrection.hh.
Referenced by AlongStepDoIt(), G4AdjointAlongStepWeightCorrection(), and ~G4AdjointAlongStepWeightCorrection().