45 allChannelsCreated =
false;
53 allChannelsCreated =
false;
61 for(
G4int i=0;i<nChannels; i++)
63 delete theChannels[i];
65 delete [] theChannels;
76 G4int numberOfIsos(0);
77 for(ii=0; ii<nChannels; ii++)
79 numberOfIsos = theChannels[ii]->
GetNiso();
80 if(numberOfIsos!=0)
break;
84 for(i=0;i<numberOfIsos; i++)
86 if(i!=0) running[i] = running[i-1];
87 for(ii=0; ii<nChannels; ii++)
89 if(theChannels[ii]->HasAnyData(i))
92 theChannels[ii]->
GetN(i),
93 theChannels[ii]->
GetZ(i),
99 G4int isotope=nChannels-1;
101 for(i=0;i<numberOfIsos; i++)
105 if(running[numberOfIsos-1] != 0)
if(random<running[i]/running[numberOfIsos-1])
break;
114 for(i=0; i<nChannels; i++)
116 if(i!=0) running[i] = running[i-1];
117 if(theChannels[i]->HasAnyData(isotope))
120 theChannels[i]->
GetN(isotope),
121 theChannels[i]->
GetZ(isotope),
124 targA=(
G4int)theChannels[i]->GetN(isotope);
125 targZ=(
G4int)theChannels[i]->GetZ(isotope);
130 if ( running[nChannels-1] == 0 )
133 if ( targA == -1 && targZ == -1 ) {
134 throw G4HadronicException(__FILE__, __LINE__,
"NeutronHP model encounter lethal discrepancy with cross section data");
138 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;
157 for(i=0; i<nChannels; i++)
160 if(running[nChannels-1] != 0)
if(random<running[i]/running[nChannels-1])
break;
170 theElement = anElement;
178 if(!allChannelsCreated)
184 for(i=0; i<nChannels; i++)
186 theBuffer[i] = theChannels[i];
188 delete [] theChannels;
189 theChannels = theBuffer;
198 theChannels[nChannels]->
Init(theElement, theDir, name);
205 theChannels[theInitCount]->
Register(theFS);
G4bool Register(G4NeutronHPFinalState *theFS)
G4double GetWeightedXsec(G4double energy, G4int isoNumber)
CLHEP::Hep3Vector G4ThreeVector
void Init(G4Element *theElement, const G4String dirName)
static G4NeutronHPManager * GetInstance()
G4NeutronHPReactionWhiteBoard * GetReactionWhiteBoard()
G4ParticleDefinition * GetIon(G4int Z, G4int A, G4int lvl=0)
~G4NeutronHPChannelList()
G4HadFinalState * ApplyYourself(const G4HadProjectile &theTrack, G4int isoNumber=-1)
G4GLOB_DLL std::ostream G4cout
G4double GetKineticEnergy() const
const G4LorentzVector & Get4Momentum() const
static G4IonTable * GetIonTable()
G4HadFinalState * ApplyYourself(const G4Element *theElement, const G4HadProjectile &aTrack)
void SetEnergyChange(G4double anEnergy)
G4double GetFSCrossSection(G4double energy, G4int isoNumber)
G4double GetThermalEnergy(const G4HadProjectile &aP, const G4Element *anE, G4double aT)
G4double GetTemperature() const
const G4Material * GetMaterial() const
void Register(G4NeutronHPFinalState *theFS, const G4String &aName)
void SetMomentumChange(const G4ThreeVector &aV)
void AddSecondary(G4DynamicParticle *aP)