77G4String G4NeutronGeneralProcess::nameT[nTables] = {
"0",
"1",
"2",
"3",
"4"};
81 fMinEnergy(1*
CLHEP::keV),
82 fMiddleEnergy(20*
CLHEP::MeV),
83 fMaxEnergy(100*
CLHEP::TeV),
84 fTimeLimit(10*
CLHEP::microsecond)
102 theHandler =
nullptr;
119 fInelasticXS = InitialisationXS(ptr);
120 if(
nullptr == fInelasticXS) {
132 fElasticXS = InitialisationXS(ptr);
133 if(
nullptr == fElasticXS) {
145 fCaptureXS = InitialisationXS(ptr);
146 if(
nullptr == fCaptureXS) {
170 G4cout <<
"G4NeutronGeneralProcess::PreparePhysicsTable() for "
173 <<
" isMaster: " << isMaster <<
G4endl;
175 G4bool noEl = (
nullptr == fElastic);
176 G4bool noInel = (
nullptr == fInelastic);
177 G4bool noCap = (
nullptr == fCapture);
178 if(noEl || noInel || noCap) {
180 ed <<
"Incomplete configuration of the neutron general process." <<
G4endl;
181 if(noEl) { ed <<
"Neutron elastic process is not defined" <<
G4endl; }
182 if(noInel) { ed <<
"Neutron inelastic process is not defined" <<
G4endl; }
183 if(noCap) { ed <<
"Neutron capture process is not defined" <<
G4endl; }
184 G4Exception (
"G4NeutronGeneralProcess::PreparePhysicsTable(..)",
"had001",
205 std::size_t nmax = 0;
206 for(std::size_t i=0; i<nmat; ++i) {
207 std::size_t nelm = (*matTable)[i]->GetNumberOfElements();
208 nmax = std::max(nmax, nelm);
213 if(
nullptr == theHandler) {
217 fMaxEnergy = std::max(fMaxEnergy, param->
GetMaxEnergy());
218 nLowE *=
G4lrint(std::log10(fMiddleEnergy/fMinEnergy));
219 nHighE *=
G4lrint(std::log10(fMaxEnergy/fMiddleEnergy));
225 for(std::size_t i=0; i<nTables; ++i) {
229 for(std::size_t j=0; j<nmat; ++j) {
231 if (
nullptr == vec) {
249 G4cout <<
"### G4NeutronGeneralProcess::BuildPhysicsTable() for "
264 G4double sigEl(0.), sigInel(0.), sigCap(0.), val(0.), sum(0.);
266 for(std::size_t i=0; i<nmat; ++i) {
270 std::size_t nn = (*(tables[0]))[i]->GetVectorLength();
272 G4cout <<
"======= Zone 0 ======= N= " << nn
275 for(std::size_t j=0; j<nn; ++j) {
276 G4double e = (*(tables[0]))[i]->Energy(j);
278 sigEl = fXSFactorEl*ComputeCrossSection(fElasticXS, mat, e, loge);
279 sigInel = fXSFactorInel*ComputeCrossSection(fInelasticXS, mat, e, loge);
280 sigCap = ComputeCrossSection(fCaptureXS, mat, e, loge);
281 sum = sigEl + sigInel + sigCap;
283 G4cout << j <<
". E= " << e <<
" xs=" << sum <<
" sigEl=" << sigEl
284 <<
" sigInel=" << sigInel <<
" sigCap=" << sigCap <<
G4endl;
286 (*(tables[0]))[i]->PutValue(j, sum);
288 (*(tables[1]))[i]->PutValue(j, val);
289 val = (sigEl + sigInel)/sum;
290 (*(tables[2]))[i]->PutValue(j, val);
294 nn = (*(tables[3]))[0]->GetVectorLength();
298 for(std::size_t j=0; j<nn; ++j) {
299 G4double e = (*(tables[3]))[i]->Energy(j);
301 sigEl = fXSFactorEl*ComputeCrossSection(fElasticXS, mat, e, loge);
302 sigInel = fXSFactorInel*ComputeCrossSection(fInelasticXS, mat, e, loge);
303 sum = sigEl + sigInel;
305 G4cout << j <<
". E= " << e <<
" xs=" << sum <<
" sigEl=" << sigEl
306 <<
" sigInel=" << sigInel <<
" factInel=" << fXSFactorInel
309 (*(tables[3]))[i]->PutValue(j, sum);
311 (*(tables[4]))[i]->PutValue(j, val);
316 G4cout <<
"### G4VEmProcess::BuildPhysicsTable() done for "
333 for(
G4int i=0; i<nelm; ++i) {
364 CurrentCrossSection(track);
394 fSelectedProc =
this;
408 if (0 == idxEnergy) {
444 if(!isMaster) {
return yes; }
445 for(std::size_t i=0; i<nTables; ++i) {
447 ?
"LambdaNeutronGeneral" + nameT[i] :
"ProbNeutronGeneral" + nameT[i];
449 auto table = theHandler->
Table(i);
450 if(
nullptr == table || !table->StorePhysicsTable(fnam, ascii)) {
465 CurrentCrossSection(track);
482 return (
nullptr != fSelectedProc) ? fSelectedProc->
GetProcessName()
498 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()
static size_t GetNumberOfMaterials()
const G4Element * GetElement(G4int iel) const
size_t GetNumberOfElements() const
const G4double * GetVecNbOfAtomsPerVolume() const
static G4MaterialTable * GetMaterialTable()
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
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
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