55 if (theChannels !=
nullptr) {
56 for (
G4int i = 0; i < nChannels; ++i) {
57 delete theChannels[i];
70 G4int numberOfIsos(0);
71 for (ii = 0; ii < nChannels; ++ii) {
72 numberOfIsos = theChannels[ii]->
GetNiso();
73 if (numberOfIsos != 0)
break;
75 auto running =
new G4double[numberOfIsos];
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)) {
87 G4int isotope = nChannels - 1;
89 for (i = 0; i < numberOfIsos; ++i) {
91 if (running[numberOfIsos - 1] != 0)
92 if (random < running[i] / running[numberOfIsos - 1])
break;
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);
109 targA = (
G4int)theChannels[i]->GetN(isotope);
110 targZ = (
G4int)theChannels[i]->GetZ(isotope);
117 if (running[nChannels - 1] == 0) {
119 if (targA == -1 && targZ == -1) {
122 "ParticleHP model encounter lethal discrepancy with cross section data");
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."
147 for (i = 0; i < nChannels; i++) {
149 if (running[nChannels - 1] != 0)
150 if (random < running[i] / running[nChannels - 1])
break;
155 G4cout <<
" G4ParticleHPChannelList SELECTED ISOTOPE " << isotope <<
" SELECTED CHANNEL "
166 theElement = anElement;
168 theProjectile = projectile;
174 theChannels[idx]->
Init(theElement, theDir, aName);
181 G4cout <<
"================================================================" <<
G4endl;
183 G4cout <<
" Number of channels: " << nChannels <<
G4endl;
186 for (
G4int i = 0; i < nChannels; ++i) {
188 G4cout <<
"----------------------------------------------------------------" <<
G4endl;
190 G4cout <<
"----------------------------------------------------------------" <<
G4endl;
193 G4cout <<
"================================================================" <<
G4endl;
CLHEP::Hep3Vector G4ThreeVector
G4GLOB_DLL std::ostream G4cout
const G4String & GetName() const
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
static G4Neutron * Neutron()
const G4String & GetParticleName() const
~G4ParticleHPChannelList()
G4ParticleHPChannelList(G4int n=0, G4ParticleDefinition *p=nullptr)
G4HadFinalState * ApplyYourself(const G4Element *theElement, const G4HadProjectile &aTrack)
G4bool HasDataInAnyFinalState()
void Register(G4ParticleHPFinalState *theFS, const G4String &aName)
G4double GetZ(G4int i) const
G4double GetN(G4int i) const
G4HadFinalState * ApplyYourself(const G4HadProjectile &theTrack, G4int isoNumber=-1, G4bool isElastic=false)
G4double GetWeightedXsec(G4double energy, G4int isoNumber)
G4bool Register(G4ParticleHPFinalState *theFS)
void Init(G4Element *theElement, const G4String &dirName)
G4double GetFSCrossSection(G4double energy, G4int isoNumber)
static G4ParticleHPManager * GetInstance()
G4ParticleHPReactionWhiteBoard * GetReactionWhiteBoard()
G4double GetThermalEnergy(const G4HadProjectile &aP, const G4Element *anE, G4double aT)