65{
68
69
70 G4int numberOfIsos(0);
71 for (ii = 0; ii < nChannels; ++ii) {
72 numberOfIsos = theChannels[ii]->
GetNiso();
73 if (numberOfIsos != 0) break;
74 }
75 auto running =
new G4double[numberOfIsos];
76 running[0] = 0;
77 for (i = 0; i < numberOfIsos; i++) {
78 if (i != 0) running[i] = running[i - 1];
79 for (ii = 0; ii < nChannels; ii++) {
80 if (theChannels[ii]->HasAnyData(i)) {
82 aThermalE.
GetThermalEnergy(aTrack, theChannels[ii]->GetN(i), theChannels[ii]->GetZ(i),
84 }
85 }
86 }
87 G4int isotope = nChannels - 1;
89 for (i = 0; i < numberOfIsos; ++i) {
90 isotope = i;
91 if (running[numberOfIsos - 1] != 0)
92 if (random < running[i] / running[numberOfIsos - 1]) break;
93 }
94 delete[] running;
95
96
98 running[0] = 0;
101 for (i = 0; i < nChannels; i++) {
102 if (i != 0) running[i] = running[i - 1];
103 if (theChannels[i]->HasAnyData(isotope)) {
104 targA = (
G4int)theChannels[i]->GetN(isotope);
105 targZ = (
G4int)theChannels[i]->GetZ(isotope);
108 isotope);
109 targA = (
G4int)theChannels[i]->GetN(isotope);
110 targZ = (
G4int)theChannels[i]->GetZ(isotope);
111
112
113 }
114 }
115
116
117 if (running[nChannels - 1] == 0) {
118
119 if (targA == -1 && targZ == -1) {
121 __FILE__, __LINE__,
122 "ParticleHP model encounter lethal discrepancy with cross section data");
123 }
124
125
126 G4cout <<
"Warning from NeutronHP: could not find proper reaction channel. This may cause by "
127 "inconsistency between cross section and model. Unchanged final states are returned."
130
131
137
140 delete[] running;
141 return &unChanged;
142 }
143
144
147 for (i = 0; i < nChannels; i++) {
148 lChan = i;
149 if (running[nChannels - 1] != 0)
150 if (random < running[i] / running[nChannels - 1]) break;
151 }
152 delete[] running;
153#ifdef G4PHPDEBUG
155 G4cout <<
" G4ParticleHPChannelList SELECTED ISOTOPE " << isotope <<
" SELECTED CHANNEL "
157#endif
159}
CLHEP::Hep3Vector G4ThreeVector
G4GLOB_DLL std::ostream G4cout
void AddSecondary(G4DynamicParticle *aP, G4int mod=-1)
void SetEnergyChange(G4double anEnergy)
void SetMomentumChange(const G4ThreeVector &aV)
const G4Material * GetMaterial() const
G4double GetKineticEnergy() const
const G4LorentzVector & Get4Momentum() const
G4ParticleDefinition * GetIon(G4int Z, G4int A, G4int lvl=0)
static G4IonTable * GetIonTable()
G4double GetTemperature() const
G4HadFinalState * ApplyYourself(const G4HadProjectile &theTrack, G4int isoNumber=-1, G4bool isElastic=false)
G4double GetWeightedXsec(G4double energy, G4int isoNumber)
G4double GetFSCrossSection(G4double energy, G4int isoNumber)
static G4ParticleHPManager * GetInstance()
G4ParticleHPReactionWhiteBoard * GetReactionWhiteBoard()
G4double GetThermalEnergy(const G4HadProjectile &aP, const G4Element *anE, G4double aT)