Geant4 Version: 10.4.2
Operating System: Linux Debian
Compiler/Version: 10.2.1
CMake Version: 3.31.1
Dear all,
I try to use UrQMD model in Hadr02 example.
-
To perform this I asked for urqmd-1.3cr lib and export it to urqmd-1.3cr folder.
-
Then I copied g4urqmdblockdata.f and GNUmakefile files to urqmd-1.3cr folder.
-
The in urqmd-1.3cr folder I did the next command: make TYPE=“G4INTERFACE” FFLAGS=“-fallow-argument-mismatch -Wno-argument-mismatch -std=legacy”. Works fine.
-
There was a lot of error when I tried to “cmake .. & make”. To solve the main errors I made:
a) I changed
G4double AT = theTarget.GetN();
G4double ZT = theTarget.GetZ();
to
G4double AT = theTarget.GetN_asInt();
G4double ZT = theTarget.GetZ_asInt();
in G4UrQMD1_3Model.cc
b) Added
G4VCrossSectionDataSet * ChipsKaonMinus;
G4VCrossSectionDataSet * ChipsKaonPlus;
G4VCrossSectionDataSet * ChipsKaonZero;
in HadronPhysicsUrQMD.hh
c)
Also I did in StackingAction.cc
fKillAll(false),
fKillEM(false)
-
Also I deleted UrqmdMain.o from obj_G4INTERFACE because of two main functions.
-
I added in CMakeLists.txt following lines:
option(G4_USE_URQMD “Using UrQMD” ON)add_definitions(-DG4_USE_URQMD)
set(URQMD_OBJ_DIR ${CMAKE_CURRENT_SOURCE_DIR}/urqmd1_3/urqmd-1.3cr/obj_G4INTERFACE)
file(GLOB URQMD_OBJECTS ${URQMD_OBJ_DIR}/*.o)
and
target_link_libraries(Hadr02 ${Geant4_LIBRARIES} ${URQMD_OBJECTS} -lgfortran -lgmp -lmpfr)
The macro file is following:
/control/verbose 1
/run/verbose 1
/tracking/verbose 0
/testhadr/TargetMat G4_O
/testhadr/TargetRadius 20000 cm
/testhadr/TargetLength 10000 cm
/run/printProgress 100
#/testhadr/ionPhysics UrQMD
#/testhadr/ionPhysics FTF
/run/initialize
/run/setCut 1 km
/gun/particle proton
#/gun/ion 16 32
/gun/energy 50. GeV
#/testhadr/HistoType root
#/testhadr/HistoName s32_al_dpmjet
/run/beamOn 10000
I use only UrQMD model: (phys = new UrQMD;)
In simulation result I see a lot of
UrQMDModel running-------------
-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : had012
issued by : G4HadronicProcess:CheckResult()
Warning: Bad energy non-conservation detected, will re-sample the interaction
Process / Model: protonInelastic / UrQMD1_3
Primary: proton (2212), E= 50935.9, target nucleus (8, 16)
E(initial - final) = 7401.55 MeV.
and in the end:
Run terminated.
Run Summary
Number of events processed : 10000
User=7.21s Real=7.24s Sys=0.01s
RunAction: End of run action is starting
HistoManager: End of run actions are started
========================================================
Beam particle proton
Beam Energy(GeV) 50
Number of events 10000
Average energy deposit (GeV) 0.03049 RMS(GeV) 0.02183
Average number of steps 93.65
Average number of gamma 0
Average number of e- 0.0013
Average number of e+ 0
Average number of neutrons 0
Average number of protons 0
Average number of antiprotons 0
Average number of pi+ & pi- 0
Average number of pi0 0
Average number of kaons 0
Average number of muons 0
Average number of deuterons+tritons 0
Average number of He3+alpha 0
Average number of ions 0
=======================================================
G4 kernel has come to Quit state.
So there is no a lot secondary particles…
What should I do to make to work it right? I think the problem is in GetN_asInt and GetZ_asInt methods? I also tried to uncomment GetN and GetZ in G4Nucleus.hh. In this case the result is the following:
** G4Exception : had007
issued by : G4HadronicProcess::PostStepDoIt
Hadronic model UrQMD1_3
created kaon0
→ forced to be kaon0S
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------
G4DecayTable::SelectADecayChannel :: no possible DecayChannel neutron
-------- EEEE ------- G4Exception-START -------- EEEE -------
*** G4Exception : DECAY003
issued by : G4Decay::DoIt
Can not determine decay channel for neutron
mass of dynamic particle: 0.924453 (GEV)
dacay table has 1 entries
0: BR 1, IsOK? 0, → e- + anti_nu_e + proton
*** Fatal Exception *** core dump ***
G4Track (0x5580a6043ef0) - track ID = 76, parent ID = 19
Particle type : neutron - creator process : anti_protonInelastic, creator model : Undefined
Kinetic energy : 0 eV - Momentum direction : (-0.270135,-0.823213,0.499348)
Step length : 0 fm - total energy deposit : 0 eV
Pre-step point : (-6474.7,-19776,11889.8) - Physical volume : Target (G4_O)
- defined by : hadElastic - step status : 4
Post-step point : (-6474.7,-19776,11889.8) - Physical volume : Target (G4_O) - defined by : hadElastic - step status : 7
*** Note: Step information might not be properly updated.
-------- EEEE -------- G4Exception-END --------- EEEE -------
*** G4Exception: Aborting execution ***
Also I tried other different geant4 version (old ones 4.9.6, other newer, and the last one). The different versions give different errors, for example for the last one there is no some cross sections for proton, for older one there are errors like I wrote above. But in some versions there is segmentation fault after 100 warnings of non-conservation energy…