├── .gitignore ├── CMakeLists.txt ├── LICENSE ├── NMSAlphaNData ├── CMakeLists.txt ├── include │ ├── NMSANSpectrum.hh │ ├── NMSANYield.hh │ ├── NMSANcsdata.hh │ └── NMSStoppingPower.hh └── src │ ├── NMSANSpectrum.cc │ ├── NMSANYield.cc │ ├── NMSANcsdata.cc │ └── NMSStoppingPower.cc ├── NMSMaterialDecay ├── CMakeLists.txt ├── LICENSE ├── README.md ├── include │ ├── NMSANSource.hh │ ├── NMSAlphaNReaction.hh │ ├── NMSAlphaNSet.hh │ ├── NMSAlphaSingleIsoDecaySource.hh │ ├── NMSMaterialDecaySettings.hh │ ├── NMSMaterialDecaySource.hh │ ├── NMSMaterialDecaySourceMessenger.hh │ ├── NMSMultipleDecaySource.hh │ ├── NMSNewSingleDecaySource.hh │ ├── NMSPosDistribution.hh │ ├── NMSPrimaryUserInformation.hh │ ├── NMSSFSingleIsoDecaySource.hh │ └── fissionEventData.hh └── src │ ├── NMSANSource.cc │ ├── NMSAlphaNSet.cc │ ├── NMSAlphaSingleIsoDecaySource.cc │ ├── NMSMaterialDecaySettings.cc │ ├── NMSMaterialDecaySource.cc │ ├── NMSMaterialDecaySourceMessenger.cc │ ├── NMSMultipleDecaySource.cc │ ├── NMSNewSingleDecaySource.cc │ ├── NMSPosDistribution.cc │ ├── NMSPrimaryUserInformation.cc │ ├── NMSSFSingleIsoDecaySource.cc │ └── fissionEventData.cc ├── NMSPulsetrainAnalysis ├── CMakeLists.txt ├── example │ ├── cf252_example_pulsetrain_list │ └── nmspa_example.cc ├── include │ ├── NMSDetectedEvent.hh │ ├── NMSDetectedEventSet.hh │ ├── NMSMultiplicityMeasurementSetting.hh │ ├── NMSMultiplicityResult.hh │ ├── NMSPulsetrainManager.hh │ └── NMSSimpleEvent.hh └── src │ ├── LLResultsAllEventsBackward.cc │ ├── LLResultsAllEventsForward.cc │ ├── LLResultsAllEventsForwardF.cc │ ├── LLResultsSingleEventBackward.cc │ ├── LLResultsSingleEventForward.cc │ ├── NMSDetectedEvent.cc │ ├── NMSDetectedEventSet.cc │ ├── NMSMultiplicityResult.cc │ ├── NMSPulsetrainManager.cc │ ├── ResultsAllEvents.cc │ ├── ResultsAllEventsForward.cc │ ├── ResultsAllTimeSteps.cc │ └── ResultsFastForward.cc ├── README.md ├── cmd.mac ├── fission ├── CMakeLists.txt ├── changes ├── include │ ├── Fission.h │ ├── Fission.hh │ ├── Fission.inc │ └── fissionEvent.h └── src │ ├── COPYRIGHT.TXT │ ├── COPYRIGHT_FORTRAN.TXT │ ├── COPYRIGHT_FREYA.TXT │ ├── Fission.cc │ ├── Makefile_copyright │ ├── Readme │ ├── Recipe_mcnpx.txt │ ├── SmpFreya.cc │ ├── SmpGEng.cc │ ├── SmpIsoDir.cc │ ├── SmpNEngCf252.cc │ ├── SmpNPEnergyCons.cc │ ├── SmpNVel.cc │ ├── SmpNuDistDataPu239.cc │ ├── SmpNuDistDataPu239_241.cc │ ├── SmpNuDistDataPu239_241_MC.cc │ ├── SmpNuDistDataU232_234_236_238.cc │ ├── SmpNuDistDataU232_234_236_238_MC.cc │ ├── SmpNuDistDataU233_235.cc │ ├── SmpNuDistDataU233_235_MC.cc │ ├── SmpNuDistDataU235.cc │ ├── SmpNuDistDataU238.cc │ ├── SmpNugDist.cc │ ├── SmpPVel.cc │ ├── SmpSpNuDistData.cc │ ├── SmpSpNubarData.cc │ ├── SmpSpNugDistData.cc │ ├── SmpSpWatt.cc │ ├── SmpTerrell.cc │ ├── SmpWatt.cc │ ├── allocateMem.cc │ ├── copyright.cmake │ ├── erf.cc │ ├── fissionEvent.cc │ ├── fissionerr.cc │ ├── getNSepEng.cc │ ├── getNubarg.cc │ ├── getTotEngN.cc │ ├── getTotEngNEnergyCons.cc │ ├── getTotEngNEnergyConsAllActinides.cc │ ├── getTotEngP.cc │ ├── getTotEngPEnergyCons.cc │ ├── getTotEngPEnergyConsAllActinides.cc │ ├── msFREYA_data.F90 │ ├── msFREYA_error.F90 │ ├── msFREYA_event.F90 │ ├── msFREYA_interfaces.F90 │ ├── msFREYA_setup.F90 │ ├── normsinv.cc │ └── rngc.cc ├── gdml ├── detector │ ├── AWCC.gdml │ └── PSMC.gdml ├── samples │ ├── ep1-c1.gdml │ ├── ep1-c2.gdml │ ├── ep1-c3b.gdml │ ├── ep1-c3s.gdml │ ├── ep1-c4b.gdml │ ├── ep1-c4s.gdml │ ├── ep3-2.gdml │ ├── ep3-c1.gdml │ ├── ep3-c3.gdml │ ├── ep3-c4.gdml │ ├── ep3-c5.gdml │ ├── ep3-c6.gdml │ ├── pm1.gdml │ ├── pm2.gdml │ ├── pm3.gdml │ ├── puo2-10.gdml │ ├── puo2-20.gdml │ ├── puo2-21.gdml │ ├── puo2-22.gdml │ └── puo2-23.gdml └── schema │ ├── gdml.xsd │ ├── gdml_core.xsd │ ├── gdml_define.xsd │ ├── gdml_extensions.xsd │ ├── gdml_materials.xsd │ ├── gdml_parameterised.xsd │ ├── gdml_replicas.xsd │ └── gdml_solids.xsd ├── include ├── NMSAnalysisManager.hh ├── NMSAnalysisManagerMessenger.hh ├── NMSDetectorConstruction.hh ├── NMSEventAction.hh ├── NMSHadronElasticPhysicsHP_Thermal.hh ├── NMSPrimaryGeneratorAction.hh ├── NMSPrimaryGeneratorActionGPS.hh ├── NMSRunAction.hh ├── NMSRunManager.hh ├── NMSRunManagerMessenger.hh ├── NMSSteppingAction.hh ├── NMSTrackingAction.hh └── NMS_QGSP_BIC_HP_Thermal.hh ├── macros ├── ep1-c1-1000_0_0.mac ├── ep1-c1-100_0_0.mac ├── ep1-c1-10_0_0.mac ├── ep1-c2-1000_0_0.mac ├── ep1-c2-100_0_0.mac ├── ep1-c2-10_0_0.mac ├── ep1-c3b_0_0.mac ├── ep1-c3s_0_0.mac ├── ep1-c4b_0_0.mac ├── ep1-c4s_0_0.mac ├── ep3-c3_0_0.mac ├── ep3-c4_0_0.mac ├── ep3-c5_0_0.mac ├── ep3-c6_0_0.mac ├── pm1_0_0.mac ├── pm2_0_0.mac ├── pm3_0_0.mac ├── puo2-10_0_0.mac ├── puo2-20_0_0.mac ├── puo2-21_0_0.mac ├── puo2-22_0_0.mac └── puo2-23_0_0.mac ├── nms.cc ├── src ├── NMSAnalysisManager.cc ├── NMSAnalysisManagerMessenger.cc ├── NMSDetectorConstruction.cc ├── NMSEventAction.cc ├── NMSHadronElasticPhysicsHP_Thermal.cc ├── NMSPrimaryGeneratorAction.cc ├── NMSPrimaryGeneratorActionGPS.cc ├── NMSRunAction.cc ├── NMSRunManager.cc ├── NMSRunManagerMessenger.cc ├── NMSSteppingAction.cc ├── NMSTrackingAction.cc └── NMS_QGSP_BIC_HP_Thermal.cc ├── tools ├── JENDL-conversion │ ├── 451-lines.patch │ ├── README.org │ ├── convert.py │ ├── download.sh │ ├── endfgeant4converter.py │ ├── endftogeant4.py │ ├── geantdata.py │ ├── headline.patch │ ├── newmf.py │ ├── patch.sh │ └── rename-ZAID.py └── ziegler_low_e_table └── vis.mac /.gitignore: -------------------------------------------------------------------------------- 1 | *~ -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6 FATAL_ERROR) 2 | project(nms) 3 | 4 | 5 | message(STATUS "Building NMS (main cmake folder)") 6 | message(STATUS "Source folder: ${CMAKE_SOURCE_DIR}") 7 | 8 | # FISSION (in source tree) 9 | add_subdirectory(fission) 10 | include_directories(${PROJECT_SOURCE_DIR}/fission/include) 11 | 12 | # NMS libraries in project tree 13 | add_subdirectory(NMSAlphaNData) 14 | include_directories(${PROJECT_SOURCE_DIR}/NMSAlphaNData/include) 15 | add_subdirectory(NMSMaterialDecay) 16 | include_directories(${PROJECT_SOURCE_DIR}/NMSMaterialDecay/include) 17 | add_subdirectory(NMSPulsetrainAnalysis) 18 | include_directories(${PROJECT_SOURCE_DIR}/NMSPulsetrainAnalysis/include) 19 | 20 | 21 | # GEANT 22 | find_package(Geant4 REQUIRED vis_all) 23 | include(${Geant4_USE_FILE}) 24 | include_directories(${PROJECT_SOURCE_DIR}/include) 25 | 26 | # SOURCES AND HEADERS of PROJECT 27 | file(GLOB sources ${PROJECT_SOURCE_DIR}/src/*.cc) 28 | file(GLOB headers ${PROJECT_SOURCE_DIR}/include/*.hh) 29 | 30 | # EXECUTABLE 31 | add_executable(nms nms.cc ${sources} ${headers}) 32 | 33 | ###### LINK TO LIBRARIES 34 | 35 | #----- Geant 36 | target_link_libraries(nms ${Geant4_LIBRARIES}) 37 | 38 | #----- NMSAlphaNData 39 | target_link_libraries(nms NMSAlphaNData) 40 | 41 | #----- NMSMaterialDecay 42 | target_link_libraries(nms NMSMaterialDecay) 43 | 44 | #----- NMSPulsetrainAnalysis 45 | target_link_libraries(nms NMSPulsetrainAnalysis) 46 | 47 | #----- FISSION Lib from LLNL (FIXME: add cmake for compilation of sources later) 48 | target_link_libraries(nms Fission) 49 | 50 | 51 | # There was a good reason for linking NMSMaterialDecay before Fission! 52 | 53 | file(GLOB ALL_MAC *.mac) 54 | 55 | 56 | foreach(_macfile ${ALL_MAC}) 57 | message(STATUS "Copy .mac script '${_macfile}'") 58 | configure_file(${_macfile} ${PROJECT_BINARY_DIR} COPYONLY) 59 | endforeach() 60 | 61 | # copy GDML files, schema files and examples 62 | file(COPY ${PROJECT_SOURCE_DIR}/gdml DESTINATION ${PROJECT_BINARY_DIR}) 63 | file(COPY ${PROJECT_SOURCE_DIR}/macros DESTINATION ${PROJECT_BINARY_DIR}) 64 | file(COPY ${PROJECT_SOURCE_DIR}/examples DESTINATION ${PROJECT_BINARY_DIR}) 65 | -------------------------------------------------------------------------------- /NMSAlphaNData/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #NMSAlphaNData Library 2 | 3 | message(STATUS "Building NMSAlphaNData") 4 | message(STATUS "Source folder: ${CMAKE_SOURCE_DIR}") 5 | 6 | cmake_minimum_required(VERSION 2.6 FATAL_ERROR) 7 | project(NMSAlphaNData) 8 | 9 | find_package(Geant4) 10 | include(${Geant4_USE_FILE}) 11 | include_directories(${PROJECT_SOURCE_DIR}/include) 12 | 13 | # GEANT 14 | find_package(Geant4 REQUIRED vis_all) 15 | include(${Geant4_USE_FILE}) 16 | include_directories(${PROJECT_SOURCE_DIR}/include) 17 | 18 | # SOURCES AND HEADERS of PROJECT 19 | file(GLOB sources ${PROJECT_SOURCE_DIR}/src/*.cc) 20 | file(GLOB headers ${PROJECT_SOURCE_DIR}/include/*.hh) 21 | 22 | add_library(NMSAlphaNData ${sources} ${headers}) 23 | target_link_libraries(NMSAlphaNData ${Geant4_LIBRARIES}) 24 | 25 | # add_executable (test_AlphaNData test_AlphaNData.cc) 26 | # target_link_libraries (test_AlphaNData NMSAlphaNData) 27 | # target_link_libraries (test_AlphaNData ${Geant4_LIBRARIES}) 28 | 29 | # add_executable (test_AlphaNSpectrum test_AlphaNSpectrum.cc) 30 | # target_link_libraries (test_AlphaNSpectrum NMSAlphaNData) 31 | # target_link_libraries (test_AlphaNSpectrum ${Geant4_LIBRARIES}) 32 | 33 | # add_executable (test_stoppingpower test_stoppingpower.cc) 34 | # target_link_libraries (test_stoppingpower NMSAlphaNData) 35 | # target_link_libraries (test_stoppingpower ${Geant4_LIBRARIES}) 36 | 37 | install (FILES ${headers} DESTINATION include) 38 | install (TARGETS NMSAlphaNData DESTINATION lib) 39 | # install (TARGETS test_AlphaNData DESTINATION bin ) 40 | 41 | -------------------------------------------------------------------------------- /NMSAlphaNData/include/NMSANSpectrum.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * ONMS - Open Neutron Multiplicity Simulation 3 | * 4 | * 5 | * Copyright (C) 2013-2016 Moritz Kütt 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | * 20 | * Contact: moritz@nuclearfreesoftware.org 21 | */ 22 | 23 | #ifndef NMSANSPECTRUM_H 24 | #define NMSANSPECTRUM_H 1 25 | 26 | #include "G4Material.hh" 27 | #include "G4LPhysicsFreeVector.hh" 28 | 29 | #include "NMSStoppingPower.hh" 30 | #include "NMSANcsdata.hh" 31 | 32 | struct spectrumdata { 33 | G4double intensity; 34 | G4double energy; 35 | G4LPhysicsFreeVector * spectrum; 36 | }; 37 | 38 | class NMSANSpectrum { 39 | public: 40 | NMSANSpectrum(); 41 | ~NMSANSpectrum(); 42 | 43 | void SetUseMT91(G4bool mt91b = true) { mt91 = mt91b; }; 44 | G4bool GetUseMT91() { return mt91; }; 45 | 46 | G4LPhysicsFreeVector * fromSource(G4Material * mat); 47 | G4LPhysicsFreeVector * fromEnergy(G4double E, G4Material * mat); 48 | G4LPhysicsFreeVector * fromEnergy(G4double E, G4Material * mat, const G4Isotope * iso); 49 | G4LPhysicsFreeVector * fromEnergy(G4double E, G4Material * mat, const G4Isotope * iso, G4int lidx); 50 | 51 | void clear(); 52 | 53 | private: 54 | G4int verboseLevel; 55 | 56 | G4int neutronbins; 57 | G4double neutronEmin; 58 | G4double neutronEmax; 59 | G4double ngridbinwidth; 60 | 61 | G4bool mt91; 62 | 63 | std::vector spectrumvector; 64 | NMSStoppingPower * stoppingData; 65 | NMSANcsdata * csData; 66 | }; 67 | 68 | #endif /* NMSANSPECTRUM_H */ 69 | 70 | -------------------------------------------------------------------------------- /NMSAlphaNData/include/NMSANYield.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * ONMS - Open Neutron Multiplicity Simulation 3 | * 4 | * 5 | * Copyright (C) 2013-2016 Moritz Kütt 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | * 20 | * Contact: moritz@nuclearfreesoftware.org 21 | */ 22 | 23 | #ifndef NMSANYield_h 24 | #define NMSANYield_h 1 25 | 26 | #include "G4Material.hh" 27 | #include "G4Element.hh" 28 | #include "G4Isotope.hh" 29 | #include "G4LPhysicsFreeVector.hh" 30 | #include "G4SystemOfUnits.hh" 31 | 32 | #include "G4IonTable.hh" 33 | #include "G4RadioactiveDecay.hh" 34 | #include "G4AlphaDecayChannel.hh" 35 | #include "G4AlphaDecay.hh" 36 | #include "G4DecayProducts.hh" 37 | 38 | #include "NMSANcsdata.hh" 39 | 40 | #include "NMSStoppingPower.hh" 41 | 42 | struct yielddata { 43 | G4double activity; 44 | G4double energy; 45 | G4double yieldfore; 46 | G4double yield; 47 | }; 48 | 49 | class NMSANYield 50 | { 51 | public: 52 | NMSANYield(); 53 | virtual ~NMSANYield(); 54 | 55 | G4double fromSource(G4Material * mat); 56 | G4double alphaActivityFromSource(G4Material * mat); 57 | G4double fromEnergy(G4double E, G4Material * mat); 58 | 59 | void initialize(); // store cs data in vector, use method from NMSAlphaLE 60 | 61 | void SetVerboseLevel(G4int i) { verboseLevel = i; } 62 | G4int GetVerboseLevel() { return verboseLevel; } 63 | 64 | public: 65 | static const G4int csno; 66 | static const G4int csarray[17][2]; 67 | static const G4String nameString[100]; 68 | 69 | // Yield Table 70 | // G4PhysicsVector 71 | private: 72 | G4int verboseLevel; 73 | std::vector csIsoVector; 74 | std::vector yieldvector; 75 | 76 | NMSANcsdata * csData; 77 | NMSStoppingPower * stoppingData; 78 | }; 79 | 80 | 81 | #endif /* NMSANYield_h */ 82 | -------------------------------------------------------------------------------- /NMSAlphaNData/include/NMSANcsdata.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * ONMS - Open Neutron Multiplicity Simulation 3 | * 4 | * 5 | * Copyright (C) 2013-2016 Moritz Kütt 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | * 20 | * Contact: moritz@nuclearfreesoftware.org 21 | */ 22 | 23 | #ifndef NMSANCSDATA_H 24 | #define NMSANCSDATA_H 25 | 26 | #include "G4LPhysicsFreeVector.hh" 27 | 28 | struct inelasticdata { 29 | G4int mt; 30 | G4double Qex; 31 | G4LPhysicsFreeVector * cs; 32 | }; 33 | 34 | class NMSANcsdata { 35 | public: 36 | static NMSANcsdata* Instance(); 37 | 38 | NMSANcsdata(); 39 | ~NMSANcsdata(); 40 | 41 | void Init(); 42 | 43 | void SetVerboseLevel(G4int i) { verboseLevel = i; } 44 | G4int GetVerboseLevel() { return verboseLevel; } 45 | 46 | G4int no() {return csno; } 47 | G4bool has(G4int Z, G4int A); 48 | G4int index(G4int Z, G4int A); 49 | G4LPhysicsFreeVector * getcsVector(G4int idx); 50 | 51 | G4int inelasticNo(G4int idx); 52 | G4LPhysicsFreeVector * getInelasticCsVector(G4int idx, G4int ridx); 53 | G4int getInelasticCsMT(G4int idx, G4int ridx); 54 | G4double getInelasticCsQex(G4int idx, G4int ridx); 55 | 56 | public: 57 | static const G4int csno; 58 | static const G4int csarray[17][2]; 59 | static const G4String nameString[100]; 60 | 61 | private: 62 | G4int verboseLevel; 63 | std::vector csIsoVector; 64 | std::vector< std::vector< inelasticdata > > inelasticCsVector; 65 | 66 | }; 67 | 68 | #endif /* NMSANCSDATA_H */ 69 | -------------------------------------------------------------------------------- /NMSAlphaNData/include/NMSStoppingPower.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * ONMS - Open Neutron Multiplicity Simulation 3 | * 4 | * 5 | * Copyright (C) 2013-2016 Moritz Kütt 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | * 20 | * Contact: moritz@nuclearfreesoftware.org 21 | */ 22 | 23 | #ifndef NMSStoppingPower_h 24 | #define NMSStoppingPower_h 1 25 | 26 | #include "G4Material.hh" 27 | #include "G4ASTARStopping.hh" 28 | #include "G4EmCalculator.hh" 29 | #include "G4Alpha.hh" 30 | #include "G4SystemOfUnits.hh" 31 | #include "G4LossTableManager.hh" 32 | 33 | enum StoppingDataSource { STOPPINGPOWER_DS_G4EMCALCULATOR, 34 | STOPPINGPOWER_DS_ZIEGLER_T3, 35 | STOPPINGPOWER_DS_ASTAR, 36 | STOPPINGPOWER_DS_ASTARZIEGLER 37 | }; 38 | 39 | 40 | class NMSStoppingPower 41 | { 42 | public: 43 | NMSStoppingPower(); 44 | virtual ~NMSStoppingPower(); 45 | void initialize(); 46 | 47 | G4double getDEDX(G4double E, G4int Z); 48 | G4double getDEDX(G4double E, G4Material * mat); 49 | G4double getDEDXfromZieglerT3(G4double E, G4Material* mat); 50 | G4double getDEDXfromEMCal(G4double E, G4Material* mat); 51 | G4double getDEDXfromASTAR(G4double E, G4Material* mat); 52 | 53 | G4bool ASTARapplicable(G4double E, G4Material* mat); 54 | 55 | void setDataSource(StoppingDataSource newds); 56 | StoppingDataSource getDataSource() { return ds; } 57 | 58 | private: 59 | G4bool initialized; 60 | StoppingDataSource ds; 61 | G4ParticleDefinition * alpha; 62 | G4ASTARStopping * astar; 63 | G4EmCalculator emcal; 64 | G4String emprocessname; 65 | 66 | G4double zieglerdata[92][5]; 67 | }; 68 | 69 | 70 | 71 | #endif /* NMSStoppingPower_h */ 72 | -------------------------------------------------------------------------------- /NMSMaterialDecay/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #NMSMaterialDecay Library 2 | 3 | message(STATUS "Building NMSMaterialDecay") 4 | message(STATUS "Source folder: ${CMAKE_SOURCE_DIR}") 5 | 6 | cmake_minimum_required(VERSION 2.6 FATAL_ERROR) 7 | project(NMSMaterialDecay) 8 | 9 | include_directories(/geant/fission) 10 | 11 | find_package(Geant4) 12 | include(${Geant4_USE_FILE}) 13 | include_directories(${PROJECT_SOURCE_DIR}/include) 14 | include_directories(${PROJECT_SOURCE_DIR}/../NMSAlphaNData/include) 15 | 16 | file(GLOB sources ${PROJECT_SOURCE_DIR}/src/*.cc) 17 | file(GLOB headers ${PROJECT_SOURCE_DIR}/include/*.hh) 18 | 19 | add_library(NMSMaterialDecay ${sources} ${headers}) 20 | target_link_libraries(NMSMaterialDecay NMSAlphaNData) 21 | 22 | install (FILES ${headers} DESTINATION include) 23 | install (TARGETS NMSMaterialDecay DESTINATION lib) 24 | 25 | -------------------------------------------------------------------------------- /NMSMaterialDecay/README.md: -------------------------------------------------------------------------------- 1 | ### NMSMaterialDecay 2 | 3 | The NMSMaterialDecay library provides a particle source that can be placed in any Geant4 application. It can creates starting α particles or electrons according to either alpha- and beta-decays, as well as neutrons or gammas from spontaneous fission of given isotopes. The isotopes are taken from a source material. 4 | 5 | The library forms a part of the application NMS (Neutron Multiplicity Simulation) 6 | 7 | #### Requirements 8 | 9 | - CMake 10 | - Geant4, version >= 9.6 11 | - Fission, from the Physics Simulation Package (http://nuclear.llnl.gov/simulation/main.html) 12 | 13 | #### Build 14 | 1. Extract / clone repository in a directory ("A"). 15 | 2. Create a new directory ("B") and go to B. 16 | 3. Edit CMakeLists.txt to reflect your location of fission 17 | 4. Execute `cmake` 18 | 5. Execute `make` / `make install` -------------------------------------------------------------------------------- /NMSMaterialDecay/include/NMSANSource.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * ONMS - Open Neutron Multiplicity Simulation 3 | * 4 | * 5 | * Copyright (C) 2013-2016 Moritz Kütt 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | * 20 | * Contact: moritz@nuclearfreesoftware.org 21 | */ 22 | 23 | #ifndef NMSANSource_h 24 | #define NMSANSource_h 1 25 | 26 | #include "G4DataVector.hh" 27 | #include "Randomize.hh" 28 | 29 | #include "G4IonTable.hh" 30 | #include "G4RadioactiveDecay.hh" 31 | #include "G4VDecayChannel.hh" 32 | #include "G4DecayProducts.hh" 33 | #include "G4AlphaDecayChannel.hh" 34 | 35 | #include "G4LPhysicsFreeVector.hh" 36 | 37 | #include "G4SystemOfUnits.hh" 38 | #include "G4PhysicalConstants.hh" 39 | 40 | #include "G4SPSPosDistribution.hh" 41 | #include "G4SPSAngDistribution.hh" 42 | 43 | #include "G4SingleParticleSource.hh" 44 | 45 | #include "NMSPrimaryUserInformation.hh" 46 | #include "NMSNewSingleDecaySource.hh" 47 | #include "NMSMaterialDecaySettings.hh" 48 | 49 | static G4int NMSANCalcNeutronBins = 1000; 50 | 51 | class NMSANSource : public NMSNewSingleDecaySource 52 | { 53 | public: 54 | NMSANSource(); 55 | ~NMSANSource(); 56 | 57 | void GeneratePrimaryVertex(G4Event* anEvent); 58 | 59 | G4double SampleEnergy(); 60 | G4ThreeVector SamplePosition(); 61 | G4ThreeVector SampleDirection(); 62 | 63 | G4double GetEnergyFromSampleIndex(); 64 | G4ThreeVector GetDirectionFromSampleIndex(); 65 | 66 | void Init(); 67 | void WriteANSpectrum(G4String filename); 68 | 69 | G4bool neutronSource() { 70 | return true; 71 | } 72 | G4double neutronPerEvent() { return 1.0; } 73 | 74 | private: 75 | G4int lastSampleIndex; 76 | 77 | NMSMaterialDecaySettings * nmsmdsSettings; 78 | 79 | G4LPhysicsFreeVector * nspectrum; 80 | }; 81 | 82 | #endif /* NMSANSource_h */ 83 | -------------------------------------------------------------------------------- /NMSMaterialDecay/include/NMSAlphaNReaction.hh: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2014, Moritz Kütt 2 | * 3 | * This file is part of NMSMaterialDecay. 4 | * 5 | * NMSMaterialDecay is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * NMSMaterialDecay is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with NMSMaterialDecay. If not, see . 17 | * 18 | */ 19 | /* 20 | * ONMS - Open Neutron Multiplicity Simulation 21 | * 22 | * 23 | * Copyright (C) 2013-2016 Moritz Kütt 24 | * 25 | * This program is free software: you can redistribute it and/or modify 26 | * it under the terms of the GNU General Public License as published by 27 | * the Free Software Foundation, either version 3 of the License, or 28 | * (at your option) any later version. 29 | * 30 | * This program is distributed in the hope that it will be useful, 31 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 32 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 33 | * GNU General Public License for more details. 34 | * 35 | * You should have received a copy of the GNU General Public License 36 | * along with this program. If not, see . 37 | * 38 | * Contact: moritz@nuclearfreesoftware.org 39 | */ 40 | 41 | 42 | #ifndef NMSAlphaNReaction_h 43 | #define NMSAlphaNReaction_h 1 44 | 45 | #include "G4ThreeVector.hh" 46 | 47 | struct NMSAlphaNReaction { 48 | G4ThreeVector position; 49 | G4ThreeVector alphaDirection; 50 | G4double energy; 51 | G4double time; 52 | }; 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /NMSMaterialDecay/include/NMSAlphaNSet.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * ONMS - Open Neutron Multiplicity Simulation 3 | * 4 | * 5 | * Copyright (C) 2013-2016 Moritz Kütt 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | * 20 | * Contact: moritz@nuclearfreesoftware.org 21 | */ 22 | 23 | #ifndef NMSAlphaNSet_h 24 | #define NMSAlphaNSet_h 1 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | #include "G4SystemOfUnits.hh" 32 | 33 | #include "NMSAlphaNReaction.hh" 34 | 35 | class NMSAlphaNSet : public std::vector { 36 | public: 37 | NMSAlphaNSet(); 38 | virtual ~NMSAlphaNSet(); 39 | 40 | void saveToFile(G4String filename); 41 | void loadFromFile(G4String filename); 42 | 43 | private: 44 | inline bool file_exists(G4String filename) { 45 | struct stat buffer; 46 | return (stat (filename.c_str(), &buffer) == 0); 47 | } 48 | 49 | }; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /NMSMaterialDecay/include/NMSAlphaSingleIsoDecaySource.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * ONMS - Open Neutron Multiplicity Simulation 3 | * 4 | * 5 | * Copyright (C) 2013-2016 Moritz Kütt 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | * 20 | * Contact: moritz@nuclearfreesoftware.org 21 | */ 22 | 23 | #ifndef NMSAlphaSingleIsoDecaySource_h 24 | #define NMSAlphaSingleIsoDecaySource_h 1 25 | 26 | #include "G4DataVector.hh" 27 | #include "Randomize.hh" 28 | 29 | #include "G4IonTable.hh" 30 | #include "G4RadioactiveDecay.hh" 31 | #include "G4VDecayChannel.hh" 32 | #include "G4DecayProducts.hh" 33 | #include "G4AlphaDecayChannel.hh" 34 | 35 | #include "G4SystemOfUnits.hh" 36 | #include "G4PhysicalConstants.hh" 37 | 38 | #include "G4SPSPosDistribution.hh" 39 | #include "G4SPSAngDistribution.hh" 40 | 41 | #include "G4SingleParticleSource.hh" 42 | 43 | #include "NMSPrimaryUserInformation.hh" 44 | #include "NMSNewSingleDecaySource.hh" 45 | 46 | class NMSAlphaSingleIsoDecaySource : public NMSNewSingleDecaySource 47 | { 48 | public: 49 | NMSAlphaSingleIsoDecaySource(); 50 | ~NMSAlphaSingleIsoDecaySource(); 51 | 52 | void GeneratePrimaryVertex(G4Event* anEvent); 53 | 54 | void Init(); 55 | 56 | void setIsotope(G4int iso); 57 | 58 | private: 59 | G4int DecayIsotope; 60 | 61 | std::vector energyList; 62 | std::vector branchingList; 63 | 64 | }; 65 | 66 | #endif /* NMSAlphaSingleIsoDecaySource_h */ 67 | -------------------------------------------------------------------------------- /NMSMaterialDecay/include/NMSMaterialDecaySourceMessenger.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * ONMS - Open Neutron Multiplicity Simulation 3 | * 4 | * 5 | * Copyright (C) 2013-2016 Moritz Kütt 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | * 20 | * Contact: moritz@nuclearfreesoftware.org 21 | */ 22 | 23 | #ifndef NMSMaterialDecaySourceMessenger_h 24 | #define NMSMaterialDecaySourceMessenger_h 1 25 | 26 | #include "G4UIcmdWithAString.hh" 27 | #include "G4UIcmdWithADoubleAndUnit.hh" 28 | #include "G4UIcmdWith3Vector.hh" 29 | #include "G4UIcmdWith3VectorAndUnit.hh" 30 | #include "G4UIcmdWithAnInteger.hh" 31 | #include "G4UIcmdWithADouble.hh" 32 | #include "G4UIcmdWithABool.hh" 33 | #include "G4UIcmdWithoutParameter.hh" 34 | #include "G4UImessenger.hh" 35 | 36 | #include "NMSMaterialDecaySource.hh" 37 | #include "NMSMaterialDecaySettings.hh" 38 | 39 | class G4UIcmdWithADoubleAndUnit; 40 | 41 | class NMSMaterialDecaySource; 42 | 43 | class NMSMaterialDecaySourceMessenger : public G4UImessenger { 44 | public: 45 | NMSMaterialDecaySourceMessenger(NMSMaterialDecaySource* ); 46 | ~NMSMaterialDecaySourceMessenger(); 47 | 48 | void SetNewValue(G4UIcommand* cmd, G4String newval); 49 | 50 | private: 51 | NMSMaterialDecaySource* nmsmds; 52 | NMSMaterialDecaySettings* nmsmdsSettings; 53 | 54 | G4UIdirectory* sourceDir; 55 | G4UIdirectory* sourcePosDistDir; 56 | G4UIdirectory* sourceANDir; 57 | 58 | G4UIcmdWithAnInteger * VerboseCmd; 59 | 60 | G4UIcmdWithAString* MaterialCmd; 61 | G4UIcmdWithAString* SourceFromVolumeCmd; 62 | G4UIcommand* Cf252Cmd; 63 | G4UIcmdWithADoubleAndUnit* ActiveVolumeCmd; 64 | G4UIcmdWithADoubleAndUnit* ActivityCmd; 65 | G4UIcmdWithABool* ActivityFixedCmd; 66 | 67 | G4UIcmdWithABool* SFnCmd; 68 | G4UIcmdWithABool* SFgCmd; 69 | G4UIcmdWithABool* BetaCmd; 70 | G4UIcmdWithABool* AlphaCmd; 71 | G4UIcmdWithABool* AlphaNCmd; 72 | 73 | G4UIcmdWithAString* ANWriteYieldFileCmd; 74 | G4UIcmdWithAnInteger* ANSampleDirectionCmd; 75 | G4UIcmdWithAnInteger* ANSampleEnergyCmd; 76 | G4UIcmdWithAnInteger* ANSamplePositionCmd; 77 | G4UIcmdWithADoubleAndUnit* ANEnergyCmd; 78 | G4UIcmdWithAString* ANFileCmd; 79 | G4UIcmdWithAString* ANEnergyFileCmd; 80 | G4UIcmdWithAString* ANWriteEnergyFileCmd; 81 | G4UIcmdWithABool* ANSpectrumCalcMT91; 82 | G4UIcmdWithAnInteger* ANActivityCalcCmd; 83 | G4UIcmdWithADouble* ANActivityCmd; 84 | 85 | G4UIcmdWithAString* posTypeCmd; 86 | G4UIcmdWithAString* posShapeCmd; 87 | G4UIcmdWithAString* posConfineVolumeCmd; 88 | G4UIcmdWithADoubleAndUnit* posRadiusCmd; 89 | G4UIcmdWithADoubleAndUnit* posRadius0Cmd; 90 | G4UIcmdWithADoubleAndUnit* posHalfXCmd; 91 | G4UIcmdWithADoubleAndUnit* posHalfYCmd; 92 | G4UIcmdWithADoubleAndUnit* posHalfZCmd; 93 | G4UIcmdWith3VectorAndUnit* posCentreCoordsCmd; 94 | 95 | G4UIcmdWithoutParameter* dumpSourceStatusCmd; 96 | }; 97 | 98 | #endif /* NMSMaterialDecaySourceMessenger_h */ 99 | -------------------------------------------------------------------------------- /NMSMaterialDecay/include/NMSPrimaryUserInformation.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * ONMS - Open Neutron Multiplicity Simulation 3 | * 4 | * 5 | * Copyright (C) 2013-2016 Moritz Kütt 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | * 20 | * Contact: moritz@nuclearfreesoftware.org 21 | */ 22 | 23 | 24 | #ifndef NMSPrimaryUserInformation_h 25 | #define NMSPrimaryUserInformation_h 1 26 | 27 | #include "G4VUserPrimaryParticleInformation.hh" 28 | 29 | enum NMSOrigin { ORIGIN_ALPHA_N, ORIGIN_SF, ORIGIN_ALPHA }; 30 | 31 | class NMSPrimaryUserInformation : public G4VUserPrimaryParticleInformation { 32 | public: 33 | NMSPrimaryUserInformation(); 34 | ~NMSPrimaryUserInformation(); 35 | 36 | void Print() const; 37 | 38 | NMSOrigin GetOrigin(); 39 | void SetOrigin(NMSOrigin newor); 40 | 41 | private: 42 | NMSOrigin ori; 43 | 44 | }; 45 | 46 | #endif /* NMSPrimaryUserInformation_h */ 47 | -------------------------------------------------------------------------------- /NMSMaterialDecay/include/NMSSFSingleIsoDecaySource.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * ONMS - Open Neutron Multiplicity Simulation 3 | * 4 | * 5 | * Copyright (C) 2013-2016 Moritz Kütt 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | * 20 | * Contact: moritz@nuclearfreesoftware.org 21 | */ 22 | 23 | #ifndef NMSSFSingleIsoDecaySource_h 24 | #define NMSSFSingleIsoDecaySource_h 1 25 | 26 | #include "G4DataVector.hh" 27 | #include "Randomize.hh" 28 | 29 | #include "G4IonTable.hh" 30 | #include "G4RadioactiveDecay.hh" 31 | #include "G4VDecayChannel.hh" 32 | #include "G4DecayProducts.hh" 33 | #include "G4AlphaDecayChannel.hh" 34 | 35 | #include "G4SystemOfUnits.hh" 36 | #include "G4PhysicalConstants.hh" 37 | 38 | #include "G4SPSPosDistribution.hh" 39 | #include "G4SPSAngDistribution.hh" 40 | 41 | #include "G4SingleParticleSource.hh" 42 | 43 | #include "NMSPrimaryUserInformation.hh" 44 | #include "NMSNewSingleDecaySource.hh" 45 | 46 | class NMSSFSingleIsoDecaySource : public NMSNewSingleDecaySource 47 | { 48 | public: 49 | NMSSFSingleIsoDecaySource(); 50 | ~NMSSFSingleIsoDecaySource(); 51 | static double UniformRand(); 52 | 53 | void SetCf252n(G4int, G4int); 54 | 55 | void GeneratePrimaryVertex(G4Event* anEvent); 56 | 57 | void Init(); 58 | 59 | void setIsotope(G4int iso); 60 | void setDecayType(G4int type); 61 | 62 | void setIsoSourceType(G4int iso); 63 | 64 | G4bool neutronSource() { 65 | return true; 66 | } 67 | G4double neutronPerEvent(); 68 | 69 | private: 70 | G4int DecayIsotope; 71 | G4int DecayType; 72 | 73 | G4int cf252ndist; 74 | G4int cf252neng; 75 | 76 | G4double list; 77 | }; 78 | 79 | #endif /* NMSSFSingleIsoDecaySource_h */ 80 | -------------------------------------------------------------------------------- /NMSMaterialDecay/include/fissionEventData.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * ONMS - Open Neutron Multiplicity Simulation 3 | * 4 | * 5 | * Copyright (C) 2013-2016 Moritz Kütt 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | * 20 | * Contact: moritz@nuclearfreesoftware.org 21 | */ 22 | 23 | #ifndef FISSIONEVENTDATA_H 24 | #define FISSIONEVENTDATA_H 1 25 | 26 | #define SP_FISSION_ISOTOPES 16 27 | #define SP_FISSION_N 11 28 | #define SP_FISSION_NUBAR_ISOTOPES 18 29 | 30 | class fissionEventData 31 | { 32 | public: 33 | fissionEventData(); 34 | virtual ~fissionEventData(); 35 | 36 | static int sfDataIndex(int isotope, int Cf252option = 0); 37 | static double fissionEventNu(int isotope, int n, int Cf252option = 0); 38 | static double getSfNubar(int isotope, int Cf252option = 0); 39 | 40 | private: 41 | static double sfnu[SP_FISSION_ISOTOPES][SP_FISSION_N]; 42 | 43 | static int spzaid[SP_FISSION_NUBAR_ISOTOPES]; 44 | static double spnubar[SP_FISSION_NUBAR_ISOTOPES]; 45 | }; 46 | 47 | 48 | #endif /* FISSIONEVENTDATA_H */ 49 | -------------------------------------------------------------------------------- /NMSMaterialDecay/src/NMSAlphaNSet.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * ONMS - Open Neutron Multiplicity Simulation 3 | * 4 | * 5 | * Copyright (C) 2013-2016 Moritz Kütt 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | * 20 | * Contact: moritz@nuclearfreesoftware.org 21 | */ 22 | 23 | 24 | #include "NMSAlphaNSet.hh" 25 | 26 | NMSAlphaNSet::NMSAlphaNSet() : std::vector() { 27 | 28 | } 29 | 30 | NMSAlphaNSet::~NMSAlphaNSet() { 31 | 32 | } 33 | 34 | void NMSAlphaNSet::saveToFile(G4String filename) { 35 | std::ofstream outfile; 36 | outfile.open(filename.c_str()); 37 | for(int i = 0; i < this->size(); i++) { 38 | // add two threevectors position and alphaDirection 39 | outfile << std::setprecision(15) 40 | << this->std::vector::operator[](i).position.x() << "," 41 | << this->std::vector::operator[](i).position.y() << "," 42 | << this->std::vector::operator[](i).position.z() << "," 43 | << this->std::vector::operator[](i).alphaDirection.x() << "," 44 | << this->std::vector::operator[](i).alphaDirection.y() << "," 45 | << this->std::vector::operator[](i).alphaDirection.z() << "," 46 | << this->std::vector::operator[](i).energy << "," 47 | << this->std::vector::operator[](i).time << std::endl; 48 | } 49 | outfile.close(); 50 | 51 | } 52 | 53 | void NMSAlphaNSet::loadFromFile(G4String filename) { 54 | std::ifstream input; 55 | G4String test; 56 | G4String fieldstr; 57 | G4double value; 58 | NMSAlphaNReaction tempreaction; 59 | 60 | if(file_exists(filename)) { 61 | this->clear(); 62 | 63 | input.open(filename.c_str()); 64 | while ( input.good() ) { 65 | getline(input, test); 66 | // input >> test; 67 | if(test.length() > 0) { 68 | std::istringstream iss( test ); 69 | getline(iss, fieldstr, ','); 70 | std::istringstream( fieldstr ) >> value; 71 | tempreaction.position.setX(value * cm); 72 | getline(iss, fieldstr, ','); 73 | std::istringstream( fieldstr ) >> value; 74 | tempreaction.position.setY(value * cm); 75 | getline(iss, fieldstr, ','); 76 | std::istringstream( fieldstr ) >> value; 77 | tempreaction.position.setZ(value * cm); 78 | getline(iss, fieldstr, ','); 79 | std::istringstream( fieldstr ) >> value; 80 | tempreaction.alphaDirection.setX(value); 81 | getline(iss, fieldstr, ','); 82 | std::istringstream( fieldstr ) >> value; 83 | tempreaction.alphaDirection.setY(value); 84 | getline(iss, fieldstr, ','); 85 | std::istringstream( fieldstr ) >> value; 86 | tempreaction.alphaDirection.setZ(value); 87 | getline(iss, fieldstr, ','); 88 | std::istringstream( fieldstr ) >> value; 89 | tempreaction.energy = value * MeV; 90 | getline(iss, fieldstr, ','); 91 | std::istringstream( fieldstr ) >> value; 92 | tempreaction.time = value * microsecond; 93 | push_back(tempreaction); 94 | } 95 | } 96 | input.close(); 97 | } 98 | else { 99 | G4cout << "ERROR: could not find file " << filename << G4endl; 100 | } 101 | 102 | 103 | } 104 | -------------------------------------------------------------------------------- /NMSMaterialDecay/src/NMSNewSingleDecaySource.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * ONMS - Open Neutron Multiplicity Simulation 3 | * 4 | * 5 | * Copyright (C) 2013-2016 Moritz Kütt 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | * 20 | * Contact: moritz@nuclearfreesoftware.org 21 | */ 22 | 23 | 24 | 25 | #include "NMSNewSingleDecaySource.hh" 26 | 27 | NMSNewSingleDecaySource::NMSNewSingleDecaySource() : G4SingleParticleSource() { 28 | sourcetype = "Undefined"; 29 | verboseLevel = 0; 30 | initialized = false; 31 | } 32 | 33 | 34 | NMSNewSingleDecaySource::NMSNewSingleDecaySource(G4String st) : G4SingleParticleSource(){ 35 | sourcetype = st; 36 | verboseLevel = 0; 37 | initialized = false; 38 | } 39 | 40 | NMSNewSingleDecaySource::~NMSNewSingleDecaySource() { 41 | 42 | } 43 | 44 | void NMSNewSingleDecaySource::SetVerboseLevel(G4int vl) { 45 | verboseLevel = vl; 46 | } 47 | 48 | G4PrimaryVertex * NMSNewSingleDecaySource::getNewGeneralVertex() { 49 | G4ThreeVector sourcePosition = GetPosDist()->GenerateOne(); 50 | 51 | if(verboseLevel >= 2) { 52 | G4cout << "New Source Event" << G4endl; 53 | G4cout << "Time: " << GetParticleTime() / second << G4endl; 54 | G4cout << "Position: " << sourcePosition / cm << G4endl; 55 | G4cout << "Position Distribution Type: " << GetPosDist()->GetPosDisType() << G4endl; 56 | } 57 | 58 | return new G4PrimaryVertex(sourcePosition, GetParticleTime()); 59 | 60 | } 61 | -------------------------------------------------------------------------------- /NMSMaterialDecay/src/NMSPrimaryUserInformation.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * ONMS - Open Neutron Multiplicity Simulation 3 | * 4 | * 5 | * Copyright (C) 2013-2016 Moritz Kütt 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | * 20 | * Contact: moritz@nuclearfreesoftware.org 21 | */ 22 | 23 | 24 | #include "NMSPrimaryUserInformation.hh" 25 | 26 | NMSPrimaryUserInformation::NMSPrimaryUserInformation() : G4VUserPrimaryParticleInformation() { 27 | 28 | } 29 | 30 | NMSPrimaryUserInformation::~NMSPrimaryUserInformation() { 31 | 32 | } 33 | 34 | void NMSPrimaryUserInformation::Print() const { 35 | 36 | } 37 | 38 | NMSOrigin NMSPrimaryUserInformation::GetOrigin() { 39 | return ori; 40 | } 41 | 42 | void NMSPrimaryUserInformation::SetOrigin(NMSOrigin newor) { 43 | ori = newor; 44 | } 45 | 46 | -------------------------------------------------------------------------------- /NMSPulsetrainAnalysis/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6 FATAL_ERROR) 2 | project(NMSPulsetrainAnalysis) 3 | 4 | find_package( PkgConfig REQUIRED) 5 | pkg_check_modules( gsl REQUIRED gsl ) 6 | 7 | include_directories(${PROJECT_SOURCE_DIR}/include) 8 | 9 | file(GLOB sources ${PROJECT_SOURCE_DIR}/src/*.cc) 10 | file(GLOB headers ${PROJECT_SOURCE_DIR}/include/*.hh) 11 | 12 | add_library(NMSPulsetrainAnalysis ${sources} ${headers}) 13 | target_link_libraries( NMSPulsetrainAnalysis ${gsl_LIBRARIES} ) 14 | 15 | add_executable (nmspa_example example/nmspa_example.cc) 16 | target_link_libraries (nmspa_example NMSPulsetrainAnalysis) 17 | 18 | install (FILES ${headers} DESTINATION include) 19 | install (TARGETS NMSPulsetrainAnalysis DESTINATION lib) 20 | install (TARGETS nmspa_example DESTINATION example ) 21 | install (FILES example/cf252_example_pulsetrain_list DESTINATION example) 22 | -------------------------------------------------------------------------------- /NMSPulsetrainAnalysis/include/NMSDetectedEvent.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * ONMS - Open Neutron Multiplicity Simulation 3 | * 4 | * 5 | * Copyright (C) 2013-2016 Moritz Kütt 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | * 20 | * Contact: moritz@nuclearfreesoftware.org 21 | */ 22 | 23 | /** \brief Class for single pulse train events 24 | * 25 | */ 26 | 27 | #ifndef NMSDetectedEvent_h 28 | #define NMSDetectedEvent_h 1 29 | 30 | #include 31 | 32 | class NMSDetectedEvent { 33 | public: 34 | NMSDetectedEvent(double et = 0, double lt = 0, int eid = 0, std::string einfo = ""); 35 | 36 | inline double getStarttime() { 37 | return eventtime - lifetime; 38 | } 39 | 40 | inline bool operator < (const NMSDetectedEvent& e) const { 41 | return (eventtime < e.eventtime); 42 | } 43 | 44 | public: 45 | double eventtime; 46 | double lifetime; 47 | int eventid; 48 | // std::string info; 49 | }; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /NMSPulsetrainAnalysis/include/NMSDetectedEventSet.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * ONMS - Open Neutron Multiplicity Simulation 3 | * 4 | * 5 | * Copyright (C) 2013-2016 Moritz Kütt 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | * 20 | * Contact: moritz@nuclearfreesoftware.org 21 | */ 22 | 23 | #ifndef NMSDetectedEventSet_h 24 | #define NMSDetectedEventSet_h 1 25 | 26 | #include 27 | #include "NMSDetectedEvent.hh" 28 | 29 | class NMSDetectedEventSet : public std::vector { 30 | public: 31 | NMSDetectedEventSet(); 32 | virtual ~NMSDetectedEventSet(); 33 | 34 | // retrieve and store 35 | 36 | }; 37 | 38 | #endif /* NMSDetectedEventSet_h */ 39 | -------------------------------------------------------------------------------- /NMSPulsetrainAnalysis/include/NMSMultiplicityMeasurementSetting.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * ONMS - Open Neutron Multiplicity Simulation 3 | * 4 | * 5 | * Copyright (C) 2013-2016 Moritz Kütt 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | * 20 | * Contact: moritz@nuclearfreesoftware.org 21 | */ 22 | 23 | #ifndef NMSMultiplicityMeasurementSetting_h 24 | #define NMSMultiplicityMeasurementSetting_h 1 25 | 26 | enum GatefractionMethod { 27 | GM_FROM_DIEAWAY, 28 | GM_FROM_LONGGATE, 29 | GM_FROM_EVENTNO, 30 | GM_FIXED 31 | }; 32 | 33 | enum DieawayMethod { 34 | DAM_FIXED, 35 | DAM_AVERAGELIFETIME 36 | }; 37 | 38 | struct NMSMultiplicityMeasurementSetting { 39 | double predelay; 40 | double gate; 41 | double adelay; 42 | 43 | int registerLength; 44 | double registerPeriod; 45 | int quantizeRegisterBuffer; 46 | bool quantizeRegister; 47 | 48 | double derandomizePeriod; 49 | int derandomizeBuffer; 50 | bool derandomize; 51 | 52 | double efficiency; 53 | DieawayMethod dm; 54 | double dieaway; 55 | double infinitegate; 56 | GatefractionMethod gm; 57 | double doublegatefraction; 58 | double triplegatefraction; 59 | 60 | double predeadtime; 61 | bool predeadtimeUpdating; 62 | double postdeadtime; 63 | bool postdeadtimeUpdating; 64 | 65 | int multiplicityLength; 66 | 67 | double measurementLength; 68 | }; 69 | 70 | #endif /* NMSMultiplicityMeasurementSetting_h */ 71 | -------------------------------------------------------------------------------- /NMSPulsetrainAnalysis/include/NMSSimpleEvent.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * ONMS - Open Neutron Multiplicity Simulation 3 | * 4 | * 5 | * Copyright (C) 2013-2016 Moritz Kütt 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | * 20 | * Contact: moritz@nuclearfreesoftware.org 21 | */ 22 | 23 | #ifndef NMSSIMPLEEVENT_H 24 | #define NMSSIMPLEEVENT_H 1 25 | 26 | struct NMSSimpleEvent { 27 | unsigned long long eventtime; 28 | unsigned long long lifetime; 29 | int eventid; 30 | 31 | bool operator < (const NMSSimpleEvent& e) const { 32 | return (eventtime < e.eventtime); 33 | } 34 | }; 35 | 36 | #endif /* NMSSIMPLEEVENT_H */ 37 | -------------------------------------------------------------------------------- /NMSPulsetrainAnalysis/src/LLResultsAllEventsBackward.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * ONMS - Open Neutron Multiplicity Simulation 3 | * 4 | * 5 | * Copyright (C) 2013-2016 Moritz Kütt 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | * 20 | * Contact: moritz@nuclearfreesoftware.org 21 | */ 22 | 23 | #include "NMSMultiplicityResult.hh" 24 | #include "NMSPulsetrainManager.hh" 25 | 26 | #include 27 | #include 28 | 29 | // Comments starting with ### give hints on intended conditionals, replaced in code by floating point equivalents 30 | 31 | NMSMultiplicityResult NMSPulsetrainManager::LLResultsAllEventsBackward() { 32 | 33 | NMSMultiplicityResult mr(mms.multiplicityLength); 34 | mr.SetSettings(mms); 35 | 36 | unsigned long long lastevent = 0; 37 | unsigned long long pd = llround(mms.predelay * 1000000); 38 | unsigned long long ad = llround(mms.adelay * 1000000); 39 | unsigned long long gate = llround(mms.gate * 1000000); 40 | 41 | // Timing of process 42 | double start; 43 | double stop; 44 | start = clock(); 45 | 46 | // No events => return empty result 47 | if( eventsprocessed.size() == 0) { 48 | return mr; 49 | } 50 | 51 | // Verbose output 52 | int verbositySteps = eventsprocessed.size() / 50; 53 | if(verbositySteps == 0) { 54 | verbositySteps = 1; 55 | } 56 | 57 | if(verboseLevel >= 1) { 58 | std::cout << "Calculating"; 59 | std::cout.flush(); 60 | } 61 | 62 | // Loop / count variables 63 | int j = 0; 64 | int shiftcount = 0; 65 | 66 | // Main Loop 67 | for(int i = 0; i < eventsprocessed.size(); i++) { 68 | if(i % verbositySteps == 0) { 69 | if(verboseLevel >= 1) { 70 | std::cout << "."; 71 | std::cout.flush(); 72 | } 73 | } 74 | 75 | // jump over predelay events 76 | // trigger 77 | // |gate |pd | 78 | // |---------------------------------|xxxxx| 79 | j = i - 1; 80 | while(j >= 0 81 | && eventsprocessed[i].eventtime - pd < eventsprocessed[j].eventtime ) { 82 | j--; 83 | } 84 | 85 | // count events in gate 86 | // trigger 87 | // |gate |pd | 88 | // |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|-----| 89 | shiftcount = 0; 90 | while(j >= 0 91 | && eventsprocessed[i].eventtime - (pd + gate) < eventsprocessed[j].eventtime ) { 92 | j--; 93 | shiftcount++; 94 | } 95 | mr.addRA(shiftcount, 1); 96 | 97 | j = i - 1; 98 | while(j >= 0 99 | && eventsprocessed[i].eventtime - ad < eventsprocessed[j].eventtime) { 100 | j--; 101 | } 102 | 103 | shiftcount = 0; 104 | while(j >= 0 105 | && eventsprocessed[i].eventtime - (ad + gate) < eventsprocessed[j].eventtime) { 106 | j--; 107 | shiftcount++; 108 | } 109 | mr.addA(shiftcount, 1); 110 | } 111 | 112 | if(verboseLevel >= 1) { 113 | std::cout << std::endl; 114 | } 115 | 116 | mr.setLastEvent(eventsprocessed.back().eventtime / 1000000.0); 117 | 118 | stop = clock(); 119 | if(verboseLevel >= 1) { 120 | std::cout << "WALL: Calculation took " << ( stop - start ) / CLOCKS_PER_SEC << " second" << std::endl; 121 | } 122 | 123 | return mr; 124 | } 125 | -------------------------------------------------------------------------------- /NMSPulsetrainAnalysis/src/LLResultsAllEventsForwardF.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * ONMS - Open Neutron Multiplicity Simulation 3 | * 4 | * 5 | * Copyright (C) 2013-2016 Moritz Kütt 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | * 20 | * Contact: moritz@nuclearfreesoftware.org 21 | */ 22 | 23 | #include "NMSMultiplicityResult.hh" 24 | #include "NMSPulsetrainManager.hh" 25 | 26 | #include 27 | 28 | NMSMultiplicityResult NMSPulsetrainManager::LLResultsAllEventsForwardF() { 29 | 30 | NMSMultiplicityResult mr(mms.multiplicityLength); 31 | mr.SetSettings(mms); 32 | 33 | unsigned long long lastevent = 0; 34 | unsigned long long pd = llround(mms.predelay * 1000000); 35 | unsigned long long ad = llround(mms.adelay * 1000000); 36 | unsigned long long gate = llround(mms.gate * 1000000); 37 | 38 | // Timing of process 39 | double start; 40 | double stop; 41 | start = clock(); 42 | 43 | // No Events => return empty result 44 | if( eventsprocessed.size() == 0) { 45 | return mr; 46 | } 47 | 48 | // Verbose output 49 | int verbositySteps = eventsprocessed.size() / 50; 50 | if(verbositySteps == 0) { 51 | verbositySteps = 1; 52 | } 53 | if(verboseLevel >= 1) { 54 | std::cout << "Calculating"; 55 | std::cout.flush(); 56 | } 57 | 58 | // Loop / count variables 59 | int j = 0; 60 | int shiftcount = 0; 61 | 62 | // Main loop 63 | for(int i = 0; i < eventsprocessed.size(); i++) { 64 | //for(int i = 0; i < 3000; i++) { 65 | if(i % verbositySteps == 0) { 66 | if(verboseLevel >= 1) { 67 | std::cout << "."; 68 | std::cout.flush(); 69 | } 70 | } 71 | 72 | // jump over predelay events 73 | shiftcount = 0; 74 | j = i + 1; 75 | while(j < eventsprocessed.size() 76 | && eventsprocessed[i].eventtime + pd > eventsprocessed[j].eventtime ) { 77 | j++; 78 | } 79 | 80 | // count events in gate 81 | while(j < eventsprocessed.size() 82 | && eventsprocessed[i].eventtime + pd + gate >= eventsprocessed[j].eventtime) { 83 | j++; 84 | // std::cout << eventsprocessed[j].eventtime << " "; 85 | shiftcount++; 86 | } 87 | // std::cout << std::endl; 88 | mr.addRA(shiftcount, 1); 89 | 90 | // jump over long delay events 91 | shiftcount = 0; 92 | j = i + 1; 93 | while(j < eventsprocessed.size() 94 | && eventsprocessed[i].eventtime + ad > eventsprocessed[j].eventtime) { 95 | j++; 96 | } 97 | 98 | // count events in gate 99 | while(j < eventsprocessed.size() 100 | && eventsprocessed[i].eventtime + ad + gate >= eventsprocessed[j].eventtime) { 101 | j++; 102 | shiftcount++; 103 | } 104 | mr.addA(shiftcount, 1); 105 | } 106 | 107 | if(verboseLevel >= 1) { 108 | std::cout << std::endl; 109 | } 110 | 111 | mr.setLastEvent(eventsprocessed.back().eventtime); 112 | 113 | stop = clock(); 114 | if(verboseLevel >= 1) { 115 | std::cout << "WALL: Calculation took " << ( stop - start ) / CLOCKS_PER_SEC << " second" << std::endl; 116 | } 117 | 118 | return mr; 119 | } 120 | -------------------------------------------------------------------------------- /NMSPulsetrainAnalysis/src/LLResultsSingleEventBackward.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * ONMS - Open Neutron Multiplicity Simulation 3 | * 4 | * 5 | * Copyright (C) 2013-2016 Moritz Kütt 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | * 20 | * Contact: moritz@nuclearfreesoftware.org 21 | */ 22 | 23 | #include "NMSMultiplicityResult.hh" 24 | #include "NMSPulsetrainManager.hh" 25 | 26 | #include 27 | #include 28 | 29 | NMSMultiplicityResult NMSPulsetrainManager::LLResultsSingleEventBackward(bool infinitegate) { 30 | 31 | NMSMultiplicityResult gateResult(mms.multiplicityLength); 32 | gateResult.SetSettings(mms); 33 | NMSMultiplicityResult noGateResult(mms.multiplicityLength); 34 | noGateResult.SetSettings(mms); 35 | 36 | unsigned long long lastevent = 0; 37 | unsigned long long pd = llround(mms.predelay * 1000000); 38 | unsigned long long gate = llround(mms.gate * 1000000); 39 | unsigned long long ad = llround(mms.adelay * 1000000); 40 | 41 | // No Events => return empty result 42 | if( eventsprocessed.size() == 0) { 43 | return gateResult; 44 | } 45 | 46 | // Map pulsetrain by event groups 47 | std::cout << "Mapping" << std::endl; 48 | std::map eventmap; 49 | std::vector< std::vector< int > > eventgroups; 50 | std::vector< int > eventidx; 51 | for(size_t i = 0; i < eventsprocessed.size(); i++ ) { 52 | if ( eventmap.find(eventsprocessed[i].eventid) == eventmap.end() ) { 53 | eventmap[eventsprocessed[i].eventid] = eventgroups.size(); 54 | eventidx.clear(); 55 | eventidx.push_back(i); 56 | eventgroups.push_back(eventidx); 57 | } else { 58 | eventgroups[eventmap[eventsprocessed[i].eventid]].push_back(i); 59 | } 60 | } 61 | 62 | // Calculate results 63 | for(size_t i = 0; i < eventgroups.size(); i++) { 64 | // First event always has no predecessors 65 | gateResult.addRA(0); 66 | noGateResult.addRA(0); 67 | for(size_t j = 1; j < eventgroups[i].size(); j++ ) { 68 | size_t k = j - 1; 69 | size_t jidx = eventgroups[i][j]; 70 | size_t kidx = eventgroups[i][k]; 71 | 72 | // Jump over Predelay 73 | int pcount = 0; 74 | while(k >= 0 75 | && eventsprocessed[kidx].eventtime > eventsprocessed[jidx].eventtime - pd) { 76 | k--; kidx = eventgroups[i][k]; 77 | pcount++; 78 | } 79 | 80 | // Gate 81 | int gcount = 0; 82 | while(k >= 0 83 | && eventsprocessed[kidx].eventtime > eventsprocessed[jidx].eventtime - (pd + gate)) { 84 | k--; kidx = eventgroups[i][k]; 85 | gcount++; 86 | } 87 | 88 | size_t remainingevents = eventgroups[i].size() - (pcount + gcount); 89 | if(gcount < mms.multiplicityLength) { 90 | gateResult.addRA(gcount); 91 | } 92 | else { 93 | std::cout << "Gate has " << gcount << " events, that is more than the length of the virtual shift register" << std::endl; 94 | } 95 | if(remainingevents + gcount < mms.multiplicityLength) { 96 | noGateResult.addRA(remainingevents + gcount + pcount); 97 | } 98 | else { 99 | std::cout << "'Infinite' Gate has " << remainingevents + gcount + pcount<< " events, that is more than the length of the virtual shift register" << std::endl; 100 | } 101 | } 102 | } 103 | 104 | if(infinitegate) { 105 | return noGateResult; 106 | } 107 | else { 108 | return gateResult; 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /NMSPulsetrainAnalysis/src/LLResultsSingleEventForward.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * ONMS - Open Neutron Multiplicity Simulation 3 | * 4 | * 5 | * Copyright (C) 2013-2016 Moritz Kütt 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | * 20 | * Contact: moritz@nuclearfreesoftware.org 21 | */ 22 | 23 | #include "NMSMultiplicityResult.hh" 24 | #include "NMSPulsetrainManager.hh" 25 | 26 | #include 27 | #include 28 | 29 | NMSMultiplicityResult NMSPulsetrainManager::LLResultsSingleEventForward(bool infinitegate) { 30 | 31 | NMSMultiplicityResult gateResult(mms.multiplicityLength); 32 | gateResult.SetSettings(mms); 33 | NMSMultiplicityResult noGateResult(mms.multiplicityLength); 34 | noGateResult.SetSettings(mms); 35 | 36 | unsigned long long lastevent = 0; 37 | unsigned long long pd = llround(mms.predelay * 1000000); 38 | unsigned long long gate = llround(mms.gate * 1000000); 39 | unsigned long long ad = llround(mms.adelay * 1000000); 40 | 41 | // No Events => return empty result 42 | if( eventsprocessed.size() == 0) { 43 | return gateResult; 44 | } 45 | 46 | // Map pulsetrain by event groups 47 | std::map eventmap; 48 | std::vector< std::vector< int > > eventgroups; 49 | std::vector< int > eventidx; 50 | for(size_t i = 0; i < eventsprocessed.size(); i++ ) { 51 | if ( eventmap.find(eventsprocessed[i].eventid) == eventmap.end() ) { 52 | eventmap[eventsprocessed[i].eventid] = eventgroups.size(); 53 | eventidx.clear(); 54 | eventidx.push_back(i); 55 | eventgroups.push_back(eventidx); 56 | } else { 57 | eventgroups[eventmap[eventsprocessed[i].eventid]].push_back(i); 58 | } 59 | } 60 | 61 | // Calculate results 62 | for(size_t i = 0; i < eventgroups.size(); i++) { 63 | for(size_t j = 0; j < eventgroups[i].size(); j++ ) { 64 | size_t k = j + 1; 65 | size_t jidx = eventgroups[i][j]; 66 | size_t kidx = eventgroups[i][k]; 67 | 68 | // Predelay 69 | int pcount = 0; 70 | while(k < eventgroups[i].size() 71 | && eventsprocessed[kidx].eventtime < eventsprocessed[jidx].eventtime + pd) { 72 | k++; kidx = eventgroups[i][k]; 73 | pcount++; 74 | } 75 | 76 | // Gate 77 | int gcount = 0; 78 | while(k < eventgroups[i].size() 79 | && eventsprocessed[kidx].eventtime < eventsprocessed[jidx].eventtime + pd + gate) { 80 | k++; kidx = eventgroups[i][k]; 81 | gcount++; 82 | } 83 | 84 | size_t remainingevents = eventgroups[i].size() - k; 85 | if(gcount < mms.multiplicityLength) { 86 | gateResult.addRA(gcount); 87 | } 88 | else { 89 | std::cout << "Gate has " << gcount << " events, that is more than the length of the virtual shift register" << std::endl; 90 | } 91 | if(remainingevents + gcount < mms.multiplicityLength) { 92 | noGateResult.addRA(remainingevents + gcount + pcount); 93 | } 94 | else { 95 | std::cout << "'Infinite' Gate has " << remainingevents + gcount + pcount<< " events, that is more than the length of the virtual shift register" << std::endl; 96 | } 97 | } 98 | } 99 | 100 | if(infinitegate) { 101 | return noGateResult; 102 | } 103 | else { 104 | return gateResult; 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /NMSPulsetrainAnalysis/src/NMSDetectedEvent.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * ONMS - Open Neutron Multiplicity Simulation 3 | * 4 | * 5 | * Copyright (C) 2013-2016 Moritz Kütt 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | * 20 | * Contact: moritz@nuclearfreesoftware.org 21 | */ 22 | 23 | #include "NMSDetectedEvent.hh" 24 | 25 | NMSDetectedEvent::NMSDetectedEvent(double et, double lt, int eid, std::string einfo) : eventtime(et), lifetime(lt), eventid(eid) { 26 | // info = einfo; 27 | } 28 | -------------------------------------------------------------------------------- /NMSPulsetrainAnalysis/src/NMSDetectedEventSet.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * ONMS - Open Neutron Multiplicity Simulation 3 | * 4 | * 5 | * Copyright (C) 2013-2016 Moritz Kütt 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | * 20 | * Contact: moritz@nuclearfreesoftware.org 21 | */ 22 | 23 | #include "NMSDetectedEventSet.hh" 24 | 25 | NMSDetectedEventSet::NMSDetectedEventSet() { 26 | } 27 | 28 | NMSDetectedEventSet::~NMSDetectedEventSet() { 29 | 30 | } 31 | -------------------------------------------------------------------------------- /NMSPulsetrainAnalysis/src/ResultsAllTimeSteps.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * ONMS - Open Neutron Multiplicity Simulation 3 | * 4 | * 5 | * Copyright (C) 2013-2016 Moritz Kütt 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | * 20 | * Contact: moritz@nuclearfreesoftware.org 21 | */ 22 | 23 | #include "NMSMultiplicityResult.hh" 24 | #include "NMSPulsetrainManager.hh" 25 | 26 | #include 27 | #include 28 | 29 | // Comments starting with ### give hints on intended conditionals, replaced in code by floating point equivalents 30 | 31 | NMSMultiplicityResult NMSPulsetrainManager::ResultsAllTimeSteps() { 32 | 33 | NMSMultiplicityResult mr(mms.registerLength); 34 | mr.SetSettings(mms); 35 | 36 | double lastevent = 0; 37 | std::queue predelayqueue; 38 | std::queue longdelayqueue; 39 | std::queue shiftregister; 40 | int onshiftregister = 0; 41 | 42 | 43 | for (int i = 0; i < mms.registerLength; i++) { 44 | shiftregister.push(0); 45 | } 46 | while(!predelayqueue.empty()) { 47 | predelayqueue.pop(); 48 | } 49 | if( processedevents.size() == 0) { 50 | return mr; 51 | } 52 | 53 | double epsilon = mms.registerPeriod / 100; 54 | double oldt = 0; 55 | int i = 0; 56 | double t = 0; 57 | for(int j = 0; j <= (processedevents.back()/mms.registerPeriod); j+=1) { 58 | t = j * mms.registerPeriod; 59 | if(processedevents[i] >= oldt && processedevents[i] <= t) { 60 | 61 | // mr.addRA(onshiftregister,1); 62 | } 63 | 64 | // if (((t - processedevents[i]) < epsilon) && ((t - processedevents[i]) > -epsilon)){ 65 | // mr.addRA(onshiftregister, 1); 66 | // predelayqueue.push(t + predelay); 67 | // i++; 68 | // } 69 | 70 | if(shiftregister.front()) { 71 | onshiftregister--; 72 | } 73 | shiftregister.pop(); 74 | 75 | // if (((t - predelayqueue.front()) < epsilon) && ((t - predelayqueue.front()) > -epsilon)){ 76 | // t >= predelayqueue.front() 77 | if (!predelayqueue.empty() && ((t - predelayqueue.front()) > -epsilon)) { 78 | predelayqueue.pop(); 79 | shiftregister.push(1); 80 | onshiftregister++; 81 | } 82 | else { 83 | shiftregister.push(0); 84 | } 85 | 86 | if(!longdelayqueue.empty() && ((t - longdelayqueue.front()) > -epsilon)) { 87 | mr.addA(onshiftregister,1 ); 88 | longdelayqueue.pop(); 89 | } 90 | 91 | if (((t - processedevents[i]) < epsilon) && ((t - processedevents[i]) > -epsilon)){ 92 | mr.addRA(onshiftregister, 1); 93 | predelayqueue.push(t + mms.predelay); 94 | longdelayqueue.push(t + mms.adelay); 95 | i++; 96 | } 97 | 98 | /* // ### (processedevents[i] + predelay) < t 99 | if((t - (processedevents[i] + predelay)) > epsilon) { 100 | 101 | shiftregister.push(1); 102 | onshiftregister++; 103 | 104 | // i++; 105 | } 106 | else { 107 | shiftregister.push(0); 108 | }*/ 109 | 110 | oldt = t; 111 | 112 | } 113 | // lastevent = processedevents[9999]; 114 | // cout << setprecision(14) << lastevent << " " << processedevents[9999] << std::endl; 115 | 116 | mr.setLastEvent(processedevents.back()); 117 | return mr; 118 | 119 | } 120 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### ONMS - Open Neutron Multiplicity Simulation 2 | 3 | This software allows to carry out simulations of neutron multiplicity measurements. It is based on Geant4 (version 10.2). To compile, a Geant4 installation and CMake, as well as the Boost C++ libraries is required. 4 | 5 | Further information will be added soon. 6 | 7 | ONMS includes several files that are part of the Fission Library, from the Physics Simulation Package (http://nuclear.llnl.gov/simulation/main.html) -------------------------------------------------------------------------------- /cmd.mac: -------------------------------------------------------------------------------- 1 | /control/execute testing.mac -------------------------------------------------------------------------------- /fission/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #---------------------------------------------------------------------------- 2 | # 3 | # Jerome Verbeke 4 | # 5 | # Created 07/09/2014 6 | # 7 | 8 | # Build dynamic (default) or static library 9 | set(STATIC false CACHE BOOL "build static library") 10 | # Make files for LANL 11 | # set(FORLANL false CACHE BOOL "prepare files for LANL/MCNP") 12 | # set(DIRFORLANL ${CMAKE_SOURCE_DIR}/../private/src_forlanl) 13 | # set(CCFILEFORLANL ${DIRFORLANL}/LLNLFission.cc) 14 | # set(FORTRANFILEFORLANL ${DIRFORLANL}/freya.F90) 15 | # Custom "lint" build 16 | set(LINT false CACHE BOOL "lint build of library") 17 | # Apply copyright 18 | set(COPYRIGHT false CACHE BOOL "add copyright notices to files") 19 | set(COPYRIGHTFILE "COPYRIGHT.TXT") 20 | set(FORTCOPYRIGHTFILE "COPYRIGHT_FORTRAN.TXT") 21 | set(FREYACOPYRIGHTFILE "COPYRIGHT_FREYA.TXT") 22 | # Where to put the files with copyright notices 23 | # set(COPYRIGHT_DESTINATION_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}) 24 | # set(COPYRIGHT_DESTINATION_SRC_DIR ${CMAKE_CURRENT_BINARY_DIR}) 25 | set(COPYRIGHT_DESTINATION_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/include) 26 | set(COPYRIGHT_DESTINATION_SRC_DIR ${CMAKE_SOURCE_DIR}) 27 | 28 | # Setup the project 29 | cmake_minimum_required(VERSION 2.6 FATAL_ERROR) 30 | 31 | # Check if we have a fortran compiler 32 | find_program(FORT NAMES $ENV{FC} 33 | gfortran 34 | ifort) 35 | if(NOT FORT) 36 | project(Fission C CXX) 37 | message(STATUS 38 | "No Fortran compiler found: FREYA is not included") 39 | else() 40 | project(Fission C CXX Fortran) 41 | message(STATUS 42 | "Fortran compiler found: FREYA is included") 43 | # only build FREYA if FORTRAN compiler is found 44 | add_definitions(-DFREYA) 45 | endif() 46 | 47 | # Locate source and headers for this project 48 | include_directories(${PROJECT_SOURCE_DIR}/include) 49 | file(GLOB CSRC ${PROJECT_SOURCE_DIR}/src/*.cc) 50 | if(NOT FORT) 51 | list(REMOVE_ITEM CSRC ${PROJECT_SOURCE_DIR}/src/SmpFreya.cc) 52 | else() 53 | file(GLOB FSRC ${PROJECT_SOURCE_DIR}/src/*.F90) 54 | endif() 55 | 56 | #---------------------------------------------------------------------------- 57 | # Project-specific compiler flags 58 | add_definitions(-DLLNLBUILD) 59 | 60 | #---------------------------------------------------------------------------- 61 | # Build static or dynamic (default) library 62 | # 63 | if(STATIC) 64 | add_library(Fission STATIC ${CSRC} ${FSRC} ${HEADERS}) 65 | message(STATUS "Build static library") 66 | else() 67 | add_library(Fission SHARED ${CSRC} ${FSRC} ${HEADERS}) 68 | message(STATUS "Build dynamic library") 69 | endif() 70 | 71 | #---------------------------------------------------------------------------- 72 | # Install the library to 'lib' directory 73 | # 74 | install(TARGETS Fission DESTINATION lib) 75 | 76 | #---------------------------------------------------------------------------- 77 | # Add custom "lint" build 78 | # 79 | if(LINT) 80 | set (CMAKE_CXX_FLAGS "-Wall -Werror") 81 | if(FORT AND CMAKE_Fortran_COMPILER) 82 | get_filename_component(Fortran_COMPILER_NAME ${CMAKE_Fortran_COMPILER} NAME) 83 | if (${Fortran_COMPILER_NAME} MATCHES "gfortran.*") 84 | set (CMAKE_Fortran_FLAGS "-Wall -Werror -DWRITEL6 -DWRITEL8 -DWRITEL9 -Wno-character-truncation") 85 | message(STATUS "FORTRAN compiler is gfortran, adding full 'lint' flags") 86 | else() 87 | set (CMAKE_Fortran_FLAGS "-Wall -Werror -DWRITEL6 -DWRITEL8 -DWRITEL9") 88 | message(STATUS "FORTRAN compiler is not gfortran, 'lint' flags partially added") 89 | endif() 90 | endif() 91 | endif() 92 | 93 | INCLUDE(src/copyright.cmake) 94 | -------------------------------------------------------------------------------- /fission/changes: -------------------------------------------------------------------------------- 1 | Moved CMakeLists.txt to this directory (from src) -------------------------------------------------------------------------------- /fission/include/Fission.hh: -------------------------------------------------------------------------------- 1 | Fission.h -------------------------------------------------------------------------------- /fission/include/Fission.inc: -------------------------------------------------------------------------------- 1 | ! Copyright (c) 2006-2015 Lawrence Livermore National Security, LLC. 2 | ! Produced at the Lawrence Livermore National Laboratory 3 | ! UCRL-CODE-224807. 4 | ! 5 | ! All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | ! 7 | ! o Redistributions of source code must retain the above copyright notice, this list of conditions and the disclaimer below. 8 | ! 9 | ! o Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the disclaimer (as noted below) in the documentation and/or other materials provided with the distribution. 10 | ! 11 | ! o Neither the name of the LLNS/LLNL nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 12 | ! 13 | ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY, LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 14 | ! Additional BSD Notice 15 | ! 16 | ! 1. This notice is required to be provided under our contract with the U.S. Department of Energy (DOE). This work was produced at Lawrence Livermore National Laboratory under Contract No. DE-AC52-07NA27344 with the DOE. 17 | ! 18 | ! 2. Neither the United States Government nor Lawrence Livermore National Security, LLC nor any of their employees, makes any warranty, express or implied, or assumes any liability or responsibility for the accuracy, completeness, or usefulness of any information, apparatus, product, or process disclosed, or represents that its use would not infringe privately-owned rights. 19 | ! 20 | ! 3. Also, reference herein to any specific commercial products, process, or services by trade name, trademark, manufacturer or otherwise does not necessarily constitute or imply its endorsement, recommendation, or favoring by the United States Government or Lawrence Livermore National Security, LLC. The views and opinions of authors expressed herein do not necessarily state or reflect those of the United States Government or Lawrence Livermore National Security, LLC, and shall not be used for advertising or product endorsement purposes. 21 | 22 | 23 | external genspfissevt 24 | external genfissevt 25 | external genphotofissevt 26 | external getnnu, getpnu 27 | external getneng, getpeng 28 | external getnvel, getpvel 29 | external getnage, getpage 30 | external getndircosu, getndircosv, getndircosw 31 | external getpdircosu, getpdircosv, getpdircosw 32 | external setdelay, setcorrel, setnudist, setcf252 33 | external setrngf, setrngd 34 | 35 | integer getnnu, getpnu 36 | double precision getneng, getpeng 37 | double precision getnvel, getpvel 38 | double precision getnage, getpage 39 | double precision getndircosu, getndircosv, getndircosw 40 | double precision getpdircosu, getpdircosv, getpdircosw 41 | double precision getnsepeng 42 | 43 | 44 | -------------------------------------------------------------------------------- /fission/src/COPYRIGHT.TXT: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2006-2015 Lawrence Livermore National Security, LLC. 3 | Produced at the Lawrence Livermore National Laboratory 4 | UCRL-CODE-224807. 5 | 6 | All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 7 | 8 | o Redistributions of source code must retain the above copyright notice, this list of conditions and the disclaimer below. 9 | 10 | o Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the disclaimer (as noted below) in the documentation and/or other materials provided with the distribution. 11 | 12 | o Neither the name of the LLNS/LLNL nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY, LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | Additional BSD Notice 16 | 17 | 1. This notice is required to be provided under our contract with the U.S. Department of Energy (DOE). This work was produced at Lawrence Livermore National Laboratory under Contract No. DE-AC52-07NA27344 with the DOE. 18 | 19 | 2. Neither the United States Government nor Lawrence Livermore National Security, LLC nor any of their employees, makes any warranty, express or implied, or assumes any liability or responsibility for the accuracy, completeness, or usefulness of any information, apparatus, product, or process disclosed, or represents that its use would not infringe privately-owned rights. 20 | 21 | 3. Also, reference herein to any specific commercial products, process, or services by trade name, trademark, manufacturer or otherwise does not necessarily constitute or imply its endorsement, recommendation, or favoring by the United States Government or Lawrence Livermore National Security, LLC. The views and opinions of authors expressed herein do not necessarily state or reflect those of the United States Government or Lawrence Livermore National Security, LLC, and shall not be used for advertising or product endorsement purposes. 22 | */ 23 | 24 | 25 | -------------------------------------------------------------------------------- /fission/src/COPYRIGHT_FORTRAN.TXT: -------------------------------------------------------------------------------- 1 | ! Copyright (c) 2006-2015 Lawrence Livermore National Security, LLC. 2 | ! Produced at the Lawrence Livermore National Laboratory 3 | ! UCRL-CODE-224807. 4 | ! 5 | ! All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | ! 7 | ! o Redistributions of source code must retain the above copyright notice, this list of conditions and the disclaimer below. 8 | ! 9 | ! o Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the disclaimer (as noted below) in the documentation and/or other materials provided with the distribution. 10 | ! 11 | ! o Neither the name of the LLNS/LLNL nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 12 | ! 13 | ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY, LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 14 | ! Additional BSD Notice 15 | ! 16 | ! 1. This notice is required to be provided under our contract with the U.S. Department of Energy (DOE). This work was produced at Lawrence Livermore National Laboratory under Contract No. DE-AC52-07NA27344 with the DOE. 17 | ! 18 | ! 2. Neither the United States Government nor Lawrence Livermore National Security, LLC nor any of their employees, makes any warranty, express or implied, or assumes any liability or responsibility for the accuracy, completeness, or usefulness of any information, apparatus, product, or process disclosed, or represents that its use would not infringe privately-owned rights. 19 | ! 20 | ! 3. Also, reference herein to any specific commercial products, process, or services by trade name, trademark, manufacturer or otherwise does not necessarily constitute or imply its endorsement, recommendation, or favoring by the United States Government or Lawrence Livermore National Security, LLC. The views and opinions of authors expressed herein do not necessarily state or reflect those of the United States Government or Lawrence Livermore National Security, LLC, and shall not be used for advertising or product endorsement purposes. 21 | 22 | 23 | -------------------------------------------------------------------------------- /fission/src/COPYRIGHT_FREYA.TXT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nuclearfreesoftware/onms/07b5475908416f10b15adae3671fbed58a3c672c/fission/src/COPYRIGHT_FREYA.TXT -------------------------------------------------------------------------------- /fission/src/Makefile_copyright: -------------------------------------------------------------------------------- 1 | # 2 | # Apply copyright 3 | # 4 | # Put copyright text at the beginning of all source code files. 5 | # 6 | # We do not want source code with copyright checked in, so only allow this to 7 | # work on non-SVN directories. Makefile will stop user from doing this on SVN version. 8 | # 9 | # Doug Wright 10 | 11 | TEXT := COPYRIGHT.TXT 12 | TEXTFREYA := COPYRIGHT_FREYA.TXT 13 | 14 | 15 | srcC := $(wildcard ../include/*.h *.cc) 16 | srcF := $(wildcard ../include/*.inc) 17 | srcFREYA := $(wildcard *.F90) 18 | 19 | #....Add copyright text to all source code 20 | copyright: copyrightExport copyrightC copyrightF copyrightFREYA 21 | 22 | #....Only allow this to run on non-SVN directory 23 | copyrightExport: 24 | @test ! -e .svn || (echo Can not add copyright to SVN version, please do svn export first; false) 25 | 26 | #....C style comment 27 | copyrightC: $(srcC) 28 | @for file in $?; do cat $(TEXT) $$file > tmp; mv tmp $$file; done 29 | 30 | #....Fortran style comment 31 | # TEXTF = Fortran version of copyright text, i.e. with ! in first column 32 | TEXTF := $(TEXT)_FORTRAN 33 | copyrightF: $(srcF) 34 | @cat $(TEXT) | awk '{ print "! " $$0 }' > $(TEXTF) # create Fortran version of copyright text 35 | @for file in $?; do cat $(TEXTF) $$file > tmp; mv tmp $$file; done 36 | @rm $(TEXTF) 37 | 38 | #....FREYA copyright 39 | copyrightFREYA: $(srcFREYA) 40 | @for file in $?; do cat $(TEXTFREYA) $$file > tmp; mv tmp $$file; done 41 | 42 | .PHONY: copyrightExport copyrightC copyrightF copyrightFREYA 43 | -------------------------------------------------------------------------------- /fission/src/Readme: -------------------------------------------------------------------------------- 1 | # How to build the LLNL fission library 2 | # ------------------------------------- 3 | # Jerome Verbeke 4 | # 07/16/2014 5 | # 6 | # pre-requisite: gfortran 4.4.0 or higher (for interfaces, Fortran 2003) 7 | # 8 | # to use specific compiler, FC=... C=... CXX=... cmake ... 9 | 10 | 11 | # create a separate build directory for files generated by cmake system 12 | # (on LLNL can make system specific directory ${SYS_TYPE}-build) 13 | mkdir ../build 14 | cd ../build 15 | 16 | # compile options 17 | cmake ../src; make # regular build 18 | cmake -DCMAKE_BUILD_TYPE=Debug ../src; make # debug build 19 | cmake -DCMAKE_BUILD_TYPE=Release ../src; make # release build 20 | cmake -DSTATIC:BOOL=ON ../src; make # static library (default is dynamic) 21 | cmake -DLINT:BOOL=ON ../src; make VERBOSE=1 # check if code compiles (strict compilation rules) 22 | 23 | # installs library in lib 24 | make install 25 | 26 | # to apply copyright notices (within src subdirectory) 27 | cmake -DCOPYRIGHT:BOOL=ON . # apply copyright notices to all files 28 | cmake -DCOPYRIGHT:BOOL=ON -DFORLANL:BOOL=ON . # prepare files for LANL 29 | 30 | # delete CMakeCache.txt between 2 invocations of cmake. Otherwise, cmake variables 31 | # in CMakeCache.txt will be re-used. For compiler change, `rm -rf *` 32 | 33 | # How to test the library 34 | # ----------------------- 35 | cd ../regr; run_test 36 | -------------------------------------------------------------------------------- /fission/src/Recipe_mcnpx.txt: -------------------------------------------------------------------------------- 1 | Recipe for linking latest fission library with MCNPX 2 | Jerome Verbeke, LLNL 6-20-2013 3 | 4 | 1. replace files 5 | LLNLFission.cc 6 | fissionEvent.h 7 | and add 8 | freya.f90 9 | in directory src/mcnpx/mcnpc (done by install script on LC) 10 | 11 | 2. add object freya.o to mcnpcOBJS 12 | mcnpcOBJS = mcnpc/mcnpc.o mcnpc/LLNLFission.o mcnpc/freya.o 13 | in file src/mcnpx/Makefile (and src/mcnpx/Makefile.in if already generated) 14 | 15 | 3. add rule 16 | %.o : %.f90 17 | ${FCOMP} ${F90FLAGS} ${FPPFLAGS} ${FFLAGS} ${FDEFS} ${FCOMPILEONLY} ${FOUTPUT} ${FINPUT} 18 | to file src/mcnpx/Makefile (and src/mcnpx/Makefile.in if already created) 19 | 20 | 4. add line 21 | F90FLAGS = -cpp 22 | to file src/mcnpx/Makefile.h 23 | 24 | 5. in file src/mcnpx/mcnpf/imcn.F, after comment 'im7b 11', add line 25 | external setcorrel 26 | 27 | 6. in file src/mcnpx/mcnpf/imcn.F, after comment 'im7c 17', add line 28 | call setcorrel(3) 29 | 30 | 7. in file src/mcnpx/mcnpf/msgtsk.F, after comment 'mh7b 12', add line 31 | external setcorrel 32 | 33 | 8. in file src/mcnpx/mcnpf/msgtsk.F, after comment 'mh7c 10', add line 34 | call setcorrel(3) 35 | 36 | 9. in file src/mcnpx/mcnpf/acedel.F, after comment 'zdxc 7', add lines 37 | if( ifisnu==5) then 38 | tn = acenu(jxs(2,iex)) 39 | ip = nxs(2,iex) 40 | tm = tme/1.0d8 41 | 90 call genfissevt(ip,tm,tn,erg) 42 | if (getnnu().eq.0) goto 90 43 | endif 44 | 45 | 10. in file src/mcnpx/mcnpf/acedel.F, after comment '!zd7c 52', remove lines 46 | colout(1,i) = getneng(i-1) !/*zd7c 53*/ 47 | colout(2,i) = getndircosu(i-1) !/*zd7c 54*/ 48 | td = 1.0d8*getnage(i-1)-tme !/*zd7c 55*/ 49 | and add lines 50 | if(jq.eq.2) then 51 | k= 1+floor(abs(rang()-vsmall)*getnnu()) 52 | else 53 | k= i 54 | endif 55 | colout(1,i) = getneng(k-1) 56 | colout(2,i) = getndircosu(k-1) 57 | td = 1.0d8*(getnage(k-1)-tm) 58 | 59 | NB: 60 | steps 5-8: These steps are UNIX specific, more lines (4 lines per step) are necessary for non-UNIX platforms 61 | steps 9-10: These steps are not related to the FREYA build, they fix the following bug: 62 | "kcode does not work when the LLNL fission library is in use." 63 | -------------------------------------------------------------------------------- /fission/src/SmpFreya.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nuclearfreesoftware/onms/07b5475908416f10b15adae3671fbed58a3c672c/fission/src/SmpFreya.cc -------------------------------------------------------------------------------- /fission/src/SmpIsoDir.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2006-2015 Lawrence Livermore National Security, LLC. 3 | Produced at the Lawrence Livermore National Laboratory 4 | UCRL-CODE-224807. 5 | 6 | All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 7 | 8 | o Redistributions of source code must retain the above copyright notice, this list of conditions and the disclaimer below. 9 | 10 | o Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the disclaimer (as noted below) in the documentation and/or other materials provided with the distribution. 11 | 12 | o Neither the name of the LLNS/LLNL nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY, LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | Additional BSD Notice 16 | 17 | 1. This notice is required to be provided under our contract with the U.S. Department of Energy (DOE). This work was produced at Lawrence Livermore National Laboratory under Contract No. DE-AC52-07NA27344 with the DOE. 18 | 19 | 2. Neither the United States Government nor Lawrence Livermore National Security, LLC nor any of their employees, makes any warranty, express or implied, or assumes any liability or responsibility for the accuracy, completeness, or usefulness of any information, apparatus, product, or process disclosed, or represents that its use would not infringe privately-owned rights. 20 | 21 | 3. Also, reference herein to any specific commercial products, process, or services by trade name, trademark, manufacturer or otherwise does not necessarily constitute or imply its endorsement, recommendation, or favoring by the United States Government or Lawrence Livermore National Security, LLC. The views and opinions of authors expressed herein do not necessarily state or reflect those of the United States Government or Lawrence Livermore National Security, LLC, and shall not be used for advertising or product endorsement purposes. 22 | */ 23 | 24 | 25 | #include 26 | #include 27 | #include "fissionEvent.h" 28 | 29 | void fissionEvent::SmpIsoDir(double* cosdiru, double* cosdirv, double* cosdirw) { 30 | 31 | /* 32 | Description 33 | determine the 3 direction cosines of a particle emitted isotropically 34 | */ 35 | 36 | /* 37 | Input 38 | Output 39 | - 3 components of the direction cosines 40 | (cosdiru, cosdirv, cosdirw) 41 | */ 42 | 43 | double cospolang, sinpolang, phi; 44 | 45 | /* 46 | Choose emission angle isotropically. 47 | Select a polar angle direction cosine. 48 | */ 49 | cospolang = 1.-2.*fisslibrng(); 50 | sinpolang = sqrt(1.-pow(cospolang, 2.)); 51 | /* 52 | Select an azimuthal angle uniformly on (0,2*pi) 53 | */ 54 | phi = 2.*3.14159265358979323846*fisslibrng(); 55 | *cosdiru = sinpolang * cos(phi); 56 | *cosdirv = sinpolang * sin(phi); 57 | *cosdirw = cospolang; 58 | } 59 | -------------------------------------------------------------------------------- /fission/src/SmpNVel.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2006-2015 Lawrence Livermore National Security, LLC. 3 | Produced at the Lawrence Livermore National Laboratory 4 | UCRL-CODE-224807. 5 | 6 | All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 7 | 8 | o Redistributions of source code must retain the above copyright notice, this list of conditions and the disclaimer below. 9 | 10 | o Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the disclaimer (as noted below) in the documentation and/or other materials provided with the distribution. 11 | 12 | o Neither the name of the LLNS/LLNL nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY, LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | Additional BSD Notice 16 | 17 | 1. This notice is required to be provided under our contract with the U.S. Department of Energy (DOE). This work was produced at Lawrence Livermore National Laboratory under Contract No. DE-AC52-07NA27344 with the DOE. 18 | 19 | 2. Neither the United States Government nor Lawrence Livermore National Security, LLC nor any of their employees, makes any warranty, express or implied, or assumes any liability or responsibility for the accuracy, completeness, or usefulness of any information, apparatus, product, or process disclosed, or represents that its use would not infringe privately-owned rights. 20 | 21 | 3. Also, reference herein to any specific commercial products, process, or services by trade name, trademark, manufacturer or otherwise does not necessarily constitute or imply its endorsement, recommendation, or favoring by the United States Government or Lawrence Livermore National Security, LLC. The views and opinions of authors expressed herein do not necessarily state or reflect those of the United States Government or Lawrence Livermore National Security, LLC, and shall not be used for advertising or product endorsement purposes. 22 | */ 23 | 24 | 25 | #include 26 | #include 27 | #include "fissionEvent.h" 28 | 29 | double fissionEvent::SmpNVel(double eng) { 30 | 31 | /* 32 | Description 33 | Knowing the neutron energy, determine its velocity 34 | */ 35 | 36 | /* 37 | Input 38 | eng - energy of neutron 39 | Output 40 | - velocity 41 | */ 42 | 43 | const double rme = 939.56563; /* Rest Mass Energy equivalents for neutrons (MeV) */ 44 | 45 | double vel; 46 | double ratio = eng/rme; 47 | 48 | if (ratio > 1.e-8) { 49 | /* Relativistic vel calculation */ 50 | vel = SmpPVel()*sqrt(1.-rme*rme/((rme+eng)*(rme+eng))); 51 | } else { 52 | /* Non-relativistic vel calculation */ 53 | vel = SmpPVel()*sqrt(2.*eng/rme); 54 | } 55 | 56 | return vel; 57 | } 58 | -------------------------------------------------------------------------------- /fission/src/SmpPVel.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2006-2015 Lawrence Livermore National Security, LLC. 3 | Produced at the Lawrence Livermore National Laboratory 4 | UCRL-CODE-224807. 5 | 6 | All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 7 | 8 | o Redistributions of source code must retain the above copyright notice, this list of conditions and the disclaimer below. 9 | 10 | o Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the disclaimer (as noted below) in the documentation and/or other materials provided with the distribution. 11 | 12 | o Neither the name of the LLNS/LLNL nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY, LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | Additional BSD Notice 16 | 17 | 1. This notice is required to be provided under our contract with the U.S. Department of Energy (DOE). This work was produced at Lawrence Livermore National Laboratory under Contract No. DE-AC52-07NA27344 with the DOE. 18 | 19 | 2. Neither the United States Government nor Lawrence Livermore National Security, LLC nor any of their employees, makes any warranty, express or implied, or assumes any liability or responsibility for the accuracy, completeness, or usefulness of any information, apparatus, product, or process disclosed, or represents that its use would not infringe privately-owned rights. 20 | 21 | 3. Also, reference herein to any specific commercial products, process, or services by trade name, trademark, manufacturer or otherwise does not necessarily constitute or imply its endorsement, recommendation, or favoring by the United States Government or Lawrence Livermore National Security, LLC. The views and opinions of authors expressed herein do not necessarily state or reflect those of the United States Government or Lawrence Livermore National Security, LLC, and shall not be used for advertising or product endorsement purposes. 22 | */ 23 | 24 | 25 | #include 26 | #include 27 | #include "fissionEvent.h" 28 | 29 | double fissionEvent::SmpPVel() { 30 | 31 | /* 32 | Description 33 | Returns the speed of light 34 | */ 35 | 36 | /* 37 | Input 38 | Output 39 | - velocity 40 | */ 41 | 42 | const double cspeed = 2.99792458e+8; /* speed of light (m/sec) */ 43 | 44 | return cspeed; 45 | } 46 | -------------------------------------------------------------------------------- /fission/src/SmpTerrell.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2006-2015 Lawrence Livermore National Security, LLC. 3 | Produced at the Lawrence Livermore National Laboratory 4 | UCRL-CODE-224807. 5 | 6 | All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 7 | 8 | o Redistributions of source code must retain the above copyright notice, this list of conditions and the disclaimer below. 9 | 10 | o Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the disclaimer (as noted below) in the documentation and/or other materials provided with the distribution. 11 | 12 | o Neither the name of the LLNS/LLNL nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY, LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | Additional BSD Notice 16 | 17 | 1. This notice is required to be provided under our contract with the U.S. Department of Energy (DOE). This work was produced at Lawrence Livermore National Laboratory under Contract No. DE-AC52-07NA27344 with the DOE. 18 | 19 | 2. Neither the United States Government nor Lawrence Livermore National Security, LLC nor any of their employees, makes any warranty, express or implied, or assumes any liability or responsibility for the accuracy, completeness, or usefulness of any information, apparatus, product, or process disclosed, or represents that its use would not infringe privately-owned rights. 20 | 21 | 3. Also, reference herein to any specific commercial products, process, or services by trade name, trademark, manufacturer or otherwise does not necessarily constitute or imply its endorsement, recommendation, or favoring by the United States Government or Lawrence Livermore National Security, LLC. The views and opinions of authors expressed herein do not necessarily state or reflect those of the United States Government or Lawrence Livermore National Security, LLC, and shall not be used for advertising or product endorsement purposes. 22 | */ 23 | 24 | 25 | #include 26 | #include 27 | #include 28 | #include "fissionEvent.h" 29 | 30 | #define TWOPI 6.283185307 31 | #define SQRT2 1.414213562 32 | #define BSHIFT -0.43287 33 | #define WIDTH 1.079 34 | 35 | double fissionEvent::SmpTerrell(double nubar) { 36 | /* 37 | Description 38 | Sample Fission Number from Terrell's modified Gaussian distribution 39 | 40 | method uses Red Cullen's algoritm UCRL-TR-222526 41 | */ 42 | 43 | /* 44 | Input 45 | nubar - average number of neutrons per fission 46 | Output 47 | SmpTerrell - sampled multiplicity 48 | 49 | */ 50 | 51 | double width; 52 | double temp1, temp2, expo, cshift; 53 | double rw, theta, sampleg; 54 | 55 | 56 | if (nubar < WIDTH) { 57 | std::ostringstream o; 58 | o << nubar; 59 | std::string errMsg = "fission nubar out of range, nubar=" + o.str(); 60 | fissionerr(6, "SmpTerrell", errMsg); 61 | } 62 | 63 | width = SQRT2 * WIDTH; 64 | temp1 = nubar + 0.5; 65 | temp2 = temp1/width; 66 | temp2 *= temp2; 67 | expo = exp(-temp2); 68 | cshift = temp1 + BSHIFT * WIDTH * expo/(1. - expo); 69 | 70 | do { 71 | rw = sqrt(-log(fisslibrng())); 72 | theta = TWOPI * fisslibrng(); 73 | sampleg = width * rw * cos(theta) + cshift; 74 | } while (sampleg < 0.0); 75 | 76 | return floor(sampleg); 77 | } 78 | -------------------------------------------------------------------------------- /fission/src/allocateMem.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2006-2015 Lawrence Livermore National Security, LLC. 3 | Produced at the Lawrence Livermore National Laboratory 4 | UCRL-CODE-224807. 5 | 6 | All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 7 | 8 | o Redistributions of source code must retain the above copyright notice, this list of conditions and the disclaimer below. 9 | 10 | o Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the disclaimer (as noted below) in the documentation and/or other materials provided with the distribution. 11 | 12 | o Neither the name of the LLNS/LLNL nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY, LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | Additional BSD Notice 16 | 17 | 1. This notice is required to be provided under our contract with the U.S. Department of Energy (DOE). This work was produced at Lawrence Livermore National Laboratory under Contract No. DE-AC52-07NA27344 with the DOE. 18 | 19 | 2. Neither the United States Government nor Lawrence Livermore National Security, LLC nor any of their employees, makes any warranty, express or implied, or assumes any liability or responsibility for the accuracy, completeness, or usefulness of any information, apparatus, product, or process disclosed, or represents that its use would not infringe privately-owned rights. 20 | 21 | 3. Also, reference herein to any specific commercial products, process, or services by trade name, trademark, manufacturer or otherwise does not necessarily constitute or imply its endorsement, recommendation, or favoring by the United States Government or Lawrence Livermore National Security, LLC. The views and opinions of authors expressed herein do not necessarily state or reflect those of the United States Government or Lawrence Livermore National Security, LLC, and shall not be used for advertising or product endorsement purposes. 22 | */ 23 | 24 | 25 | #include "fissionEvent.h" 26 | 27 | void fissionEvent::allocateMem(int nu, int nug){ 28 | if (nu > 0) { 29 | neutronEnergies = new double[ nu ]; 30 | neutronVelocities = new double[ nu ]; 31 | neutronDircosu = new double[ nu ]; 32 | neutronDircosv = new double[ nu ]; 33 | neutronDircosw = new double[ nu ]; 34 | neutronAges = new double[ nu ]; 35 | } 36 | if (nug > 0) { 37 | photonEnergies = new double[ nug ]; 38 | photonVelocities = new double[ nug ]; 39 | photonDircosu = new double[ nug ]; 40 | photonDircosv = new double[ nug ]; 41 | photonDircosw = new double[ nug ]; 42 | photonAges = new double[ nug ]; 43 | } 44 | } 45 | 46 | -------------------------------------------------------------------------------- /fission/src/copyright.cmake: -------------------------------------------------------------------------------- 1 | #---------------------------------------------------------------------------- 2 | # 3 | # Jerome Verbeke 4 | # 5 | # Created 09/04/2014 6 | # 7 | #---------------------------------------------------------------------------- 8 | # 9 | # Apply copyright 10 | # 11 | # Put copyright text at the beginning of all source code files 12 | # 13 | # We do not want source code with copyright checked in, so only allow this to 14 | # work on non-SVN directories. cmake with stop user from doing this on SVN version. 15 | # 16 | 17 | # define mprepend function (to prepend copyright notices) 18 | function(mprepend COPYRIGHTFILE FILE_LIST) 19 | file(READ ${COPYRIGHTFILE} COPYRIGHTCONTENTS) 20 | STRING(REGEX REPLACE ";" "\\\\;" COPYRIGHTCONTENTS "${COPYRIGHTCONTENTS}") # to keep semi-colons 21 | foreach(IN_FILE ${FILE_LIST}) 22 | file(READ ${IN_FILE} CONTENTS) 23 | STRING(REGEX REPLACE ";" "\\\\;" CONTENTS "${CONTENTS}") # to keep semi-colons 24 | file(WRITE ${IN_FILE}.tmp "") 25 | file(APPEND ${IN_FILE}.tmp ${COPYRIGHTCONTENTS}) 26 | file(APPEND ${IN_FILE}.tmp ${CONTENTS}) 27 | file(RENAME ${IN_FILE}.tmp ${IN_FILE}) 28 | endforeach() 29 | endfunction() 30 | 31 | # define concat function to concatenate multiple files 32 | function(concat DESTINATION_FILE FILE_LIST) 33 | file(REMOVE ${DESTINATION_FILE}) 34 | file(WRITE ${DESTINATION_FILE} "") 35 | foreach(IN_FILE ${FILE_LIST}) 36 | file(READ ${IN_FILE} CONTENTS) 37 | STRING(REGEX REPLACE ";" "\\\\;" CONTENTS "${CONTENTS}") # to keep semi-colons 38 | file(APPEND ${DESTINATION_FILE} ${CONTENTS}) 39 | endforeach() 40 | endfunction() 41 | 42 | # define mprepend_copyright function to copy file and prepend copyright 43 | function(mprepend_copyright SRC_FILE_DIR EXTENSION 44 | COPYRIGHTFILE COPYRIGHT_DESTINATION_DIR) 45 | file(GLOB FILE_LIST "${SRC_FILE_DIR}/${EXTENSION}") 46 | file(COPY ${FILE_LIST} DESTINATION "${COPYRIGHT_DESTINATION_DIR}") 47 | file(GLOB FILE_LIST_BINDIR "${COPYRIGHT_DESTINATION_DIR}/${EXTENSION}") 48 | mprepend(${COPYRIGHTFILE} "${FILE_LIST_BINDIR}") 49 | endfunction() 50 | 51 | # apply copyright notices 52 | if(COPYRIGHT) 53 | find_file(SVN .svn PATHS ${CMAKE_CURRENT_BINARY_DIR} 54 | ${CMAKE_SOURCE_DIR} 55 | ${CMAKE_SOURCE_DIR}/../.. 56 | NO_DEFAULT_PATH) 57 | if (NOT SVN) 58 | else() 59 | message(FATAL_ERROR "Can not add copyright to SVN version, please do svn export first") 60 | endif() 61 | 62 | mprepend_copyright("${CMAKE_SOURCE_DIR}/../include" "*.h" 63 | ${COPYRIGHTFILE} ${COPYRIGHT_DESTINATION_INCLUDE_DIR}) # c++ header files 64 | mprepend_copyright("${CMAKE_SOURCE_DIR}" "*.cc" 65 | ${COPYRIGHTFILE} ${COPYRIGHT_DESTINATION_SRC_DIR}) # c++ implementation files 66 | mprepend_copyright("${CMAKE_SOURCE_DIR}/../include" "*.inc" 67 | ${FORTCOPYRIGHTFILE} ${COPYRIGHT_DESTINATION_INCLUDE_DIR}) # Fortran include files 68 | mprepend_copyright("${CMAKE_SOURCE_DIR}" "*.F90" 69 | ${FREYACOPYRIGHTFILE} ${COPYRIGHT_DESTINATION_SRC_DIR}) # FREYA Fortran files 70 | 71 | if(FORLANL) 72 | # make code for LANL MCNP/X 73 | file(MAKE_DIRECTORY ${DIRFORLANL}) 74 | message(STATUS "source code is in directory ${DIRFORLANL}") 75 | 76 | file(GLOB CPPSRC_BINDIR ${COPYRIGHT_DESTINATION_SRC_DIR}/*.cc ) 77 | concat(${CCFILEFORLANL} "${CPPSRC_BINDIR}") 78 | 79 | file(COPY ${COPYRIGHT_DESTINATION_INCLUDE_DIR}/fissionEvent.h DESTINATION ${DIRFORLANL}) 80 | 81 | file(GLOB FREYASRC_BINDIR ${COPYRIGHT_DESTINATION_SRC_DIR}/*.F90) 82 | # modules in msFREYA_data.F90 and msFREYA_interfaces.F90 must be first (or mcnpx build fails) 83 | LIST(REMOVE_ITEM FREYASRC_BINDIR "${COPYRIGHT_DESTINATION_SRC_DIR}/msFREYA_data.F90") 84 | LIST(REMOVE_ITEM FREYASRC_BINDIR "${COPYRIGHT_DESTINATION_SRC_DIR}/msFREYA_interfaces.F90") 85 | LIST(INSERT FREYASRC_BINDIR 0 "${COPYRIGHT_DESTINATION_SRC_DIR}/msFREYA_interfaces.F90") 86 | LIST(INSERT FREYASRC_BINDIR 0 "${COPYRIGHT_DESTINATION_SRC_DIR}/msFREYA_data.F90") 87 | concat(${FORTRANFILEFORLANL} "${FREYASRC_BINDIR}") 88 | endif() 89 | endif() 90 | 91 | -------------------------------------------------------------------------------- /fission/src/fissionerr.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2006-2015 Lawrence Livermore National Security, LLC. 3 | Produced at the Lawrence Livermore National Laboratory 4 | UCRL-CODE-224807. 5 | 6 | All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 7 | 8 | o Redistributions of source code must retain the above copyright notice, this list of conditions and the disclaimer below. 9 | 10 | o Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the disclaimer (as noted below) in the documentation and/or other materials provided with the distribution. 11 | 12 | o Neither the name of the LLNS/LLNL nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY, LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | Additional BSD Notice 16 | 17 | 1. This notice is required to be provided under our contract with the U.S. Department of Energy (DOE). This work was produced at Lawrence Livermore National Laboratory under Contract No. DE-AC52-07NA27344 with the DOE. 18 | 19 | 2. Neither the United States Government nor Lawrence Livermore National Security, LLC nor any of their employees, makes any warranty, express or implied, or assumes any liability or responsibility for the accuracy, completeness, or usefulness of any information, apparatus, product, or process disclosed, or represents that its use would not infringe privately-owned rights. 20 | 21 | 3. Also, reference herein to any specific commercial products, process, or services by trade name, trademark, manufacturer or otherwise does not necessarily constitute or imply its endorsement, recommendation, or favoring by the United States Government or Lawrence Livermore National Security, LLC. The views and opinions of authors expressed herein do not necessarily state or reflect those of the United States Government or Lawrence Livermore National Security, LLC, and shall not be used for advertising or product endorsement purposes. 22 | */ 23 | 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include "fissionEvent.h" 31 | 32 | std::string itoa(const int& x); 33 | 34 | void fissionEvent::fissionerr(int iSever, std::string chSubNam, std::string chMsg) 35 | 36 | /* 37 | Description 38 | multi error handling routine 39 | */ 40 | 41 | /* 42 | Input 43 | iSever - severity code: larger number: more severe 44 | 0 : no error 45 | 1-5 : non-fatal 46 | 6- : fatal 47 | chSubNm - calling subroutine name 48 | chMsg - error message 49 | */ 50 | 51 | { 52 | int doExit; 53 | std::string ExitMsg; 54 | 55 | 56 | if (iSever <= 5) { /* warning */ 57 | doExit = 0; 58 | } 59 | else { 60 | doExit = 1; 61 | } 62 | 63 | ExitMsg = "Error in Function "+chSubNam+", Severity=" + itoa(iSever) + " : "+chMsg; 64 | 65 | std::cerr << "Fission " << ExitMsg << std::endl; 66 | if (doExit == 1) exit(iSever); 67 | 68 | return; 69 | 70 | } 71 | 72 | std::string itoa(const int& x) 73 | { 74 | std::ostringstream o; 75 | if (!(o << x)) return "ERROR"; 76 | return o.str(); 77 | } 78 | -------------------------------------------------------------------------------- /fission/src/getNubarg.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2006-2015 Lawrence Livermore National Security, LLC. 3 | Produced at the Lawrence Livermore National Laboratory 4 | UCRL-CODE-224807. 5 | 6 | All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 7 | 8 | o Redistributions of source code must retain the above copyright notice, this list of conditions and the disclaimer below. 9 | 10 | o Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the disclaimer (as noted below) in the documentation and/or other materials provided with the distribution. 11 | 12 | o Neither the name of the LLNS/LLNL nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY, LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | Additional BSD Notice 16 | 17 | 1. This notice is required to be provided under our contract with the U.S. Department of Energy (DOE). This work was produced at Lawrence Livermore National Laboratory under Contract No. DE-AC52-07NA27344 with the DOE. 18 | 19 | 2. Neither the United States Government nor Lawrence Livermore National Security, LLC nor any of their employees, makes any warranty, express or implied, or assumes any liability or responsibility for the accuracy, completeness, or usefulness of any information, apparatus, product, or process disclosed, or represents that its use would not infringe privately-owned rights. 20 | 21 | 3. Also, reference herein to any specific commercial products, process, or services by trade name, trademark, manufacturer or otherwise does not necessarily constitute or imply its endorsement, recommendation, or favoring by the United States Government or Lawrence Livermore National Security, LLC. The views and opinions of authors expressed herein do not necessarily state or reflect those of the United States Government or Lawrence Livermore National Security, LLC, and shall not be used for advertising or product endorsement purposes. 22 | */ 23 | 24 | 25 | #include 26 | #include "fissionEvent.h" 27 | 28 | double fissionEvent::getNubarg(int isotope, double nubar, double ePart, bool spontaneous) { 29 | 30 | /* 31 | Description 32 | Determine the average number of fission photons from neutron induced 33 | fission by dividing the average total energy available to prompt fission 34 | gamma-rays by the average single prompt fission gamma-ray energy 35 | (Tim Valentine's model) 36 | */ 37 | 38 | /* 39 | Input 40 | isotope - isotope 41 | nubar - average number of prompt fission neutrons per fission 42 | ePart - energy of incident neutron causing fission 43 | spontaneous - set to tru for spontaneous fissions 44 | 45 | Output 46 | getNubarg - average number of fission photons 47 | */ 48 | 49 | int A, Z; 50 | double nubarg; 51 | 52 | A = (int) (isotope-1000*((int)(isotope/1000))); 53 | Z = (int) ((isotope-A)/1000); 54 | nubarg = getTotEngP(ePart, nubar, isotope, A, Z, spontaneous)/(-1.33+119.6*pow((double)Z,1./3.)/A); 55 | if (nubarg == 0) { 56 | std::string errMsg = "Average number of prompt fission gammas equals 0 for nuclide "; errMsg += isotope; 57 | fissionerr(6, "getNubarg", errMsg); 58 | } 59 | return nubarg; 60 | } 61 | -------------------------------------------------------------------------------- /fission/src/msFREYA_data.F90: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nuclearfreesoftware/onms/07b5475908416f10b15adae3671fbed58a3c672c/fission/src/msFREYA_data.F90 -------------------------------------------------------------------------------- /fission/src/msFREYA_error.F90: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nuclearfreesoftware/onms/07b5475908416f10b15adae3671fbed58a3c672c/fission/src/msFREYA_error.F90 -------------------------------------------------------------------------------- /fission/src/msFREYA_event.F90: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nuclearfreesoftware/onms/07b5475908416f10b15adae3671fbed58a3c672c/fission/src/msFREYA_event.F90 -------------------------------------------------------------------------------- /fission/src/msFREYA_interfaces.F90: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nuclearfreesoftware/onms/07b5475908416f10b15adae3671fbed58a3c672c/fission/src/msFREYA_interfaces.F90 -------------------------------------------------------------------------------- /fission/src/msFREYA_setup.F90: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nuclearfreesoftware/onms/07b5475908416f10b15adae3671fbed58a3c672c/fission/src/msFREYA_setup.F90 -------------------------------------------------------------------------------- /fission/src/rngc.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2006-2015 Lawrence Livermore National Security, LLC. 3 | Produced at the Lawrence Livermore National Laboratory 4 | UCRL-CODE-224807. 5 | 6 | All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 7 | 8 | o Redistributions of source code must retain the above copyright notice, this list of conditions and the disclaimer below. 9 | 10 | o Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the disclaimer (as noted below) in the documentation and/or other materials provided with the distribution. 11 | 12 | o Neither the name of the LLNS/LLNL nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY, LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | Additional BSD Notice 16 | 17 | 1. This notice is required to be provided under our contract with the U.S. Department of Energy (DOE). This work was produced at Lawrence Livermore National Laboratory under Contract No. DE-AC52-07NA27344 with the DOE. 18 | 19 | 2. Neither the United States Government nor Lawrence Livermore National Security, LLC nor any of their employees, makes any warranty, express or implied, or assumes any liability or responsibility for the accuracy, completeness, or usefulness of any information, apparatus, product, or process disclosed, or represents that its use would not infringe privately-owned rights. 20 | 21 | 3. Also, reference herein to any specific commercial products, process, or services by trade name, trademark, manufacturer or otherwise does not necessarily constitute or imply its endorsement, recommendation, or favoring by the United States Government or Lawrence Livermore National Security, LLC. The views and opinions of authors expressed herein do not necessarily state or reflect those of the United States Government or Lawrence Livermore National Security, LLC, and shall not be used for advertising or product endorsement purposes. 22 | */ 23 | 24 | 25 | #include "fissionEvent.h" 26 | 27 | double (*fissionEvent::rngdptr)(void) = 0; 28 | float (*fissionEvent::rngfptr)(void) = 0; 29 | 30 | double fissionEvent::rngf2d() { 31 | return (double) rngfptr(); 32 | } 33 | -------------------------------------------------------------------------------- /gdml/samples/ep1-c1.gdml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /gdml/samples/ep1-c2.gdml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /gdml/samples/ep1-c3b.gdml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /gdml/samples/ep1-c3s.gdml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /gdml/samples/ep1-c4b.gdml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /gdml/samples/ep1-c4s.gdml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /gdml/samples/ep3-2.gdml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /gdml/samples/ep3-c1.gdml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /gdml/samples/ep3-c3.gdml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /gdml/schema/gdml_extensions.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /include/NMSAnalysisManagerMessenger.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * ONMS - Open Neutron Multiplicity Simulation 3 | * 4 | * 5 | * Copyright (C) 2013-2016 Moritz Kütt 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | * 20 | * Contact: moritz@nuclearfreesoftware.org 21 | */ 22 | 23 | #ifndef NMSAnalysisManagerMessenger_h 24 | #define NMSAnalysisManagerMessenger_h 1 25 | 26 | #include "G4UImessenger.hh" 27 | #include "G4UIcmdWithoutParameter.hh" 28 | #include "G4UIcmdWithAString.hh" 29 | #include "G4UIcmdWithADoubleAndUnit.hh" 30 | #include "G4UIcmdWithAnInteger.hh" 31 | #include "G4UIcmdWithABool.hh" 32 | 33 | class G4UIcmdWithoutParameter; 34 | class G4UIcmdWithAString; 35 | class G4UIcmdWithADoubleAndUnit; 36 | class G4UIcmdWithAnInteger; 37 | class G4UIcmdWithABool; 38 | 39 | #include "NMSAnalysisManager.hh" 40 | class NMSAnalysisManager; 41 | 42 | class NMSAnalysisManagerMessenger : public G4UImessenger { 43 | public: 44 | NMSAnalysisManagerMessenger(NMSAnalysisManager* ); 45 | ~NMSAnalysisManagerMessenger(); 46 | 47 | void SetNewValue(G4UIcommand* cmd, G4String newval); 48 | 49 | private: 50 | NMSAnalysisManager* nmsam; 51 | 52 | G4UIdirectory* analysisDir; 53 | G4UIdirectory* ptdataDir; 54 | 55 | G4UIcmdWithAString* setDetectorVolumeCmd; 56 | G4UIcmdWithAString* setLostNeutronVolumeCmd; 57 | 58 | G4UIcmdWithoutParameter* showResultsCmd; 59 | 60 | G4UIcmdWithAString * saveSourceNeutronSpectrumToFileCmd; 61 | 62 | G4UIcmdWithAnInteger * eventOffsetCmd; 63 | 64 | G4UIcmdWithAString* writeResultsToFileCmd; 65 | G4UIcmdWithABool* exportPulsetrainCmd; 66 | G4UIcmdWithABool* exportResultsAfterRunCmd; 67 | G4UIcmdWithAString* loadPulsetrainFromFileCmd; 68 | G4UIcmdWithAString* loadPulsetrainFromShakesFileCmd; 69 | G4UIcommand* addPulsetrainFromFileCmd; 70 | G4UIcommand* splitPulsetrainCmd; 71 | G4UIcmdWithAString* savePulsetrainCmd; 72 | G4UIcmdWithoutParameter* resetPulsetrainCmd; 73 | 74 | G4UIcmdWithoutParameter* recalculateCmd; 75 | 76 | G4UIcmdWithAnInteger* setMultiplicityLengthCmd; 77 | 78 | G4UIcmdWithAnInteger* setRegisterLengthCmd; 79 | G4UIcmdWithADoubleAndUnit* setRegisterPeriodCmd; 80 | G4UIcmdWithADoubleAndUnit* setPredelayCmd; 81 | G4UIcmdWithADoubleAndUnit* setLongdelayCmd; 82 | G4UIcmdWithADoubleAndUnit* setGateCmd; 83 | 84 | G4UIcmdWithADoubleAndUnit* setDerandomizePeriodCmd; 85 | G4UIcmdWithABool* derandomizeDoCmd; 86 | G4UIcmdWithABool* registerQuantizationDoCmd; 87 | 88 | G4UIcmdWithADouble* setEfficiencyCmd; 89 | G4UIcmdWithAnInteger* dieawayMethodCmd; 90 | G4UIcmdWithADoubleAndUnit* dieawayCmd; 91 | G4UIcmdWithADoubleAndUnit* infiniteGateCmd; 92 | G4UIcmdWithAnInteger* gatefractionMethodCmd; 93 | G4UIcommand* gateFractionsCmd; 94 | 95 | G4UIcmdWithADoubleAndUnit* predeadtimeCmd; 96 | G4UIcmdWithABool* predeadtimeUpdatingCmd; 97 | G4UIcmdWithADoubleAndUnit* postdeadtimeCmd; 98 | G4UIcmdWithABool* postdeadtimeUpdatingCmd; 99 | 100 | G4UIcmdWithAnInteger * pulsetrainAnalysisModeCmd; 101 | G4UIcmdWithABool * setRuntimeFromPulsetrainCmd; 102 | 103 | G4UIcmdWithAString* setRunModeCmd; 104 | 105 | }; 106 | 107 | #endif /* NMSAnalysisManagerMessenger_h */ 108 | -------------------------------------------------------------------------------- /include/NMSDetectorConstruction.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * ONMS - Open Neutron Multiplicity Simulation 3 | * 4 | * 5 | * Copyright (C) 2013-2016 Moritz Kütt 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | * 20 | * Contact: moritz@nuclearfreesoftware.org 21 | */ 22 | 23 | #ifndef NMSDetectorConstruction_h 24 | #define NMSDetectorConstruction_h 1 25 | 26 | #include "G4VUserDetectorConstruction.hh" 27 | #include "G4PVPlacement.hh" 28 | #include "G4VisAttributes.hh" 29 | #include "G4Colour.hh" 30 | #include "G4ThreeVector.hh" 31 | #include "G4GDMLParser.hh" 32 | #include "G4SystemOfUnits.hh" 33 | #include "G4Material.hh" 34 | 35 | extern const G4String LVNAME_DETECTOR_CAVITY; 36 | extern const G4String LVNAME_SAMPLE_MOTHER; 37 | extern const G4String GDML_SAMPLE_POSITION; 38 | 39 | class G4LogicalVolume; 40 | class G4VPhysicalVolume; 41 | class G4Material; 42 | 43 | class NMSDetectorConstruction : public G4VUserDetectorConstruction { 44 | public: 45 | NMSDetectorConstruction(G4String detector, G4String sample); 46 | ~NMSDetectorConstruction(); 47 | 48 | G4VPhysicalVolume* Construct(); 49 | 50 | private: 51 | G4GDMLParser detectorparser; 52 | G4GDMLParser sampleparser; 53 | G4String detectorfilename; 54 | G4String samplefilename; 55 | G4ThreeVector sampleposition; 56 | }; 57 | 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /include/NMSEventAction.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * ONMS - Open Neutron Multiplicity Simulation 3 | * 4 | * 5 | * Copyright (C) 2013-2016 Moritz Kütt 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | * 20 | * Contact: moritz@nuclearfreesoftware.org 21 | */ 22 | 23 | #ifndef NMSEventAction_h 24 | #define NMSEventAction_h 1 25 | 26 | #include "globals.hh" 27 | #include "G4UserEventAction.hh" 28 | #include "G4Event.hh" 29 | 30 | #include "NMSPrimaryUserInformation.hh" 31 | 32 | class G4Event; 33 | 34 | class NMSEventAction : public G4UserEventAction { 35 | public: 36 | NMSEventAction(); 37 | 38 | inline virtual void BeginOfEventAction(const G4Event*); 39 | 40 | void SetPrintModulo(G4int val); 41 | 42 | private: 43 | G4int printModulo; 44 | 45 | }; 46 | 47 | inline void NMSEventAction::BeginOfEventAction(const G4Event* evt) { 48 | G4PrimaryVertex* pv = evt->GetPrimaryVertex(); 49 | for(G4int i = 0; i < pv->GetNumberOfParticle(); i++) { 50 | NMSPrimaryUserInformation* pui = (NMSPrimaryUserInformation*) pv->GetPrimary(i)->GetUserInformation(); 51 | if(pui != 0) { 52 | if(pui->GetOrigin() == ORIGIN_ALPHA_N) { 53 | G4cout << " From alpha n" << G4endl; 54 | } 55 | } 56 | } 57 | G4int nEvt = evt->GetEventID(); 58 | if(G4int(nEvt/printModulo)*printModulo == nEvt) { 59 | G4cout << "** Event # " << nEvt << " started" << G4endl; 60 | } 61 | } 62 | 63 | 64 | #endif /* NMSEventAction_h */ 65 | -------------------------------------------------------------------------------- /include/NMSHadronElasticPhysicsHP_Thermal.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * ONMS - Open Neutron Multiplicity Simulation 3 | * 4 | * 5 | * Copyright (C) 2013-2016 Moritz Kütt 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | * 20 | * Contact: moritz@nuclearfreesoftware.org 21 | */ 22 | 23 | 24 | // This file is a modification of G4HadronElasticPhysicsHP.hh of Geant4 10.2 25 | // 26 | // DERIVED CLASS 27 | 28 | #ifndef NMSHadronElasticPhysicsHP_Thermal_h 29 | #define NMSHadronElasticPhysicsHP_Thermal_h 1 30 | 31 | #include "globals.hh" 32 | #include "G4VPhysicsConstructor.hh" 33 | 34 | class G4HadronElasticPhysics; 35 | 36 | class NMSHadronElasticPhysicsHP_Thermal : public G4VPhysicsConstructor 37 | { 38 | public: 39 | 40 | NMSHadronElasticPhysicsHP_Thermal(G4int ver = 1); 41 | 42 | virtual ~NMSHadronElasticPhysicsHP_Thermal(); 43 | 44 | // This method will be invoked in the Construct() method. 45 | // each particle type will be instantiated 46 | virtual void ConstructParticle(); 47 | 48 | // This method will be invoked in the Construct() method. 49 | // each physics process will be instantiated and 50 | // registered to the process manager of each particle type 51 | virtual void ConstructProcess(); 52 | 53 | private: 54 | 55 | NMSHadronElasticPhysicsHP_Thermal(NMSHadronElasticPhysicsHP_Thermal &); 56 | NMSHadronElasticPhysicsHP_Thermal & operator=(const NMSHadronElasticPhysicsHP_Thermal &right); 57 | 58 | G4int verbose; 59 | static G4ThreadLocal G4bool wasActivated; 60 | static G4ThreadLocal G4HadronElasticPhysics* mainElasticBuilder; 61 | }; 62 | 63 | 64 | #endif 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /include/NMSPrimaryGeneratorAction.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * ONMS - Open Neutron Multiplicity Simulation 3 | * 4 | * 5 | * Copyright (C) 2013-2016 Moritz Kütt 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | * 20 | * Contact: moritz@nuclearfreesoftware.org 21 | */ 22 | 23 | #ifndef NMSPrimaryGeneratorAction_h 24 | #define NMSPrimaryGeneratorAction_h 1 25 | 26 | #include "G4VUserPrimaryGeneratorAction.hh" 27 | 28 | #include "NMSRunManager.hh" 29 | 30 | #include "Fission.hh" 31 | #include "NMSMaterialDecaySource.hh" 32 | #include "NMSPosDistribution.hh" 33 | 34 | class G4Event; 35 | 36 | class NMSPrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction 37 | { 38 | public: 39 | NMSPrimaryGeneratorAction(); 40 | ~NMSPrimaryGeneratorAction(); 41 | 42 | public: 43 | void GeneratePrimaries(G4Event* anEvent); 44 | void SetVerboseLevel(G4int level); 45 | 46 | void SetSourceMaterial(G4Material* sourceMat); 47 | void SetActivity(G4double act); 48 | G4double GetActivity() { return nmsmdSource->GetActivity(); } 49 | void SetActiveVolume(G4double vol); 50 | 51 | void SetSpontaneousFission(G4bool neutron, G4bool gamma); 52 | void SetAlphaDecay(G4bool status); 53 | void SetBetaDecay(G4bool status); 54 | void SetAlphaNSource(G4bool status); 55 | void SetAlphaNFile(G4String filename); 56 | 57 | void SetRuntime(G4double rt); 58 | G4double GetRuntime() { return nmsmdSource->GetRuntime(); } 59 | 60 | inline NMSPosDistribution* GetPosDist() { return nmsmdSource->GetPosDist(); }; 61 | inline bool GetSpontaneousFissionGamma() { return nmsmdSource->GetSpontaneousFissionGamma(); }; 62 | inline bool GetSpontaneousFissionNeutron() { return nmsmdSource->GetSpontaneousFissionNeutron(); }; 63 | 64 | private: 65 | G4int verboseLevel; 66 | 67 | NMSMaterialDecaySource* nmsmdSource; 68 | 69 | }; 70 | 71 | #endif 72 | -------------------------------------------------------------------------------- /include/NMSPrimaryGeneratorActionGPS.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * ONMS - Open Neutron Multiplicity Simulation 3 | * 4 | * 5 | * Copyright (C) 2013-2016 Moritz Kütt 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | * 20 | * Contact: moritz@nuclearfreesoftware.org 21 | */ 22 | 23 | #ifndef NMSPrimaryGeneratorActionGPS_h 24 | #define NMSPrimaryGeneratorActionGPS_h 1 25 | 26 | #include "G4VUserPrimaryGeneratorAction.hh" 27 | #include "G4GeneralParticleSource.hh" 28 | #include "G4Event.hh" 29 | 30 | class G4Event; 31 | 32 | class NMSPrimaryGeneratorActionGPS : public G4VUserPrimaryGeneratorAction { 33 | public: 34 | NMSPrimaryGeneratorActionGPS(); 35 | ~NMSPrimaryGeneratorActionGPS(); 36 | 37 | public: 38 | void GeneratePrimaries(G4Event* anEvent); 39 | 40 | private: 41 | G4GeneralParticleSource* particlesource; 42 | }; 43 | 44 | #endif /* NMSPrimaryGeneratorActionGPS_h */ 45 | 46 | -------------------------------------------------------------------------------- /include/NMSRunAction.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * ONMS - Open Neutron Multiplicity Simulation 3 | * 4 | * 5 | * Copyright (C) 2013-2016 Moritz Kütt 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | * 20 | * Contact: moritz@nuclearfreesoftware.org 21 | */ 22 | 23 | #ifndef NMSRunAction_h 24 | #define NMSRunAction_h 1 25 | 26 | #include "G4UserRunAction.hh" 27 | #include "G4Run.hh" 28 | 29 | #include "NMSAnalysisManager.hh" 30 | 31 | class NMSRunAction : public G4UserRunAction 32 | { 33 | public: 34 | 35 | virtual void BeginOfRunAction(const G4Run*); 36 | virtual void EndOfRunAction(const G4Run*); 37 | 38 | }; 39 | 40 | 41 | 42 | #endif /* NMSRunAction_h */ 43 | -------------------------------------------------------------------------------- /include/NMSRunManager.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * ONMS - Open Neutron Multiplicity Simulation 3 | * 4 | * 5 | * Copyright (C) 2013-2016 Moritz Kütt 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | * 20 | * Contact: moritz@nuclearfreesoftware.org 21 | */ 22 | 23 | #ifndef NMSRunManager_h 24 | #define NMSRunManager_h 1 25 | 26 | #include "G4RunManager.hh" 27 | 28 | #include "NMSPrimaryGeneratorAction.hh" 29 | #include "NMSEventAction.hh" 30 | 31 | #include "NMSRunManagerMessenger.hh" 32 | 33 | class NMSRunManagerMessenger; 34 | 35 | class NMSRunManager : public G4RunManager { 36 | public: 37 | NMSRunManager(); 38 | virtual ~NMSRunManager(); 39 | 40 | void SetRuntime(G4double rt); 41 | inline G4double GetRuntime() { return runtime; }; 42 | 43 | void SetPrintModulo(G4int pm); 44 | inline G4int GetPrintModulo(G4int pm); 45 | 46 | void SetCLOptions(G4bool newgps); 47 | 48 | void RunFromTime(G4double); 49 | private: 50 | NMSRunManagerMessenger* nmsrmm; 51 | G4double runtime; 52 | G4int printModulo; 53 | G4bool gps; 54 | }; 55 | 56 | 57 | #endif /* NMSRunManager_h */ 58 | -------------------------------------------------------------------------------- /include/NMSRunManagerMessenger.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * ONMS - Open Neutron Multiplicity Simulation 3 | * 4 | * 5 | * Copyright (C) 2013-2016 Moritz Kütt 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | * 20 | * Contact: moritz@nuclearfreesoftware.org 21 | */ 22 | 23 | #ifndef NMSRunManagerMessenger_h 24 | #define NMSRunManagerMessenger_h 1 25 | 26 | #include 27 | 28 | #include "G4UImessenger.hh" 29 | #include "G4UIcmdWithADoubleAndUnit.hh" 30 | #include "G4UIcmdWithAnInteger.hh" 31 | #include "G4UIcmdWithADouble.hh" 32 | 33 | #include "G4RNGHelper.hh" 34 | 35 | class G4UIcmdWithADoubleAndUnit; 36 | class G4UIcmdWithAnInteger; 37 | class G4UIcmdWithADouble; 38 | 39 | #include "NMSRunManager.hh" 40 | class NMSRunManager; 41 | 42 | 43 | class NMSRunManagerMessenger : public G4UImessenger { 44 | public: 45 | NMSRunManagerMessenger(NMSRunManager*); 46 | ~NMSRunManagerMessenger(); 47 | 48 | void SetNewValue(G4UIcommand* cmd, G4String newval); 49 | 50 | private: 51 | NMSRunManager* rm; 52 | 53 | G4UIdirectory* nmsDir; 54 | G4UIdirectory* runDir; 55 | 56 | G4UIcmdWithADoubleAndUnit* runtimeCmd; 57 | G4UIcmdWithAnInteger* printModuloCmd; 58 | G4UIcmdWithADouble* runFromTimeCmd; 59 | // alphaN??? 60 | 61 | G4UIcommand* randomSeedCmd; 62 | }; 63 | 64 | #endif /* NMSRunManagerMessenger_h */ 65 | -------------------------------------------------------------------------------- /include/NMSSteppingAction.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * ONMS - Open Neutron Multiplicity Simulation 3 | * 4 | * 5 | * Copyright (C) 2013-2016 Moritz Kütt 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | * 20 | * Contact: moritz@nuclearfreesoftware.org 21 | */ 22 | 23 | #ifndef NMSSteppingAction_H 24 | #define NMSSteppingAction_H 1 25 | 26 | #include "G4UserSteppingAction.hh" 27 | 28 | #include "NMSAnalysisManager.hh" 29 | 30 | class NMSSteppingAction : public G4UserSteppingAction 31 | { 32 | public: 33 | NMSSteppingAction(NMSAnalysisManager* newnmsam); 34 | virtual ~NMSSteppingAction(); 35 | 36 | virtual void UserSteppingAction(const G4Step*); 37 | 38 | private: 39 | NMSAnalysisManager* nmsam; 40 | }; 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /include/NMSTrackingAction.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * ONMS - Open Neutron Multiplicity Simulation 3 | * 4 | * 5 | * Copyright (C) 2013-2016 Moritz Kütt 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | * 20 | * Contact: moritz@nuclearfreesoftware.org 21 | */ 22 | 23 | #ifndef NMSTrackingAction_h 24 | #define NMSTrackingAction_h 1 25 | 26 | #include "G4UserTrackingAction.hh" 27 | #include "G4ParticleDefinition.hh" 28 | 29 | #include "NMSAnalysisManager.hh" 30 | class NMSAnalysisManager; 31 | 32 | class NMSTrackingAction : public G4UserTrackingAction { 33 | public: 34 | NMSTrackingAction(NMSAnalysisManager*); 35 | virtual ~NMSTrackingAction(); 36 | virtual void PreUserTrackingAction(const G4Track*); 37 | virtual void PostUserTrackingAction(const G4Track*); 38 | 39 | void SetRunMode(RunMode newrm = RUNMODE_HE_DETECTOR); 40 | RunMode GetRunMode() { return rm; }; 41 | 42 | private: 43 | NMSAnalysisManager* nmsam; 44 | RunMode rm; 45 | }; 46 | 47 | 48 | 49 | #endif /* NMSTrackingAction_h */ 50 | -------------------------------------------------------------------------------- /include/NMS_QGSP_BIC_HP_Thermal.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * ONMS - Open Neutron Multiplicity Simulation 3 | * 4 | * 5 | * Copyright (C) 2013-2016 Moritz Kütt 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | * 20 | * Contact: moritz@nuclearfreesoftware.org 21 | */ 22 | 23 | // File derived from QGSP_BIC_HP from Geant4 24 | 25 | #ifndef NMS_QGSP_BIC_HP_Thermal_h 26 | #define NMS_QGSP_BIC_HP_Thermal_h 1 27 | 28 | #include 29 | 30 | #include "globals.hh" 31 | #include "G4VModularPhysicsList.hh" 32 | #include "CompileTimeConstraints.hh" 33 | 34 | class NMS_QGSP_BIC_HP_Thermal: public G4VModularPhysicsList 35 | { 36 | public: 37 | NMS_QGSP_BIC_HP_Thermal(G4int ver = 1); 38 | virtual ~NMS_QGSP_BIC_HP_Thermal(); 39 | 40 | public: 41 | // SetCuts() 42 | virtual void SetCuts(); 43 | 44 | private: 45 | // enum {ok = CompileTimeConstraints::IsA::ok }; 46 | }; 47 | 48 | #endif 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /macros/ep1-c1-1000_0_0.mac: -------------------------------------------------------------------------------- 1 | # Detector Settings 2 | /NMS/analysis/detectorvolume HE1-He 3 | /NMS/analysis/lostvolume PolyethyleneArea 4 | 5 | # Source Geometry 6 | /NMS/source/geometry/type Point 7 | /NMS/source/geometry/centre 0 0 0 8 | 9 | # Source Volume & Material 10 | /NMS/source/material NMSSourceMaterial 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | # Source Type and settings 25 | /NMS/source/sfg false 26 | /NMS/source/sfn false 27 | /NMS/source/alpha false 28 | /NMS/source/neutronAlphaN true 29 | /NMS/source/activity 2680000 30 | 31 | # AlphaN Settings 32 | /NMS/source/alphan/directionSampling 0 33 | /NMS/source/alphan/energySampling 3 34 | /NMS/source/alphan/positionSampling 0 35 | # /NMS/source/alphan/energy - not given 36 | /NMS/source/alphan/energyFilename amli.alphan 37 | /NMS/source/alphan/activityCalculation 0 38 | /NMS/source/alphan/activity 1 39 | 40 | # Runtime settings 41 | /random/setSeeds 28607207 36633217 42 | /NMS/run/runtime 0.5 43 | /NMS/run/printmodulo 1000 44 | /NMS/analysis/eventoffset 0 45 | 46 | # Run 47 | /NMS/run/beamOnRuntime 1 48 | 49 | # Create some output 50 | /NMS/analysis/efficiency 0.373 51 | /NMS/source/dumpstatus 52 | /NMS/analysis/writesourceneutronenergies ep1-c1_0_0 53 | /NMS/source/alphan/writeEnergyFile ep1-c1_0_0 54 | /NMS/analysis/showresults 55 | /NMS/analysis/writeincludepulsetrain true 56 | /NMS/analysis/writeresults ep1-c1_0_0 57 | -------------------------------------------------------------------------------- /macros/ep1-c1-100_0_0.mac: -------------------------------------------------------------------------------- 1 | # Detector Settings 2 | /NMS/analysis/detectorvolume HE1-He 3 | /NMS/analysis/lostvolume PolyethyleneArea 4 | 5 | # Source Geometry 6 | /NMS/source/geometry/type Point 7 | /NMS/source/geometry/centre 0 0 0 8 | 9 | # Source Volume & Material 10 | /NMS/source/material NMSSourceMaterial 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | # Source Type and settings 25 | /NMS/source/sfg false 26 | /NMS/source/sfn false 27 | /NMS/source/alpha false 28 | /NMS/source/neutronAlphaN true 29 | /NMS/source/activity 268000 30 | 31 | # AlphaN Settings 32 | /NMS/source/alphan/directionSampling 0 33 | /NMS/source/alphan/energySampling 3 34 | /NMS/source/alphan/positionSampling 0 35 | # /NMS/source/alphan/energy - not given 36 | /NMS/source/alphan/energyFilename amli.alphan 37 | /NMS/source/alphan/activityCalculation 0 38 | /NMS/source/alphan/activity 1 39 | 40 | # Runtime settings 41 | /random/setSeeds 28607207 36633217 42 | /NMS/run/runtime 5.0 43 | /NMS/run/printmodulo 1000 44 | /NMS/analysis/eventoffset 0 45 | 46 | # Run 47 | /NMS/run/beamOnRuntime 1 48 | 49 | # Create some output 50 | /NMS/analysis/efficiency 0.373 51 | /NMS/source/dumpstatus 52 | /NMS/analysis/writesourceneutronenergies ep1-c1_0_0 53 | /NMS/source/alphan/writeEnergyFile ep1-c1_0_0 54 | /NMS/analysis/showresults 55 | /NMS/analysis/writeincludepulsetrain true 56 | /NMS/analysis/writeresults ep1-c1_0_0 57 | -------------------------------------------------------------------------------- /macros/ep1-c1-10_0_0.mac: -------------------------------------------------------------------------------- 1 | # Detector Settings 2 | /NMS/analysis/detectorvolume HE1-He 3 | /NMS/analysis/lostvolume PolyethyleneArea 4 | 5 | # Source Geometry 6 | /NMS/source/geometry/type Point 7 | /NMS/source/geometry/centre 0 0 0 8 | 9 | # Source Volume & Material 10 | /NMS/source/material NMSSourceMaterial 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | # Source Type and settings 25 | /NMS/source/sfg false 26 | /NMS/source/sfn false 27 | /NMS/source/alpha false 28 | /NMS/source/neutronAlphaN true 29 | /NMS/source/activity 26800 30 | 31 | # AlphaN Settings 32 | /NMS/source/alphan/directionSampling 0 33 | /NMS/source/alphan/energySampling 3 34 | /NMS/source/alphan/positionSampling 0 35 | # /NMS/source/alphan/energy - not given 36 | /NMS/source/alphan/energyFilename amli.alphan 37 | /NMS/source/alphan/activityCalculation 0 38 | /NMS/source/alphan/activity 1 39 | 40 | # Runtime settings 41 | /random/setSeeds 28607207 36633217 42 | /NMS/run/runtime 5.0 43 | /NMS/run/printmodulo 1000 44 | /NMS/analysis/eventoffset 0 45 | 46 | # Run 47 | /NMS/run/beamOnRuntime 1 48 | 49 | # Create some output 50 | /NMS/analysis/efficiency 0.373 51 | /NMS/source/dumpstatus 52 | /NMS/analysis/writesourceneutronenergies ep1-c1_0_0 53 | /NMS/source/alphan/writeEnergyFile ep1-c1_0_0 54 | /NMS/analysis/showresults 55 | /NMS/analysis/writeincludepulsetrain true 56 | /NMS/analysis/writeresults ep1-c1_0_0 57 | -------------------------------------------------------------------------------- /macros/ep1-c2-1000_0_0.mac: -------------------------------------------------------------------------------- 1 | # Detector Settings 2 | /NMS/analysis/detectorvolume HE1-He 3 | /NMS/analysis/lostvolume PolyethyleneArea 4 | 5 | # Source Geometry 6 | /NMS/source/geometry/type Point 7 | /NMS/source/geometry/centre 0 0 0 8 | 9 | # Source Volume & Material 10 | /NMS/source/material NMSSourceMaterial 11 | 12 | # Cf spectrum changed (ESARDA Benchmark) 13 | /NMS/source/cf252sfoptions 0 2 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | # Source Type and settings 26 | /NMS/source/sfg false 27 | /NMS/source/sfn true 28 | /NMS/source/alpha false 29 | /NMS/source/neutronAlphaN false 30 | /NMS/source/activity 860000 31 | 32 | # AlphaN Settings 33 | /NMS/source/alphan/directionSampling 0 34 | /NMS/source/alphan/energySampling 0 35 | /NMS/source/alphan/positionSampling 0 36 | # /NMS/source/alphan/energy - not given 37 | # /NMS/source/alphan/energyFilename - not given 38 | /NMS/source/alphan/activityCalculation 2 39 | # /NMS/source/alphan/activity - not given 40 | 41 | # Runtime settings 42 | /random/setSeeds 28607207 36633217 43 | /NMS/run/runtime 0.5 44 | /NMS/run/printmodulo 1000 45 | /NMS/analysis/eventoffset 0 46 | 47 | # Run 48 | /NMS/run/beamOnRuntime 1 49 | 50 | # Create some output 51 | /NMS/analysis/efficiency 0.31 52 | /NMS/source/dumpstatus 53 | /NMS/analysis/writesourceneutronenergies ep1-c2_0_0 54 | /NMS/source/alphan/writeEnergyFile ep1-c2_0_0 55 | /NMS/analysis/showresults 56 | /NMS/analysis/writeincludepulsetrain true 57 | /NMS/analysis/writeresults ep1-c2_0_0 58 | -------------------------------------------------------------------------------- /macros/ep1-c2-100_0_0.mac: -------------------------------------------------------------------------------- 1 | # Detector Settings 2 | /NMS/analysis/detectorvolume HE1-He 3 | /NMS/analysis/lostvolume PolyethyleneArea 4 | 5 | # Source Geometry 6 | /NMS/source/geometry/type Point 7 | /NMS/source/geometry/centre 0 0 0 8 | 9 | # Source Volume & Material 10 | /NMS/source/material NMSSourceMaterial 11 | 12 | # Cf spectrum changed (ESARDA Benchmark) 13 | /NMS/source/cf252sfoptions 0 2 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | # Source Type and settings 26 | /NMS/source/sfg false 27 | /NMS/source/sfn true 28 | /NMS/source/alpha false 29 | /NMS/source/neutronAlphaN false 30 | /NMS/source/activity 86000 31 | 32 | # AlphaN Settings 33 | /NMS/source/alphan/directionSampling 0 34 | /NMS/source/alphan/energySampling 0 35 | /NMS/source/alphan/positionSampling 0 36 | # /NMS/source/alphan/energy - not given 37 | # /NMS/source/alphan/energyFilename - not given 38 | /NMS/source/alphan/activityCalculation 2 39 | # /NMS/source/alphan/activity - not given 40 | 41 | # Runtime settings 42 | /random/setSeeds 28607207 36633217 43 | /NMS/run/runtime 5.0 44 | /NMS/run/printmodulo 1000 45 | /NMS/analysis/eventoffset 0 46 | 47 | # Run 48 | /NMS/run/beamOnRuntime 1 49 | 50 | # Create some output 51 | /NMS/analysis/efficiency 0.31 52 | /NMS/source/dumpstatus 53 | /NMS/analysis/writesourceneutronenergies ep1-c2_0_0 54 | /NMS/source/alphan/writeEnergyFile ep1-c2_0_0 55 | /NMS/analysis/showresults 56 | /NMS/analysis/writeincludepulsetrain true 57 | /NMS/analysis/writeresults ep1-c2_0_0 58 | -------------------------------------------------------------------------------- /macros/ep1-c2-10_0_0.mac: -------------------------------------------------------------------------------- 1 | # Detector Settings 2 | /NMS/analysis/detectorvolume HE1-He 3 | /NMS/analysis/lostvolume PolyethyleneArea 4 | 5 | # Source Geometry 6 | /NMS/source/geometry/type Point 7 | /NMS/source/geometry/centre 0 0 0 8 | 9 | # Source Volume & Material 10 | /NMS/source/material NMSSourceMaterial 11 | 12 | # Cf spectrum changed (ESARDA Benchmark) 13 | /NMS/source/cf252sfoptions 0 2 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | # Source Type and settings 26 | /NMS/source/sfg false 27 | /NMS/source/sfn true 28 | /NMS/source/alpha false 29 | /NMS/source/neutronAlphaN false 30 | /NMS/source/activity 8600 31 | 32 | # AlphaN Settings 33 | /NMS/source/alphan/directionSampling 0 34 | /NMS/source/alphan/energySampling 0 35 | /NMS/source/alphan/positionSampling 0 36 | # /NMS/source/alphan/energy - not given 37 | # /NMS/source/alphan/energyFilename - not given 38 | /NMS/source/alphan/activityCalculation 2 39 | # /NMS/source/alphan/activity - not given 40 | 41 | # Runtime settings 42 | /random/setSeeds 28607207 36633217 43 | /NMS/run/runtime 5.0 44 | /NMS/run/printmodulo 1000 45 | /NMS/analysis/eventoffset 0 46 | 47 | # Run 48 | /NMS/run/beamOnRuntime 1 49 | 50 | # Create some output 51 | /NMS/analysis/efficiency 0.31 52 | /NMS/source/dumpstatus 53 | /NMS/analysis/writesourceneutronenergies ep1-c2_0_0 54 | /NMS/source/alphan/writeEnergyFile ep1-c2_0_0 55 | /NMS/analysis/showresults 56 | /NMS/analysis/writeincludepulsetrain true 57 | /NMS/analysis/writeresults ep1-c2_0_0 58 | -------------------------------------------------------------------------------- /macros/ep1-c3b_0_0.mac: -------------------------------------------------------------------------------- 1 | # Source Volume & Material 2 | /NMS/source/material NMSSourceMaterial 3 | /NMS/source/sourcefromvolume Sample 4 | 5 | # Detector Settings 6 | /NMS/analysis/detectorvolume HE1-He 7 | /NMS/analysis/lostvolume PolyethyleneArea 8 | 9 | 10 | 11 | # Source Type and settings 12 | /NMS/source/sfg false 13 | /NMS/source/sfn true 14 | /NMS/source/alpha false 15 | /NMS/source/neutronAlphaN false 16 | # /NMS/source/activity - not given 17 | 18 | # AlphaN Settings 19 | /NMS/source/alphan/directionSampling 0 20 | /NMS/source/alphan/energySampling 2 21 | /NMS/source/alphan/positionSampling 0 22 | # /NMS/source/alphan/energy - not given 23 | # /NMS/source/alphan/energyFilename - not given 24 | /NMS/source/alphan/activityCalculation 2 25 | # /NMS/source/alphan/activity - not given 26 | 27 | # Runtime settings 28 | /random/setSeeds 28607207 36633217 29 | /NMS/run/runtime 2.5 30 | /NMS/run/printmodulo 1000 31 | /NMS/analysis/eventoffset 0 32 | 33 | # Run 34 | /NMS/run/beamOnRuntime 1 35 | 36 | # Create some output 37 | /NMS/analysis/efficiency 0.31 38 | /NMS/source/dumpstatus 39 | /NMS/analysis/writesourceneutronenergies ep1-c3b_0_0 40 | /NMS/source/alphan/writeEnergyFile ep1-c3b_0_0 41 | /NMS/analysis/showresults 42 | /NMS/analysis/writeincludepulsetrain true 43 | /NMS/analysis/writeresults ep1-c3b_0_0 44 | -------------------------------------------------------------------------------- /macros/ep1-c3s_0_0.mac: -------------------------------------------------------------------------------- 1 | # Source Volume & Material 2 | /NMS/source/material NMSSourceMaterial 3 | /NMS/source/sourcefromvolume Sample 4 | 5 | # Detector Settings 6 | /NMS/analysis/detectorvolume HE1-He 7 | /NMS/analysis/lostvolume PolyethyleneArea 8 | 9 | 10 | 11 | # Source Type and settings 12 | /NMS/source/sfg false 13 | /NMS/source/sfn true 14 | /NMS/source/alpha false 15 | /NMS/source/neutronAlphaN false 16 | # /NMS/source/activity - not given 17 | 18 | # AlphaN Settings 19 | /NMS/source/alphan/directionSampling 0 20 | /NMS/source/alphan/energySampling 2 21 | /NMS/source/alphan/positionSampling 0 22 | # /NMS/source/alphan/energy - not given 23 | # /NMS/source/alphan/energyFilename - not given 24 | /NMS/source/alphan/activityCalculation 2 25 | # /NMS/source/alphan/activity - not given 26 | 27 | # Runtime settings 28 | /random/setSeeds 28607207 36633217 29 | /NMS/run/runtime 5.0 30 | /NMS/run/printmodulo 1000 31 | /NMS/analysis/eventoffset 0 32 | 33 | # Run 34 | /NMS/run/beamOnRuntime 1 35 | 36 | # Create some output 37 | /NMS/analysis/efficiency 0.31 38 | /NMS/source/dumpstatus 39 | /NMS/analysis/writesourceneutronenergies ep1-c3s_0_0 40 | /NMS/source/alphan/writeEnergyFile ep1-c3s_0_0 41 | /NMS/analysis/showresults 42 | /NMS/analysis/writeincludepulsetrain true 43 | /NMS/analysis/writeresults ep1-c3s_0_0 44 | -------------------------------------------------------------------------------- /macros/ep1-c4b_0_0.mac: -------------------------------------------------------------------------------- 1 | # Source Volume & Material 2 | /NMS/source/material NMSSourceMaterial 3 | /NMS/source/sourcefromvolume Sample 4 | 5 | # Detector Settings 6 | /NMS/analysis/detectorvolume HE1-He 7 | /NMS/analysis/lostvolume PolyethyleneArea 8 | 9 | 10 | 11 | # Source Type and settings 12 | /NMS/source/sfg false 13 | /NMS/source/sfn true 14 | /NMS/source/alpha false 15 | /NMS/source/neutronAlphaN true 16 | # /NMS/source/activity - not given 17 | 18 | # AlphaN Settings 19 | /NMS/source/alphan/directionSampling 0 20 | /NMS/source/alphan/energySampling 2 21 | /NMS/source/alphan/positionSampling 0 22 | # /NMS/source/alphan/energy - not given 23 | # /NMS/source/alphan/energyFilename - not given 24 | /NMS/source/alphan/activityCalculation 2 25 | # /NMS/source/alphan/activity - not given 26 | 27 | # Runtime settings 28 | /random/setSeeds 28607207 36633217 29 | /NMS/run/runtime 0.5 30 | /NMS/run/printmodulo 1000 31 | /NMS/analysis/eventoffset 0 32 | 33 | # Run 34 | /NMS/run/beamOnRuntime 1 35 | 36 | # Create some output 37 | /NMS/analysis/efficiency 0.31 38 | /NMS/source/dumpstatus 39 | /NMS/analysis/writesourceneutronenergies ep1-c4b_0_0 40 | /NMS/source/alphan/writeEnergyFile ep1-c4b_0_0 41 | /NMS/analysis/showresults 42 | /NMS/analysis/writeincludepulsetrain true 43 | /NMS/analysis/writeresults ep1-c4b_0_0 44 | -------------------------------------------------------------------------------- /macros/ep1-c4s_0_0.mac: -------------------------------------------------------------------------------- 1 | # Source Volume & Material 2 | /NMS/source/material NMSSourceMaterial 3 | /NMS/source/sourcefromvolume Sample 4 | 5 | # Detector Settings 6 | /NMS/analysis/detectorvolume HE1-He 7 | /NMS/analysis/lostvolume PolyethyleneArea 8 | 9 | 10 | 11 | # Source Type and settings 12 | /NMS/source/sfg false 13 | /NMS/source/sfn true 14 | /NMS/source/alpha false 15 | /NMS/source/neutronAlphaN true 16 | # /NMS/source/activity - not given 17 | 18 | # AlphaN Settings 19 | /NMS/source/alphan/directionSampling 0 20 | /NMS/source/alphan/energySampling 2 21 | /NMS/source/alphan/positionSampling 0 22 | # /NMS/source/alphan/energy - not given 23 | # /NMS/source/alphan/energyFilename - not given 24 | /NMS/source/alphan/activityCalculation 2 25 | # /NMS/source/alphan/activity - not given 26 | 27 | # Runtime settings 28 | /random/setSeeds 28607207 36633217 29 | /NMS/run/runtime 5.0 30 | /NMS/run/printmodulo 1000 31 | /NMS/analysis/eventoffset 0 32 | 33 | # Run 34 | /NMS/run/beamOnRuntime 1 35 | 36 | # Create some output 37 | /NMS/analysis/efficiency 0.31 38 | /NMS/source/dumpstatus 39 | /NMS/analysis/writesourceneutronenergies ep1-c4s_0_0 40 | /NMS/source/alphan/writeEnergyFile ep1-c4s_0_0 41 | /NMS/analysis/showresults 42 | /NMS/analysis/writeincludepulsetrain true 43 | /NMS/analysis/writeresults ep1-c4s_0_0 44 | -------------------------------------------------------------------------------- /macros/ep3-c3_0_0.mac: -------------------------------------------------------------------------------- 1 | # Source Volume & Material 2 | /NMS/source/material NMSSourceMaterial 3 | /NMS/source/sourcefromvolume Sample 4 | 5 | # Detector Settings 6 | /NMS/analysis/detectorvolume HE1-He 7 | /NMS/analysis/lostvolume PolyethyleneArea 8 | 9 | 10 | 11 | # Source Type and settings 12 | /NMS/source/sfg false 13 | /NMS/source/sfn true 14 | /NMS/source/alpha false 15 | /NMS/source/neutronAlphaN false 16 | # /NMS/source/activity - not given 17 | 18 | # AlphaN Settings 19 | /NMS/source/alphan/directionSampling 0 20 | /NMS/source/alphan/energySampling 2 21 | /NMS/source/alphan/positionSampling 0 22 | # /NMS/source/alphan/energy - not given 23 | # /NMS/source/alphan/energyFilename - not given 24 | /NMS/source/alphan/activityCalculation 2 25 | # /NMS/source/alphan/activity - not given 26 | 27 | # Runtime settings 28 | /random/setSeeds 28607207 36633217 29 | /NMS/run/runtime 5.0 30 | /NMS/run/printmodulo 1000 31 | /NMS/analysis/eventoffset 0 32 | 33 | # Run 34 | /NMS/run/beamOnRuntime 1 35 | 36 | # Create some output 37 | /NMS/analysis/efficiency 0.31 38 | /NMS/source/dumpstatus 39 | /NMS/analysis/writesourceneutronenergies ep3-c3_0_0 40 | /NMS/source/alphan/writeEnergyFile ep3-c3_0_0 41 | /NMS/analysis/showresults 42 | /NMS/analysis/writeincludepulsetrain true 43 | /NMS/analysis/writeresults ep3-c3_0_0 44 | -------------------------------------------------------------------------------- /macros/ep3-c4_0_0.mac: -------------------------------------------------------------------------------- 1 | # Source Volume & Material 2 | /NMS/source/material NMSSourceMaterial 3 | /NMS/source/sourcefromvolume NMSSourceVolume 4 | 5 | # Detector Settings 6 | /NMS/analysis/detectorvolume HE1-He 7 | /NMS/analysis/lostvolume PolyethyleneArea 8 | 9 | 10 | 11 | # Source Type and settings 12 | /NMS/source/sfg false 13 | /NMS/source/sfn true 14 | /NMS/source/alpha false 15 | /NMS/source/neutronAlphaN true 16 | # /NMS/source/activity - not given 17 | 18 | # AlphaN Settings 19 | /NMS/source/alphan/directionSampling 0 20 | /NMS/source/alphan/energySampling 2 21 | /NMS/source/alphan/positionSampling 0 22 | # /NMS/source/alphan/energy - not given 23 | # /NMS/source/alphan/energyFilename - not given 24 | /NMS/source/alphan/activityCalculation 2 25 | # /NMS/source/alphan/activity - not given 26 | 27 | # Runtime settings 28 | /random/setSeeds 28607207 36633217 29 | /NMS/run/runtime 5.0 30 | /NMS/run/printmodulo 1000 31 | /NMS/analysis/eventoffset 0 32 | 33 | # Run 34 | /NMS/run/beamOnRuntime 1 35 | 36 | # Create some output 37 | /NMS/analysis/efficiency 0.31 38 | /NMS/source/dumpstatus 39 | /NMS/analysis/writesourceneutronenergies ep3-c4_0_0 40 | /NMS/source/alphan/writeEnergyFile ep3-c4_0_0 41 | /NMS/analysis/showresults 42 | /NMS/analysis/writeincludepulsetrain true 43 | /NMS/analysis/writeresults ep3-c4_0_0 44 | -------------------------------------------------------------------------------- /macros/ep3-c5_0_0.mac: -------------------------------------------------------------------------------- 1 | # Source Volume & Material 2 | /NMS/source/material NMSSourceMaterial 3 | /NMS/source/sourcefromvolume NMSSourceVolume 4 | 5 | # Detector Settings 6 | /NMS/analysis/detectorvolume HE1-He 7 | /NMS/analysis/lostvolume PolyethyleneArea 8 | 9 | 10 | 11 | # Source Type and settings 12 | /NMS/source/sfg false 13 | /NMS/source/sfn true 14 | /NMS/source/alpha false 15 | /NMS/source/neutronAlphaN true 16 | # /NMS/source/activity - not given 17 | 18 | # AlphaN Settings 19 | /NMS/source/alphan/directionSampling 0 20 | /NMS/source/alphan/energySampling 2 21 | /NMS/source/alphan/positionSampling 0 22 | # /NMS/source/alphan/energy - not given 23 | # /NMS/source/alphan/energyFilename - not given 24 | /NMS/source/alphan/activityCalculation 2 25 | # /NMS/source/alphan/activity - not given 26 | 27 | # Runtime settings 28 | /random/setSeeds 28607207 36633217 29 | /NMS/run/runtime 5.0 30 | /NMS/run/printmodulo 1000 31 | /NMS/analysis/eventoffset 0 32 | 33 | # Run 34 | /NMS/run/beamOnRuntime 1 35 | 36 | # Create some output 37 | /NMS/analysis/efficiency 0.31 38 | /NMS/source/dumpstatus 39 | /NMS/analysis/writesourceneutronenergies ep3-c5_0_0 40 | /NMS/source/alphan/writeEnergyFile ep3-c5_0_0 41 | /NMS/analysis/showresults 42 | /NMS/analysis/writeincludepulsetrain true 43 | /NMS/analysis/writeresults ep3-c5_0_0 44 | -------------------------------------------------------------------------------- /macros/ep3-c6_0_0.mac: -------------------------------------------------------------------------------- 1 | # Source Volume & Material 2 | /NMS/source/material NMSSourceMaterial 3 | /NMS/source/sourcefromvolume NMSSourceVolume 4 | 5 | # Detector Settings 6 | /NMS/analysis/detectorvolume HE1-He 7 | /NMS/analysis/lostvolume PolyethyleneArea 8 | 9 | 10 | 11 | # Source Type and settings 12 | /NMS/source/sfg false 13 | /NMS/source/sfn true 14 | /NMS/source/alpha false 15 | /NMS/source/neutronAlphaN true 16 | # /NMS/source/activity - not given 17 | 18 | # AlphaN Settings 19 | /NMS/source/alphan/directionSampling 0 20 | /NMS/source/alphan/energySampling 2 21 | /NMS/source/alphan/positionSampling 0 22 | # /NMS/source/alphan/energy - not given 23 | # /NMS/source/alphan/energyFilename - not given 24 | /NMS/source/alphan/activityCalculation 2 25 | # /NMS/source/alphan/activity - not given 26 | 27 | # Runtime settings 28 | /random/setSeeds 28607207 36633217 29 | /NMS/run/runtime 5.0 30 | /NMS/run/printmodulo 1000 31 | /NMS/analysis/eventoffset 0 32 | 33 | # Run 34 | /NMS/run/beamOnRuntime 1 35 | 36 | # Create some output 37 | /NMS/analysis/efficiency 0.31 38 | /NMS/source/dumpstatus 39 | /NMS/analysis/writesourceneutronenergies ep3-c6_0_0 40 | /NMS/source/alphan/writeEnergyFile ep3-c6_0_0 41 | /NMS/analysis/showresults 42 | /NMS/analysis/writeincludepulsetrain true 43 | /NMS/analysis/writeresults ep3-c6_0_0 44 | -------------------------------------------------------------------------------- /macros/pm1_0_0.mac: -------------------------------------------------------------------------------- 1 | # Source Volume & Material 2 | /NMS/source/material NMSSourceMaterial 3 | /NMS/source/sourcefromvolume NMSSourceVolume 4 | 5 | # Detector Settings 6 | /NMS/analysis/detectorvolume HE1-He 7 | /NMS/analysis/lostvolume PolyethyleneArea 8 | 9 | 10 | 11 | # Source Type and settings 12 | /NMS/source/sfg false 13 | /NMS/source/sfn true 14 | /NMS/source/alpha false 15 | /NMS/source/neutronAlphaN false 16 | # /NMS/source/activity - not given 17 | 18 | # AlphaN Settings 19 | /NMS/source/alphan/directionSampling 0 20 | /NMS/source/alphan/energySampling 2 21 | /NMS/source/alphan/positionSampling 0 22 | # /NMS/source/alphan/energy - not given 23 | # /NMS/source/alphan/energyFilename - not given 24 | /NMS/source/alphan/activityCalculation 2 25 | # /NMS/source/alphan/activity - not given 26 | 27 | # Runtime settings 28 | /random/setSeeds 28607207 36633217 29 | /NMS/run/runtime 5.0 30 | /NMS/run/printmodulo 1000 31 | /NMS/analysis/eventoffset 0 32 | 33 | # Run 34 | /NMS/run/beamOnRuntime 1 35 | 36 | # Create some output 37 | /NMS/analysis/efficiency 0.561 38 | /NMS/source/dumpstatus 39 | /NMS/analysis/writesourceneutronenergies pm1_0_0 40 | /NMS/source/alphan/writeEnergyFile pm1_0_0 41 | /NMS/analysis/showresults 42 | /NMS/analysis/writeincludepulsetrain true 43 | /NMS/analysis/writeresults pm1_0_0 44 | -------------------------------------------------------------------------------- /macros/pm2_0_0.mac: -------------------------------------------------------------------------------- 1 | # Source Volume & Material 2 | /NMS/source/material NMSSourceMaterial 3 | /NMS/source/sourcefromvolume NMSSourceVolume 4 | 5 | # Detector Settings 6 | /NMS/analysis/detectorvolume HE1-He 7 | /NMS/analysis/lostvolume PolyethyleneArea 8 | 9 | 10 | 11 | # Source Type and settings 12 | /NMS/source/sfg false 13 | /NMS/source/sfn true 14 | /NMS/source/alpha false 15 | /NMS/source/neutronAlphaN false 16 | # /NMS/source/activity - not given 17 | 18 | # AlphaN Settings 19 | /NMS/source/alphan/directionSampling 0 20 | /NMS/source/alphan/energySampling 2 21 | /NMS/source/alphan/positionSampling 0 22 | # /NMS/source/alphan/energy - not given 23 | # /NMS/source/alphan/energyFilename - not given 24 | /NMS/source/alphan/activityCalculation 2 25 | # /NMS/source/alphan/activity - not given 26 | 27 | # Runtime settings 28 | /random/setSeeds 28607207 36633217 29 | /NMS/run/runtime 5.0 30 | /NMS/run/printmodulo 1000 31 | /NMS/analysis/eventoffset 0 32 | 33 | # Run 34 | /NMS/run/beamOnRuntime 1 35 | 36 | # Create some output 37 | /NMS/analysis/efficiency 0.561 38 | /NMS/source/dumpstatus 39 | /NMS/analysis/writesourceneutronenergies pm2_0_0 40 | /NMS/source/alphan/writeEnergyFile pm2_0_0 41 | /NMS/analysis/showresults 42 | /NMS/analysis/writeincludepulsetrain true 43 | /NMS/analysis/writeresults pm2_0_0 44 | -------------------------------------------------------------------------------- /macros/pm3_0_0.mac: -------------------------------------------------------------------------------- 1 | # Source Volume & Material 2 | /NMS/source/material NMSSourceMaterial 3 | /NMS/source/sourcefromvolume NMSSourceVolume 4 | 5 | # Detector Settings 6 | /NMS/analysis/detectorvolume HE1-He 7 | /NMS/analysis/lostvolume PolyethyleneArea 8 | 9 | 10 | 11 | # Source Type and settings 12 | /NMS/source/sfg false 13 | /NMS/source/sfn true 14 | /NMS/source/alpha false 15 | /NMS/source/neutronAlphaN false 16 | # /NMS/source/activity - not given 17 | 18 | # AlphaN Settings 19 | /NMS/source/alphan/directionSampling 0 20 | /NMS/source/alphan/energySampling 2 21 | /NMS/source/alphan/positionSampling 0 22 | # /NMS/source/alphan/energy - not given 23 | # /NMS/source/alphan/energyFilename - not given 24 | /NMS/source/alphan/activityCalculation 2 25 | # /NMS/source/alphan/activity - not given 26 | 27 | # Runtime settings 28 | /random/setSeeds 28607207 36633217 29 | /NMS/run/runtime 5.0 30 | /NMS/run/printmodulo 1000 31 | /NMS/analysis/eventoffset 0 32 | 33 | # Run 34 | /NMS/run/beamOnRuntime 1 35 | 36 | # Create some output 37 | /NMS/analysis/efficiency 0.561 38 | /NMS/source/dumpstatus 39 | /NMS/analysis/writesourceneutronenergies pm3_0_0 40 | /NMS/source/alphan/writeEnergyFile pm3_0_0 41 | /NMS/analysis/showresults 42 | /NMS/analysis/writeincludepulsetrain true 43 | /NMS/analysis/writeresults pm3_0_0 44 | -------------------------------------------------------------------------------- /macros/puo2-10_0_0.mac: -------------------------------------------------------------------------------- 1 | # Source Volume & Material 2 | /NMS/source/material NMSSourceMaterial 3 | /NMS/source/sourcefromvolume NMSSourceVolume 4 | 5 | # Detector Settings 6 | /NMS/analysis/detectorvolume HE1-He 7 | /NMS/analysis/lostvolume PolyethyleneArea 8 | 9 | 10 | 11 | # Source Type and settings 12 | /NMS/source/sfg false 13 | /NMS/source/sfn true 14 | /NMS/source/alpha false 15 | /NMS/source/neutronAlphaN true 16 | # /NMS/source/activity - not given 17 | 18 | # AlphaN Settings 19 | /NMS/source/alphan/directionSampling 0 20 | /NMS/source/alphan/energySampling 2 21 | /NMS/source/alphan/positionSampling 0 22 | # /NMS/source/alphan/energy - not given 23 | # /NMS/source/alphan/energyFilename - not given 24 | /NMS/source/alphan/activityCalculation 2 25 | # /NMS/source/alphan/activity - not given 26 | 27 | # Runtime settings 28 | /random/setSeeds 28607207 36633217 29 | /NMS/run/runtime 5.0 30 | /NMS/run/printmodulo 1000 31 | /NMS/analysis/eventoffset 0 32 | 33 | # Run 34 | /NMS/run/beamOnRuntime 1 35 | 36 | # Create some output 37 | /NMS/analysis/efficiency 0.546 38 | /NMS/source/dumpstatus 39 | /NMS/analysis/writesourceneutronenergies puo2-10_0_0 40 | /NMS/source/alphan/writeEnergyFile puo2-10_0_0 41 | /NMS/analysis/showresults 42 | /NMS/analysis/writeincludepulsetrain true 43 | /NMS/analysis/writeresults puo2-10_0_0 44 | -------------------------------------------------------------------------------- /macros/puo2-20_0_0.mac: -------------------------------------------------------------------------------- 1 | # Source Volume & Material 2 | /NMS/source/material NMSSourceMaterial 3 | /NMS/source/sourcefromvolume NMSSourceVolume 4 | 5 | # Detector Settings 6 | /NMS/analysis/detectorvolume HE1-He 7 | /NMS/analysis/lostvolume PolyethyleneArea 8 | 9 | 10 | 11 | # Source Type and settings 12 | /NMS/source/sfg false 13 | /NMS/source/sfn true 14 | /NMS/source/alpha false 15 | /NMS/source/neutronAlphaN true 16 | # /NMS/source/activity - not given 17 | 18 | # AlphaN Settings 19 | /NMS/source/alphan/directionSampling 0 20 | /NMS/source/alphan/energySampling 2 21 | /NMS/source/alphan/positionSampling 0 22 | # /NMS/source/alphan/energy - not given 23 | # /NMS/source/alphan/energyFilename - not given 24 | /NMS/source/alphan/activityCalculation 2 25 | # /NMS/source/alphan/activity - not given 26 | 27 | # Runtime settings 28 | /random/setSeeds 28607207 36633217 29 | /NMS/run/runtime 5.0 30 | /NMS/run/printmodulo 1000 31 | /NMS/analysis/eventoffset 0 32 | 33 | # Run 34 | /NMS/run/beamOnRuntime 1 35 | 36 | # Create some output 37 | /NMS/analysis/efficiency 0.546 38 | /NMS/source/dumpstatus 39 | /NMS/analysis/writesourceneutronenergies puo2-20_0_0 40 | /NMS/source/alphan/writeEnergyFile puo2-20_0_0 41 | /NMS/analysis/showresults 42 | /NMS/analysis/writeincludepulsetrain true 43 | /NMS/analysis/writeresults puo2-20_0_0 44 | -------------------------------------------------------------------------------- /macros/puo2-21_0_0.mac: -------------------------------------------------------------------------------- 1 | # Source Volume & Material 2 | /NMS/source/material NMSSourceMaterial 3 | /NMS/source/sourcefromvolume NMSSourceVolume 4 | 5 | # Detector Settings 6 | /NMS/analysis/detectorvolume HE1-He 7 | /NMS/analysis/lostvolume PolyethyleneArea 8 | 9 | 10 | 11 | # Source Type and settings 12 | /NMS/source/sfg false 13 | /NMS/source/sfn true 14 | /NMS/source/alpha false 15 | /NMS/source/neutronAlphaN true 16 | # /NMS/source/activity - not given 17 | 18 | # AlphaN Settings 19 | /NMS/source/alphan/directionSampling 0 20 | /NMS/source/alphan/energySampling 2 21 | /NMS/source/alphan/positionSampling 0 22 | # /NMS/source/alphan/energy - not given 23 | # /NMS/source/alphan/energyFilename - not given 24 | /NMS/source/alphan/activityCalculation 2 25 | # /NMS/source/alphan/activity - not given 26 | 27 | # Runtime settings 28 | /random/setSeeds 28607207 36633217 29 | /NMS/run/runtime 5.0 30 | /NMS/run/printmodulo 1000 31 | /NMS/analysis/eventoffset 0 32 | 33 | # Run 34 | /NMS/run/beamOnRuntime 1 35 | 36 | # Create some output 37 | /NMS/analysis/efficiency 0.546 38 | /NMS/source/dumpstatus 39 | /NMS/analysis/writesourceneutronenergies puo2-21_0_0 40 | /NMS/source/alphan/writeEnergyFile puo2-21_0_0 41 | /NMS/analysis/showresults 42 | /NMS/analysis/writeincludepulsetrain true 43 | /NMS/analysis/writeresults puo2-21_0_0 44 | -------------------------------------------------------------------------------- /macros/puo2-22_0_0.mac: -------------------------------------------------------------------------------- 1 | # Source Volume & Material 2 | /NMS/source/material NMSSourceMaterial 3 | /NMS/source/sourcefromvolume NMSSourceVolume 4 | 5 | # Detector Settings 6 | /NMS/analysis/detectorvolume HE1-He 7 | /NMS/analysis/lostvolume PolyethyleneArea 8 | 9 | 10 | 11 | # Source Type and settings 12 | /NMS/source/sfg false 13 | /NMS/source/sfn true 14 | /NMS/source/alpha false 15 | /NMS/source/neutronAlphaN true 16 | # /NMS/source/activity - not given 17 | 18 | # AlphaN Settings 19 | /NMS/source/alphan/directionSampling 0 20 | /NMS/source/alphan/energySampling 2 21 | /NMS/source/alphan/positionSampling 0 22 | # /NMS/source/alphan/energy - not given 23 | # /NMS/source/alphan/energyFilename - not given 24 | /NMS/source/alphan/activityCalculation 2 25 | # /NMS/source/alphan/activity - not given 26 | 27 | # Runtime settings 28 | /random/setSeeds 28607207 36633217 29 | /NMS/run/runtime 5.0 30 | /NMS/run/printmodulo 1000 31 | /NMS/analysis/eventoffset 0 32 | 33 | # Run 34 | /NMS/run/beamOnRuntime 1 35 | 36 | # Create some output 37 | /NMS/analysis/efficiency 0.546 38 | /NMS/source/dumpstatus 39 | /NMS/analysis/writesourceneutronenergies puo2-22_0_0 40 | /NMS/source/alphan/writeEnergyFile puo2-22_0_0 41 | /NMS/analysis/showresults 42 | /NMS/analysis/writeincludepulsetrain true 43 | /NMS/analysis/writeresults puo2-22_0_0 44 | -------------------------------------------------------------------------------- /macros/puo2-23_0_0.mac: -------------------------------------------------------------------------------- 1 | # Source Volume & Material 2 | /NMS/source/material NMSSourceMaterial 3 | /NMS/source/sourcefromvolume NMSSourceVolume 4 | 5 | # Detector Settings 6 | /NMS/analysis/detectorvolume HE1-He 7 | /NMS/analysis/lostvolume PolyethyleneArea 8 | 9 | 10 | 11 | # Source Type and settings 12 | /NMS/source/sfg false 13 | /NMS/source/sfn true 14 | /NMS/source/alpha false 15 | /NMS/source/neutronAlphaN true 16 | # /NMS/source/activity - not given 17 | 18 | # AlphaN Settings 19 | /NMS/source/alphan/directionSampling 0 20 | /NMS/source/alphan/energySampling 2 21 | /NMS/source/alphan/positionSampling 0 22 | # /NMS/source/alphan/energy - not given 23 | # /NMS/source/alphan/energyFilename - not given 24 | /NMS/source/alphan/activityCalculation 2 25 | # /NMS/source/alphan/activity - not given 26 | 27 | # Runtime settings 28 | /random/setSeeds 28607207 36633217 29 | /NMS/run/runtime 5.0 30 | /NMS/run/printmodulo 1000 31 | /NMS/analysis/eventoffset 0 32 | 33 | # Run 34 | /NMS/run/beamOnRuntime 1 35 | 36 | # Create some output 37 | /NMS/analysis/efficiency 0.546 38 | /NMS/source/dumpstatus 39 | /NMS/analysis/writesourceneutronenergies puo2-23_0_0 40 | /NMS/source/alphan/writeEnergyFile puo2-23_0_0 41 | /NMS/analysis/showresults 42 | /NMS/analysis/writeincludepulsetrain true 43 | /NMS/analysis/writeresults puo2-23_0_0 44 | -------------------------------------------------------------------------------- /src/NMSDetectorConstruction.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * ONMS - Open Neutron Multiplicity Simulation 3 | * 4 | * 5 | * Copyright (C) 2013-2016 Moritz Kütt 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | * 20 | * Contact: moritz@nuclearfreesoftware.org 21 | */ 22 | 23 | #include "NMSDetectorConstruction.hh" 24 | 25 | G4VPhysicalVolume* NMSDetectorConstruction::Construct() { 26 | G4VPhysicalVolume* worldPhysical; 27 | 28 | detectorparser.Read(detectorfilename); 29 | worldPhysical = detectorparser.GetWorldVolume(); 30 | G4LogicalVolume* worldLogical = detectorparser.GetVolume(LVNAME_DETECTOR_CAVITY); 31 | 32 | if(samplefilename != "none") { 33 | sampleparser.Read(samplefilename); 34 | sampleposition = sampleparser.GetPosition(GDML_SAMPLE_POSITION); 35 | G4LogicalVolume* sampleLogical = sampleparser.GetVolume(LVNAME_SAMPLE_MOTHER); 36 | G4VisAttributes * sampleVisAtt = new G4VisAttributes(G4Colour(1.0,0.,0.)); 37 | sampleLogical->SetVisAttributes(sampleVisAtt); 38 | G4PVPlacement * samplePhysical = new G4PVPlacement(0, sampleposition, sampleLogical, "Sample", worldLogical, false, 700); 39 | } 40 | 41 | 42 | G4cout<<*(G4Material::GetMaterialTable()) <. 19 | * 20 | * Contact: moritz@nuclearfreesoftware.org 21 | */ 22 | 23 | #include "NMSEventAction.hh" 24 | 25 | NMSEventAction::NMSEventAction() { 26 | printModulo = 1; 27 | } 28 | 29 | 30 | void NMSEventAction::SetPrintModulo(G4int val) { 31 | printModulo = val; 32 | } 33 | -------------------------------------------------------------------------------- /src/NMSHadronElasticPhysicsHP_Thermal.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * ONMS - Open Neutron Multiplicity Simulation 3 | * 4 | * 5 | * Copyright (C) 2013-2016 Moritz Kütt 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | * 20 | * Contact: moritz@nuclearfreesoftware.org 21 | */ 22 | 23 | // Modified file, based on G4HadronElasticPhysicsHP.cc, Geant4 24 | 25 | // HP model for n with E < 20 MeV 26 | 27 | #include "NMSHadronElasticPhysicsHP_Thermal.hh" 28 | #include "G4SystemOfUnits.hh" 29 | #include "G4HadronElasticPhysics.hh" 30 | #include "G4Neutron.hh" 31 | #include "G4HadronicProcess.hh" 32 | #include "G4HadronElastic.hh" 33 | #include "G4NeutronHPElastic.hh" 34 | #include "G4NeutronHPElasticData.hh" 35 | #include "G4NeutronHPThermalScattering.hh" 36 | #include "G4NeutronHPThermalScatteringData.hh" 37 | 38 | // factory 39 | #include "G4PhysicsConstructorFactory.hh" 40 | // 41 | G4_DECLARE_PHYSCONSTR_FACTORY(NMSHadronElasticPhysicsHP_Thermal); 42 | 43 | G4ThreadLocal G4bool NMSHadronElasticPhysicsHP_Thermal::wasActivated = false; 44 | G4ThreadLocal G4HadronElasticPhysics* NMSHadronElasticPhysicsHP_Thermal::mainElasticBuilder = 0; 45 | 46 | NMSHadronElasticPhysicsHP_Thermal::NMSHadronElasticPhysicsHP_Thermal(G4int ver) 47 | : G4VPhysicsConstructor("hElasticWEL_CHIPS_HP"), verbose(ver) 48 | { 49 | if(verbose > 1) { 50 | G4cout << "### NMSHadronElasticPhysicsHP_Thermal: " << GetPhysicsName() 51 | << G4endl; 52 | } 53 | mainElasticBuilder = new G4HadronElasticPhysics(verbose); 54 | } 55 | 56 | NMSHadronElasticPhysicsHP_Thermal::~NMSHadronElasticPhysicsHP_Thermal() 57 | { 58 | delete mainElasticBuilder; 59 | } 60 | 61 | void NMSHadronElasticPhysicsHP_Thermal::ConstructParticle() 62 | { 63 | // G4cout << "G4HadronElasticPhysics::ConstructParticle" << G4endl; 64 | mainElasticBuilder->ConstructParticle(); 65 | } 66 | 67 | void NMSHadronElasticPhysicsHP_Thermal::ConstructProcess() 68 | { 69 | if(wasActivated) { return; } 70 | wasActivated = true; 71 | //Needed because this is a TLS object and this method is called by all threads 72 | if ( ! mainElasticBuilder ) mainElasticBuilder = new G4HadronElasticPhysics(verbose); 73 | mainElasticBuilder->ConstructProcess(); 74 | 75 | mainElasticBuilder->GetNeutronModel()->SetMinEnergy(19.5*MeV); 76 | 77 | G4HadronicProcess* hel = mainElasticBuilder->GetNeutronProcess(); 78 | G4NeutronHPElastic* hp = new G4NeutronHPElastic(); 79 | hp->SetMinEnergy(4.0*eV); 80 | hel->RegisterMe(hp); 81 | hel->AddDataSet(new G4NeutronHPElasticData()); 82 | 83 | G4NeutronHPThermalScattering* theThermalModel = new G4NeutronHPThermalScattering(); 84 | theThermalModel->SetMaxEnergy(4.0*eV); 85 | hel->RegisterMe(theThermalModel); 86 | hel->AddDataSet(new G4NeutronHPThermalScatteringData()); 87 | 88 | if (verbose > 1) 89 | { 90 | G4cout << "### NMSHadronElasticPhysicsHP_Thermal is constructed " << G4endl; 91 | } 92 | } 93 | 94 | 95 | -------------------------------------------------------------------------------- /src/NMSPrimaryGeneratorActionGPS.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * ONMS - Open Neutron Multiplicity Simulation 3 | * 4 | * 5 | * Copyright (C) 2013-2016 Moritz Kütt 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | * 20 | * Contact: moritz@nuclearfreesoftware.org 21 | */ 22 | 23 | #include "NMSPrimaryGeneratorActionGPS.hh" 24 | 25 | 26 | NMSPrimaryGeneratorActionGPS::NMSPrimaryGeneratorActionGPS() 27 | { 28 | particlesource = new G4GeneralParticleSource(); 29 | } 30 | 31 | void NMSPrimaryGeneratorActionGPS::GeneratePrimaries(G4Event* anEvent) 32 | { 33 | particlesource->GeneratePrimaryVertex(anEvent); 34 | } 35 | 36 | NMSPrimaryGeneratorActionGPS::~NMSPrimaryGeneratorActionGPS() 37 | { 38 | delete particlesource; 39 | } 40 | -------------------------------------------------------------------------------- /src/NMSRunAction.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * ONMS - Open Neutron Multiplicity Simulation 3 | * 4 | * 5 | * Copyright (C) 2013-2016 Moritz Kütt 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | * 20 | * Contact: moritz@nuclearfreesoftware.org 21 | */ 22 | 23 | #include "NMSRunAction.hh" 24 | 25 | void NMSRunAction::BeginOfRunAction(const G4Run* run) { 26 | NMSAnalysisManager::GetInstance()->reset(); 27 | } 28 | 29 | void NMSRunAction::EndOfRunAction(const G4Run* run) { 30 | NMSAnalysisManager* am = NMSAnalysisManager::GetInstance(); 31 | if(am->GetRunMode() == RUNMODE_ALPHAN) { 32 | am->saveAlphaNToFile(); 33 | } 34 | am->calculateResults(); 35 | 36 | am->exportCheck(run->GetRunID()); 37 | } 38 | -------------------------------------------------------------------------------- /src/NMSSteppingAction.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * ONMS - Open Neutron Multiplicity Simulation 3 | * 4 | * 5 | * Copyright (C) 2013-2016 Moritz Kütt 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | * 20 | * Contact: moritz@nuclearfreesoftware.org 21 | */ 22 | 23 | #include "NMSSteppingAction.hh" 24 | 25 | #include "G4EventManager.hh" 26 | 27 | NMSSteppingAction::NMSSteppingAction(NMSAnalysisManager* newnmsam) 28 | { 29 | nmsam = newnmsam; 30 | } 31 | 32 | NMSSteppingAction::~NMSSteppingAction() 33 | { 34 | 35 | } 36 | 37 | void NMSSteppingAction::UserSteppingAction(const G4Step * theStep) 38 | { 39 | G4Track * theTrack = theStep->GetTrack(); 40 | // check if it is not alive anymore, otherwise return 41 | if(theTrack->GetTrackStatus()==fAlive) { 42 | return; 43 | } 44 | 45 | G4ParticleDefinition * particleType = theTrack->GetDefinition(); 46 | if(particleType==G4Neutron::NeutronDefinition()) 47 | { 48 | G4String lostneutronvolumename = nmsam->GetLostNeutronVolume(); 49 | 50 | G4StepPoint * thePostPoint = theStep->GetPostStepPoint(); 51 | G4VPhysicalVolume * thePostPV = thePostPoint->GetPhysicalVolume(); 52 | G4String thePostPVname = "Unknown"; 53 | if(thePostPV != 0) { 54 | thePostPVname = thePostPV->GetName(); 55 | } 56 | G4String processname = "Unknown"; 57 | if(thePostPoint->GetProcessDefinedStep() != 0) { 58 | processname = thePostPoint->GetProcessDefinedStep()->GetProcessName(); 59 | } 60 | G4int eid = G4EventManager::GetEventManager()->GetConstCurrentEvent()->GetEventID() + nmsam->GetEventOffset(); 61 | if(thePostPVname(0,nmsam->GetDetectorVolume().length()) == nmsam->GetDetectorVolume()) { 62 | if((processname != "inelastic") && (processname != "NeutronInelastic") && (processname != "neutronInelastic")) { 63 | G4cout << "** ERROR: Unknown process in detector volume, event will be counted anyway: " << processname << G4endl; 64 | } 65 | // convert to non-unit value in microseconds 66 | nmsam->addDetectorNeutron(NMSDetectedEvent(theTrack->GetGlobalTime() / microsecond, theTrack->GetLocalTime() / microsecond, eid)); 67 | } 68 | else if(thePostPVname(0,lostneutronvolumename.length()) == lostneutronvolumename) { 69 | nmsam->addLostNeutron(NMSDetectedEvent(theTrack->GetGlobalTime() / microsecond, theTrack->GetLocalTime() / microsecond, eid)); 70 | } 71 | //Only for debug purposes 72 | /* else { 73 | G4cout << "Neutron absorbed in " << thePostPVname << " with '" << processname << "'" << G4endl; 74 | nmsam->addSomeNeutron(NMSDetectedEvent(theTrack->GetGlobalTime() / microsecond, theTrack->GetLocalTime() / microsecond, eid, thePostPVname)); 75 | }*/ 76 | 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /src/NMSTrackingAction.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * ONMS - Open Neutron Multiplicity Simulation 3 | * 4 | * 5 | * Copyright (C) 2013-2016 Moritz Kütt 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | * 20 | * Contact: moritz@nuclearfreesoftware.org 21 | */ 22 | 23 | #include "NMSTrackingAction.hh" 24 | 25 | NMSTrackingAction::NMSTrackingAction(NMSAnalysisManager* newnmsam) : nmsam(newnmsam) { 26 | rm = RUNMODE_HE_DETECTOR; 27 | } 28 | 29 | NMSTrackingAction::~NMSTrackingAction() { 30 | 31 | } 32 | 33 | void NMSTrackingAction::SetRunMode(RunMode newrm) { 34 | rm = newrm; 35 | } 36 | 37 | 38 | void NMSTrackingAction::PreUserTrackingAction(const G4Track* aTrack) 39 | { 40 | 41 | G4int parent = aTrack->GetParentID(); 42 | G4ParticleDefinition * particleType = aTrack->GetDefinition(); 43 | 44 | if (parent == 0) { // primary particle 45 | G4double energy = aTrack->GetKineticEnergy(); 46 | if(particleType==G4Neutron::NeutronDefinition()) { 47 | nmsam->addSourceNeutron(energy); 48 | } 49 | if(particleType==G4Alpha::AlphaDefinition()) { 50 | nmsam->addSourceAlpha(energy); 51 | } 52 | if(particleType==G4Gamma::GammaDefinition()) { 53 | nmsam->addSourceGamma(energy); 54 | } 55 | } 56 | else { 57 | if(particleType==G4Neutron::NeutronDefinition()) { 58 | G4double energy = aTrack->GetKineticEnergy(); 59 | nmsam->addSecondaryNeutron(energy); 60 | if(rm == RUNMODE_ALPHAN) { 61 | G4String processname = "Unknown"; 62 | if(aTrack->GetCreatorProcess() != 0) { 63 | processname = aTrack->GetCreatorProcess()->GetProcessName(); 64 | } 65 | if(processname == "alphaInelastic") { 66 | // fRunAction->addProducedNeutron(); 67 | // fRunAction->producedEnergyNeutron(energy); 68 | G4cout << "Neutron produced by: " << processname << G4endl; 69 | G4cout << "Neutron energy: " << energy << G4endl; 70 | NMSAlphaNReaction ar; 71 | ar.energy = energy / MeV; 72 | ar.time = aTrack->GetGlobalTime() / microsecond; 73 | ar.position = aTrack->GetPosition() / cm; 74 | ar.alphaDirection = aTrack->GetMomentum(); 75 | nmsam->addAlphaNReaction(ar); 76 | fpTrackingManager->EventAborted(); 77 | } 78 | } 79 | } 80 | else { 81 | G4Track* tr = (G4Track*) aTrack; 82 | tr->SetTrackStatus(fStopAndKill); 83 | } 84 | } 85 | } 86 | 87 | void NMSTrackingAction::PostUserTrackingAction(const G4Track* aTrack) 88 | { 89 | 90 | } 91 | -------------------------------------------------------------------------------- /src/NMS_QGSP_BIC_HP_Thermal.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * ONMS - Open Neutron Multiplicity Simulation 3 | * 4 | * 5 | * Copyright (C) 2013-2016 Moritz Kütt 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | * 20 | * Contact: moritz@nuclearfreesoftware.org 21 | */ 22 | 23 | #include 24 | 25 | #include "globals.hh" 26 | #include "G4ios.hh" 27 | #include "G4ProcessManager.hh" 28 | #include "G4ProcessVector.hh" 29 | #include "G4ParticleTypes.hh" 30 | #include "G4ParticleTable.hh" 31 | 32 | #include "G4Material.hh" 33 | #include "G4MaterialTable.hh" 34 | 35 | #include "G4DecayPhysics.hh" 36 | #include "G4EmStandardPhysics.hh" 37 | #include "G4EmExtraPhysics.hh" 38 | #include "G4IonPhysics.hh" 39 | #include "G4StoppingPhysics.hh" 40 | #include "G4HadronElasticPhysicsHP.hh" 41 | 42 | #include "G4DataQuestionaire.hh" 43 | #include "G4HadronPhysicsQGSP_BIC_HP.hh" 44 | 45 | #include "NMS_QGSP_BIC_HP_Thermal.hh" 46 | #include "NMSHadronElasticPhysicsHP_Thermal.hh" 47 | 48 | NMS_QGSP_BIC_HP_Thermal::NMS_QGSP_BIC_HP_Thermal(G4int ver): G4VModularPhysicsList() 49 | { 50 | // default cut value (1.0mm) 51 | // defaultCutValue = 1.0*CLHEP::mm; 52 | 53 | G4DataQuestionaire it(photon, neutron); 54 | G4cout << "<<< Geant4 Physics List simulation engine: Thermal n-scattering (based on QGSP_BIC_HP 2.0)"<defaultCutValue = 0.7*CLHEP::mm; 58 | this->SetVerboseLevel(ver); 59 | 60 | 61 | // EM Physics 62 | this->RegisterPhysics( new G4EmStandardPhysics(ver) ); 63 | 64 | // Synchroton Radiation & GN Physics 65 | this->RegisterPhysics( new G4EmExtraPhysics(ver) ); 66 | 67 | // Decays 68 | this->RegisterPhysics( new G4DecayPhysics(ver) ); 69 | 70 | // This has been changed! 71 | // Hadron Elastic scattering 72 | this->RegisterPhysics( new NMSHadronElasticPhysicsHP_Thermal(ver) ); 73 | 74 | // Hadron Physics 75 | this->RegisterPhysics( new G4HadronPhysicsQGSP_BIC_HP(ver)); 76 | 77 | // Stopping Physics 78 | this->RegisterPhysics( new G4StoppingPhysics(ver) ); 79 | 80 | // Ion Physics 81 | this->RegisterPhysics( new G4IonPhysics(ver)); 82 | 83 | } 84 | 85 | NMS_QGSP_BIC_HP_Thermal::~NMS_QGSP_BIC_HP_Thermal() 86 | { 87 | } 88 | 89 | void NMS_QGSP_BIC_HP_Thermal::SetCuts() 90 | { 91 | if (this->verboseLevel >1){ 92 | G4cout << "NMS_QGSP_BIC_HP_Thermal::SetCuts:"; 93 | } 94 | // " G4VUserPhysicsList::SetCutsWithDefault" method sets 95 | // the default cut value for all particle types 96 | 97 | this->SetCutsWithDefault(); 98 | 99 | // if (this->verboseLevel >0) 100 | // G4VUserPhysicsList::DumpCutValuesTable(); 101 | 102 | } 103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /tools/JENDL-conversion/convert.py: -------------------------------------------------------------------------------- 1 | import endfgeant4converter 2 | reload(endfgeant4converter) 3 | egc = endfgeant4converter.ENDFGeant4Converter(inputdir = "JENDL-AN-2005-linux-patched") 4 | 5 | egc.convertF0() 6 | egc.convert() 7 | -------------------------------------------------------------------------------- /tools/JENDL-conversion/download.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ################################################################################ 3 | # Download files and convert Windows newline to Linux newline 4 | ################################################################################ 5 | 6 | wget -O jendlan2005.tar.gz http://wwwndc.jaea.go.jp/ftpnd/ftp/JENDL/jendlan2005.tar.gz 7 | tar -xzf jendlan2005.tar.gz 8 | mkdir JENDL-AN-2005-linux > /dev/null 9 | for i in $(ls JENDL-AN-2005/*.dat) 10 | do 11 | sed $'s/\r$//' $i > ${i/2005/2005-linux} 12 | done 13 | -------------------------------------------------------------------------------- /tools/JENDL-conversion/endftogeant4.py: -------------------------------------------------------------------------------- 1 | import endfgeant4converter 2 | reload(endfgeant4converter) 3 | egc = endfgeant4converter.ENDFGeant4Converter(inputdir = "JENDL-AN-2005-linux-patched") 4 | 5 | egc.convertF0() 6 | egc.convert() 7 | -------------------------------------------------------------------------------- /tools/JENDL-conversion/patch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ################################################################################ 3 | # Fix ENDF notation using patches 4 | ################################################################################ 5 | 6 | cp -R JENDL-AN-2005-linux JENDL-AN-2005-linux-patched 7 | cd JENDL-AN-2005-linux-patched 8 | patch -s -p1 <../451-lines.patch 9 | patch -s -p1 <../headline.patch 10 | -------------------------------------------------------------------------------- /tools/JENDL-conversion/rename-ZAID.py: -------------------------------------------------------------------------------- 1 | import os 2 | import shutil 3 | from pyne import nucname 4 | dirname = "JENDL-AN-2005-linux-patched" 5 | zaiddirname = dirname + "-ZAID/" 6 | if not os.path.exists(zaiddirname): 7 | os.makedirs(zaiddirname) 8 | files = [ f for f in os.listdir(dirname) if (os.path.isfile(os.path.join(dirname,f)) & f.endswith(".dat")) ] 9 | for file in files: 10 | nucid = nucname.id(os.path.splitext(file)[0]) 11 | zaid = nucname.zzzaaa(nucid) 12 | zaidfile = str(zaid) + ".dat" 13 | shutil.copyfile(os.path.join(dirname , file), os.path.join(zaiddirname, zaidfile )) 14 | -------------------------------------------------------------------------------- /tools/ziegler_low_e_table: -------------------------------------------------------------------------------- 1 | H 0.9661 0.4126 6.92 8.831 2.582 2 | He 2.027 0.2931 26.34 6.66 0.3409 3 | Li 1.42 0.49 12.25 32 9.161 4 | Be 2.206 0.51 15.32 0.25 8.995 5 | B 3.691 0.4128 18.48 50.72 9 6 | C 4.232 0.3877 22.99 35 7.993 7 | N 2.51 0.4752 38.26 13.02 1.892 8 | O 1.766 0.5261 37.11 15.24 2.804 9 | F 1.533 0.531 40.44 18.41 2.718 10 | Ne 1.183 0.55 39.83 17.49 4.001 11 | Na 9.894 0.3081 23.65 0.384 92.93 12 | Mg 4.3 0.47 34.3 3.3 12.74 13 | Al 2.5 0.625 45.7 0.1 4.359 14 | Si 2.1 0.65 49.34 1.788 4.133 15 | P 1.729 0.6562 53.41 2.405 3.845 16 | S 1.402 0.6791 58.98 3.528 3.211 17 | Cl 1.117 0.7044 69.69 3.705 2.156 18 | Ar 0.9172 0.724 79.44 3.648 1.646 19 | K 8.554 0.3817 83.61 11.84 1.875 20 | Ca 6.297 0.4622 65.39 10.14 5.036 21 | Sc 5.307 0.4918 61.74 12.4 6.665 22 | Ti 4.71 0.5087 65.28 8.806 5.948 23 | V 6.151 0.4524 83 18.31 2.71 24 | Cr 6.57 0.4322 84.76 15.53 2.779 25 | Mn 5.738 0.4492 84.61 14.18 3.101 26 | Fe 5.013 0.4707 85.58 16.55 3.211 27 | Co 4.32 0.4947 76.14 10.85 5.441 28 | Ni 4.652 0.4571 80.73 22 4.952 29 | Cu 3.114 0.5236 76.67 7.62 6.385 30 | Zn 3.114 0.5236 76.67 7.62 7.502 31 | Ga 3.114 0.5236 76.67 7.62 8.514 32 | Ge 5.746 0.4662 79.24 1.185 7.993 33 | As 2.792 0.6356 106.1 0.2986 2.331 34 | Se 4.667 0.5095 124.3 2.102 1.667 35 | Br 2.44 0.6346 105 0.83 2.851 36 | Kr 1.491 0.7118 120.6 1.101 1.877 37 | Rb 11.72 0.3826 102.8 9.231 4.371 38 | Sr 7.126 0.4804 119.3 5.784 2.454 39 | Y 11.61 0.3955 146.7 7.031 1.423 40 | Zr 10.99 0.41 163.9 7.1 1.052 41 | Nb 9.241 0.4275 163.1 7.954 1.102 42 | Mo 9.276 0.418 157.1 8.038 1.29 43 | Tc 3.999 0.6152 97.6 1.297 5.792 44 | Ru 4.306 0.5658 97.99 5.514 5.754 45 | Rh 3.615 0.6197 86.26 0.333 8.689 46 | Pd 5.8 0.49 147.2 6.903 1.289 47 | Ag 5.6 0.49 130 10 2.844 48 | Cd 3.55 0.6068 124.7 1.112 3.119 49 | In 3.6 0.62 105.8 0.1692 6.026 50 | Sn 5.4 0.53 103.1 3.931 7.767 51 | Sb 3.97 0.6459 131.8 0.2233 2.723 52 | Te 3.65 0.64 126.8 0.6834 3.411 53 | In 3.118 0.6519 164.9 1.208 1.51 54 | Xe 2.031 0.7181 153.1 1.362 1.958 55 | Cs 14.4 0.3923 152.5 8.354 2.597 56 | Ba 10.99 0.4599 138.4 4.811 3.726 57 | La 16.6 0.3773 224.1 6.28 0.9121 58 | Ce 10.54 0.4533 159.3 4.832 2.529 59 | Pr 10.33 0.4502 162 5.132 2.444 60 | Nd 10.15 0.4471 165.6 5.378 2.328 61 | Pm 9.976 0.4439 168 5.721 2.258 62 | Sm 9.804 0.4408 176.2 5.675 1.997 63 | Eu 14.22 0.363 228.4 7.024 1.016 64 | Gd 9.952 0.4318 233.5 5.065 0.9244 65 | Tb 9.272 0.4345 210 4.911 1.258 66 | Dy 10.13 0.4146 225.7 5.525 1.055 67 | Ho 8.949 0.4304 213.3 5.071 1.221 68 | Er 11.94 0.3783 247.2 6.655 0.849 69 | Tm 8.472 0.4405 195.5 4.051 1.604 70 | Yb 8.301 0.4399 203.7 3.667 1.459 71 | Lu 6.567 0.4858 193 2.65 1.66 72 | Hf 5.951 0.4016 196.1 2.662 1.589 73 | Ta 7.495 0.4523 251.4 3.433 0.8619 74 | W 6.335 0.4825 255.1 2.834 0.8228 75 | Re 4.314 0.5558 214.8 2.354 1.263 76 | Os 4.02 0.5681 219.9 2.402 1.191 77 | Ir 3.836 0.5765 210.2 2.742 1.305 78 | Pt 4.68 0.5247 244.7 2.749 0.8962 79 | Au 3.223 0.5883 232.7 2.954 1.05 80 | Hg 2.892 0.6204 208.6 2.415 1.416 81 | Tl 4.728 0.5522 217 3.091 1.386 82 | Pb 6.18 0.52 170 4 3.224 83 | Bi 9 0.47 198 3.8 2.032 84 | Po 2.324 0.6997 216 1.599 1.399 85 | At 1.961 0.7286 223 1.621 1.296 86 | Rn 1.75 0.7427 350.1 0.9789 0.5507 87 | Fr 10.31 0.4613 261.2 4.738 0.9899 88 | Ra 7.962 0.519 235.7 4.347 1.313 89 | Ac 6.227 0.5645 231.9 3.961 1.379 90 | Th 5.246 0.5947 228.6 4.027 1.432 91 | Pa 5.408 0.5811 235.7 3.961 1.358 92 | U 5.218 0.5828 245 3.838 1.25 93 | -------------------------------------------------------------------------------- /vis.mac: -------------------------------------------------------------------------------- 1 | /vis/open OGL 600x600-0+0 2 | /vis/drawVolume 3 | /vis/viewer/set/viewpointThetaPhi 60 60 4 | /vis/viewer/zoom 3 5 | 6 | /vis/scene/add/trajectories 7 | /vis/scene/endOfEventAction accumulate 8 | 9 | 10 | #/control/execute testing.mac --------------------------------------------------------------------------------