Message: Re: G4VSolid to G4Box Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: G4VSolid to G4Box 

Forum: Geometry
Re: Question G4VSolid to G4Box (Manuel Castro Avila)
Re: None Re: G4VSolid to G4Box (Marc Verderi)
Date: 08 Apr, 2013
From: Manuel Castro Avila <Manuel Castro Avila>

Hi Marc,

Thank you very much, I solved my problem with your suggestion.

I would like your help. This kind of declaration (G4Box*) myLogicalVolume .... ( or something like that) I saw in some examples in Geant4 but I do not understand that very well. What do that mean? In this case (G4Box*) are you forcing that myLogicalVolume->GetSolid to be of G4Box type or ..?

Cheers,

Manuel

On Mon, 08 Apr 2013 14:29:21 GMT, Marc Verderi wrote:

> Hello Manuel,
> 
> if you are sure that the G4VSolid you look at is of actual G4Box type, 
> just make a cast:
> 
>      G4Box* theBox = (G4Box *) myLogicalVolume->GetSolid();
> 
> Cheers,
> Marc
> 
> On 04/08/2013 04:21 PM, Manuel Castro Avila wrote:
> > *** Discussion title: Geometry
> >
> > Hi Geant4 Users,
> >
> > I created a geometry and inside some volumes, I placed a daughter
> > volumes. When I run the simulation, I am checking if the geometry is
> > fine and the number of daughter volumes (if is the case) inside a mother
> > volume. In order to perform that, I use the GetNoDaughters() and
> > GetDaughter (const G4int i ) methods from G4LogicalVolume class.
> > GetDaughter returns a G4VPhysicalVolume element and from it, I can get
> > the logical volume associated with the daughter volume. Now, I want to
> > know the dimensions (solid volume) of the daughter volume. From the
> > logical volume, I can get the solid volume using GetSolid method, but
> > this variable is of the G4VSolid type. G4VSolid does not have any method
> > to get the dimensions. I know the daughter volume was created with the
> > class G4Box, but I do not know how associate the solid from GetSolid
> > with G4Box (if possible), any idea?
> >
> > Thanks in advance,
> >
> > Manuel
> >
> > -------------------------------------------------------------
> > Visit this GEANT4 at hypernews.slac.stanford.edu message (to reply or unsubscribe) at:
> > http://hypernews.slac.stanford.edu/HyperNews/geant4/get/geometry/1265.html
> 

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

1 None: Re: G4VSolid to G4Box   (Michael H. Kelsey - 08 Apr, 2013)
 Add Message Add Message
to: "Re: G4VSolid to G4Box"

 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 ]