Problem 1082 - repeated calls to G4LogicalVolume::TotalVolumeEntities() give wrong value
Summary: repeated calls to G4LogicalVolume::TotalVolumeEntities() give wrong value
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: geometry/volumes (show other problems)
Version: 9.2
Hardware: PC Linux
: P5 normal
Assignee: Gabriele Cosmo
URL:
Depends on:
Blocks:
 
Reported: 2009-09-24 19:09 CEST by munther.m.hindi
Modified: 2009-09-25 10:02 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 munther.m.hindi 2009-09-24 19:09:55 CEST
In geant4.9.2.p01 there is a logical mistake in the function 
G4LogicalVolume::TotalVolumeEntities(). The function uses a static 
variable (static G4int vols=0) that is used to accumulate the number 
of repeated entities recursively. This works correctly the first time 
that function is called, but if the function is called again you will 
get double the correct number, then  triple, then quadruple, etc, 
since the static variable still retains the value from previous 
calls.
Comment 1 Gabriele Cosmo 2009-09-25 10:02:28 CEST
The implementation has been corrected in the development version
and will be included in the next release or patch. Thanks.