Skip to content

StatMF MacroCanonical fix#100

Open
apBUSampK wants to merge 1 commit intoGeant4:masterfrom
apBUSampK:fixMF
Open

StatMF MacroCanonical fix#100
apBUSampK wants to merge 1 commit intoGeant4:masterfrom
apBUSampK:fixMF

Conversation

@apBUSampK
Copy link
Copy Markdown

@apBUSampK apBUSampK commented May 6, 2026

In Geant4 v11.4.0 release the Macrocanonical part of Statistical Multifragmentation Model has been changed. In particular, in the function G4StatMFMacroCanonical::ChooseA that decides the masses of the resulting fragments, the procedure for invalidating the resulting mass distribution vector upon rejecting the sample was changed from explicit for-loop to std::vector::resize. This, however, is a mistake, since resize does nothing if the vector's size is equal to the requested one.

Therefore, upon sample rejection, the mass distribution vector kept the distributions from previous samples and new sample was added to them. This results in the model working correctly only if the very first sample is valid, which is rare, even more so for heavier fragments. When testing to find this issue, I observed millions of fragments with A=1 produced from a single A=150 nucleus remnant going through de-excitation. The returned distribution breaks the following logic of G4StatMFMacroCanonical::ChooseZ and results in the stall of de-excitation model, but does not produce any errors (at least for about 5 minutes I was willing to wait before looking into it).

I propose to change the function from std::vector::resize to std::vector::assign that both resizes the vector (if needed) and always replaces its contents with the second argument (as intended by the logic of ChooseA function).

@gcosmo gcosmo requested a review from civanch May 6, 2026 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants