| Summary: | Particle weights using LHEP_BIC_HP | ||
|---|---|---|---|
| Product: | Geant4 | Reporter: | ersmark |
| Component: | processes/hadronic/models | Assignee: | Gunter.Folger |
| Status: | RESOLVED INVALID | ||
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | other | ||
| Hardware: | PC | ||
| OS: | Linux | ||
|
Description
ersmark
2004-03-28 12:12:03 CEST
Thank you for reporting this. Many greetings, Hans-Peter. Hi Gunter, can you have a look? Many greetings, Hans-Peter. 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 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. 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?)
|