78G4String G4NeutronGeneralProcess::nameT[nTables] = {
"0",
"1",
"2",
"3",
"4"};
82 fMinEnergy(1*
CLHEP::keV),
83 fMiddleEnergy(20*
CLHEP::MeV),
84 fMaxEnergy(100*
CLHEP::TeV),
85 fTimeLimit(10*
CLHEP::microsecond)
103 theHandler =
nullptr;
120 fInelasticXS = InitialisationXS(ptr);
121 if(
nullptr == fInelasticXS) {
133 fElasticXS = InitialisationXS(ptr);
134 if(
nullptr == fElasticXS) {
146 fCaptureXS = InitialisationXS(ptr);
147 if(
nullptr == fCaptureXS) {
174 else if(type ==
fCapture) { xs = fCaptureXS; }
186 else if(type ==
fCapture) { ptr = fCaptureP; }
195 G4cout <<
"G4NeutronGeneralProcess::PreparePhysicsTable() for "
198 <<
" isMaster: " << isMaster <<
G4endl;
200 G4bool noEl = (
nullptr == fElasticP);
201 G4bool noInel = (
nullptr == fInelasticP);
202 G4bool noCap = (
nullptr == fCaptureP);
203 if(noEl || noInel || noCap) {
205 ed <<
"Incomplete configuration of the neutron general process." <<
G4endl;
206 if(noEl) { ed <<
"Neutron elastic process is not defined" <<
G4endl; }
207 if(noInel) { ed <<
"Neutron inelastic process is not defined" <<
G4endl; }
208 if(noCap) { ed <<
"Neutron capture process is not defined" <<
G4endl; }
209 G4Exception (
"G4NeutronGeneralProcess::PreparePhysicsTable(..)",
"had001",
230 std::size_t nmax = 0;
231 for(std::size_t i=0; i<nmat; ++i) {
232 std::size_t nelm = (*matTable)[i]->GetNumberOfElements();
233 nmax = std::max(nmax, nelm);
238 if(
nullptr == theHandler) {
242 fMaxEnergy = std::max(fMaxEnergy, param->
GetMaxEnergy());
243 nLowE *=
G4lrint(std::log10(fMiddleEnergy/fMinEnergy));
244 nHighE *=
G4lrint(std::log10(fMaxEnergy/fMiddleEnergy));
250 for(std::size_t i=0; i<nTables; ++i) {
254 for(std::size_t j=0; j<nmat; ++j) {
256 if (
nullptr == vec) {
274 G4cout <<
"### G4NeutronGeneralProcess::BuildPhysicsTable() for "
289 G4double sigEl(0.), sigInel(0.), sigCap(0.), val(0.), sum(0.);
291 for(std::size_t i=0; i<nmat; ++i) {
295 std::size_t nn = (*(tables[0]))[i]->GetVectorLength();
297 G4cout <<
"======= Zone 0 ======= N= " << nn
300 for(std::size_t j=0; j<nn; ++j) {
301 G4double e = (*(tables[0]))[i]->Energy(j);
303 sigEl = fXSFactorEl*ComputeCrossSection(fElasticXS, mat, e, loge);
304 sigInel = fXSFactorInel*ComputeCrossSection(fInelasticXS, mat, e, loge);
305 sigCap = ComputeCrossSection(fCaptureXS, mat, e, loge);
306 sum = sigEl + sigInel + sigCap;
308 G4cout << j <<
". E= " << e <<
" xs=" << sum <<
" sigEl=" << sigEl
309 <<
" sigInel=" << sigInel <<
" sigCap=" << sigCap <<
G4endl;
311 (*(tables[0]))[i]->PutValue(j, sum);
313 (*(tables[1]))[i]->PutValue(j, val);
314 val = (sigEl + sigInel)/sum;
315 (*(tables[2]))[i]->PutValue(j, val);
319 nn = (*(tables[3]))[0]->GetVectorLength();
323 for(std::size_t j=0; j<nn; ++j) {
324 G4double e = (*(tables[3]))[i]->Energy(j);
326 sigEl = fXSFactorEl*ComputeCrossSection(fElasticXS, mat, e, loge);
327 sigInel = fXSFactorInel*ComputeCrossSection(fInelasticXS, mat, e, loge);
328 sum = sigEl + sigInel;
330 G4cout << j <<
". E= " << e <<
" xs=" << sum <<
" sigEl=" << sigEl
331 <<
" sigInel=" << sigInel <<
" factInel=" << fXSFactorInel
334 (*(tables[3]))[i]->PutValue(j, sum);
336 (*(tables[4]))[i]->PutValue(j, val);
341 G4cout <<
"### G4VEmProcess::BuildPhysicsTable() done for "
358 for(
G4int i=0; i<nelm; ++i) {
389 CurrentCrossSection(track);
419 fSelectedProc =
this;
433 if (0 == idxEnergy) {
469 if(!isMaster) {
return yes; }
470 for(std::size_t i=0; i<nTables; ++i) {
472 ?
"LambdaNeutronGeneral" + nameT[i] :
"ProbNeutronGeneral" + nameT[i];
474 auto table = theHandler->
Table(i);
475 if(
nullptr == table || !table->StorePhysicsTable(fnam, ascii)) {
490 CurrentCrossSection(track);
507 return (
nullptr != fSelectedProc) ? fSelectedProc->
GetProcessName()
523 return fSelectedProc;
G4double condition(const G4ErrorSymMatrix &m)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4double G4Log(G4double x)
std::vector< G4Material * > G4MaterialTable
G4GLOB_DLL std::ostream G4cout
const std::vector< G4VCrossSectionDataSet * > & GetDataSetList() const
G4double ComputeCrossSection(const G4DynamicParticle *, const G4Material *)
G4PhysicsTable * Table(std::size_t idx) const
void UpdateTable(G4PhysicsTable *, std::size_t idx)
const std::vector< G4PhysicsTable * > & GetTables() const
G4bool ApplyFactorXS() const
static G4HadronicParameters * Instance()
G4int GetVerboseLevel() const
G4double XSFactorNucleonElastic() const
G4double GetMaxEnergy() const
G4double XSFactorNucleonInelastic() const
G4VParticleChange * PostStepDoIt(const G4Track &aTrack, const G4Step &aStep) override
void ProcessDescription(std::ostream &outFile) const override
G4ParticleChange * theTotalResult
void AddDataSet(G4VCrossSectionDataSet *aDataSet)
void PreparePhysicsTable(const G4ParticleDefinition &) override
void BuildPhysicsTable(const G4ParticleDefinition &) override
G4CrossSectionDataStore * GetCrossSectionDataStore()
const G4Element * GetElement(G4int iel) const
static std::size_t GetNumberOfMaterials()
const G4double * GetVecNbOfAtomsPerVolume() const
static G4MaterialTable * GetMaterialTable()
std::size_t GetNumberOfElements() const
const G4String & GetName() const
void SetCaptureProcess(G4HadronicProcess *)
G4NeutronGeneralProcess(const G4String &pname="NeutronGeneralProc")
~G4NeutronGeneralProcess() override
void StartTracking(G4Track *) override
G4int GetSubProcessSubType() const
void ProcessDescription(std::ostream &outFile) const override
G4VCrossSectionDataSet * GetXSection(G4int type)
void PreparePhysicsTable(const G4ParticleDefinition &) override
G4double GetMeanFreePath(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition) override
void SelectedProcess(const G4Step &step, G4HadronicProcess *ptr, G4CrossSectionDataStore *)
G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &) override
void SetElasticProcess(G4HadronicProcess *)
G4double GetProbability(size_t idxt)
G4bool StorePhysicsTable(const G4ParticleDefinition *part, const G4String &directory, G4bool ascii) override
void BuildPhysicsTable(const G4ParticleDefinition &) override
const G4VProcess * GetCreatorProcess() const override
G4double PostStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition) override
const G4String & GetSubProcessName() const
G4HadronicProcess * GetHadronicProcess(G4int type)
void SetInelasticProcess(G4HadronicProcess *)
G4bool IsApplicable(const G4ParticleDefinition &) override
static G4Neutron * Neutron()
void Initialize(const G4Track &) override
const G4String & GetParticleName() const
static void SetPhysicsVector(G4PhysicsTable *physTable, std::size_t idx, G4PhysicsVector *vec)
void resize(std::size_t, G4PhysicsVector *vec=nullptr)
G4double GetGlobalTime() const
const G4DynamicParticle * GetDynamicParticle() const
virtual G4double ComputeCrossSectionPerElement(G4double kinEnergy, G4double loge, const G4ParticleDefinition *, const G4Element *, const G4Material *mat=nullptr)
void ProposeTrackStatus(G4TrackStatus status)
G4double currentInteractionLength
G4double theInitialNumberOfInteractionLength
void SetVerboseLevel(G4int value)
G4double theNumberOfInteractionLengthLeft
void SetProcessSubType(G4int)
G4int GetProcessSubType() const
const G4String & GetPhysicsTableFileName(const G4ParticleDefinition *, const G4String &directory, const G4String &tableName, G4bool ascii=false)
const G4String & GetProcessName() const