42 : theAdjointSteppingAction(anAction)
59 is_adjoint_tracking_mode =
true;
64 is_adjoint_tracking_mode =
false;
65 if (theUserFwdTrackingAction)
80 last_ekin = theAdjointSteppingAction->
GetLastEkin();
82 if(!is_adjoint_tracking_mode)
84 if (theUserFwdTrackingAction !=
nullptr)
93 last_direction /=last_direction.
mag();
94 last_cos_th = last_direction.
z();
97 last_fwd_part_name.erase(0,4);
100 last_ekin = theAdjointSteppingAction->
GetLastEkin();
101 last_ekin_nuc = last_ekin;
105 last_ekin_nuc /= nb_nuc;
108 last_fwd_part_index = -1;
110 while(i< pListOfPrimaryFwdParticles->size() && last_fwd_part_index<0)
112 if ((*pListOfPrimaryFwdParticles)[i]->GetParticleName()
113 == last_fwd_part_name)
115 last_fwd_part_index=(
G4int)i;
122 last_pos_vec.push_back(last_pos);
123 last_direction_vec.push_back(last_direction);
124 last_ekin_vec.push_back(last_ekin);
125 last_ekin_nuc_vec.push_back(last_ekin_nuc);
126 last_cos_th_vec.push_back(last_cos_th);
127 last_weight_vec.push_back(last_weight);
128 last_fwd_part_PDGEncoding_vec.push_back(last_fwd_part_PDGEncoding);
129 last_fwd_part_index_vec.push_back(last_fwd_part_index);
140 last_pos_vec.clear();
141 last_direction_vec.clear();
142 last_ekin_vec.clear();
143 last_ekin_nuc_vec.clear();
144 last_cos_th_vec.clear();
145 last_weight_vec.clear();
146 last_fwd_part_PDGEncoding_vec.clear();
147 last_fwd_part_index_vec.clear();
void SetAdjointTrackingMode(G4bool aBool)
G4ParticleDefinition * GetLastPartDef()
G4bool GetDidAdjParticleReachTheExtSource()
G4ThreeVector GetLastMomentum()
void SetPrimWeight(G4double weight)
G4ThreeVector GetLastPosition()
virtual void PreUserTrackingAction(const G4Track *)
virtual void PostUserTrackingAction(const G4Track *)
G4AdjointTrackingAction(G4AdjointSteppingAction *anAction)
void ClearEndOfAdjointTrackInfoVectors()
virtual ~G4AdjointTrackingAction()
const G4String & GetParticleType() const
G4int GetPDGEncoding() const
G4int GetBaryonNumber() const
const G4String & GetParticleName() const
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
static G4ParticleTable * GetParticleTable()
const G4ParticleDefinition * GetParticleDefinition() const
G4double GetWeight() const
virtual void PostUserTrackingAction(const G4Track *)
virtual void PreUserTrackingAction(const G4Track *)
G4bool contains(const G4String &str, std::string_view ss)
Check if a string contains a given substring.