UrQMD model in Hadr02 example

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.

  1. To perform this I asked for urqmd-1.3cr lib and export it to urqmd-1.3cr folder.

  2. Then I copied g4urqmdblockdata.f and GNUmakefile files to urqmd-1.3cr folder.

  3. 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.

  4. 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)

  1. Also I deleted UrqmdMain.o from obj_G4INTERFACE because of two main functions.

  2. 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…

Hi Aleksei,

The empty result is not a UrQMD physics problem… it comes from your GetN() → GetN_asInt() edit. The names look similar, but there was an API change in geant4 and they mean different things, this is easy to misread:

  • Old Geant4: GetN() returned the mass number A (confusing name: it says “N” but it always meant A).
  • Newer Geant4: GetN() was removed and replaced by integer methods. Now GetA_asInt() returns A, and GetN_asInt() returns the neutron number N = A − Z.

So the correct replacement is GetA_asInt() , not GetN_asInt() …

I would also suggest you open a bugzilla ticket reporting the problems with this UrQMD interface, since it no longer builds against current Geant4 without manual patches…

Dear dkonst,

thank you very much for help, I will try to make this and write results latter then. At which version of geant4 did you try this method? Did it work with the last one version?

Because in the version 11.4.2 I get the next error:

error: ‘class G4AntiBarionBuilder’ has no member named ‘RegisterMe’
98 | fAntiBaryon->RegisterMe(fUrQMDAntiBaryon);

In case of using 11.3.2 I get error:

-------- EEEE ------- G4Exception-START -------- EEEE -------
*** G4Exception : had001
issued by : G4CrossSectionDataStore::BuildPhysicsTable
No cross section is registered for proton

In case of version 10.4.2:

I have changed GetN_asInt() to GetA_asInt() and it works I think, but I have a lot of warnings like:

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= 100576, target nucleus (7, 14)
E(initial - final) = 92410.6 MeV.

*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------

Is it ok for that or still something wrong?

Hello @Aleksei , I think I can not help much here… I have not found anywhere this special version of urqmd availble - urqmd-1.3cr.tar.gz

Thanks;) If it is possible you can contact with me via dinAlt22​00@gmail.com