Geant4 Cross Reference |
1 // 1 2 // ******************************************* 3 // * License and Disclaimer 4 // * 5 // * The Geant4 software is copyright of th 6 // * the Geant4 Collaboration. It is provided 7 // * conditions of the Geant4 Software License 8 // * LICENSE and available at http://cern.ch/ 9 // * include a list of copyright holders. 10 // * 11 // * Neither the authors of this software syst 12 // * institutes,nor the agencies providing fin 13 // * work make any representation or warran 14 // * regarding this software system or assum 15 // * use. Please see the license in the file 16 // * for the full disclaimer and the limitatio 17 // * 18 // * This code implementation is the result 19 // * technical work of the GEANT4 collaboratio 20 // * By using, copying, modifying or distri 21 // * any work based on the software) you ag 22 // * use in resulting scientific publicati 23 // * acceptance of all terms of the Geant4 Sof 24 // ******************************************* 25 // 26 // neutron_hp -- source file 27 // J.P. Wellisch, Nov-1996 28 // A prototype of the low energy neutron trans 29 // 30 // 070523 bug fix for G4FPE_DEBUG on by A. How 31 // 08-08-06 delete unnecessary and harmed decl 32 // 33 // P. Arce, June-2014 Conversion neutron_hp to 34 // 35 #include "G4ParticleHPFission.hh" 36 37 #include "G4ParticleHPFissionFS.hh" 38 #include "G4ParticleHPManager.hh" 39 #include "G4ParticleHPThermalBoost.hh" 40 #include "G4SystemOfUnits.hh" 41 #include "G4Threading.hh" 42 43 G4ParticleHPFission::G4ParticleHPFission() : G 44 { 45 SetMinEnergy(0.0); 46 SetMaxEnergy(20. * MeV); 47 } 48 49 G4ParticleHPFission::~G4ParticleHPFission() 50 { 51 // Vector is shared, only master deletes it 52 // delete [] theFission; 53 if (!G4Threading::IsMasterThread()) { 54 if (theFission != nullptr) { 55 for (auto it = theFission->cbegin(); it 56 delete *it; 57 } 58 theFission->clear(); 59 } 60 } 61 } 62 63 G4HadFinalState* G4ParticleHPFission::ApplyYou 64 65 { 66 G4ParticleHPManager::GetInstance()->OpenReac 67 const G4Material* theMaterial = aTrack.GetMa 68 auto n = (G4int)theMaterial->GetNumberOfElem 69 std::size_t index = theMaterial->GetElement( 70 if (n != 1) { 71 auto xSec = new G4double[n]; 72 G4double sum = 0; 73 G4int i; 74 const G4double* NumAtomsPerVolume = theMat 75 G4double rWeight; 76 G4ParticleHPThermalBoost aThermalE; 77 for (i = 0; i < n; ++i) { 78 index = theMaterial->GetElement(i)->GetI 79 rWeight = NumAtomsPerVolume[i]; 80 xSec[i] = ((*theFission)[index]) 81 ->GetXsec(aThermalE.GetTherm 82 83 xSec[i] *= rWeight; 84 sum += xSec[i]; 85 } 86 G4double random = G4UniformRand(); 87 G4double running = 0; 88 for (i = 0; i < n; ++i) { 89 running += xSec[i]; 90 index = theMaterial->GetElement(i)->GetI 91 // if(random<=running/sum) break; 92 if (sum == 0 || random <= running / sum) 93 } 94 delete[] xSec; 95 } 96 // return theFission[index].ApplyYourself(aT 97 G4HadFinalState* result = ((*theFission)[ind 98 99 // Overwrite target parameters 100 aNucleus.SetParameters(G4ParticleHPManager:: 101 G4ParticleHPManager:: 102 const G4Element* target_element = (*G4Elemen 103 const G4Isotope* target_isotope = nullptr; 104 auto iele = (G4int)target_element->GetNumber 105 for (G4int j = 0; j != iele; ++j) { 106 target_isotope = target_element->GetIsotop 107 if (target_isotope->GetN() 108 == G4ParticleHPManager::GetInstance()- 109 break; 110 } 111 aNucleus.SetIsotope(target_isotope); 112 113 G4ParticleHPManager::GetInstance()->CloseRea 114 return result; 115 } 116 117 const std::pair<G4double, G4double> G4Particle 118 { 119 // max energy non-conservation is mass of he 120 return std::pair<G4double, G4double>(10.0 * 121 } 122 123 G4int G4ParticleHPFission::GetVerboseLevel() c 124 { 125 return G4ParticleHPManager::GetInstance()->G 126 } 127 128 void G4ParticleHPFission::SetVerboseLevel(G4in 129 { 130 G4ParticleHPManager::GetInstance()->SetVerbo 131 } 132 133 void G4ParticleHPFission::BuildPhysicsTable(co 134 { 135 G4ParticleHPManager* hpmanager = G4ParticleH 136 137 theFission = hpmanager->GetFissionFinalState 138 139 if (G4Threading::IsMasterThread()) { 140 if (theFission == nullptr) theFission = ne 141 142 if (numEle == (G4int)G4Element::GetNumberO 143 144 if (theFission->size() == G4Element::GetNu 145 numEle = (G4int)G4Element::GetNumberOfEl 146 return; 147 } 148 149 if (G4FindDataDir("G4NEUTRONHPDATA") == nu 150 throw G4HadronicException( 151 __FILE__, __LINE__, 152 "Please setenv G4NEUTRONHPDATA to poin 153 dirName = G4FindDataDir("G4NEUTRONHPDATA") 154 G4String tString = "/Fission"; 155 dirName = dirName + tString; 156 157 for (G4int i = numEle; i < (G4int)G4Elemen 158 theFission->push_back(new G4ParticleHPCh 159 if ((*(G4Element::GetElementTable()))[i] 160 ((*theFission)[i])->Init((*(G4Element: 161 ((*theFission)[i])->Register(new G4Par 162 } 163 } 164 hpmanager->RegisterFissionFinalStates(theF 165 } 166 numEle = (G4int)G4Element::GetNumberOfElemen 167 } 168 169 void G4ParticleHPFission::ModelDescription(std 170 { 171 outFile << "High Precision model based on Ev 172 << "for induced fission reaction of 173 } 174