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 /* 27 * File: G4WendtFissionFragmentGenerator.hh 28 * Author: B. Wendt (wendbryc@isu.edu) 29 * 30 * Created on June 21, 2013, 13:58 MST 31 */ 32 33 #include "G4WendtFissionFragmentGenerator.hh" 34 35 #include "G4FFGDebuggingMacros.hh" 36 #include "G4ParticleHPManager.hh" 37 #include "G4PhysicsModelCatalog.hh" 38 39 G4ThreadLocal G4WendtFissionFragmentGenerator* 40 41 G4WendtFissionFragmentGenerator::G4WendtFissio 42 { 43 // Set the default verbosity 44 Verbosity_ = G4FFGDefaultValues::Verbosity; 45 46 // Set the creator model ID 47 secID = G4PhysicsModelCatalog::GetModelID("m 48 } 49 /* 50 G4WendtFissionFragmentGenerator* G4WendtFissio 51 GetInstance() 52 { 53 //static G4WendtFissionFragmentGenerator n 54 // 55 //return &newMe; 56 57 if ( instance == NULL) instance = new G4We 58 59 return instance; 60 } 61 */ 62 G4HadFinalState* G4WendtFissionFragmentGenerat 63 64 { 65 G4FFG_FUNCTIONENTER__ 66 67 G4HadFinalState* finalState = nullptr; 68 G4DynamicParticleVector* finalParticles = nu 69 G4int isotope; 70 std::map<const G4int, G4FissionFragmentGener 71 72 // Look for the first available isomer since 73 for (unsigned int M = 0; M < 10; ++M) { 74 isotope = G4FissionFragmentGenerator::G4Ma 75 fissionGenerator = fissionIsotopes.find(is 76 77 if (fissionGenerator != fissionIsotopes.en 78 // Only generate particles if the genera 79 if (fissionGenerator->second != nullptr) 80 finalParticles = fissionGenerator->sec 81 } 82 83 break; 84 } 85 } 86 87 if (finalParticles != nullptr) { 88 finalState = new G4HadFinalState(); 89 90 for (auto& finalParticle : *finalParticles 91 finalState->AddSecondary(finalParticle, 92 } 93 } 94 95 // TK modified 131108 add next line 96 // TK 160112 fix for coverity #53481 97 if (finalState != nullptr) finalState->SetSt 98 G4FFG_FUNCTIONLEAVE__ 99 return finalState; 100 } 101 102 void G4WendtFissionFragmentGenerator::Initiali 103 104 105 { 106 // G4FFG_FUNCTIONENTER__ 107 108 const G4int isotope = G4FissionFragmentGener 109 G4FFGEnumerations::MetaState metaState; 110 std::pair<std::map<const G4int, G4FissionFra 111 112 // Check to see if the isotope/isomer alread 113 newIsotope = 114 fissionIsotopes.insert(std::make_pair(isot 115 116 if (newIsotope.second || newIsotope.first->s 117 // Get the data file 118 G4bool flag; 119 G4ParticleHPDataUsed dataFile = fileNames. 120 G4String dataFileName = dataFile.GetName() 121 122 // Check if the file exists, and do not cr 123 // G4cout << "*** Z = " << Z << "\tA = " < 124 // FILE: " << dataFileName << G4endl; 125 std::istringstream dataStream(std::ios::in 126 G4ParticleHPManager::GetInstance()->GetDat 127 if (!dataStream) { 128 // G4FFG_FUNCTIONLEAVE__ 129 // G4cerr << "*** Stream error" << G4en 130 return; 131 } 132 133 // Check the data file parameters 134 if (!flag 135 || (Z < 2.5 136 && ((G4double)abs(dataFile.GetZ() 137 || (G4double)abs((G4int)dataFi 138 { 139 // G4cerr << "*** Something wrong with t 140 // G4FFG_FUNCTIONLEAVE__ 141 return; 142 } 143 144 auto const fissionGenerator = new G4Fissio 145 newIsotope.first->second = fissionGenerato 146 147 switch (M) { 148 case 1: 149 metaState = G4FFGEnumerations::META_1; 150 break; 151 152 case 2: 153 metaState = G4FFGEnumerations::META_2; 154 break; 155 156 default: 157 // TODO Display a warning message here 158 // Fall through to the ground state by 159 case 0: 160 metaState = G4FFGEnumerations::GROUND_ 161 break; 162 } 163 164 fissionGenerator->G4SetIsotope(isotope); 165 fissionGenerator->G4SetMetaState(metaState 166 fissionGenerator->G4SetCause(G4FFGEnumerat 167 // TODO Load all the fission data and use 168 fissionGenerator->G4SetIncidentEnergy(G4FF 169 fissionGenerator->G4SetYieldType(G4FFGEnum 170 fissionGenerator->G4SetSamplingScheme(G4FF 171 172 // TODO Remove the need for forcing a load 173 // i.e. remove the ability to dynamic 174 // that cause reload because a G4Fiss 175 // each isotope should be loaded in t 176 if (!fissionGenerator->InitializeFissionPr 177 // Delete if the initialization fails 178 delete fissionGenerator; 179 180 fissionIsotopes.erase(newIsotope.first); 181 } 182 } 183 184 // G4FFG_FUNCTIONLEAVE__ 185 } 186 187 G4WendtFissionFragmentGenerator::~G4WendtFissi 188 { 189 std::map<const G4int, G4FissionFragmentGener 190 191 for (fissionGenerator = fissionIsotopes.begi 192 ++fissionGenerator) 193 { 194 delete fissionGenerator->second; 195 } 196 } 197