|Message: Re: Can GEANT4 measure the volume of an object?||Not Logged In (login)|
Click on the Forum title, e.g. on the "Forums by Category" page, to read a sequence of postings to the Forum and its threads all in one page. If you are only interested in one thread or the thread following a specific posting, click the thread or the posting, which takes you to a smaller page, which contains only the part you are interested in and may be easier to navigate.
Messages are "chained" if there are only replies at the first level, i.e. 1/1.html, 1/1/1.html etc. In case of "chained" messages the message number is replaced by the icon and there is no indentation.
Inline: Display the subject line only or also the text of the posting(s); for the choice "All" the "Outline" choices are switched off.
|1||0||1||no text / full text of posting|
|2||1||All||text for level 1 only / text for All postings|
Outline: Choose the depth of the posting thread, successive toggle controls provide increasing detail.
|1||2||1||2 levels / 1 level (original posting)|
|2||3||2||3 levels / 2 levels|
|3||3||All||3 levels / all levels (all postings)|
On Tue, 22 Jul 2008 20:33:08 GMT, ajk17 wrote:
> Hello all. I need some help with volume measurement for a complex object > in GEANT4. I have created a physical (and corresponding logical) volume > by adding and subtracting several G4 spheres, cubes, etc. The resulting > volume is a complex shape which is hard to measure. Is it possible to > measure the actual volume (in cm3) of the complex object through GEANT4? > G4 is able to keep track of an object's boundaries and identify the > region within the world which is occupied by the object. Therefore, from > this information, it should be able to determine the volume of the > object and give the value to the user. Is this possible? > > The function GetVolume() has been mentioned in a few Geant4 course PPT > files online, but I'm not yet clear if this is the way to go. Can > someone help? >
In class G4LogicalVolume I found a function GetMass(), but not GetVolume()!
G4double GetMass(G4bool forced=false, G4bool propagate=true, G4Material* parMaterial=0);
// Returns the mass of the logical volume tree computed from the // estimated geometrical volume of each solid and material associated // to the logical volume and (by default) to its daughters. // NOTE: the computation may require a considerable amount of time, // depending from the complexity of the geometry tree. // The returned value is cached and can be used for successive // calls (default), unless recomputation is forced by providing // 'true' for the boolean argument in input. Computation should // be forced if the geometry setup has changed after the previous // call. By setting the 'propagate' boolean flag to 'false' the // method returns the mass of the present logical volume only // (subtracted for the volume occupied by the daughter volumes). // An optional argument to specify a material is also provided.
Since there is an option to set a material, I guess that, giving a reference material (for example water), you can get the volume.
|Inline Depth:||Outline Depth:||Add message:|