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) {