Message: Re: access to geometry (detector) Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: access to geometry (detector) 

Forum: Geometry
Re: None access to geometry (detector) (Vladyslav Libov)
Date: 07 Jul, 2016
From: Marc Verderi <Marc Verderi>

Hello,

Indeed, you can do:

     const MyDetectorConstruction* detector = (const 
MyDetectorConstruction*) G4RunManager::GetRunManager 
()->GetUserDetectorConstruction ();

I put the cast (const MyDetectorConstruction*) because you will likely 
need to call you own detector construction methods (ie, added to your 
class, compared to the base class G4VUserDetectorConstruction).

Cheers,
Marc

On 07/07/2016 15:36, Vladyslav Libov wrote:
> *** Discussion title: Geometry
>
> Dear all,
>
> I have a simple question: let's say I defined some geometry (i.e.
> implemented a class deriving from G4VUserDetectorConstruction). Can I
> access the pointer to this class from some other class?
>
> I could imagine some geometry manager class, instance of which can be
> accessed from anywhere (like fir the analysis manager,
> G4AnalysisManager::Instance() returns pointer to it) - is there anything
> like this for detector?
>
> thanks!
>
> Thanks! Slava
>
> -------------------------------------------------------------
> Visit this GEANT4 at hypernews.slac.stanford.edu message (to reply or unsubscribe) at:
> http://hypernews.slac.stanford.edu/HyperNews/geant4/get/geometry/1485.html


 [ MIME part of type text/html without a name stripped ]

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

1 None: Re: access to geometry (detector)   (Vladyslav Libov - 08 Jul, 2016)
 Add Message Add Message
to: "Re: access to geometry (detector)"

 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 ]