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)
Date: 08 Apr, 2013
From: Marc Verderi <Marc Verderi>

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   (Manuel Castro Avila - 08 Apr, 2013)
(_ 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 ]