38 G4int G4NeutronHPChannelList::trycounter = 0;
44 allChannelsCreated =
false;
52 allChannelsCreated =
false;
60 for(
G4int i=0;i<nChannels; i++)
62 delete theChannels[i];
64 delete [] theChannels;
75 G4int numberOfIsos(0);
76 for(ii=0; ii<nChannels; ii++)
78 numberOfIsos = theChannels[ii]->
GetNiso();
79 if(numberOfIsos!=0)
break;
83 for(i=0;i<numberOfIsos; i++)
85 if(i!=0) running[i] = running[i-1];
86 for(ii=0; ii<nChannels; ii++)
88 if(theChannels[ii]->HasAnyData(i))
91 theChannels[ii]->
GetN(i),
92 theChannels[ii]->
GetZ(i),
98 G4int isotope=nChannels-1;
100 for(i=0;i<numberOfIsos; i++)
104 if(running[numberOfIsos-1] != 0)
if(random<running[i]/running[numberOfIsos-1])
break;
113 for(i=0; i<nChannels; i++)
115 if(i!=0) running[i] = running[i-1];
116 if(theChannels[i]->HasAnyData(isotope))
119 theChannels[i]->
GetN(isotope),
120 theChannels[i]->
GetZ(isotope),
123 targA=(
G4int)theChannels[i]->GetN(isotope);
124 targZ=(
G4int)theChannels[i]->GetZ(isotope);
129 if ( running[nChannels-1] == 0 )
132 if ( targA == -1 && targZ == -1 ) {
133 throw G4HadronicException(__FILE__, __LINE__,
"NeutronHP model encounter lethal discrepancy with cross section data");
137 G4cout <<
"Warning from NeutronHP: could not find proper reaction channel. This may cause by inconsistency between cross section and model. Unchanged final states are returned." <<
G4endl;
156 for(i=0; i<nChannels; i++)
159 if(running[nChannels-1] != 0)
if(random<running[i]/running[nChannels-1])
break;
169 theElement = anElement;
177 if(!allChannelsCreated)
183 for(i=0; i<nChannels; i++)
185 theBuffer[i] = theChannels[i];
187 delete [] theChannels;
188 theChannels = theBuffer;
197 theChannels[nChannels]->
Init(theElement, theDir, name);
204 theChannels[theInitCount]->
Register(theFS);