163 G4double nb_fwd_interaction_length_over_step=0.;
164 G4double nb_adj_interaction_length_over_step=0.;
168 nb_fwd_interaction_length_over_step = stepLength*lastFwdCS;
169 nb_adj_interaction_length_over_step = stepLength*lastAdjCS;
170 G4double fwd_survival_probability=std::exp(-nb_fwd_interaction_length_over_step);
171 G4double mc_induced_survival_probability=1.;
173 if (is_free_flight_gamma) {
175 total_acc_nb_fwd_interaction_length+=nb_fwd_interaction_length_over_step;
176 total_acc_nb_adj_interaction_length+=nb_adj_interaction_length_over_step;
177 acc_track_length+=stepLength;
180 G4double previous_acc_nb_adj_interaction_length =acc_nb_adj_interaction_length;
181 acc_nb_fwd_interaction_length+=nb_fwd_interaction_length_over_step;
182 acc_nb_adj_interaction_length+=nb_adj_interaction_length_over_step;
187 mc_induced_survival_probability = 1.e50;
190 mc_induced_survival_probability= std::exp(-acc_nb_adj_interaction_length)-std::exp(-total_acc_nb_adj_interaction_length);
191 mc_induced_survival_probability=mc_induced_survival_probability/(std::exp(-previous_acc_nb_adj_interaction_length)-std::exp(-total_acc_nb_adj_interaction_length));
194 G4double weight_correction = fwd_survival_probability/mc_induced_survival_probability;
211 return fParticleChange;
static G4AdjointGamma * AdjointGamma()
G4double GetTotalAdjointCS(G4ParticleDefinition *aPartDef, G4double Ekin, const G4MaterialCutsCouple *aCouple)
G4ParticleDefinition * GetDefinition() const
G4double GetWeight() const
G4double GetStepLength() const
void ProposeParentWeight(G4double finalWeight)
const G4ThreeVector & GetPosition() const
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
G4double theNumberOfInteractionLengthLeft
const G4Step * GetStep() const
void SetSecondaryWeightByProcess(G4bool)
void SetParentWeightByProcess(G4bool)
G4double GetKineticEnergy() const
G4double GetTotalForwardCS(G4ParticleDefinition *aPartDef, G4double Ekin, const G4MaterialCutsCouple *aCouple)
virtual void Initialize(const G4Track &)
G4StepPoint * GetPostStepPoint() const
static G4AdjointCSManager * GetAdjointCSManager()