Geant4 Cross Reference |
1 // 2 // ******************************************************************** 3 // * License and Disclaimer * 4 // * * 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. * 10 // * * 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitation of liability. * 17 // * * 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************************************** 25 // 26 27 #ifndef G4ParticleHPManager_h 28 #define G4ParticleHPManager_h 1 29 30 // 121031 First implementation done by T. Koi (SLAC/PPA) 31 // P. Arce, June-2014 Conversion neutron_hp to particle_hp 32 // V. Ivanchenko, July-2023 Basic revision of particle HP classes 33 // 34 #include "G4ParticleHPReactionWhiteBoard.hh" 35 #include "globals.hh" 36 37 #include <map> 38 #include <vector> 39 40 class G4ParticleDefinition; 41 class G4ParticleHPChannel; 42 class G4ParticleHPChannelList; 43 class G4ParticleHPMessenger; 44 class G4ParticleHPVector; 45 class G4ParticleHPIsoProbabilityTable; 46 class G4PhysicsTable; 47 48 struct E_isoAng; 49 struct E_P_E_isoAng; 50 51 class G4ParticleHPManager 52 { 53 public: 54 55 static G4ParticleHPManager* GetInstance(); 56 ~G4ParticleHPManager(); 57 58 G4ParticleHPReactionWhiteBoard* GetReactionWhiteBoard(); 59 void OpenReactionWhiteBoard(); 60 void CloseReactionWhiteBoard(); 61 62 void GetDataStream(const G4String&, std::istringstream& iss); 63 void GetDataStream2(const G4String&, std::istringstream& iss); 64 void SetVerboseLevel(G4int i); 65 G4int GetVerboseLevel() const { return verboseLevel; } 66 67 void DumpDataSource() const; 68 69 G4bool GetUseOnlyPhotoEvaporation() const { return USE_ONLY_PHOTONEVAPORATION; } 70 G4bool GetSkipMissingIsotopes() const { return SKIP_MISSING_ISOTOPES; } 71 G4bool GetNeglectDoppler() const { return NEGLECT_DOPPLER; } 72 G4bool GetDoNotAdjustFinalState() const { return DO_NOT_ADJUST_FINAL_STATE; } 73 G4bool GetProduceFissionFragments() const { return PRODUCE_FISSION_FRAGMENTS; } 74 G4bool GetUseWendtFissionModel() const { return USE_WENDT_FISSION_MODEL; } 75 G4bool GetUseNRESP71Model() const { return USE_NRESP71_MODEL; } 76 G4bool GetUseDBRC() const { return USE_DBRC; } 77 G4bool GetCheckHPNames() const { return CHECK_HP_NAMES; } 78 G4bool GetPHPCheck() const { return PHP_CHECK; } 79 G4bool GetPHCUsePoisson() const { return PHP_USE_POISSON; } 80 G4bool GetDEBUG() const { return DEBUG; } 81 82 const G4String& GetNeutronHPPath() const { return fDataPath[0]; }; 83 const G4String& GetParticleHPPath(const G4ParticleDefinition*) const; 84 G4int GetPHPIndex(const G4ParticleDefinition*) const; 85 86 void SetUseOnlyPhotoEvaporation(G4bool val) { USE_ONLY_PHOTONEVAPORATION = val; } 87 void SetSkipMissingIsotopes(G4bool val) { SKIP_MISSING_ISOTOPES = val; } 88 void SetNeglectDoppler(G4bool val) { NEGLECT_DOPPLER = val; } 89 void SetDoNotAdjustFinalState(G4bool val) { DO_NOT_ADJUST_FINAL_STATE = val; } 90 void SetProduceFissionFragments(G4bool val) 91 { 92 // Make sure both fission fragment models are not active at same time 93 PRODUCE_FISSION_FRAGMENTS = USE_WENDT_FISSION_MODEL ? false : val; 94 } 95 void SetUseWendtFissionModel(G4bool val) 96 { 97 USE_WENDT_FISSION_MODEL = val; 98 // Make sure both fission fragment models are not active at same time 99 if (USE_WENDT_FISSION_MODEL) PRODUCE_FISSION_FRAGMENTS = false; 100 } 101 void SetUseNRESP71Model(G4bool val) { USE_NRESP71_MODEL = val; } 102 void SetUseDBRC(G4bool val) { USE_DBRC = val; } 103 104 void DumpSetting(); 105 106 void RegisterElasticCrossSections(G4PhysicsTable* val) { theElasticCrossSections = val; } 107 G4PhysicsTable* GetElasticCrossSections() const { return theElasticCrossSections; } 108 void RegisterCaptureCrossSections(G4PhysicsTable* val) { theCaptureCrossSections = val; } 109 G4PhysicsTable* GetCaptureCrossSections() const { return theCaptureCrossSections; } 110 void RegisterInelasticCrossSections(const G4ParticleDefinition* part, G4PhysicsTable* ptr) 111 { 112 theInelasticCrossSections[GetPHPIndex(part)] = ptr; 113 } 114 G4PhysicsTable* GetInelasticCrossSections(const G4ParticleDefinition* part) const 115 { 116 return theInelasticCrossSections[GetPHPIndex(part)]; 117 } 118 void RegisterFissionCrossSections(G4PhysicsTable* val) { theFissionCrossSections = val; } 119 G4PhysicsTable* GetFissionCrossSections() const { return theFissionCrossSections; } 120 121 std::vector<G4ParticleHPChannel*>* GetElasticFinalStates() const { return theElasticFSs; } 122 void RegisterElasticFinalStates(std::vector<G4ParticleHPChannel*>* val) 123 { 124 theElasticFSs = val; 125 } 126 127 std::vector<G4ParticleHPChannelList*>* 128 GetInelasticFinalStates(const G4ParticleDefinition* part) const 129 { 130 return theInelasticFSs[GetPHPIndex(part)]; 131 } 132 void RegisterInelasticFinalStates(const G4ParticleDefinition* part, 133 std::vector<G4ParticleHPChannelList*>* ptr) 134 { 135 theInelasticFSs[GetPHPIndex(part)] = ptr; 136 } 137 138 std::vector<G4ParticleHPChannel*>* GetCaptureFinalStates() const { return theCaptureFSs; } 139 void RegisterCaptureFinalStates(std::vector<G4ParticleHPChannel*>* val) 140 { 141 theCaptureFSs = val; 142 } 143 std::vector<G4ParticleHPChannel*>* GetFissionFinalStates() const { return theFissionFSs; } 144 void RegisterFissionFinalStates(std::vector<G4ParticleHPChannel*>* val) 145 { 146 theFissionFSs = val; 147 } 148 149 std::map<G4int, std::map<G4double, G4ParticleHPVector*>*>* 150 GetThermalScatteringCoherentCrossSections() const 151 { 152 return theTSCoherentCrossSections; 153 } 154 void RegisterThermalScatteringCoherentCrossSections( 155 std::map<G4int, std::map<G4double, G4ParticleHPVector*>*>* val) 156 { 157 theTSCoherentCrossSections = val; 158 } 159 std::map<G4int, std::map<G4double, G4ParticleHPVector*>*>* 160 GetThermalScatteringIncoherentCrossSections() const 161 { 162 return theTSIncoherentCrossSections; 163 } 164 void RegisterThermalScatteringIncoherentCrossSections( 165 std::map<G4int, std::map<G4double, G4ParticleHPVector*>*>* val) 166 { 167 theTSIncoherentCrossSections = val; 168 } 169 std::map<G4int, std::map<G4double, G4ParticleHPVector*>*>* 170 GetThermalScatteringInelasticCrossSections() const 171 { 172 return theTSInelasticCrossSections; 173 } 174 void RegisterThermalScatteringInelasticCrossSections( 175 std::map<G4int, std::map<G4double, G4ParticleHPVector*>*>* val) 176 { 177 theTSInelasticCrossSections = val; 178 } 179 180 std::map<G4int, std::map<G4double, std::vector<std::pair<G4double, G4double>*>*>*>* 181 GetThermalScatteringCoherentFinalStates() const 182 { 183 return theTSCoherentFinalStates; 184 } 185 void RegisterThermalScatteringCoherentFinalStates( 186 std::map<G4int, std::map<G4double, std::vector<std::pair<G4double, G4double>*>*>*>* val) 187 { 188 theTSCoherentFinalStates = val; 189 } 190 std::map<G4int, std::map<G4double, std::vector<E_isoAng*>*>*>* 191 GetThermalScatteringIncoherentFinalStates() const 192 { 193 return theTSIncoherentFinalStates; 194 } 195 void RegisterThermalScatteringIncoherentFinalStates( 196 std::map<G4int, std::map<G4double, std::vector<E_isoAng*>*>*>* val) 197 { 198 theTSIncoherentFinalStates = val; 199 } 200 std::map<G4int, std::map<G4double, std::vector<E_P_E_isoAng*>*>*>* 201 GetThermalScatteringInelasticFinalStates() const 202 { 203 return theTSInelasticFinalStates; 204 } 205 void RegisterThermalScatteringInelasticFinalStates( 206 std::map<G4int, std::map<G4double, std::vector<E_P_E_isoAng*>*>*>* val) 207 { 208 theTSInelasticFinalStates = val; 209 } 210 211 std::vector< std::map< G4int, G4ParticleHPIsoProbabilityTable* > >* GetProbabilityTables() const 212 { return theProbabilityTables; } 213 void RegisterProbabilityTables( std::vector< std::map< G4int, G4ParticleHPIsoProbabilityTable* > >* val ) 214 { theProbabilityTables = val; } 215 216 std::vector< std::pair< G4double, G4double > >* GetURRlimits() const { return theURRlimits; } 217 void RegisterURRlimits( std::vector< std::pair< G4double, G4double > >* val ) { theURRlimits = val; } 218 219 G4double GetMinADBRC() const { return theMinADBRC; } 220 G4double GetMinEnergyDBRC() const { return theMinEnergyDBRC; } 221 G4double GetMaxEnergyDBRC() const { return theMaxEnergyDBRC; } 222 G4double GetMaxEnergyDoppler() const { return theMaxEnergyDoppler; } 223 224 void SetMinADBRC(G4double val) { theMinADBRC = val; } 225 void SetMinEnergyDBRC(G4double val) { theMinEnergyDBRC = val; } 226 void SetMaxEnergyDBRC(G4double val) { theMaxEnergyDBRC = val; } 227 void SetMaxEnergyDoppler(G4double val) { theMaxEnergyDoppler = val; } 228 229 G4ParticleHPManager(G4ParticleHPManager &) = delete; 230 G4ParticleHPManager & operator=(const G4ParticleHPManager &right) = delete; 231 232 private: 233 234 G4ParticleHPManager(); 235 void register_data_file(const G4String&, const G4String&); 236 237 static G4ParticleHPManager* instance; 238 239 std::map<G4String, G4String> mDataEvaluation; 240 241 G4int verboseLevel{1}; 242 243 G4ParticleHPMessenger* messenger; 244 G4bool USE_ONLY_PHOTONEVAPORATION{false}; 245 G4bool SKIP_MISSING_ISOTOPES{false}; 246 G4bool NEGLECT_DOPPLER{false}; 247 G4bool DO_NOT_ADJUST_FINAL_STATE{false}; 248 G4bool PRODUCE_FISSION_FRAGMENTS{false}; 249 G4bool USE_WENDT_FISSION_MODEL{false}; 250 G4bool USE_NRESP71_MODEL{false}; 251 G4bool USE_DBRC{false}; 252 G4bool CHECK_HP_NAMES{false}; 253 G4bool PHP_CHECK{true}; 254 G4bool PHP_USE_POISSON{false}; 255 G4bool DEBUG{false}; 256 G4bool isPrinted{false}; 257 258 G4PhysicsTable* theElasticCrossSections{nullptr}; 259 G4PhysicsTable* theCaptureCrossSections{nullptr}; 260 G4PhysicsTable* theInelasticCrossSections[6]{nullptr}; 261 G4PhysicsTable* theFissionCrossSections{nullptr}; 262 263 std::vector<G4ParticleHPChannel*>* theElasticFSs{nullptr}; 264 std::vector<G4ParticleHPChannelList*>* theInelasticFSs[6]{nullptr}; 265 std::vector<G4ParticleHPChannel*>* theCaptureFSs{nullptr}; 266 std::vector<G4ParticleHPChannel*>* theFissionFSs{nullptr}; 267 268 std::map<G4int, std::map<G4double, G4ParticleHPVector*>*>* theTSCoherentCrossSections{nullptr}; 269 std::map<G4int, std::map<G4double, G4ParticleHPVector*>*>* theTSIncoherentCrossSections{nullptr}; 270 std::map<G4int, std::map<G4double, G4ParticleHPVector*>*>* theTSInelasticCrossSections{nullptr}; 271 272 std::map<G4int, std::map<G4double, std::vector<std::pair<G4double, G4double>*>*>*>* 273 theTSCoherentFinalStates{nullptr}; 274 std::map<G4int, std::map<G4double, std::vector<E_isoAng*>*>*>* theTSIncoherentFinalStates{nullptr}; 275 std::map<G4int, std::map<G4double, std::vector<E_P_E_isoAng*>*>*>* theTSInelasticFinalStates{nullptr}; 276 277 G4double theMinADBRC{200.}; 278 G4double theMinEnergyDBRC; 279 G4double theMaxEnergyDBRC; 280 G4double theMaxEnergyDoppler; 281 282 G4String fDataPath[6]{""}; 283 284 std::vector< std::map< G4int, G4ParticleHPIsoProbabilityTable* > >* theProbabilityTables{nullptr}; 285 std::vector< std::pair< G4double, G4double > >* theURRlimits{nullptr}; 286 287 }; 288 #endif 289