66{
67
68
69 last_weight = theAdjointSteppingAction->GetLastWeight();
70 last_ekin = theAdjointSteppingAction->GetLastEkin();
71
72 if (! is_adjoint_tracking_mode) {
73 if (theUserFwdTrackingAction != nullptr) {
74 theUserFwdTrackingAction->PostUserTrackingAction(aTrack);
75 }
76 }
77 else if (theAdjointSteppingAction->GetDidAdjParticleReachTheExtSource()) {
78 last_pos = theAdjointSteppingAction->GetLastPosition();
79 last_direction = theAdjointSteppingAction->GetLastMomentum();
80 last_direction /= last_direction.mag();
81 last_cos_th = last_direction.z();
82 G4ParticleDefinition* aPartDef = theAdjointSteppingAction->GetLastPartDef();
84 last_fwd_part_name.erase(0, 4);
85 last_fwd_part_PDGEncoding =
87 last_ekin = theAdjointSteppingAction->GetLastEkin();
88 last_ekin_nuc = last_ekin;
91 last_ekin_nuc /= nb_nuc;
92 }
93
94 last_fwd_part_index = -1;
95 std::size_t i = 0;
96 while (i < pListOfPrimaryFwdParticles->size() && last_fwd_part_index < 0) {
97 if ((*pListOfPrimaryFwdParticles)[i]->GetParticleName() == last_fwd_part_name) {
98 last_fwd_part_index = (
G4int)i;
99 }
100 ++i;
101 }
102
103
104
105 last_pos_vec.push_back(last_pos);
106 last_direction_vec.push_back(last_direction);
107 last_ekin_vec.push_back(last_ekin);
108 last_ekin_nuc_vec.push_back(last_ekin_nuc);
109 last_cos_th_vec.push_back(last_cos_th);
110 last_weight_vec.push_back(last_weight);
111 last_fwd_part_PDGEncoding_vec.push_back(last_fwd_part_PDGEncoding);
112 last_fwd_part_index_vec.push_back(last_fwd_part_index);
113 }
114 else {
115 }
116}
const G4String & GetParticleType() const
G4int GetPDGEncoding() const
G4int GetBaryonNumber() const
const G4String & GetParticleName() const
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
static G4ParticleTable * GetParticleTable()