43 :theProjectile(projectile)
47 allChannelsCreated =
false;
57 allChannelsCreated =
false;
67 for(
G4int i=0;i<nChannels; i++)
69 delete theChannels[i];
71 delete [] theChannels;
82 G4int numberOfIsos(0);
83 for(ii=0; ii<nChannels; ii++)
85 numberOfIsos = theChannels[ii]->
GetNiso();
86 if(numberOfIsos!=0)
break;
90 for(i=0;i<numberOfIsos; i++)
92 if(i!=0) running[i] = running[i-1];
93 for(ii=0; ii<nChannels; ii++)
95 if(theChannels[ii]->HasAnyData(i))
98 theChannels[ii]->
GetN(i),
99 theChannels[ii]->
GetZ(i),
105 G4int isotope=nChannels-1;
107 for(i=0;i<numberOfIsos; i++)
111 if(running[numberOfIsos-1] != 0)
if(random<running[i]/running[numberOfIsos-1])
break;
120 for(i=0; i<nChannels; i++)
122 if(i!=0) running[i] = running[i-1];
123 if(theChannels[i]->HasAnyData(isotope))
125 targA=(
G4int)theChannels[i]->GetN(isotope);
126 targZ=(
G4int)theChannels[i]->GetZ(isotope);
132 targA=(
G4int)theChannels[i]->GetN(isotope);
133 targZ=(
G4int)theChannels[i]->GetZ(isotope);
139 if ( running[nChannels-1] == 0 )
142 if ( targA == -1 && targZ == -1 ) {
143 throw G4HadronicException(__FILE__, __LINE__,
"ParticleHP model encounter lethal discrepancy with cross section data");
147 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;
167 for(i=0; i<nChannels; i++)
170 if(running[nChannels-1] != 0)
if(random<running[i]/running[nChannels-1])
break;
174 if( std::getenv(
"G4ParticleHPDebug") )
G4cout <<
" G4ParticleHPChannelList SELECTED ISOTOPE " << isotope <<
" SELECTED CHANNEL " << lChan <<
G4endl;
183 theElement = anElement;
185 theProjectile = projectile;
191 if(!allChannelsCreated)
197 for(i=0; i<nChannels; i++)
199 theBuffer[i] = theChannels[i];
201 delete [] theChannels;
202 theChannels = theBuffer;
211 theChannels[nChannels]->
Init(theElement, theDir, name);
219 theChannels[theInitCount]->
Register(theFS);
225 G4cout<<
"================================================================"<<
G4endl;
230 for(
int i=0;i<nChannels;i++){
232 G4cout<<
"----------------------------------------------------------------"<<
G4endl;
234 G4cout<<
"----------------------------------------------------------------"<<
G4endl;
237 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()
G4HadFinalState * ApplyYourself(const G4Element *theElement, const G4HadProjectile &aTrack)
G4bool HasDataInAnyFinalState()
void Register(G4ParticleHPFinalState *theFS, const G4String &aName)
G4ParticleHPChannelList()
G4HadFinalState * ApplyYourself(const G4HadProjectile &theTrack, G4int isoNumber=-1)
void Init(G4Element *theElement, const G4String dirName)
G4double GetWeightedXsec(G4double energy, G4int isoNumber)
G4bool Register(G4ParticleHPFinalState *theFS)
G4double GetFSCrossSection(G4double energy, G4int isoNumber)
static G4ParticleHPManager * GetInstance()
G4ParticleHPReactionWhiteBoard * GetReactionWhiteBoard()
G4double GetThermalEnergy(const G4HadProjectile &aP, const G4Element *anE, G4double aT)