Problem 606 - Particle weights using LHEP_BIC_HP
Summary: Particle weights using LHEP_BIC_HP
Status: RESOLVED INVALID
Alias: None
Product: Geant4
Classification: Unclassified
Component: processes/hadronic/models (show other problems)
Version: other
Hardware: PC Linux
: P2 normal
Assignee: Gunter.Folger
URL:
Depends on:
Blocks:
 
Reported: 2004-03-28 12:12 CEST by ersmark
Modified: 2004-07-05 05:38 CEST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description ersmark 2004-03-28 12:12:03 CEST
I get weights of 1.615e+12 for (many) particles in my simulations. In Geant4
5.2 the weights were all "1" (same user code). Other physics lists work fine
(e.g. LHEP_BERT_HP).

System info: Gentoo Linux 1.4, gcc 3.2.3, G4 6.1 (native physics lists)
Comment 1 Hans-Peter.Wellisch 2004-04-16 05:05:59 CEST
Thank you for reporting this.

Many greetings,

Hans-Peter.
Comment 2 Hans-Peter.Wellisch 2004-04-20 07:03:59 CEST
Hi Gunter,
can you have a look?
Many greetings,

Hans-Peter.
Comment 3 Gunter.Folger 2004-05-14 11:46:59 CEST
So far I fail to reproduce this problem. Can you give more information, like
incident particle type and energy?

Or can you send me (Gunter.Folger@cern.ch) a sample code showing this problem?

Gunter
Comment 4 ersmark 2004-05-25 08:23:59 CEST
Hi Gunter,

I do no longer believe the problem is associated with LHEP_BIC_HP, though I
have never managed to reproduce it using another physics list. Editing down my
user code to provide you with sample code I have been unable to reproduce the
problem using the standard G4ParticleGun, only with the GPS. Please see
http://www.particle.kth.se/desire/tmp/weights_bug.tgz for sample code
reproducing the problem. The weight of particles are (on my machine) currently
0 but the weight can change to anything when unrelated changes are made to the
user code, or if I link to a few more physics lists. In the sample code I am
shooting 202MeV protons along axis against a cylindrical water target with
radius 10cm and length 30cm. I detect particles exiting the far face of the
cylinder.

In the sample code I print the weights directly after generating the primary
vertex, and already here the weight is wrong. Sample output:
--------------------
..
Event 100
   Generated particle weight: 0
   Detected particle/weight: neutron/0
..
Event 116
   Generated particle weight: 0
   Detected particle/weight: gamma/1
..
--------------------

Interesting feature in main() is that when changing the lines
--------------------
17   LHEP_BIC_HP* plist = new LHEP_BIC_HP;
18   PrimaryGeneratorAction* primaryGeneratorAction = new
PrimaryGeneratorAction();
19   runManager->SetUserInitialization(detectorConstruction);
20   runManager->SetUserInitialization(plist);
--------------------
to
--------------------
17   PrimaryGeneratorAction* primaryGeneratorAction = new
PrimaryGeneratorAction();
18   LHEP_BIC_HP* plist = new LHEP_BIC_HP;
19   runManager->SetUserInitialization(detectorConstruction);
20   runManager->SetUserInitialization(plist);
--------------------
I get the weight = 1.

I realize that with the current re-engineering of the GPS there might be some
reluctance in investigating this problem.. however, "it would be nice" to be
sure that it really is the old GPS that is the culprit, and not something else
that might pop up later. Probably at the most inconvenient occasion.. I will
try to investigate this some more when I have time.


System info: Gentoo Linux, gcc 3.3.2, G4 6.1 (native physics lists, global
shared libs); problem reproduced using RedHat 8.0, gcc 3.2.
Comment 5 ersmark 2004-06-07 12:24:59 CEST
G4GeneralParticleSource.cc:
--------------------
..
  3508      // Set bweight equal to the multiple of all non-zero weights
  3509      bweight = 1.;
  3510      for(int bib=0; bib<6; bib++)
  3511        {
  3512          if(bweights[bib] > 0.) bweight = bweight * bweights[bib];
  3513        }
  3514      // bweight will now contain the events final weighting.
  3515      // now pass it to the primary vertex
  3516      vertex->SetWeight(bweight);
..
--------------------
"bweights" above is not properly initialized in the case of a point source.

I think this bug can be closed once the new GPS is finished.

(Unrelated: However, what happened in "Event 116" above where a primary with
weight 0 produced a secondary with weight 1?)