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);
CLHEP::Hep3Vector G4ThreeVector
G4DLLIMPORT std::ostream G4cout
void AddSecondary(G4DynamicParticle *aP)
void SetEnergyChange(G4double anEnergy)
void SetMomentumChange(const G4ThreeVector &aV)
const G4Material * GetMaterial() const
G4double GetKineticEnergy() const
const G4LorentzVector & Get4Momentum() const
G4double GetTemperature() const
void Register(G4NeutronHPFinalState *theFS, const G4String &aName)
G4HadFinalState * ApplyYourself(const G4Element *theElement, const G4HadProjectile &aTrack)
~G4NeutronHPChannelList()
G4bool Register(G4NeutronHPFinalState *theFS)
G4HadFinalState * ApplyYourself(const G4HadProjectile &theTrack, G4int isoNumber=-1)
G4double GetFSCrossSection(G4double energy, G4int isoNumber)
void Init(G4Element *theElement, const G4String dirName)
G4double GetWeightedXsec(G4double energy, G4int isoNumber)
static G4NeutronHPManager * GetInstance()
G4NeutronHPReactionWhiteBoard * GetReactionWhiteBoard()
G4double GetThermalEnergy(const G4HadProjectile &aP, const G4Element *anE, G4double aT)
static G4ParticleTable * GetParticleTable()
G4ParticleDefinition * GetIon(G4int atomicNumber, G4int atomicMass, G4double excitationEnergy)