84 if (aGIDITarget ==
nullptr) {
97 std::vector<G4GIDI_Product>* products;
101 }
while (products ==
nullptr && loop < loopMax);
108 if (loop > loopMax - 1) {
133 std::vector<G4int> lightProductIndex;
134 std::vector<G4int> heavyProductIndex;
135 for (
G4int i = 0; i < int( products->size() ); i++ ) {
136 productA = (*products)[i].A;
138 lightProductIndex.push_back(i);
139 GZtot += (*products)[i].Z;
142 heavyProductIndex.push_back(i);
152 auto rng = std::default_random_engine {};
153 std::shuffle(heavyProductIndex.begin(), heavyProductIndex.end(), rng);
159 std::vector<G4int> savedHeavyIndex;
161 for (
G4int i = 0; i < int(heavyProductIndex.size() ); i++) {
162 itest = heavyProductIndex[i];
163 productA = (*products)[itest].A;
164 productZ = (*products)[itest].Z;
165 if ((GAtot + productA <= iTotA) && (GZtot + productZ <= iTotZ) ) {
166 savedHeavyIndex.push_back(itest);
193 for (
G4int i = 0; i < int(lightProductIndex.size() ); i++) {
194 itest = lightProductIndex[i];
195 productZ = (*products)[itest].
Z;
196 productA = (*products)[itest].A;
198 if (productA == 1 && productZ == 0) {
200 }
else if (productA == 1 && productZ == 1) {
202 }
else if (productA == 2 && productZ == 1) {
204 }
else if (productA == 3 && productZ == 1) {
206 }
else if (productA == 4 && productZ == 2) {
213 (*products)[itest].py*MeV,
214 (*products)[itest].pz*MeV );
222 for (
G4int i = 0; i < int(savedHeavyIndex.size() ); i++) {
223 itest = savedHeavyIndex[i];
224 productZ = (*products)[itest].Z;
225 productA = (*products)[itest].A;
226 productM = (*products)[itest].m;
232 (*products)[itest].py*MeV,
233 (*products)[itest].pz*MeV );
245 if (iTotA - GAtot > 1) {
247 if (iTotZ == GZtot) {
static G4Deuteron * Deuteron()
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
void SetMomentum(const G4ThreeVector &momentum)
std::vector< G4GIDI_Product > * getOthersFinalState(double e_in, double temperature, double(*rng)(void *), void *rngState)
void SetStatusChange(G4HadFinalStateStatus aS)
void AddSecondary(G4DynamicParticle *aP, G4int mod=-1)
void SetEnergyChange(G4double anEnergy)
void SetMomentumChange(const G4ThreeVector &aV)
const G4Material * GetMaterial() const
const G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
const G4LorentzVector & Get4Momentum() const
G4HadFinalState theParticleChange
static G4IonTable * GetIonTable()
G4HadFinalState * ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &aTargetNucleus)
G4int GetNucleusEncoding(G4int iZ, G4int iA, G4int iM)
G4LENDManager * lend_manager
G4GIDI_target * get_target_from_map(G4int nuclear_code)
G4double GetTemperature() const
static G4Neutron * Neutron()
const G4Isotope * GetIsotope()
G4int GetAtomicNumber() const
G4int GetAtomicMass() const
static G4Proton * Proton()
static G4Triton * Triton()