Message: Re: Problems changing G4Polyhedra dimensions at run time. Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Feedback Re: Problems changing G4Polyhedra dimensions at run time. 

Keywords: solid dimensions
Forum: Geometry
Re: Question Problems changing G4Polyhedra dimensions at run time. (Aczel García Ríos)
Date: 07 Mar, 2008
From: Gabriele Cosmo <Gabriele Cosmo>

> When I try to change the dimensions of the G4Polyhedras at run time they
> do change but the optical surface remains the same than from the begining,
> I mean, it doesn' change its dimensions.

What you are actually doing inside SetGeometryForNewRun() is just setting
internal parameters of the solid (which are used as cached values) but you
are NOT regenerating the solid itself, therefore the solid stays the same.
To do things properly, you should look at how the solid is generated in
the actual implementation of the constructor of G4Polyhedra and eventually
do the same, taking into account to release the memory of the already allocated
objects, in order to avoid memory leaks....
In my opinion, it is more straightforward (and less error-prone) if you redefine
a new solid from scratch, delete the old one, and assign the new one to the
logical volume.

Cheers, Gabriele

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

 Add Message Add Message
to: "Re: Problems changing G4Polyhedra dimensions at run time."

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]