Problem 873 - Don't scale in G4Polyhedra::Reset()
Summary: Don't scale in G4Polyhedra::Reset()
Status: RESOLVED WONTFIX
Alias: None
Product: Geant4
Classification: Unclassified
Component: geometry/solids (show other problems)
Version: 8.0
Hardware: PC Linux
: P2 normal
Assignee: Gabriele Cosmo
URL:
Depends on:
Blocks:
 
Reported: 2006-06-08 10:02 CEST by nanjo
Modified: 2006-08-16 09:31 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 nanjo 2006-06-08 10:02:44 CEST
In G4Polyhedra::Reset(), the ReduciblePolygon is created from
original_parameters, which was already scaled in the constructor.
So rz->ScaleA at the line 493 is unnecessary.
Could you delete the line?

    460 G4bool G4Polyhedra::Reset()
    479   // Rebuild polyhedra
    480   //
    481   G4ReduciblePolygon *rz =
    482     new G4ReduciblePolygon( original_parameters->Rmin,
    483                             original_parameters->Rmax,
    484                             original_parameters->Z_values,
    485                             original_parameters->Num_z_planes );
    493   rz->ScaleA( 1/convertRad );

By the way, currently I reset a G4Polyhedra object correctly in the following way.

1. Get original_parameters with G4Polyhedra::GetOriginalParameters().
2. Scale it by convertRad temporarlly.
3. Call G4Polyhedra::Reset().
4. Scale back original_parameters by 1/convertRad.

I'm affraid the fix (deletion of unnecessary ScaleA) may affect some users who
did such treatment.

Best regards,
Hajime
Comment 1 Gabriele Cosmo 2006-06-08 10:25:59 CEST
The suggested fix is under evaluation and will be eventually provided in a future
release. Thanks.
Comment 2 Gabriele Cosmo 2006-08-16 09:31:59 CEST
Indeed the specifications of G4Polyhedra::Reset() assume that this method is called
-after- that a proper structure for the 'original_parameters' is assigned to the polyhedra.
The new 'original_parameters' structure is not assumed to be scaled, since the scaling is
implicitely done inside Reset(), and this is consistent with the way the constructor itself
initialises the internal parameters...
Therefore, in your case the correct procedure would be:
1. Get the original_parameters with GetOriginalParameters();
2. Generate from them a new (not scaled) G4PolyhedraHistorical object including
    the modifications you wish to include;
3. Assign it to your polyhedra with SetOriginalParameters() and then call Reset().