39 #include "Geant4/G4IonTable.hh" 40 #include "Geant4/G4ParticleHPCapture.hh" 41 #include "Geant4/G4ParticleHPDeExGammas.hh" 42 #include "Geant4/G4ParticleHPManager.hh" 43 #include "Geant4/G4ParticleTable.hh" 44 #include "Geant4/G4SystemOfUnits.hh" 45 #include "Geant4/G4Threading.hh" 48 : G4HadronicInteraction(
"NeutronHPCapture"), theCapture(NULL), numEle(0)
51 SetMaxEnergy(20. * MeV);
56 if (!G4Threading::IsWorkerThread()) {
68 #include "Geant4/G4ParticleHPThermalBoost.hh" 72 G4ParticleHPManager::GetInstance()->OpenReactionWhiteBoard();
73 if (std::getenv(
"NeutronHPCapture"))
74 G4cout <<
" ####### ArParticleHPCapture called" << G4endl;
75 const G4Material* theMaterial = aTrack.GetMaterial();
76 G4int
n = theMaterial->GetNumberOfElements();
77 G4int index = theMaterial->GetElement(0)->GetIndex();
79 G4double* xSec =
new G4double[
n];
82 const G4double* NumAtomsPerVolume = theMaterial->GetVecNbOfAtomsPerVolume();
84 G4ParticleHPThermalBoost aThermalE;
85 for (i = 0; i <
n; i++) {
86 index = theMaterial->GetElement(i)->GetIndex();
87 rWeight = NumAtomsPerVolume[i];
88 xSec[i] = ((*theCapture)[index])
89 ->GetXsec(aThermalE.GetThermalEnergy(
90 aTrack, theMaterial->GetElement(i), theMaterial->GetTemperature()));
94 G4double random = G4UniformRand();
96 for (i = 0; i <
n; i++) {
98 index = theMaterial->GetElement(i)->GetIndex();
99 if (sum == 0 || random <= running / sum)
103 i = std::max(0, n - 1);
107 G4HadFinalState* result = ((*theCapture)[index])->
ApplyYourself(aTrack);
110 aNucleus.SetParameters(G4ParticleHPManager::GetInstance()->GetReactionWhiteBoard()->GetTargA(),
111 G4ParticleHPManager::GetInstance()->GetReactionWhiteBoard()->GetTargZ());
112 const G4Element* target_element = (*G4Element::GetElementTable())[index];
113 const G4Isotope* target_isotope = NULL;
114 G4int iele = target_element->GetNumberOfIsotopes();
115 for (G4int j = 0; j != iele; j++) {
116 target_isotope = target_element->GetIsotope(j);
117 if (target_isotope->GetN() ==
118 G4ParticleHPManager::GetInstance()->GetReactionWhiteBoard()->GetTargA())
121 aNucleus.SetIsotope(target_isotope);
123 G4ParticleHPManager::GetInstance()->CloseReactionWhiteBoard();
127 const std::pair<G4double, G4double>
130 return std::pair<G4double, G4double>(10 * perCent, DBL_MAX);
136 return G4ParticleHPManager::GetInstance()->GetVerboseLevel();
141 G4ParticleHPManager::GetInstance()->SetVerboseLevel(newValue);
148 G4ParticleHPManager* hpmanager = G4ParticleHPManager::GetInstance();
150 theCapture = hpmanager->GetCaptureFinalStates();
152 if (G4Threading::IsMasterThread()) {
155 theCapture =
new std::vector<G4ParticleHPChannel*>;
157 if (
numEle == (G4int)G4Element::GetNumberOfElements())
160 if (
theCapture->size() == G4Element::GetNumberOfElements()) {
161 numEle = G4Element::GetNumberOfElements();
165 if (!std::getenv(
"G4NEUTRONHPDATA"))
166 throw G4HadronicException(
169 "Please setenv G4NEUTRONHPDATA to point to the neutron cross-section files.");
170 dirName = std::getenv(
"G4NEUTRONHPDATA");
174 G4ParticleHPCaptureFS* theFS =
new G4ParticleHPCaptureFS;
176 for (G4int i =
numEle; i < (G4int)G4Element::GetNumberOfElements(); i++) {
177 theCapture->push_back(
new G4ParticleHPChannel);
178 ((*theCapture)[i])->Init((*(G4Element::GetElementTable()))[i],
dirName);
179 if ((*(G4Element::GetElementTable()))[i]->GetZ() == 18) {
180 ((*theCapture)[i])->Register(theArFS);
181 std::cout <<
"======= use new Argon Capture =======" << std::endl;
187 hpmanager->RegisterCaptureFinalStates(
theCapture);
189 numEle = G4Element::GetNumberOfElements();
195 outFile <<
"High Precision model based on Evaluated Nuclear Data Files (ENDF) for radiative " 196 "capture reaction of neutrons below 20MeV\n";
G4HadFinalState * ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &aTargetNucleus) override
std::vector< G4ParticleHPChannel * > * theCapture
G4int GetVerboseLevel() const
const std::pair< G4double, G4double > GetFatalEnergyCheckLevels() const override
void BuildPhysicsTable(const G4ParticleDefinition &) override
void ModelDescription(std::ostream &outFile) const override
void SetVerboseLevel(G4int)